diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-03 21:03:52 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-03 21:03:52 +0000 |
| commit | ab0cc1022452837788b7f3ac1f235f7c75190c54 (patch) | |
| tree | b0577cdb850bb855719e7684f7963bd3af074e22 /libjava/java | |
| parent | 5b6c6a8e26f3bbaed5b61eb21fbad79ce4d0e464 (diff) | |
| download | ppe42-gcc-ab0cc1022452837788b7f3ac1f235f7c75190c54.tar.gz ppe42-gcc-ab0cc1022452837788b7f3ac1f235f7c75190c54.zip | |
* java/io/PrintWriter.java (print): Call write(String), not
print(String). See PR libgcj/277.
(print(String)): Use write, not out.write.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34853 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
| -rw-r--r-- | libjava/java/io/PrintWriter.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/libjava/java/io/PrintWriter.java b/libjava/java/io/PrintWriter.java index fab152ba485..9f9e1ca94be 100644 --- a/libjava/java/io/PrintWriter.java +++ b/libjava/java/io/PrintWriter.java @@ -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 @@ public class PrintWriter extends Writer { try { - out.write(str == null ? "null" : str); + write(str == null ? "null" : str); } catch (IOException ex) { @@ -105,32 +105,44 @@ public class PrintWriter extends Writer 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 |

