You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/10/10 13:27:19 UTC

[jira] Created: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

[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


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

        

[jira] Updated: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1809?page=all ]

Svetlana Samoilenko updated HARMONY-1809:
-----------------------------------------

    Attachment: GapContent.patch

patch

> [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
>
>
> 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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12441133 ] 
            
Svetlana Samoilenko commented on HARMONY-1809:
----------------------------------------------

Actually patch is not correct.
It is not enough to remove this exception from method synopsis because the method calls  
            removeItems(position, rmSize);
            insertItems(position, addItems, addSize)
which throws this exception accordinf=g to the specification.
So, the method must be re-designed.
  

> [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
>
>
> 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

        

[jira] Resolved: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1809?page=all ]

Alexey Petrenko resolved HARMONY-1809.
--------------------------------------

    Resolution: Fixed

The patch has been applied.
Svetlana & Alexei, please verify.

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Trivial
>         Attachments: GapContent.patch, H1809-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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12446586 ] 
            
Alexey A. Ivanov commented on HARMONY-1809:
-------------------------------------------

I've started discussion on the mailing list:
http://thread.gmane.org/gmane.comp.java.harmony.devel/17837/focus=17837

> [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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12447769 ] 
            
Alexey A. Ivanov commented on HARMONY-1809:
-------------------------------------------

H1809-GapContent.patch is to be applied only.

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Trivial
>         Attachments: GapContent.patch, H1809-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

        

[jira] Assigned: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1809?page=all ]

Alexey Petrenko reassigned HARMONY-1809:
----------------------------------------

    Assignee: Alexey Petrenko

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Trivial
>         Attachments: GapContent.patch, H1809-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

        

[jira] Updated: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1809?page=all ]

Alexey A. Ivanov updated HARMONY-1809:
--------------------------------------

    Attachment: H1809-GapContent.patch

Fixes the problem stated by silently ignoring BadLocationException which may be thrown from insertItems, removeItems methods that implement replace in Harmony.
Two votes were for this solution on the dev-list; there were no other votes.

The patch also adds final modifier to three methods: getArray(), getGapEnd(), getGapStart(). These are final according to spec. but they were not in Harmony.
Also warnings were cleaned up: @Override annotations added, @SuppressWarnings("serial"), and some cosmetic code changes.

> [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, H1809-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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12446259 ] 
            
Alexey A. Ivanov commented on HARMONY-1809:
-------------------------------------------

Another observation: Harmony implements replace as two distinct operations (remove and then insert) whereas RI implements insertString and (I believe) remove using replace (see the stack trace of RI).

> [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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12447834 ] 
            
Alexey A. Ivanov commented on HARMONY-1809:
-------------------------------------------

All's fine with me.
Thank you, Alexey.

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Trivial
>         Attachments: GapContent.patch, H1809-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

        

[jira] Commented: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1809?page=comments#action_12449948 ] 
            
Alexey A. Ivanov commented on HARMONY-1809:
-------------------------------------------

Discussion at Apache mail archive: http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200611.mbox/%3c8E389A5F2FEABA4CB1DEC35A25CB39CE69567D@mssmsx411%3e

> [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
>         Assigned To: Alexey Petrenko
>            Priority: Trivial
>         Attachments: GapContent.patch, H1809-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

        

[jira] Updated: (HARMONY-1809) [classlib][swing]javax.swing.text.GapContent.replace(int, int, java.lang.Object, int) throws unspescified BadLocationException

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ 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