harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2047) [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special char in its name
Date Wed, 15 Nov 2006 17:50:39 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2047?page=comments#action_12450123 ] 
            
Paulex Yang commented on HARMONY-2047:
--------------------------------------

Leo, the ClassTest.test_getResourceAsStream_withSharpChar() failed with your patch:

junit.framework.AssertionFailedError at org.apache.harmony.luni.tests.java.lang.ClassTest.test_getResourceAsStream_withSharpChar(ClassTest.java:724)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

I added a test#.properties in support module and rebuilt it, anything else I missed?

And if I commented out the test#.properties related tests, the test can pass in ant script,
but cannot pass in Eclipse, because in Eclipse, the path of ***.getClass().getClassLoader().getResourceAsStream("blabla")
is different with that of "new File("blabla")".

At last, I also have concerns on the patch itself, it has special handling of '#' for FileURLConnection,
but how about other special characters like '%', I wrote a small test for "AAA%.properties",
and Harmony also fails to find it. So I think we may need a little general solution? 

> [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special
char in its name
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2047
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2047
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Paulex Yang
>         Attachments: patch.diff
>
>
> ClassLoader.getResourceAsStream() fails to get property file with special char in its
name.
> Here is the testcase:
> (First pls put a property file called "AAA#.properties" in where can be searched by classpath.)
> public void testGetResourceAsStream() throws Exception
> {
>         InputStream in = TestClassLoader.class.getClassLoader().getResourceAsStream("AAA#.properties");
>         assertNotNull(in);
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message