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/01 15:50:55 UTC
[jira] Updated: (HARMONY-1809)
[classlib][swing]javax.swing.text.GapContent.replace(int, int,
java.lang.Object, int) throws unspescified BadLocationException
[ http://issues.apache.org/jira/browse/HARMONY-1809?page=all ]
Alexey A. Ivanov updated HARMONY-1809:
--------------------------------------
Attachment: HTest1809.java
This is test which demonstrates weird behaviour of GapContent.replace.
------- RI output (BEA JRockit 1.5) -------
text: 'xt
'
start = -2, end =5
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Ljava.lang.Object;ILjava.lang.Object;II)V(Unknown Source)
at javax.swing.text.GapVector.shiftGap(GapVector.java:251)
at javax.swing.text.GapContent.shiftGap(GapContent.java:366)
at javax.swing.text.GapVector.open(GapVector.java:181)
at javax.swing.text.GapVector.replace(GapVector.java:125)
at javax.swing.text.GapContent.insertString(GapContent.java:115)
at HTest1809.main(HTest1809.java:10)
===============
------- Harmony output (where replace throws BadLocationException) -------
javax.swing.text.BadLocationException: Invalid remove position
at javax.swing.text.GapContent.removeItems(GapContent.java:392)
at javax.swing.text.GapContent.replace(GapContent.java:242)
at HTest1809$MyGC.callReplace(HTest1809.java:21)
at HTest1809.main(HTest1809.java:7)
text: 'text
'
start = 4, end =9
after insert: 'Stext
'
===============
------- Harmony output (where replace merely swallows BLE; as proposed in HARMONY-1975) -------
text: 'text
'
start = 4, end =9
after insert: 'Stext
'
===============
As for Harmony it doesn't modifies the contents in both cases, and the GapContent object remains usable. At the same time RI, performs replace updating content but the object becomes unusable.
> [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-1809
> URL: http://issues.apache.org/jira/browse/HARMONY-1809
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Svetlana Samoilenko
> Priority: Trivial
> Attachments: GapContent.patch, HTest1809.java
>
>
> RI does not throw javax.swing.text.BadLocationException for GapContent.replace(int, int, java.lang.Object, int) while Harmony does.
--
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