2003-05-20 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Tue, 20 May 2003 11:53:11 +0000 (11:53 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 20 May 2003 11:53:11 +0000 (11:53 +0000)
* java/io/DataInputStream.java
(convertFromUTF): Merged comment from classpath.
* java/io/PrintStream.java
(error_occured): Renamed from error, merged comment from classpath.
(PrintStream): No need to initialized error.
(checkError): Replace error with error_occurred.
(setError): Likewise.

From-SVN: r66997

libjava/ChangeLog
libjava/java/io/DataInputStream.java
libjava/java/io/PrintStream.java

index 2afae0516d69b097a1e4fab26f8e44456403dd60..505e9c7291d9020f8eee08e63279f23249b837c4 100644 (file)
@@ -1,3 +1,13 @@
+2003-05-20  Michael Koch  <konqueror@gmx.de>
+
+       * java/io/DataInputStream.java
+       (convertFromUTF): Merged comment from classpath.
+       * java/io/PrintStream.java
+       (error_occured): Renamed from error, merged comment from classpath.
+       (PrintStream): No need to initialized error.
+       (checkError): Replace error with error_occurred.
+       (setError): Likewise.
+
 2003-05-20  Michael Koch  <konqueror@gmx.de>
 
        * java/io/DataInputStream.java:
index 07c3b4ce0d26ff606d1bc508548df4c2623770bf..6b4b1d74ead621bb7bce86c8ba65ab0dead63cd6 100644 (file)
@@ -755,6 +755,10 @@ public class DataInputStream extends FilterInputStream implements DataInput
            ((long)(buf [7] & 0xff)));  
   }
 
+  // FIXME: This method should be re-thought.  I suspect we have multiple
+  // UTF-8 decoders floating around.  We should use the standard charset
+  // converters, maybe and adding a direct call into one of the new
+  // NIO converters for a super-fast UTF8 decode.
   static String convertFromUTF (byte[] buf) 
     throws EOFException, UTFDataFormatException
   {
index 418d7f2cbd5635623cf0274c34c12dbad13d5ed9..418eea178cdc328e2644d6e9538e2684fba3a989 100644 (file)
@@ -81,9 +81,12 @@ public class PrintStream extends FilterOutputStream
   // Work buffer of bytes where we temporarily keep converter output.
   byte[] work_bytes = new byte[100];
 
-  // True if error occurred.
-  private boolean error;
-  // True if auto-flush.
+  /**
+   * This boolean indicates whether or not an error has ever occurred
+   * on this stream.
+   */
+  private boolean error_occurred = false;
+
   /**
    * This is <code>true</code> if auto-flush is enabled, 
    * <code>false</code> otherwise
@@ -123,7 +126,6 @@ public class PrintStream extends FilterOutputStream
     super(out);
 
     converter = UnicodeToBytes.getDefaultEncoder();
-    error = false;
     this.auto_flush = auto_flush;
   }
 
@@ -139,7 +141,7 @@ public class PrintStream extends FilterOutputStream
   public boolean checkError ()
   {
     flush();
-    return error;
+    return error_occurred;
   }
 
   /**
@@ -148,7 +150,7 @@ public class PrintStream extends FilterOutputStream
    */
   protected void setError ()
   {
-    error = true;
+    error_occurred = true;
   }
 
   /**