This patch (committed) fixes a bug in the last() method, picked up by the Intel
tests:
2006-07-25 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/text/Segment.java
(last): Update current index before returning DONE for zero count.
Regards,
Dave
Index: javax/swing/text/Segment.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/text/Segment.java,v
retrieving revision 1.12
diff -u -r1.12 Segment.java
--- javax/swing/text/Segment.java 2 Apr 2006 21:16:03 -0000 1.12
+++ javax/swing/text/Segment.java 25 Jul 2006 13:02:59 -0000
@@ -165,8 +165,9 @@
/**
* Sets the current index to point to the last character in the segment and
- * returns that character. If the segment contains zero characters, this
- * method returns [EMAIL PROTECTED] #DONE}.
+ * returns that character. If the segment contains zero characters, the
+ * current index is set to [EMAIL PROTECTED] #getEndIndex()} and this method
returns
+ * [EMAIL PROTECTED] #DONE}.
*
* @return The last character in the segment, or [EMAIL PROTECTED] #DONE} if
the
* segment contains zero characters.
@@ -174,7 +175,10 @@
public char last()
{
if (count == 0)
- return DONE;
+ {
+ current = getEndIndex();
+ return DONE;
+ }
current = getEndIndex() - 1;
return array[current];