You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Elena Semukhina <el...@gmail.com> on 2007/03/21 14:09:22 UTC
[classlib][net] URLClassLoader findResource() problem
Hello,
I found out that URLClassLoader.findResource() cannot find a resource if a
file name contains whitespaces.
I created https://issues.apache.org/jira/browse/HARMONY-3461 and attached
the test and the fix.
Could anyone evaluate the suggested fix?
--
Thanks,
Elena
Re: [classlib][net] URLClassLoader findResource() problem
Posted by Alexei Zakharov <al...@gmail.com>.
It is ok. I just mean that integration of patch for existing classlib
test is easier than integration of a standalone test.
Thanks,
2007/3/23, Elena Semukhina <el...@gmail.com>:
> On 3/23/07, Alexei Zakharov <al...@gmail.com> wrote:
> >
> > Hi Elena,
> >
> > Elena Semukhina wrote:
> > > I attached another patch to the JIRA. Could you evaluate it please?
> >
> > Thank you for the patch! I've made two corrections:
> > 1. I've moved encoding of the resource name from findResourceImpl() to
> > the private method targetURL(). So this should fix other potential
> > bugs of the same kind - if "jar:" scheme is used for example.
> > 2. The set of non-encoded characters was also changed from
> > URI.allLegal to (URI.someLegal + "/@") as it is done in URI itself for
> > parsing paths. Seems URI.allLegal contains characters like '[' and ']'
> > that should be encoded indeed. At least RI encodes it in this case.
> >
> > Updated version was committed at the revision 521709.
>
>
> Thank you, Alexei! As I'm not an expert in net code, I hoped for your help
> indeed.
>
> Elena Semukhina wrote (in JIRA):
> > > I attached the second naive patch which solves the problem.
> >
> > I'd like to say here that "naive" patches to *tests* are also highly
> > welcome. :) I've spent a couple of hours yesterday trying to extract a
> > minimal test case.
>
>
> The test which I submitted was the simpliest I managed to create! I tried to
> get it more obvious but failed :(
>
> Thanks,
> Elena
>
> With Best Regards,
> >
> > 2007/3/22, Elena Semukhina <el...@gmail.com>:
> > > On 3/21/07, Elena Semukhina <el...@gmail.com> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I found out that URLClassLoader.findResource() cannot find a resource
> > if a
> > > > file name contains whitespaces.
> > > > I created https://issues.apache.org/jira/browse/HARMONY-3461 and
> > attached
> > > > the test and the fix.
> > > >
> > > > Could anyone evaluate the suggested fix?
> > > >
> > >
> > > Alexei,
> > > thank you for evaluating and committing the fix. Unfortunately it solves
> > the
> > > problem only partially. We have whitespaces in the returned URL while RI
> > > encodes them.
> > > I attached another patch to the JIRA. Could you evaluate it please?
> > >
> > > Elena
--
Alexei Zakharov,
Intel ESSD
Re: [classlib][net] URLClassLoader findResource() problem
Posted by Elena Semukhina <el...@gmail.com>.
On 3/23/07, Alexei Zakharov <al...@gmail.com> wrote:
>
> Hi Elena,
>
> Elena Semukhina wrote:
> > I attached another patch to the JIRA. Could you evaluate it please?
>
> Thank you for the patch! I've made two corrections:
> 1. I've moved encoding of the resource name from findResourceImpl() to
> the private method targetURL(). So this should fix other potential
> bugs of the same kind - if "jar:" scheme is used for example.
> 2. The set of non-encoded characters was also changed from
> URI.allLegal to (URI.someLegal + "/@") as it is done in URI itself for
> parsing paths. Seems URI.allLegal contains characters like '[' and ']'
> that should be encoded indeed. At least RI encodes it in this case.
>
> Updated version was committed at the revision 521709.
Thank you, Alexei! As I'm not an expert in net code, I hoped for your help
indeed.
Elena Semukhina wrote (in JIRA):
> > I attached the second naive patch which solves the problem.
>
> I'd like to say here that "naive" patches to *tests* are also highly
> welcome. :) I've spent a couple of hours yesterday trying to extract a
> minimal test case.
The test which I submitted was the simpliest I managed to create! I tried to
get it more obvious but failed :(
Thanks,
Elena
With Best Regards,
>
> 2007/3/22, Elena Semukhina <el...@gmail.com>:
> > On 3/21/07, Elena Semukhina <el...@gmail.com> wrote:
> > >
> > > Hello,
> > >
> > > I found out that URLClassLoader.findResource() cannot find a resource
> if a
> > > file name contains whitespaces.
> > > I created https://issues.apache.org/jira/browse/HARMONY-3461 and
> attached
> > > the test and the fix.
> > >
> > > Could anyone evaluate the suggested fix?
> > >
> >
> > Alexei,
> > thank you for evaluating and committing the fix. Unfortunately it solves
> the
> > problem only partially. We have whitespaces in the returned URL while RI
> > encodes them.
> > I attached another patch to the JIRA. Could you evaluate it please?
> >
> > Elena
>
>
> --
> Alexei Zakharov,
> Intel ESSD
>
Re: [classlib][net] URLClassLoader findResource() problem
Posted by Alexei Zakharov <al...@gmail.com>.
Hi Elena,
Elena Semukhina wrote:
> I attached another patch to the JIRA. Could you evaluate it please?
Thank you for the patch! I've made two corrections:
1. I've moved encoding of the resource name from findResourceImpl() to
the private method targetURL(). So this should fix other potential
bugs of the same kind - if "jar:" scheme is used for example.
2. The set of non-encoded characters was also changed from
URI.allLegal to (URI.someLegal + "/@") as it is done in URI itself for
parsing paths. Seems URI.allLegal contains characters like '[' and ']'
that should be encoded indeed. At least RI encodes it in this case.
Updated version was committed at the revision 521709.
Elena Semukhina wrote (in JIRA):
> I attached the second naive patch which solves the problem.
I'd like to say here that "naive" patches to *tests* are also highly
welcome. :) I've spent a couple of hours yesterday trying to extract a
minimal test case.
With Best Regards,
2007/3/22, Elena Semukhina <el...@gmail.com>:
> On 3/21/07, Elena Semukhina <el...@gmail.com> wrote:
> >
> > Hello,
> >
> > I found out that URLClassLoader.findResource() cannot find a resource if a
> > file name contains whitespaces.
> > I created https://issues.apache.org/jira/browse/HARMONY-3461 and attached
> > the test and the fix.
> >
> > Could anyone evaluate the suggested fix?
> >
>
> Alexei,
> thank you for evaluating and committing the fix. Unfortunately it solves the
> problem only partially. We have whitespaces in the returned URL while RI
> encodes them.
> I attached another patch to the JIRA. Could you evaluate it please?
>
> Elena
--
Alexei Zakharov,
Intel ESSD
Re: [classlib][net] URLClassLoader findResource() problem
Posted by Elena Semukhina <el...@gmail.com>.
On 3/21/07, Elena Semukhina <el...@gmail.com> wrote:
>
> Hello,
>
> I found out that URLClassLoader.findResource() cannot find a resource if a
> file name contains whitespaces.
> I created https://issues.apache.org/jira/browse/HARMONY-3461 and attached
> the test and the fix.
>
> Could anyone evaluate the suggested fix?
>
Alexei,
thank you for evaluating and committing the fix. Unfortunately it solves the
problem only partially. We have whitespaces in the returned URL while RI
encodes them.
I attached another patch to the JIRA. Could you evaluate it please?
Elena
--
> Thanks,
> Elena
>