From: Tom Tromey Date: Mon, 3 Jul 2000 21:03:52 +0000 (+0000) Subject: PrintWriter.java (print): Call write(String), not print(String). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa948ac381009d3d4d600151c5127b257ca057c3;p=gcc.git PrintWriter.java (print): Call write(String), not print(String). * java/io/PrintWriter.java (print): Call write(String), not print(String). See PR libgcj/277. (print(String)): Use write, not out.write. From-SVN: r34853 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 35372bf4e1a..e0ac2f31b91 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2000-07-03 Tom Tromey + + * java/io/PrintWriter.java (print): Call write(String), not + print(String). See PR libgcj/277. + (print(String)): Use write, not out.write. + 2000-06-30 Tom Tromey * include/jni.h: Include . Fixes PR libgcj/270. 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