classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: another AbstractDocument fix


From: Anthony Balkissoon
Subject: [cp-patches] FYI: another AbstractDocument fix
Date: Wed, 28 Sep 2005 16:16:19 -0400

BranchElement.getElementIndex shouldn't return -1 if there are no
children, instead it should let getStartOffset() throw an NPE.

Also, if none of the child Element's contain the specified offset, the
closest child should be returned.  These are both now fixed.  

Note in the patch that the upper bound of the for loop changed.  This is
because I referenced children[index + 1] in the for loop and it doesn't
cause problems because the last child element doesn't need to be checked
(it's returned in both of the cases: 1) it contains the offset, 2) the
offset is greater than its upper bound).

2005-09-28  Anthony Balkissoon  <address@hidden>

        * javax/swing/text/AbstractDocument.java:
        (BranchElement.getElementIndex): If there are no children, don't return
        -1, instead getStartOffset() will throw NPE.  Also, if no child Element
        contains the specified offset, return the closest one.

--Tony

Attachment: BranchElementGetElementIndex.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]