[patch] Fix CollationElementIterator.java::reset()

Jerry Quinn jlquinn@optonline.net
Thu Apr 22 06:43:00 GMT 2004


If the iterator has been used previously, lookahead might be set, so
reset() followed by next() could return a stale value.

It seems trivial to me, but I'd rather someone else ok it.

2004-04-22  Jerry Quinn  <jlquinn@optonline.net>

	* java/text/CollationElementIterator.java (reset): Reset
        lookahead variables.

*** CollationElementIterator.java.~1.12.~	Thu Apr 22 01:33:21 2004
--- CollationElementIterator.java	Thu Apr 22 02:03:39 2004
***************
*** 134,139 ****
--- 134,141 ----
    public void reset()
    {
      textIndex = 0;
+     lookahead_set = false;
+     lookahead = 0;
    }
  
    /**



More information about the Java-patches mailing list