8154493: AppletViewer should emit its deprecation warning to standard error
Reviewed-by: smarks
--- a/jdk/src/java.desktop/share/classes/sun/applet/Main.java Fri Apr 29 16:37:02 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/applet/Main.java Mon May 02 12:01:39 2016 +0300
@@ -104,7 +104,8 @@
private int run(String [] args) {
// DECODE ARGS
try {
- System.out.println(lookup("deprecated"));
+ System.err.println(lookup("deprecated"));
+ System.err.flush();
if (args.length == 0) {
usage();
return 0;
--- a/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java Fri Apr 29 16:37:02 2016 -0700
+++ b/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java Mon May 02 12:01:39 2016 +0300
@@ -35,14 +35,14 @@
private static final String TEXT = "AppletViewer is deprecated.";
public static void main(final String[] args) {
- final PrintStream old = System.out;
+ final PrintStream old = System.err;
final ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
final PrintStream ps = new PrintStream(baos);
try {
- System.setOut(ps);
+ System.setErr(ps);
sun.applet.Main.main(new String[]{});
} finally {
- System.setOut(old);
+ System.setErr(old);
}
final String text = new String(baos.toByteArray());