[cp-patches] FYI: GapContent fix

Roman Kennke roman at kennke.org
Sat Nov 25 20:32:52 UTC 2006

Mario pointed out a regression in GapContent. Last time I change quite a
bit in this class but obviously forgot to adjust getPositionsInRange().
Now this method was hit by the Position object beeing weakly referenced
in the Mark and possibly beeing null. I rewrote this method to use the
(more efficient) binary search from searchFirst() which checks for this
case and thus avoids the NPE.

2006-11-25  Roman Kennke  <kennke at aicas.com>

	* javax/swing/text/GapContent.java
	(getPositionsInRange): Rewritten to use the more efficient
	binary search searchFirst() and avoid an NPE that was caused
	by GC'ed positions.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 3536 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20061125/40801c20/patch.bin

More information about the Classpath-patches mailing list