You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Elena Semukhina (JIRA)" <ji...@apache.org> on 2007/03/21 13:32:32 UTC

[jira] Created: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

[classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
-----------------------------------------------------------------------------------------

                 Key: HARMONY-3461
                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Elena Semukhina


The attached test reproduces the issue.

Please create a directory "test dir" somewhere and put a file into it. 
E.g. I created ..../test dir/new file.txt

Then run the test in the following way:

$DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource

RI prints the following:

file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test

while DRLVM prints

file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
resource  null


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484045 ] 

Elena Semukhina commented on HARMONY-3461:
------------------------------------------

I verified the applied fix. It works as expected. Thank you!



> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, H-3461_2.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elena Semukhina updated HARMONY-3461:
-------------------------------------

    Attachment: H-3461_2.patch

Alexei, thanks for updaing my naive patch in a smart way! 

It solves the problem but only partially. Now DRLVM does not return null but the URL does not look exactly like returned by RI:

RI:
resource file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test 
DRLVM:
resource file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new test 

I think we should be compatible here.

I attached the second naive patch which solves the problem. Please evaluate!






> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, H-3461_2.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elena Semukhina closed HARMONY-3461.
------------------------------------


> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, H-3461_2.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elena Semukhina updated HARMONY-3461:
-------------------------------------

    Attachment: H-3461.patch

The fix attached.

URLClassLoader.findResourceImpl() method checks that a file exists before returning its URL but it does not take care about "%" escape sequences which may be found in the filename.
The fix replaces "%20" substrings with whitespaces in the filname. 

> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: H-3461.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reassigned HARMONY-3461:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483583 ] 

Alexei Zakharov commented on HARMONY-3461:
------------------------------------------

Thanks Elena. I've committed corrected version of this new patch at the revision 521709. Please see my comments at the mailing list in "[classlib][net] URLClassLoader findResource() problem" thread.

> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, H-3461_2.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elena Semukhina updated HARMONY-3461:
-------------------------------------

    Attachment: TestGetResource.java

The test attached.


> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3461) [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov resolved HARMONY-3461.
--------------------------------------

    Resolution: Fixed

Thanks Elena. I've reworked your patch a little bit and also added a regression test to URLClassLoaderTest. Changes were committed at the repository revision 520982. Please check that it solves the above mentioned problem. 

> [classlib][net] URLClassLoader cannot find a resource if a file name contains whitespaces
> -----------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3461
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3461
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexei Zakharov
>         Attachments: H-3461.patch, TestGetResource.java
>
>
> The attached test reproduces the issue.
> Please create a directory "test dir" somewhere and put a file into it. 
> E.g. I created ..../test dir/new file.txt
> Then run the test in the following way:
> $DRLVM -Djava.class.path="/<......>/test dir":. TestGetResource
> RI prints the following:
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  file:/nfs/ins/proj/drl/coreapi/esemukhi/tmp/test%20dir/new%20test
> while DRLVM prints
> file name /nfs/ins/proj/drl/coreapi/esemukhi/tmp/test dir/new test
> resource  null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.