You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Richard Liang (JIRA)" <ji...@apache.org> on 2006/03/02 03:31:03 UTC
[jira] Created: (HARMONY-149)
java.nio.charset.Charset.forName(name) return different reference value
when requiring the same Charset.
java.nio.charset.Charset.forName(name) return different reference value when requiring the same Charset.
--------------------------------------------------------------------------------------------------------
Key: HARMONY-149
URL: http://issues.apache.org/jira/browse/HARMONY-149
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Richard Liang
java.nio.charset.Charset.forName(name) returns different reference value when requiring the same Charset.
However, RI always returns the same reference for the same Charset, no matter using "alias" or "canonical" name as parameter.
RI 5.0 passes the following test case, while Harmony fails.
=============================== Test case ====================
/*
* test forName: invoke forName two times with the same canonical name,
* it should return the same reference.
*/
public void testForName_TwoSameRef1(){
Charset cs1 = Charset.forName("UTF-8");
Charset cs2 = Charset.forName("UTF-8");
assertSame(cs1,cs2);
}
/*
* test forName: invoke forName two times for the same Charset using canonical name and alias,
* it should return the same reference.
*/
public void testForName_TwoSameRef2(){
Charset cs1 = Charset.forName("ASCII");
Charset cs2 = Charset.forName("US-ASCII");
assertSame(cs1,cs2);
}
--
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
[jira] Assigned: (HARMONY-149)
java.nio.charset.Charset.forName(name) return different reference value
when requiring the same Charset.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-149?page=all ]
Tim Ellison reassigned HARMONY-149:
-----------------------------------
Assign To: Tim Ellison
> java.nio.charset.Charset.forName(name) return different reference value when requiring the same Charset.
> --------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-149
> URL: http://issues.apache.org/jira/browse/HARMONY-149
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: Charset_patch_149.txt
>
> java.nio.charset.Charset.forName(name) returns different reference value when requiring the same Charset.
> However, RI always returns the same reference for the same Charset, no matter using "alias" or "canonical" name as parameter.
> RI 5.0 passes the following test case, while Harmony fails.
> =============================== Test case ====================
> /*
> * test forName: invoke forName two times with the same canonical name,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef1(){
> Charset cs1 = Charset.forName("UTF-8");
> Charset cs2 = Charset.forName("UTF-8");
> assertSame(cs1,cs2);
> }
>
> /*
> * test forName: invoke forName two times for the same Charset using canonical name and alias,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef2(){
> Charset cs1 = Charset.forName("ASCII");
> Charset cs2 = Charset.forName("US-ASCII");
> assertSame(cs1,cs2);
> }
--
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
[jira] Updated: (HARMONY-149)
java.nio.charset.Charset.forName(name) return different reference value
when requiring the same Charset.
Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-149?page=all ]
Richard Liang updated HARMONY-149:
----------------------------------
Attachment: Charset_patch_149.txt
Would you please have a try and apply the patch on Charset.java ? Thanks a lot!
To apply patch, simply click "Team"->"Apply patch...".
> java.nio.charset.Charset.forName(name) return different reference value when requiring the same Charset.
> --------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-149
> URL: http://issues.apache.org/jira/browse/HARMONY-149
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Attachments: Charset_patch_149.txt
>
> java.nio.charset.Charset.forName(name) returns different reference value when requiring the same Charset.
> However, RI always returns the same reference for the same Charset, no matter using "alias" or "canonical" name as parameter.
> RI 5.0 passes the following test case, while Harmony fails.
> =============================== Test case ====================
> /*
> * test forName: invoke forName two times with the same canonical name,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef1(){
> Charset cs1 = Charset.forName("UTF-8");
> Charset cs2 = Charset.forName("UTF-8");
> assertSame(cs1,cs2);
> }
>
> /*
> * test forName: invoke forName two times for the same Charset using canonical name and alias,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef2(){
> Charset cs1 = Charset.forName("ASCII");
> Charset cs2 = Charset.forName("US-ASCII");
> assertSame(cs1,cs2);
> }
--
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
[jira] Resolved: (HARMONY-149)
java.nio.charset.Charset.forName(name) return different reference value
when requiring the same Charset.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-149?page=all ]
Tim Ellison resolved HARMONY-149:
---------------------------------
Resolution: Fixed
Richard,
Fixed in NIO_CHAR module java.nio.charset.Charset at repo revision 383867.
Take a look at how I changed the test case to fit in with the test naming convention.
Please check that the patch was applied as you expected.
> java.nio.charset.Charset.forName(name) return different reference value when requiring the same Charset.
> --------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-149
> URL: http://issues.apache.org/jira/browse/HARMONY-149
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: Charset_patch_149.txt
>
> java.nio.charset.Charset.forName(name) returns different reference value when requiring the same Charset.
> However, RI always returns the same reference for the same Charset, no matter using "alias" or "canonical" name as parameter.
> RI 5.0 passes the following test case, while Harmony fails.
> =============================== Test case ====================
> /*
> * test forName: invoke forName two times with the same canonical name,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef1(){
> Charset cs1 = Charset.forName("UTF-8");
> Charset cs2 = Charset.forName("UTF-8");
> assertSame(cs1,cs2);
> }
>
> /*
> * test forName: invoke forName two times for the same Charset using canonical name and alias,
> * it should return the same reference.
> */
> public void testForName_TwoSameRef2(){
> Charset cs1 = Charset.forName("ASCII");
> Charset cs2 = Charset.forName("US-ASCII");
> assertSame(cs1,cs2);
> }
--
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