You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey A. Ivanov (JIRA)" <ji...@apache.org> on 2006/11/10 12:37:38 UTC
[jira] Commented: (HARMONY-1753) [classlib][swing]
javax.swing.text.GapContent.shiftEnd() throws unspecified
ArrayIndexOutOfBoundsException
[ http://issues.apache.org/jira/browse/HARMONY-1753?page=comments#action_12448708 ]
Alexey A. Ivanov commented on HARMONY-1753:
-------------------------------------------
Try adding the following call your main function:
localGapContent.insertString(0, "1")
and you'll get ArrayIndexOutOfBoundsException from the RI.
This bugs into the same category as HARMONY-1809.
For more details, see the discussion of HARMONY-1809: http://thread.gmane.org/gmane.comp.java.harmony.devel/17837/focus=17837
> [classlib][swing] javax.swing.text.GapContent.shiftEnd() throws unspecified ArrayIndexOutOfBoundsException
> ----------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1753
> URL: http://issues.apache.org/jira/browse/HARMONY-1753
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Ilya Okomin
> Priority: Minor
> Attachments: Harmony-1753-test.patch, Harmony-1753.patch
>
>
> Harmony throws unspecified ArrayIndexOutOfBoundsException for javax.swing.text.GapContent.remove(-1) while RI works silently.
> ---------------test.java----------------
> import javax.swing.text.GapContent;
> import junit.framework.TestCase;
> public class test extends TestCase {
> public static void main(String[] args) {
> junit.textui.TestRunner.run(test.class);
> }
> public void testRun() throws Exception {
> GC localGapContent = new GC();
> localGapContent.testShifEnd(-1);
> }
> class GC extends GapContent {
> public GC() {
> super();
> }
>
> public int testShifEnd(int sh) {
> super.shiftEnd(sh);
> return 1;
> }
> }
> }
> --------------------------------------------
> ====== Output RI ======
> .
> Time: 0.04
> OK (1 test)
> ====== Output Harmony ======
> .E
> Time: 0.02
> There was 1 error:
> 1) testRun(bugzilla.Test9308.test)java.lang.ArrayIndexOutOfBoundsException: bad arrayCopy
> at java.lang.VMMemoryManager.arrayCopy(Native Method)
> at java.lang.System.arraycopy(Unknown Source)
> at javax.swing.text.GapContent.shiftEnd(GapContent.java:279)
> at bugzilla.Test9308.test$GC.testShifEnd(test.java:25)
> at bugzilla.Test9308.test.testRun(test.java:14)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at bugzilla.Test9308.test.main(test.java:10)
> FAILURES!!!
> Tests run: 1, Failures: 0, Errors: 1
> I've investigated this issue. Harmony and RI behaves differently only for size == -1. If the size value less than -1 both Harmony and RI throws
> java.lang.NegativeArraySizeException.
--
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