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: FYI: PR 13062 fix


I'm checking this in on the trunk and in Classpath.

This fixes PR 13062, a small problem in StreamTokenizer.
I've put a test case for this in Mauve.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	PR libgcj/13062:
	* java/io/StreamTokenizer.java (commentChar): Clear other
	attributes for character.
	(quoteChar): Likewise.

Index: java/io/StreamTokenizer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/StreamTokenizer.java,v
retrieving revision 1.13
diff -u -r1.13 StreamTokenizer.java
--- java/io/StreamTokenizer.java 23 Mar 2003 19:11:19 -0000 1.13
+++ java/io/StreamTokenizer.java 16 Nov 2003 21:12:07 -0000
@@ -1,5 +1,5 @@
 /* StreamTokenizer.java -- parses streams of characters into tokens
-   Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -167,14 +167,21 @@
   }
 
   /**
-   * This method sets the comment attribute on the specified character.
+   * This method sets the comment attribute on the specified
+   * character.  Other attributes for the character are cleared.
    *
    * @param c The character to set the comment attribute for, passed as an int
    */
   public void commentChar(int ch)
   {
     if (ch >= 0 && ch <= 255)
-      comment[ch] = true;
+      {
+	comment[ch] = true;
+	whitespace[ch] = false;
+	alphabetic[ch] = false;
+	numeric[ch] = false;
+	quote[ch] = false;
+      }
   }
 
   /**
@@ -566,13 +573,20 @@
 
   /**
    * This method sets the quote attribute on the specified character.
+   * Other attributes for the character are cleared.
    *
    * @param c The character to set the quote attribute for, passed as an int.
    */
   public void quoteChar(int ch)
   {
     if (ch >= 0 && ch <= 255)
-      quote[ch] = true;
+      {
+	quote[ch] = true;
+	comment[ch] = false;
+	whitespace[ch] = false;
+	alphabetic[ch] = false;
+	numeric[ch] = false;
+      }
   }
 
   /**


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