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]

FYI: Fixlet in StreamTokenizer


Hi,

I am committing the following little fixlet for which I just made a
Mauve testcase.

2002-07-16  Mark Wielaard  <mark@klomp.org>

    * java/io/StreamTokenizer.java (pushBack): Update documentation.
    (whitespaceChars): call resetChar().

Cheers,

Mark
diff -u -r1.11 StreamTokenizer.java
--- java/io/StreamTokenizer.java	22 Jan 2002 22:40:14 -0000	1.11
+++ java/io/StreamTokenizer.java	16 Jul 2002 21:02:49 -0000
@@ -1,5 +1,5 @@
 /* StreamTokenizer.java -- parses streams of characters into tokens
-   Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation
+   Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -554,16 +554,13 @@
   }
 
   /**
-   * This method returns the current line number.  Note that if the 
-   * <code>pushBack()</code> method is called, it has no effect on the
-   * line number returned by this method.
-   *
-   * @return The current line number
+   * Puts the current token back into the StreamTokenizer so
+   * <code>nextToken</code> will return the same value on the next call.
+   * May cause the lineno method to return an incorrect value
+   * if lineno is called before the next call to nextToken.
    */
   public void pushBack()
   {
-    // pushBack may cause the lineno method to return an incorrect value
-    // if lineno is called before the next call to nextToken.
     pushedBack = true;
   }
 
@@ -670,7 +667,10 @@
     if (hi > 255)
       hi = 255;
     for (int i = low; i <= hi; i++)
-      whitespace[i] = true;
+      {
+	resetChar(i);
+	whitespace[i] = true;
+      }
   }
 
   /**

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