This is the mail archive of the java-patches@sourceware.cygnus.com 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]

Patch: addressing PR libgcj/277


I'm checking this in.  It fixes a compatibility bug related to PR
libgcj/277.

2000-07-03  Tom Tromey  <tromey@cygnus.com>

	* java/io/PrintWriter.java (print): Call write(String), not
	print(String).  See PR libgcj/277.
	(print(String)): Use write, not out.write.

Tom

Index: java/io/PrintWriter.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/io/PrintWriter.java,v
retrieving revision 1.3
diff -u -r1.3 PrintWriter.java
--- PrintWriter.java	2000/03/07 19:55:26	1.3
+++ PrintWriter.java	2000/07/03 21:02:14
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -85,7 +85,7 @@
   {
     try
       {
-	out.write(str == null ? "null" : str);
+	write(str == null ? "null" : str);
       }
     catch (IOException ex)
       {
@@ -105,32 +105,44 @@
 
   public void print(boolean bool)
   {
-    print(bool ? "true" : "false");
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write (bool ? "true" : "false");
   }
 
   public void print(int inum)
   {
-    print(Integer.toString(inum));
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write(Integer.toString(inum));
   }
 
   public void print(long lnum)
   {
-    print(Long.toString(lnum));
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write(Long.toString(lnum));
   }
 
   public void print(float fnum)
   {
-    print(Float.toString(fnum));
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write(Float.toString(fnum));
   }
 
   public void print(double dnum)
   {
-    print(Double.toString(dnum));
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write(Double.toString(dnum));
   }
 
   public void print(Object obj)
   {
-    print(obj == null ? "null" : obj.toString());
+    // We purposely call write() and not print() here.  This preserves
+    // compatibility with JDK 1.2.
+    write(obj == null ? "null" : obj.toString());
   }
 
   private static final char[] line_separator

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