This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;
    }
  
    /**


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]