8154493: AppletViewer should emit its deprecation warning to standard error

Reviewed-by: smarks
This commit is contained in:
Sergey Bylokhov 2016-05-02 12:01:39 +03:00
parent 5dda2fc113
commit 1f092412dc
2 changed files with 5 additions and 4 deletions

View File

@ -104,7 +104,8 @@ public class Main {
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;

View File

@ -35,14 +35,14 @@ public final class DeprecatedAppletViewer {
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());