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/01 03:42:39 UTC
[jira] Created: (HARMONY-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
--------------------------------------------------------------------------------------------------------------------------------------------
Key: HARMONY-142
URL: http://issues.apache.org/jira/browse/HARMONY-142
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Richard Liang
As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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] Closed: (HARMONY-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=all ]
Tim Ellison closed HARMONY-142:
-------------------------------
Verified by Richard
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: CharsetDecoder_patch.txt
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=all ]
Tim Ellison resolved HARMONY-142:
---------------------------------
Resolution: Fixed
Richard,
Thanks for the patch, applied to NIO_CHAR module java.nio.charset.CharsetDecoder at repo revision 382380.
I made a couple of minor modifications to rename the test method in keeping with the tests naming convention, and unmark the exception description as NON-NLS because it should in fact be NLS'd via the Msg type.
Please check that this fix fully resolves your problem.
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: CharsetDecoder_patch.txt
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=all ]
Richard Liang updated HARMONY-142:
----------------------------------
Attachment: CharsetDecoder_patch.txt
Please try my patch. Thanks a lot!
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Attachments: CharsetDecoder_patch.txt
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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] Commented: (HARMONY-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=comments#action_12368204 ]
Richard Liang commented on HARMONY-142:
---------------------------------------
Here is the testcases which pass on RI 5.0 and fail on both Haromny and RI 1.4.2
Thanks a lot.
/*
* test constructor: averBytesPerChar > maxBytesPerChar
*/
public void testConstructorIlegalAverageBytesPerChar() {
try {
Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$
CharsetDecoder decoder = new MockCharsetDecoderForHarmony142(cs,
1.1f, 1);
fail("Should throw IllegalArgumentException."); //$NON-NLS-1$
} catch (IllegalArgumentException e) {
// expected
}
}
/*
* MockCharsetDecoderForHarmony142: for constructor test
*/
static class MockCharsetDecoderForHarmony142 extends CharsetDecoder {
protected MockCharsetDecoderForHarmony142(Charset cs,
float averageBytesPerChar, float maxBytesPerChar) {
super(cs, averageBytesPerChar, maxBytesPerChar);
}
protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
return null;
}
}
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=all ]
Tim Ellison reassigned HARMONY-142:
-----------------------------------
Assign To: Tim Ellison
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: CharsetDecoder_patch.txt
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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] Commented: (HARMONY-142) java.nio.charset.CharsetDecoder
constructor doesn't throw IllegalArgumentException when averageCharsPerByte
is greater than maxCharsPerByte.
Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-142?page=comments#action_12368691 ]
Richard Liang commented on HARMONY-142:
---------------------------------------
Thanks a lot. The fix looks good.
> java.nio.charset.CharsetDecoder constructor doesn't throw IllegalArgumentException when averageCharsPerByte is greater than maxCharsPerByte.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-142
> URL: http://issues.apache.org/jira/browse/HARMONY-142
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Richard Liang
> Assignee: Tim Ellison
> Attachments: CharsetDecoder_patch.txt
>
> As spec says, constructor throws IllegalArgumentException when parameters are illegal. It should be considered as illegal parameters when averageCharsPerByte is greater than maxCharsPerByte.
--
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