From b7661939666c4179b26b36222719bc2654b3b726 Mon Sep 17 00:00:00 2001 From: BCG Date: Tue, 28 Jul 2015 22:28:37 -0400 Subject: [PATCH] Fixed method signatures on format() methods to return PrintStream as in OpenJDK --- classpath/java/io/PrintStream.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/classpath/java/io/PrintStream.java b/classpath/java/io/PrintStream.java index 1a976e16f..eda3feac6 100644 --- a/classpath/java/io/PrintStream.java +++ b/classpath/java/io/PrintStream.java @@ -78,23 +78,25 @@ public void print(char[] s) { print(String.valueOf(s)); } - public synchronized void printf(java.util.Locale locale, String format, Object... args) { + public synchronized PrintStream printf(java.util.Locale locale, String format, Object... args) { // should this be cached in an instance variable?? final java.util.Formatter formatter = new java.util.Formatter(this); formatter.format(locale, format, args); + return this; } - public synchronized void printf(String format, Object... args) { + public synchronized PrintStream printf(String format, Object... args) { final java.util.Formatter formatter = new java.util.Formatter(this); formatter.format(format, args); + return this; } - public void format(String format, Object... args) { - printf(format, args); + public PrintStream format(String format, Object... args) { + return printf(format, args); } - public void format(java.util.Locale locale, String format, Object... args) { - printf(locale, format, args); + public PrintStream format(java.util.Locale locale, String format, Object... args) { + return printf(locale, format, args); } public synchronized void println(String s) {