diff options
| author | 2015-12-17 14:13:00 +0000 | |
|---|---|---|
| committer | 2017-06-02 16:53:23 +0100 | |
| commit | f6c66c3348a2b64e4b6472827e31f711142006e3 (patch) | |
| tree | 0795f80e2c07dc79904590ddeb0fbe55ba9e6176 | |
| parent | 1656ca9e6996cb555b4463e5efd4bd7e3f4fb816 (diff) | |
Tests: never use System.err
Always print stack traces to System.out, and replace all
System.err.println()'s with System.out.println().
Follow-up of https://android-review.googlesource.com/#/c/187020/ and
https://android-review.googlesource.com/#/c/407032/.
Test: m test-art-host
m test-art-target
Change-Id: I9ab9cd955a8db25b2ec6673790e5bc924f62c88a
85 files changed, 291 insertions, 291 deletions
diff --git a/test/003-omnibus-opcodes/src/Main.java b/test/003-omnibus-opcodes/src/Main.java index a30ec15c66..4e1ffe2fde 100644 --- a/test/003-omnibus-opcodes/src/Main.java +++ b/test/003-omnibus-opcodes/src/Main.java @@ -67,7 +67,7 @@ public class Main { } catch (Throwable th) { // We and the RI throw ClassNotFoundException, but that isn't declared so javac // won't let us try to catch it. - th.printStackTrace(); + th.printStackTrace(System.out); } InternedString.run(); GenSelect.run(); diff --git a/test/008-exceptions/src/Main.java b/test/008-exceptions/src/Main.java index 74af00ccf7..89fe016856 100644 --- a/test/008-exceptions/src/Main.java +++ b/test/008-exceptions/src/Main.java @@ -155,7 +155,7 @@ public class Main { } catch (BadError e) { System.out.println(e); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } try { // Before splitting mirror::Class::kStatusError into @@ -171,11 +171,11 @@ public class Main { throw new IllegalStateException("Should not reach here."); } catch (NoClassDefFoundError ncdfe) { if (!(ncdfe.getCause() instanceof BadError)) { - ncdfe.getCause().printStackTrace(); + ncdfe.getCause().printStackTrace(System.out); } } catch (VerifyError e) { } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } @@ -186,7 +186,7 @@ public class Main { } catch (Error e) { System.out.println(e); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } // Before splitting mirror::Class::kStatusError into // kStatusErrorUnresolved and kStatusErrorResolved, @@ -200,7 +200,7 @@ public class Main { System.out.println(ncdfe); System.out.println(" cause: " + ncdfe.getCause()); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } try { MultiDexBadInitWrapper2.setDummy(1); @@ -209,7 +209,7 @@ public class Main { System.out.println(ncdfe); System.out.println(" cause: " + ncdfe.getCause()); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } } diff --git a/test/023-many-interfaces/src/ManyInterfaces.java b/test/023-many-interfaces/src/ManyInterfaces.java index d69a490f67..8ec4566802 100644 --- a/test/023-many-interfaces/src/ManyInterfaces.java +++ b/test/023-many-interfaces/src/ManyInterfaces.java @@ -355,7 +355,7 @@ public class ManyInterfaces static void testInstance001(Object obj, int count) { if (!(obj instanceof Interface001)) - System.err.println("BAD"); + System.out.println("BAD"); while (count-- != 0) { boolean is; is = obj instanceof Interface001; @@ -379,7 +379,7 @@ public class ManyInterfaces static void testInstance049(Object obj, int count) { if (!(obj instanceof Interface049)) - System.err.println("BAD"); + System.out.println("BAD"); while (count-- != 0) { boolean is; is = obj instanceof Interface049; @@ -403,7 +403,7 @@ public class ManyInterfaces static void testInstance099(Object obj, int count) { if (!(obj instanceof Interface099)) - System.err.println("BAD"); + System.out.println("BAD"); while (count-- != 0) { boolean is; is = obj instanceof Interface099; diff --git a/test/024-illegal-access/src/Main.java b/test/024-illegal-access/src/Main.java index 84c7114cb4..de9ad5b694 100644 --- a/test/024-illegal-access/src/Main.java +++ b/test/024-illegal-access/src/Main.java @@ -18,7 +18,7 @@ public class Main { static public void main(String[] args) { try { PublicAccess.accessStaticField(); - System.err.println("ERROR: call 1 not expected to succeed"); + System.out.println("ERROR: call 1 not expected to succeed"); } catch (VerifyError ve) { // dalvik System.out.println("Got expected failure 1"); @@ -29,7 +29,7 @@ public class Main { try { PublicAccess.accessStaticMethod(); - System.err.println("ERROR: call 2 not expected to succeed"); + System.out.println("ERROR: call 2 not expected to succeed"); } catch (IllegalAccessError iae) { // reference System.out.println("Got expected failure 2"); @@ -37,7 +37,7 @@ public class Main { try { PublicAccess.accessInstanceField(); - System.err.println("ERROR: call 3 not expected to succeed"); + System.out.println("ERROR: call 3 not expected to succeed"); } catch (VerifyError ve) { // dalvik System.out.println("Got expected failure 3"); @@ -48,7 +48,7 @@ public class Main { try { PublicAccess.accessInstanceMethod(); - System.err.println("ERROR: call 4 not expected to succeed"); + System.out.println("ERROR: call 4 not expected to succeed"); } catch (IllegalAccessError iae) { // reference System.out.println("Got expected failure 4"); @@ -56,7 +56,7 @@ public class Main { try { CheckInstanceof.main(new Object()); - System.err.println("ERROR: call 5 not expected to succeed"); + System.out.println("ERROR: call 5 not expected to succeed"); } catch (VerifyError ve) { // dalvik System.out.println("Got expected failure 5"); diff --git a/test/031-class-attributes/src/ClassAttrs.java b/test/031-class-attributes/src/ClassAttrs.java index 39e69a3066..8489a2c222 100644 --- a/test/031-class-attributes/src/ClassAttrs.java +++ b/test/031-class-attributes/src/ClassAttrs.java @@ -133,12 +133,12 @@ public class ClassAttrs { System.out.println("field signature: " + getSignatureAttribute(field)); } catch (NoSuchMethodException nsme) { - System.err.println("FAILED: " + nsme); + System.out.println("FAILED: " + nsme); } catch (NoSuchFieldException nsfe) { - System.err.println("FAILED: " + nsfe); + System.out.println("FAILED: " + nsfe); } catch (RuntimeException re) { - System.err.println("FAILED: " + re); - re.printStackTrace(); + System.out.println("FAILED: " + re); + re.printStackTrace(System.out); } test_isAssignableFrom(); @@ -228,7 +228,7 @@ public class ClassAttrs { method = c.getDeclaredMethod("getSignatureAttribute"); method.setAccessible(true); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); return "<unknown>"; } diff --git a/test/032-concrete-sub/src/ConcreteSub.java b/test/032-concrete-sub/src/ConcreteSub.java index 95adf63c37..61d1602492 100644 --- a/test/032-concrete-sub/src/ConcreteSub.java +++ b/test/032-concrete-sub/src/ConcreteSub.java @@ -45,7 +45,7 @@ public class ConcreteSub extends AbstractBase { try { meth = absClass.getMethod("redefineMe"); } catch (NoSuchMethodException nsme) { - nsme.printStackTrace(); + nsme.printStackTrace(System.out); return; } System.out.println("meth modifiers=" + meth.getModifiers()); diff --git a/test/032-concrete-sub/src/Main.java b/test/032-concrete-sub/src/Main.java index 4a5193d635..7d3be1525d 100644 --- a/test/032-concrete-sub/src/Main.java +++ b/test/032-concrete-sub/src/Main.java @@ -26,7 +26,7 @@ public class Main { ConcreteSub2 blah = new ConcreteSub2(); // other VMs fail here (AbstractMethodError) blah.doStuff(); - System.err.println("Succeeded unexpectedly"); + System.out.println("Succeeded unexpectedly"); } catch (VerifyError ve) { System.out.println("Got expected failure"); } catch (AbstractMethodError ame) { diff --git a/test/036-finalizer/src/Main.java b/test/036-finalizer/src/Main.java index 0de56f9a7c..734830f7de 100644 --- a/test/036-finalizer/src/Main.java +++ b/test/036-finalizer/src/Main.java @@ -120,7 +120,7 @@ public class Main { static void printNonFinalized() { for (int i = 0; i < maxCount; ++i) { if (!FinalizeCounter.finalized[i]) { - System.err.println("Element " + i + " was not finalized"); + System.out.println("Element " + i + " was not finalized"); } } } diff --git a/test/042-new-instance/src/Main.java b/test/042-new-instance/src/Main.java index 755d62ebb5..34d1f5a68d 100644 --- a/test/042-new-instance/src/Main.java +++ b/test/042-new-instance/src/Main.java @@ -37,31 +37,31 @@ public class Main { Object obj = c.newInstance(); System.out.println("LocalClass succeeded"); } catch (Exception ex) { - System.err.println("LocalClass failed"); - ex.printStackTrace(); + System.out.println("LocalClass failed"); + ex.printStackTrace(System.out); } // should fail try { Class<?> c = Class.forName("otherpackage.PackageAccess"); Object obj = c.newInstance(); - System.err.println("ERROR: PackageAccess succeeded unexpectedly"); + System.out.println("ERROR: PackageAccess succeeded unexpectedly"); } catch (IllegalAccessException iae) { System.out.println("Got expected PackageAccess complaint"); } catch (Exception ex) { - System.err.println("Got unexpected PackageAccess failure"); - ex.printStackTrace(); + System.out.println("Got unexpected PackageAccess failure"); + ex.printStackTrace(System.out); } LocalClass3.main(); try { MaybeAbstract ma = new MaybeAbstract(); - System.err.println("ERROR: MaybeAbstract succeeded unexpectedly"); + System.out.println("ERROR: MaybeAbstract succeeded unexpectedly"); } catch (InstantiationError ie) { System.out.println("Got expected InstantationError"); } catch (Exception ex) { - System.err.println("Got unexpected MaybeAbstract failure"); + System.out.println("Got unexpected MaybeAbstract failure"); } } @@ -73,12 +73,12 @@ public class Main { try { Class<?> c = Class.forName("LocalClass"); Constructor<?> cons = c.getConstructor(); - System.err.println("Cons LocalClass succeeded unexpectedly"); + System.out.println("Cons LocalClass succeeded unexpectedly"); } catch (NoSuchMethodException nsme) { System.out.println("Cons LocalClass failed as expected"); } catch (Exception ex) { - System.err.println("Cons LocalClass failed strangely"); - ex.printStackTrace(); + System.out.println("Cons LocalClass failed strangely"); + ex.printStackTrace(System.out); } // should succeed @@ -88,8 +88,8 @@ public class Main { Object obj = cons.newInstance(); System.out.println("Cons LocalClass2 succeeded"); } catch (Exception ex) { - System.err.println("Cons LocalClass2 failed"); - ex.printStackTrace(); + System.out.println("Cons LocalClass2 failed"); + ex.printStackTrace(System.out); } // should succeed @@ -99,8 +99,8 @@ public class Main { Object obj = cons.newInstance(new Main()); System.out.println("Cons InnerClass succeeded"); } catch (Exception ex) { - System.err.println("Cons InnerClass failed"); - ex.printStackTrace(); + System.out.println("Cons InnerClass failed"); + ex.printStackTrace(System.out); } // should succeed @@ -110,21 +110,21 @@ public class Main { Object obj = cons.newInstance(); System.out.println("Cons StaticInnerClass succeeded"); } catch (Exception ex) { - System.err.println("Cons StaticInnerClass failed"); - ex.printStackTrace(); + System.out.println("Cons StaticInnerClass failed"); + ex.printStackTrace(System.out); } // should fail try { Class<?> c = Class.forName("otherpackage.PackageAccess"); Constructor<?> cons = c.getConstructor(); - System.err.println("ERROR: Cons PackageAccess succeeded unexpectedly"); + System.out.println("ERROR: Cons PackageAccess succeeded unexpectedly"); } catch (NoSuchMethodException nsme) { // constructor isn't public System.out.println("Cons got expected PackageAccess complaint"); } catch (Exception ex) { - System.err.println("Cons got unexpected PackageAccess failure"); - ex.printStackTrace(); + System.out.println("Cons got unexpected PackageAccess failure"); + ex.printStackTrace(System.out); } // should fail @@ -132,13 +132,13 @@ public class Main { Class<?> c = Class.forName("MaybeAbstract"); Constructor<?> cons = c.getConstructor(); Object obj = cons.newInstance(); - System.err.println("ERROR: Cons MaybeAbstract succeeded unexpectedly"); + System.out.println("ERROR: Cons MaybeAbstract succeeded unexpectedly"); } catch (InstantiationException ie) { // note InstantiationException vs. InstantiationError System.out.println("Cons got expected InstantationException"); } catch (Exception ex) { - System.err.println("Cons got unexpected MaybeAbstract failure"); - ex.printStackTrace(); + System.out.println("Cons got unexpected MaybeAbstract failure"); + ex.printStackTrace(System.out); } // should fail @@ -147,13 +147,13 @@ public class Main { Constructor<?> cons = c.getConstructor(); if (!FULL_ACCESS_CHECKS) { throw new IllegalAccessException(); } Object obj = cons.newInstance(); - System.err.println("ERROR: Cons PackageAccess2 succeeded unexpectedly"); + System.out.println("ERROR: Cons PackageAccess2 succeeded unexpectedly"); } catch (IllegalAccessException iae) { // constructor is public, but class has package scope System.out.println("Cons got expected PackageAccess2 complaint"); } catch (Exception ex) { - System.err.println("Cons got unexpected PackageAccess2 failure"); - ex.printStackTrace(); + System.out.println("Cons got unexpected PackageAccess2 failure"); + ex.printStackTrace(System.out); } // should succeed @@ -161,8 +161,8 @@ public class Main { otherpackage.ConstructorAccess.newConstructorInstance(); System.out.println("Cons ConstructorAccess succeeded"); } catch (Exception ex) { - System.err.println("Cons ConstructorAccess failed"); - ex.printStackTrace(); + System.out.println("Cons ConstructorAccess failed"); + ex.printStackTrace(System.out); } } @@ -187,8 +187,8 @@ class LocalClass3 { CC.newInstance(); System.out.println("LocalClass3 succeeded"); } catch (Exception ex) { - System.err.println("Got unexpected LocalClass3 failure"); - ex.printStackTrace(); + System.out.println("Got unexpected LocalClass3 failure"); + ex.printStackTrace(System.out); } } @@ -200,7 +200,7 @@ class LocalClass3 { Class<?> c = CC.class; return c.newInstance(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); return null; } } diff --git a/test/044-proxy/src/BasicTest.java b/test/044-proxy/src/BasicTest.java index 5f04b9344c..7f301f667b 100644 --- a/test/044-proxy/src/BasicTest.java +++ b/test/044-proxy/src/BasicTest.java @@ -34,9 +34,9 @@ public class BasicTest { Object proxy = createProxy(proxyMe); if (!Proxy.isProxyClass(proxy.getClass())) - System.err.println("not a proxy class?"); + System.out.println("not a proxy class?"); if (Proxy.getInvocationHandler(proxy) == null) - System.err.println("ERROR: Proxy.getInvocationHandler is null"); + System.out.println("ERROR: Proxy.getInvocationHandler is null"); /* take it for a spin; verifies instanceof constraint */ Shapes shapes = (Shapes) proxy; @@ -110,13 +110,13 @@ public class BasicTest { //System.out.println("Constructor is " + cons); proxy = cons.newInstance(handler); } catch (NoSuchMethodException nsme) { - System.err.println("failed: " + nsme); + System.out.println("failed: " + nsme); } catch (InstantiationException ie) { - System.err.println("failed: " + ie); + System.out.println("failed: " + ie); } catch (IllegalAccessException ie) { - System.err.println("failed: " + ie); + System.out.println("failed: " + ie); } catch (InvocationTargetException ite) { - System.err.println("failed: " + ite); + System.out.println("failed: " + ite); } return proxy; diff --git a/test/044-proxy/src/Clash.java b/test/044-proxy/src/Clash.java index d000112fb6..7dabe927b0 100644 --- a/test/044-proxy/src/Clash.java +++ b/test/044-proxy/src/Clash.java @@ -32,7 +32,7 @@ public class Clash { Proxy.newProxyInstance(Clash.class.getClassLoader(), new Class<?>[] { Interface1A.class, Interface1A.class }, handler); - System.err.println("Dupe did not throw expected exception"); + System.out.println("Dupe did not throw expected exception"); } catch (IllegalArgumentException iae) { System.out.println("Dupe threw expected exception"); } @@ -41,7 +41,7 @@ public class Clash { Proxy.newProxyInstance(Clash.class.getClassLoader(), new Class<?>[] { Interface1A.class, Interface1B.class }, handler); - System.err.println("Clash did not throw expected exception"); + System.out.println("Clash did not throw expected exception"); } catch (IllegalArgumentException iae) { System.out.println("Clash threw expected exception"); } diff --git a/test/044-proxy/src/Clash2.java b/test/044-proxy/src/Clash2.java index e405cfea03..51221f2656 100644 --- a/test/044-proxy/src/Clash2.java +++ b/test/044-proxy/src/Clash2.java @@ -31,7 +31,7 @@ public class Clash2 { Proxy.newProxyInstance(Clash.class.getClassLoader(), new Class<?>[] { Interface2A.class, Interface2B.class }, handler); - System.err.println("Clash2 did not throw expected exception"); + System.out.println("Clash2 did not throw expected exception"); } catch (IllegalArgumentException iae) { System.out.println("Clash2 threw expected exception"); } diff --git a/test/044-proxy/src/Clash3.java b/test/044-proxy/src/Clash3.java index 44806cee7d..9d23059b9c 100644 --- a/test/044-proxy/src/Clash3.java +++ b/test/044-proxy/src/Clash3.java @@ -35,7 +35,7 @@ public class Clash3 { Interface3aa.class, Interface3b.class }, handler); - System.err.println("Clash3 did not throw expected exception"); + System.out.println("Clash3 did not throw expected exception"); } catch (IllegalArgumentException iae) { System.out.println("Clash3 threw expected exception"); } diff --git a/test/044-proxy/src/Clash4.java b/test/044-proxy/src/Clash4.java index ca5c3ab6e6..45d48208e1 100644 --- a/test/044-proxy/src/Clash4.java +++ b/test/044-proxy/src/Clash4.java @@ -36,7 +36,7 @@ public class Clash4 { Interface4b.class, Interface4bb.class }, handler); - System.err.println("Clash4 did not throw expected exception"); + System.out.println("Clash4 did not throw expected exception"); } catch (IllegalArgumentException iae) { System.out.println("Clash4 threw expected exception"); //System.out.println(iae); diff --git a/test/044-proxy/src/ConstructorProxy.java b/test/044-proxy/src/ConstructorProxy.java index 95d150cbbd..dfafbd804a 100644 --- a/test/044-proxy/src/ConstructorProxy.java +++ b/test/044-proxy/src/ConstructorProxy.java @@ -28,7 +28,7 @@ class ConstructorProxy implements InvocationHandler { new ConstructorProxy().runTest(); } catch (Exception e) { System.out.println("Unexpected failure occured"); - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/044-proxy/src/WrappedThrow.java b/test/044-proxy/src/WrappedThrow.java index 643ba053b9..afea26d5d5 100644 --- a/test/044-proxy/src/WrappedThrow.java +++ b/test/044-proxy/src/WrappedThrow.java @@ -43,29 +43,29 @@ public class WrappedThrow { InterfaceW2 if2 = (InterfaceW2) proxy; try { if1.throwFunky(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (UndeclaredThrowableException ute) { System.out.println("Got expected UTE"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } try { if1.throwFunky2(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (IOException ioe) { System.out.println("Got expected IOE"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } try { if2.throwFunky2(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (IOException ioe) { System.out.println("Got expected IOE"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } /* @@ -73,38 +73,38 @@ public class WrappedThrow { */ try { if1.throwException(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (UndeclaredThrowableException ute) { System.out.println("Got expected UTE"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } try { if1.throwBase(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (UndeclaredThrowableException ute) { System.out.println("Got expected UTE"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } try { if2.throwSub(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (SubException se) { System.out.println("Got expected exception"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } try { if2.throwSubSub(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (SubException se) { System.out.println("Got expected exception"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } /* @@ -113,11 +113,11 @@ public class WrappedThrow { */ try { if1.bothThrowBase(); - System.err.println("No exception thrown"); + System.out.println("No exception thrown"); } catch (BaseException se) { System.out.println("Got expected exception"); } catch (Throwable t) { - System.err.println("Got unexpected exception: " + t); + System.out.println("Got unexpected exception: " + t); } } } diff --git a/test/045-reflect-array/src/Main.java b/test/045-reflect-array/src/Main.java index 7418eed824..4c321b3303 100644 --- a/test/045-reflect-array/src/Main.java +++ b/test/045-reflect-array/src/Main.java @@ -102,7 +102,7 @@ public class Main { throw new RuntimeException("load should have worked"); } } catch (IllegalArgumentException iae) { - iae.printStackTrace(); + iae.printStackTrace(System.out); } try { Array.getByte(charArray, 2); @@ -116,7 +116,7 @@ public class Main { + Array.getInt(charArray, 3)); } } catch (IllegalArgumentException iae) { - iae.printStackTrace(); + iae.printStackTrace(System.out); } System.out.println("ReflectArrayTest.testSingleChar passed"); diff --git a/test/046-reflect/src/Main.java b/test/046-reflect/src/Main.java index 10dad8ddac..b8a48ea247 100644 --- a/test/046-reflect/src/Main.java +++ b/test/046-reflect/src/Main.java @@ -89,7 +89,7 @@ public class Main { try { meth = target.getMethod("packageMethod"); - System.err.println("succeeded on package-scope method"); + System.out.println("succeeded on package-scope method"); } catch (NoSuchMethodException nsme) { // good } @@ -101,7 +101,7 @@ public class Main { try { if (!FULL_ACCESS_CHECKS) { throw new IllegalAccessException(); } meth.invoke(instance); - System.err.println("inner-method invoke unexpectedly worked"); + System.out.println("inner-method invoke unexpectedly worked"); } catch (IllegalAccessException iae) { // good } @@ -110,13 +110,13 @@ public class Main { try { int x = field.getInt(instance); if (!FULL_ACCESS_CHECKS) { throw new IllegalAccessException(); } - System.err.println("field get unexpectedly worked: " + x); + System.out.println("field get unexpectedly worked: " + x); } catch (IllegalAccessException iae) { // good } } catch (Exception ex) { System.out.println("----- unexpected exception -----"); - ex.printStackTrace(); + ex.printStackTrace(System.out); } } @@ -171,7 +171,7 @@ public class Main { } catch (Exception ex) { System.out.println("GLITCH: invoke got wrong exception:"); - ex.printStackTrace(); + ex.printStackTrace(System.out); } System.out.println(""); @@ -400,7 +400,7 @@ public class Main { } catch (Exception ex) { System.out.println("----- unexpected exception -----"); - ex.printStackTrace(); + ex.printStackTrace(System.out); } System.out.println("ReflectTest done!"); @@ -414,7 +414,7 @@ public class Main { m = Collections.class.getDeclaredMethod("swap", Object[].class, int.class, int.class); } catch (NoSuchMethodException nsme) { - nsme.printStackTrace(); + nsme.printStackTrace(System.out); return; } System.out.println(m + " accessible=" + m.isAccessible()); @@ -423,10 +423,10 @@ public class Main { try { m.invoke(null, objects, 0, 1); } catch (IllegalAccessException iae) { - iae.printStackTrace(); + iae.printStackTrace(System.out); return; } catch (InvocationTargetException ite) { - ite.printStackTrace(); + ite.printStackTrace(System.out); return; } @@ -434,10 +434,10 @@ public class Main { String s = "Should be ignored"; m.invoke(s, objects, 0, 1); } catch (IllegalAccessException iae) { - iae.printStackTrace(); + iae.printStackTrace(System.out); return; } catch (InvocationTargetException ite) { - ite.printStackTrace(); + ite.printStackTrace(System.out); return; } @@ -449,7 +449,7 @@ public class Main { } catch (InvocationTargetException ite) { System.out.println("checkType got expected exception"); } catch (IllegalAccessException iae) { - iae.printStackTrace(); + iae.printStackTrace(System.out); return; } } @@ -826,7 +826,7 @@ class FieldNoisyInit { static { System.out.println("FieldNoisyInit is initializing"); //Throwable th = new Throwable(); - //th.printStackTrace(); + //th.printStackTrace(System.out); } } @@ -842,7 +842,7 @@ class MethodNoisyInit { static { System.out.println("MethodNoisyInit is initializing"); //Throwable th = new Throwable(); - //th.printStackTrace(); + //th.printStackTrace(System.out); } } diff --git a/test/048-reflect-v8/src/DefaultDeclared.java b/test/048-reflect-v8/src/DefaultDeclared.java index 16e8a24c00..d49bdc91a5 100644 --- a/test/048-reflect-v8/src/DefaultDeclared.java +++ b/test/048-reflect-v8/src/DefaultDeclared.java @@ -52,7 +52,7 @@ public class DefaultDeclared { System.out.println("NoSuchMethodException thrown for class " + klass.toString()); } catch (Throwable t) { System.out.println("Unknown error thrown for class " + klass.toString()); - t.printStackTrace(); + t.printStackTrace(System.out); } } diff --git a/test/050-sync-test/src/Main.java b/test/050-sync-test/src/Main.java index 5364e2aaaa..734b51e811 100644 --- a/test/050-sync-test/src/Main.java +++ b/test/050-sync-test/src/Main.java @@ -39,7 +39,7 @@ public class Main { Thread.sleep(1000); } catch (InterruptedException ie) { System.out.println("INTERRUPT!"); - ie.printStackTrace(); + ie.printStackTrace(System.out); } System.out.println("GONE"); } @@ -56,7 +56,7 @@ public class Main { one.wait(); } catch (InterruptedException ie) { System.out.println("INTERRUPT!"); - ie.printStackTrace(); + ie.printStackTrace(System.out); } } @@ -69,7 +69,7 @@ public class Main { two.join(); } catch (InterruptedException ie) { System.out.println("INTERRUPT!"); - ie.printStackTrace(); + ie.printStackTrace(System.out); } System.out.println("main: all done"); } @@ -167,7 +167,7 @@ class SleepyThread extends Thread { " interrupted, flag=" + Thread.interrupted()); intr = true; } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } if (!intr) diff --git a/test/050-sync-test/src/ThreadDeathHandler.java b/test/050-sync-test/src/ThreadDeathHandler.java index 0a7437d307..58061f8d00 100644 --- a/test/050-sync-test/src/ThreadDeathHandler.java +++ b/test/050-sync-test/src/ThreadDeathHandler.java @@ -27,7 +27,7 @@ public class ThreadDeathHandler implements Thread.UncaughtExceptionHandler { } public void uncaughtException(Thread t, Throwable e) { - System.err.println("Uncaught exception " + mMyMessage + "!"); - e.printStackTrace(); + System.out.println("Uncaught exception " + mMyMessage + "!"); + e.printStackTrace(System.out); } } diff --git a/test/051-thread/src/Main.java b/test/051-thread/src/Main.java index 08cb5deeac..fe1cafef56 100644 --- a/test/051-thread/src/Main.java +++ b/test/051-thread/src/Main.java @@ -79,7 +79,7 @@ public class Main { try { t.join(); } catch (InterruptedException ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } System.out.print("testThreadDaemons finished\n"); diff --git a/test/053-wait-some/src/Main.java b/test/053-wait-some/src/Main.java index 377a5781ea..b8e6dfeeae 100644 --- a/test/053-wait-some/src/Main.java +++ b/test/053-wait-some/src/Main.java @@ -39,7 +39,7 @@ public class Main { } catch (IllegalArgumentException iae) { System.out.println("Caught expected exception on neg arg"); } catch (InterruptedException ie) { - ie.printStackTrace(); + ie.printStackTrace(System.out); } for (long delay : DELAYS) { @@ -49,7 +49,7 @@ public class Main { try { sleepy.wait(delay); } catch (InterruptedException ie) { - ie.printStackTrace(); + ie.printStackTrace(System.out); } end = System.currentTimeMillis(); diff --git a/test/054-uncaught/src/Main.java b/test/054-uncaught/src/Main.java index 688a2a4d79..43de7ae258 100644 --- a/test/054-uncaught/src/Main.java +++ b/test/054-uncaught/src/Main.java @@ -33,7 +33,7 @@ public class Main { try { t.join(); } catch (InterruptedException ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } } @@ -41,7 +41,7 @@ public class Main { ThreadDeathHandler defHandler = new ThreadDeathHandler("DEFAULT"); ThreadDeathHandler threadHandler = new ThreadDeathHandler("THREAD"); - System.err.println("Test " + which); + System.out.println("Test " + which); switch (which) { case 1: { Thread.setDefaultUncaughtExceptionHandler(defHandler); diff --git a/test/054-uncaught/src/ThreadDeathHandler.java b/test/054-uncaught/src/ThreadDeathHandler.java index 0a7437d307..58061f8d00 100644 --- a/test/054-uncaught/src/ThreadDeathHandler.java +++ b/test/054-uncaught/src/ThreadDeathHandler.java @@ -27,7 +27,7 @@ public class ThreadDeathHandler implements Thread.UncaughtExceptionHandler { } public void uncaughtException(Thread t, Throwable e) { - System.err.println("Uncaught exception " + mMyMessage + "!"); - e.printStackTrace(); + System.out.println("Uncaught exception " + mMyMessage + "!"); + e.printStackTrace(System.out); } } diff --git a/test/059-finalizer-throw/src/Main.java b/test/059-finalizer-throw/src/Main.java index fa80fe3f7a..3bfbc2d5b6 100644 --- a/test/059-finalizer-throw/src/Main.java +++ b/test/059-finalizer-throw/src/Main.java @@ -46,7 +46,7 @@ public class Main { try { Thread.sleep(500); } catch (InterruptedException ie) { - System.err.println(ie); + System.out.println(ie); } } @@ -54,7 +54,7 @@ public class Main { try { Thread.sleep(750); } catch (InterruptedException ie) { - System.err.println(ie); + System.out.println(ie); } System.out.println("done"); diff --git a/test/064-field-access/src/Main.java b/test/064-field-access/src/Main.java index 50ad5b9a20..b08f3ae305 100644 --- a/test/064-field-access/src/Main.java +++ b/test/064-field-access/src/Main.java @@ -28,7 +28,7 @@ public class Main { try { GetNonexistent.main(null); - System.err.println("Not expected to succeed"); + System.out.println("Not expected to succeed"); } catch (VerifyError fe) { // dalvik System.out.println("Got expected failure"); @@ -101,22 +101,22 @@ public class Main { /* success; expected? */ if (expectedException != null) { - System.err.println("ERROR: call succeeded for field " + field + + System.out.println("ERROR: call succeeded for field " + field + " with a read of type '" + type + "', was expecting " + expectedException); Thread.dumpStack(); } } catch (Exception ex) { if (expectedException == null) { - System.err.println("ERROR: call failed unexpectedly: " + System.out.println("ERROR: call failed unexpectedly: " + ex.getClass()); - ex.printStackTrace(); + ex.printStackTrace(System.out); } else { if (!expectedException.equals(ex.getClass())) { - System.err.println("ERROR: incorrect exception: wanted " + System.out.println("ERROR: incorrect exception: wanted " + expectedException.getName() + ", got " + ex.getClass()); - ex.printStackTrace(); + ex.printStackTrace(System.out); } } } @@ -675,22 +675,22 @@ class SubClass extends PublicClass { /* success; expected? */ if (expectedException != null) { - System.err.println("ERROR: call succeeded for field " + field + + System.out.println("ERROR: call succeeded for field " + field + " with a read of type '" + type + "', was expecting " + expectedException); Thread.dumpStack(); } } catch (Exception ex) { if (expectedException == null) { - System.err.println("ERROR: call failed unexpectedly: " + System.out.println("ERROR: call failed unexpectedly: " + ex.getClass()); - ex.printStackTrace(); + ex.printStackTrace(System.out); } else { if (!expectedException.equals(ex.getClass())) { - System.err.println("ERROR: incorrect exception: wanted " + System.out.println("ERROR: incorrect exception: wanted " + expectedException.getName() + ", got " + ex.getClass()); - ex.printStackTrace(); + ex.printStackTrace(System.out); } } } @@ -704,19 +704,19 @@ class SubClass extends PublicClass { result = method.invoke(obj); /* success; expected? */ if (expectedException != null) { - System.err.println("ERROR: call succeeded for method " + method + "', was expecting " + + System.out.println("ERROR: call succeeded for method " + method + "', was expecting " + expectedException); Thread.dumpStack(); } } catch (Exception ex) { if (expectedException == null) { - System.err.println("ERROR: call failed unexpectedly: " + ex.getClass()); - ex.printStackTrace(); + System.out.println("ERROR: call failed unexpectedly: " + ex.getClass()); + ex.printStackTrace(System.out); } else { if (!expectedException.equals(ex.getClass())) { - System.err.println("ERROR: incorrect exception: wanted " + expectedException.getName() + + System.out.println("ERROR: incorrect exception: wanted " + expectedException.getName() + ", got " + ex.getClass()); - ex.printStackTrace(); + ex.printStackTrace(System.out); } } } diff --git a/test/065-mismatched-implements/src/Main.java b/test/065-mismatched-implements/src/Main.java index 5975b99e92..55d0babbef 100644 --- a/test/065-mismatched-implements/src/Main.java +++ b/test/065-mismatched-implements/src/Main.java @@ -21,7 +21,7 @@ public class Main { public static void main(String[] args) { try { Indirect.main(); - System.err.println("Succeeded unexpectedly"); + System.out.println("Succeeded unexpectedly"); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected ICCE"); } diff --git a/test/066-mismatched-super/src/Main.java b/test/066-mismatched-super/src/Main.java index 5975b99e92..55d0babbef 100644 --- a/test/066-mismatched-super/src/Main.java +++ b/test/066-mismatched-super/src/Main.java @@ -21,7 +21,7 @@ public class Main { public static void main(String[] args) { try { Indirect.main(); - System.err.println("Succeeded unexpectedly"); + System.out.println("Succeeded unexpectedly"); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected ICCE"); } diff --git a/test/068-classloader/src/Main.java b/test/068-classloader/src/Main.java index 01539b7172..0aaa1528c0 100644 --- a/test/068-classloader/src/Main.java +++ b/test/068-classloader/src/Main.java @@ -129,7 +129,7 @@ public class Main { throw new RuntimeException("target 2 has unexpected value " + value); } } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } } @@ -153,8 +153,8 @@ public class Main { try { altClass = loader.loadClass("Inaccessible1"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed"); - cnfe.printStackTrace(); + System.out.println("loadClass failed"); + cnfe.printStackTrace(System.out); return; } @@ -162,9 +162,9 @@ public class Main { Object obj; try { obj = altClass.newInstance(); - System.err.println("ERROR: Inaccessible1 was accessible"); + System.out.println("ERROR: Inaccessible1 was accessible"); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { System.out.println("Got expected access exception #1"); @@ -182,14 +182,14 @@ public class Main { try { altClass = loader.loadClass("Inaccessible2"); - System.err.println("ERROR: Inaccessible2 was accessible: " + altClass); + System.out.println("ERROR: Inaccessible2 was accessible: " + altClass); } catch (ClassNotFoundException cnfe) { Throwable cause = cnfe.getCause(); if (cause instanceof IllegalAccessError) { System.out.println("Got expected CNFE/IAE #2"); } else { - System.err.println("Got unexpected CNFE/IAE #2"); - cnfe.printStackTrace(); + System.out.println("Got unexpected CNFE/IAE #2"); + cnfe.printStackTrace(System.out); } } } @@ -202,14 +202,14 @@ public class Main { try { altClass = loader.loadClass("Inaccessible3"); - System.err.println("ERROR: Inaccessible3 was accessible: " + altClass); + System.out.println("ERROR: Inaccessible3 was accessible: " + altClass); } catch (ClassNotFoundException cnfe) { Throwable cause = cnfe.getCause(); if (cause instanceof IllegalAccessError) { System.out.println("Got expected CNFE/IAE #3"); } else { - System.err.println("Got unexpected CNFE/IAE #3"); - cnfe.printStackTrace(); + System.out.println("Got unexpected CNFE/IAE #3"); + cnfe.printStackTrace(System.out); } } } @@ -227,7 +227,7 @@ public class Main { //System.out.println("+++ DoubledExtend is " + doubledExtendClass // + " in " + doubledExtendClass.getClassLoader()); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed: " + cnfe); + System.out.println("loadClass failed: " + cnfe); return; } @@ -235,10 +235,10 @@ public class Main { try { obj = doubledExtendClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { System.out.println("Got expected LinkageError on DE"); @@ -254,8 +254,8 @@ public class Main { String result; result = Base.doStuff(de); - System.err.println("ERROR: did not get LinkageError on DE"); - System.err.println("(result=" + result + ")"); + System.out.println("ERROR: did not get LinkageError on DE"); + System.out.println("(result=" + result + ")"); } catch (LinkageError le) { System.out.println("Got expected LinkageError on DE"); return; @@ -274,7 +274,7 @@ public class Main { try { doubledExtendOkayClass = loader.loadClass("DoubledExtendOkay"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed: " + cnfe); + System.out.println("loadClass failed: " + cnfe); return; } @@ -282,14 +282,14 @@ public class Main { try { obj = doubledExtendOkayClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { - System.err.println("Got unexpected LinkageError on DEO"); - le.printStackTrace(); + System.out.println("Got unexpected LinkageError on DEO"); + le.printStackTrace(System.out); return; } @@ -304,8 +304,8 @@ public class Main { result = BaseOkay.doStuff(de); System.out.println("Got DEO result " + result); } catch (LinkageError le) { - System.err.println("Got unexpected LinkageError on DEO"); - le.printStackTrace(); + System.out.println("Got unexpected LinkageError on DEO"); + le.printStackTrace(System.out); return; } } @@ -322,7 +322,7 @@ public class Main { try { getDoubledClass = loader.loadClass("GetDoubled"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed: " + cnfe); + System.out.println("loadClass failed: " + cnfe); return; } @@ -330,10 +330,10 @@ public class Main { try { obj = getDoubledClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { // Dalvik bails here @@ -354,7 +354,7 @@ public class Main { System.out.println("Got LinkageError on GD"); return; } - System.err.println("Should have failed by now on GetDoubled"); + System.out.println("Should have failed by now on GetDoubled"); } /** @@ -368,7 +368,7 @@ public class Main { try { abstractGetClass = loader.loadClass("AbstractGet"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass ta failed: " + cnfe); + System.out.println("loadClass ta failed: " + cnfe); return; } @@ -376,10 +376,10 @@ public class Main { try { obj = abstractGetClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { System.out.println("Got LinkageError on TA"); @@ -399,7 +399,7 @@ public class Main { System.out.println("Got LinkageError on TA"); return; } - System.err.println("Should have failed by now in testAbstract"); + System.out.println("Should have failed by now in testAbstract"); } /** @@ -415,7 +415,7 @@ public class Main { try { doubledImplementClass = loader.loadClass("DoubledImplement"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed: " + cnfe); + System.out.println("loadClass failed: " + cnfe); return; } @@ -423,10 +423,10 @@ public class Main { try { obj = doubledImplementClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { System.out.println("Got LinkageError on DI (early)"); @@ -447,7 +447,7 @@ public class Main { try { di.one(); if (!isOne) { - System.err.println("ERROR: did not get LinkageError on DI"); + System.out.println("ERROR: did not get LinkageError on DI"); } } catch (LinkageError le) { if (!isOne) { @@ -476,7 +476,7 @@ public class Main { ifaceImplClass = loader.loadClass("IfaceImpl"); ifaceImplClass = loader.loadClass("DoubledImplement2"); } catch (ClassNotFoundException cnfe) { - System.err.println("loadClass failed: " + cnfe); + System.out.println("loadClass failed: " + cnfe); return; } @@ -484,10 +484,10 @@ public class Main { try { obj = ifaceImplClass.newInstance(); } catch (InstantiationException ie) { - System.err.println("newInstance failed: " + ie); + System.out.println("newInstance failed: " + ie); return; } catch (IllegalAccessException iae) { - System.err.println("newInstance failed: " + iae); + System.out.println("newInstance failed: " + iae); return; } catch (LinkageError le) { System.out.println("Got LinkageError on IDI (early)"); diff --git a/test/069-field-type/src/Main.java b/test/069-field-type/src/Main.java index f9885e64b2..d9aa9e11bf 100644 --- a/test/069-field-type/src/Main.java +++ b/test/069-field-type/src/Main.java @@ -19,7 +19,7 @@ public class Main { /* try to use the reference; should fail */ try { holder.mValue.run(); - System.err.println("ERROR: did not get expected ICCE"); + System.out.println("ERROR: did not get expected ICCE"); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected IncompatibleClassChangeError"); } diff --git a/test/070-nio-buffer/src/Main.java b/test/070-nio-buffer/src/Main.java index a7433b8516..a3eeb3fda6 100644 --- a/test/070-nio-buffer/src/Main.java +++ b/test/070-nio-buffer/src/Main.java @@ -58,7 +58,7 @@ public class Main { try { shortBuf.put(myShorts, 0, 1); // should fail - System.err.println("ERROR: out-of-bounds put succeeded\n"); + System.out.println("ERROR: out-of-bounds put succeeded\n"); } catch (BufferOverflowException boe) { System.out.println("Got expected buffer overflow exception"); } @@ -66,7 +66,7 @@ public class Main { try { shortBuf.position(0); shortBuf.put(myShorts, 0, 33); // should fail - System.err.println("ERROR: out-of-bounds put succeeded\n"); + System.out.println("ERROR: out-of-bounds put succeeded\n"); } catch (IndexOutOfBoundsException ioobe) { System.out.println("Got expected out-of-bounds exception"); } @@ -74,7 +74,7 @@ public class Main { try { shortBuf.position(16); shortBuf.put(myShorts, 0, 17); // should fail - System.err.println("ERROR: out-of-bounds put succeeded\n"); + System.out.println("ERROR: out-of-bounds put succeeded\n"); } catch (BufferOverflowException boe) { System.out.println("Got expected buffer overflow exception"); } diff --git a/test/073-mismatched-field/src/Main.java b/test/073-mismatched-field/src/Main.java index 70709c0c86..2d6b9eb51e 100644 --- a/test/073-mismatched-field/src/Main.java +++ b/test/073-mismatched-field/src/Main.java @@ -23,7 +23,7 @@ public class Main extends SuperMain implements IMain { void doit() { try { System.out.println("value=" + this.f); - System.err.println("Succeeded unexpectedly"); + System.out.println("Succeeded unexpectedly"); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected failure"); } diff --git a/test/074-gc-thrash/src/Main.java b/test/074-gc-thrash/src/Main.java index df0479365f..5165df7bd3 100644 --- a/test/074-gc-thrash/src/Main.java +++ b/test/074-gc-thrash/src/Main.java @@ -52,9 +52,9 @@ public class Main { try { dumpHprofDataMethod.invoke(null, dumpFile); } catch (IllegalAccessException iae) { - System.err.println(iae); + System.out.println(iae); } catch (InvocationTargetException ite) { - System.err.println(ite); + System.out.println(ite); } } @@ -80,7 +80,7 @@ public class Main { try { meth = vmdClass.getMethod("dumpHprofData", String.class); } catch (NoSuchMethodException nsme) { - System.err.println("Found VMDebug but not dumpHprofData method"); + System.out.println("Found VMDebug but not dumpHprofData method"); return null; } @@ -126,7 +126,7 @@ public class Main { deep.join(); large.join(); } catch (InterruptedException ie) { - System.err.println("join was interrupted"); + System.out.println("join was interrupted"); } } @@ -137,7 +137,7 @@ public class Main { try { Thread.sleep(ms); } catch (InterruptedException ie) { - System.err.println("sleep was interrupted"); + System.out.println("sleep was interrupted"); } } @@ -213,7 +213,7 @@ class Deep extends Thread { } if (!once) { - System.err.println("not even once?"); + System.out.println("not even once?"); return; } @@ -229,7 +229,7 @@ class Deep extends Thread { for (int i = 0; i < MAX_DEPTH; i++) { if (weak[i].get() != null) { - System.err.println("Deep: weak still has " + i); + System.out.println("Deep: weak still has " + i); } } @@ -251,7 +251,7 @@ class Deep extends Thread { private static void checkStringReferences() { for (int i = 0; i < MAX_DEPTH; i++) { if (strong[i] != weak[i].get()) { - System.err.println("Deep: " + i + " strong=" + strong[i] + + System.out.println("Deep: " + i + " strong=" + strong[i] + ", weak=" + weak[i].get()); } } diff --git a/test/075-verification-error/src/Main.java b/test/075-verification-error/src/Main.java index 9b66a8d5e1..3f2881eb10 100644 --- a/test/075-verification-error/src/Main.java +++ b/test/075-verification-error/src/Main.java @@ -36,12 +36,12 @@ public class Main { static void testClassNewInstance() { try { MaybeAbstract ma = new MaybeAbstract(); - System.err.println("ERROR: MaybeAbstract succeeded unexpectedly"); + System.out.println("ERROR: MaybeAbstract succeeded unexpectedly"); } catch (InstantiationError ie) { System.out.println("Got expected InstantationError"); if (VERBOSE) System.out.println("--- " + ie); } catch (Exception ex) { - System.err.println("Got unexpected MaybeAbstract failure"); + System.out.println("Got unexpected MaybeAbstract failure"); } } @@ -88,7 +88,7 @@ public class Main { try { int x = mutant.inaccessibleField; - System.err.println("ERROR: bad access succeeded (ifield)"); + System.out.println("ERROR: bad access succeeded (ifield)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (ifield)"); if (VERBOSE) System.out.println("--- " + iae); @@ -96,7 +96,7 @@ public class Main { try { int y = Mutant.inaccessibleStaticField; - System.err.println("ERROR: bad access succeeded (sfield)"); + System.out.println("ERROR: bad access succeeded (sfield)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (sfield)"); if (VERBOSE) System.out.println("--- " + iae); @@ -104,7 +104,7 @@ public class Main { try { mutant.inaccessibleMethod(); - System.err.println("ERROR: bad access succeeded (method)"); + System.out.println("ERROR: bad access succeeded (method)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (method)"); if (VERBOSE) System.out.println("--- " + iae); @@ -112,7 +112,7 @@ public class Main { try { Mutant.inaccessibleStaticMethod(); - System.err.println("ERROR: bad access succeeded (smethod)"); + System.out.println("ERROR: bad access succeeded (smethod)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (smethod)"); if (VERBOSE) System.out.println("--- " + iae); @@ -121,7 +121,7 @@ public class Main { try { /* accessible static method in an inaccessible class */ InaccessibleClass.test(); - System.err.println("ERROR: bad meth-class access succeeded (meth-class)"); + System.out.println("ERROR: bad meth-class access succeeded (meth-class)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (meth-class)"); if (VERBOSE) System.out.println("--- " + iae); @@ -130,7 +130,7 @@ public class Main { try { /* accessible static field in an inaccessible class */ int blah = InaccessibleClass.blah; - System.err.println("ERROR: bad field-class access succeeded (field-class)"); + System.out.println("ERROR: bad field-class access succeeded (field-class)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (field-class)"); if (VERBOSE) System.out.println("--- " + iae); @@ -139,7 +139,7 @@ public class Main { try { /* inaccessible static method in an accessible class */ InaccessibleMethod.test(); - System.err.println("ERROR: bad access succeeded (meth-meth)"); + System.out.println("ERROR: bad access succeeded (meth-meth)"); } catch (IllegalAccessError iae) { System.out.println("Got expected IllegalAccessError (meth-meth)"); if (VERBOSE) System.out.println("--- " + iae); diff --git a/test/077-method-override/src/Main.java b/test/077-method-override/src/Main.java index 84bdf35c29..3a3c528d61 100644 --- a/test/077-method-override/src/Main.java +++ b/test/077-method-override/src/Main.java @@ -37,8 +37,8 @@ public class Main { ((Base)derived).overrideVirtualWithStatic(); } catch (NoSuchMethodError nsme) { /* NSME is subclass of ICCE, so check it explicitly */ - System.err.println("Got NSME - ovws"); - nsme.printStackTrace(System.err); + System.out.println("Got NSME - ovws"); + nsme.printStackTrace(System.out); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected exception - ovws"); } @@ -46,8 +46,8 @@ public class Main { try { ((Base)derived).overrideStaticWithVirtual(); } catch (NoSuchMethodError nsme) { - System.err.println("Got NSME - oswv"); - nsme.printStackTrace(System.err); + System.out.println("Got NSME - oswv"); + nsme.printStackTrace(System.out); } catch (IncompatibleClassChangeError icce) { System.out.println("Got expected exception - oswv"); } diff --git a/test/079-phantom/src/Main.java b/test/079-phantom/src/Main.java index c54bc0be68..daead2e1dd 100644 --- a/test/079-phantom/src/Main.java +++ b/test/079-phantom/src/Main.java @@ -21,7 +21,7 @@ public class Main { try { Thread.sleep(ms); } catch (InterruptedException ie) { - System.err.println("sleep interrupted"); + System.out.println("sleep interrupted"); } } diff --git a/test/084-class-init/src/Main.java b/test/084-class-init/src/Main.java index 28eb3e923f..a60fbac84f 100644 --- a/test/084-class-init/src/Main.java +++ b/test/084-class-init/src/Main.java @@ -24,7 +24,7 @@ public class Main { // that is currently a resolution stub because it's running on behalf of <clinit>. try { throwDuringClinit(); - System.err.println("didn't throw!"); + System.out.println("didn't throw!"); } catch (NullPointerException ex) { System.out.println("caught exception thrown during clinit"); } @@ -44,34 +44,34 @@ public class Main { try { Thread.sleep(msec); } catch (InterruptedException ie) { - System.err.println("sleep interrupted"); + System.out.println("sleep interrupted"); } } static void checkExceptions() { try { System.out.println(PartialInit.FIELD0); - System.err.println("Construction of PartialInit succeeded unexpectedly"); + System.out.println("Construction of PartialInit succeeded unexpectedly"); } catch (ExceptionInInitializerError eiie) { System.out.println("Got expected EIIE for FIELD0"); } try { System.out.println(PartialInit.FIELD0); - System.err.println("Load of FIELD0 succeeded unexpectedly"); + System.out.println("Load of FIELD0 succeeded unexpectedly"); } catch (NoClassDefFoundError ncdfe) { System.out.println("Got expected NCDFE for FIELD0"); } try { System.out.println(PartialInit.FIELD1); - System.err.println("Load of FIELD1 succeeded unexpectedly"); + System.out.println("Load of FIELD1 succeeded unexpectedly"); } catch (NoClassDefFoundError ncdfe) { System.out.println("Got expected NCDFE for FIELD1"); } try { System.out.println(Exploder.FIELD); - System.err.println("Load of FIELD succeeded unexpectedly"); + System.out.println("Load of FIELD succeeded unexpectedly"); } catch (AssertionError expected) { System.out.println("Got expected '" + expected.getMessage() + "' from Exploder"); } @@ -92,7 +92,7 @@ public class Main { fieldThread.join(); methodThread.join(); } catch (InterruptedException ie) { - System.err.println(ie); + System.out.println(ie); } /* print all values */ diff --git a/test/086-null-super/src/Main.java b/test/086-null-super/src/Main.java index 8bd17860ea..039a9599e1 100644 --- a/test/086-null-super/src/Main.java +++ b/test/086-null-super/src/Main.java @@ -149,14 +149,14 @@ public class Main { loader = new BrokenDexLoader(ClassLoader.getSystemClassLoader()); loader.findBrokenClass(); - System.err.println("ERROR: Inaccessible was accessible"); + System.out.println("ERROR: Inaccessible was accessible"); } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof NullPointerException) { - System.err.println("Got expected ITE/NPE"); + System.out.println("Got expected ITE/NPE"); } else { - System.err.println("Got unexpected ITE"); - ite.printStackTrace(); + System.out.println("Got unexpected ITE"); + ite.printStackTrace(System.out); } } } diff --git a/test/088-monitor-verification/src/Main.java b/test/088-monitor-verification/src/Main.java index a6f0e642d4..bca3df6828 100644 --- a/test/088-monitor-verification/src/Main.java +++ b/test/088-monitor-verification/src/Main.java @@ -41,7 +41,7 @@ public class Main { m.nestedMayThrow(false); try { m.nestedMayThrow(true); - System.err.println("nestedThrow(true) did not throw"); + System.out.println("nestedThrow(true) did not throw"); } catch (MyException me) {} System.out.println("nestedMayThrow ok"); diff --git a/test/092-locale/src/Main.java b/test/092-locale/src/Main.java index 8916a29c47..60c0551b84 100644 --- a/test/092-locale/src/Main.java +++ b/test/092-locale/src/Main.java @@ -34,31 +34,31 @@ public class Main { try { testCalendar(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } try { testDateFormatSymbols(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } try { testCurrency(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } try { testNormalizer(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } try { testIso3(); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(System.out); } } @@ -125,13 +125,13 @@ public class Main { res = Normalizer.normalize(composed, Normalizer.Form.NFD); if (!decomposed.equals(res)) { - System.err.println("Bad decompose: '" + composed + "' --> '" + System.out.println("Bad decompose: '" + composed + "' --> '" + res + "'"); } res = Normalizer.normalize(decomposed, Normalizer.Form.NFC); if (!composed.equals(res)) { - System.err.println("Bad compose: '" + decomposed + "' --> '" + System.out.println("Bad compose: '" + decomposed + "' --> '" + res + "'"); } @@ -153,7 +153,7 @@ public class Main { try { System.out.println(" iso3=" + loc.getISO3Language()); } catch (MissingResourceException mre) { - System.err.println("couldn't get iso3 language"); + System.out.println("couldn't get iso3 language"); } } } diff --git a/test/095-switch-MAX_INT/src/Main.java b/test/095-switch-MAX_INT/src/Main.java index d1171ea6bc..a004a1aede 100644 --- a/test/095-switch-MAX_INT/src/Main.java +++ b/test/095-switch-MAX_INT/src/Main.java @@ -2,7 +2,7 @@ public class Main { static public void main(String[] args) throws Exception { switch (0x7fffffff) { case 0x7fffffff: - System.err.println("good"); + System.out.println("good"); break; default: throw new AssertionError(); diff --git a/test/100-reflect2/src/Main.java b/test/100-reflect2/src/Main.java index 91ba3075f4..5f6ffa8ae9 100644 --- a/test/100-reflect2/src/Main.java +++ b/test/100-reflect2/src/Main.java @@ -292,7 +292,7 @@ class Main { // Expected. } catch (Exception e) { // Error. - e.printStackTrace(); + e.printStackTrace(System.out); } } @@ -304,7 +304,7 @@ class Main { cons.newInstance(); } catch (Exception e) { // Error. - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/101-fibonacci/src/Main.java b/test/101-fibonacci/src/Main.java index c594edbded..9c57ba76eb 100644 --- a/test/101-fibonacci/src/Main.java +++ b/test/101-fibonacci/src/Main.java @@ -51,7 +51,7 @@ class Main { y = fibonacci(x + 1); System.out.printf("fibonacci(%d)=%d\n", x + 1, y); } catch (NumberFormatException ex) { - System.err.println(ex); + System.out.println(ex); System.exit(1); } } diff --git a/test/109-suspend-check/src/Main.java b/test/109-suspend-check/src/Main.java index 3c3353b4db..e140a59173 100644 --- a/test/109-suspend-check/src/Main.java +++ b/test/109-suspend-check/src/Main.java @@ -55,7 +55,7 @@ public class Main { try { Thread.sleep(ms); } catch (InterruptedException ie) { - System.err.println("sleep was interrupted"); + System.out.println("sleep was interrupted"); } } } diff --git a/test/114-ParallelGC/src/Main.java b/test/114-ParallelGC/src/Main.java index 159dd5c926..2199872ba6 100644 --- a/test/114-ParallelGC/src/Main.java +++ b/test/114-ParallelGC/src/Main.java @@ -82,7 +82,7 @@ public class Main implements Runnable { // Any exception or error getting here is bad. try { // May need allocations... - t.printStackTrace(System.err); + t.printStackTrace(System.out); } catch (Throwable tInner) { } System.exit(1); diff --git a/test/120-hashcode/src/Main.java b/test/120-hashcode/src/Main.java index d2435cee62..0955f50c1a 100644 --- a/test/120-hashcode/src/Main.java +++ b/test/120-hashcode/src/Main.java @@ -30,7 +30,7 @@ public class Main { // Make sure that all the hashes agree. if (hashOrig != hashInflated || hashOrig != hashSystemOrig || hashSystemOrig != hashSystemInflated) { - System.err.println("hash codes dont match: " + hashOrig + " " + hashInflated + " " + + System.out.println("hash codes dont match: " + hashOrig + " " + hashInflated + " " + hashSystemOrig + " " + hashSystemInflated); } System.out.println("Done."); diff --git a/test/130-hprof/src/Main.java b/test/130-hprof/src/Main.java index 5899dd1183..a8597f1391 100644 --- a/test/130-hprof/src/Main.java +++ b/test/130-hprof/src/Main.java @@ -140,7 +140,7 @@ public class Main { allocator.join(); dumper.join(); } catch (InterruptedException e) { - System.err.println("join interrupted"); + System.out.println("join interrupted"); } } @@ -178,7 +178,7 @@ public class Main { try { Thread.sleep(ms); } catch (InterruptedException e) { - System.err.println("sleep interrupted"); + System.out.println("sleep interrupted"); } } @@ -223,7 +223,7 @@ public class Main { try { meth = vmdClass.getMethod("dumpHprofData", String.class); } catch (NoSuchMethodException nsme) { - System.err.println("Found VMDebug but not dumpHprofData method"); + System.out.println("Found VMDebug but not dumpHprofData method"); return null; } diff --git a/test/135-MirandaDispatch/src/Main.java b/test/135-MirandaDispatch/src/Main.java index ada8cefead..ab2a90b3b7 100644 --- a/test/135-MirandaDispatch/src/Main.java +++ b/test/135-MirandaDispatch/src/Main.java @@ -53,7 +53,7 @@ public class Main { } catch (VerifyError expected) { System.out.println("b/21646347"); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } System.out.println("Finishing"); } diff --git a/test/138-duplicate-classes-check/src/Main.java b/test/138-duplicate-classes-check/src/Main.java index 5ffceb94fe..b32f0bcc46 100644 --- a/test/138-duplicate-classes-check/src/Main.java +++ b/test/138-duplicate-classes-check/src/Main.java @@ -42,7 +42,7 @@ public class Main { Method test = testEx.getDeclaredMethod("test"); test.invoke(null); } catch (Exception exc) { - exc.printStackTrace(); + exc.printStackTrace(System.out); } } } diff --git a/test/138-duplicate-classes-check2/src/Main.java b/test/138-duplicate-classes-check2/src/Main.java index a0d6977405..faf8b5d337 100644 --- a/test/138-duplicate-classes-check2/src/Main.java +++ b/test/138-duplicate-classes-check2/src/Main.java @@ -37,7 +37,7 @@ public class Main { Method test = testEx.getDeclaredMethod("test"); test.invoke(null); } catch (Exception exc) { - exc.printStackTrace(); + exc.printStackTrace(System.out); } } } diff --git a/test/141-class-unload/src/Main.java b/test/141-class-unload/src/Main.java index 7e8431fb52..9072c8b538 100644 --- a/test/141-class-unload/src/Main.java +++ b/test/141-class-unload/src/Main.java @@ -50,7 +50,7 @@ public class Main { // Test that objects keep class loader live for sticky GC. testStickyUnload(constructor); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/142-classloader2/src/Main.java b/test/142-classloader2/src/Main.java index a0c77645a3..193fd5dea0 100644 --- a/test/142-classloader2/src/Main.java +++ b/test/142-classloader2/src/Main.java @@ -91,7 +91,7 @@ public class Main { if (e.getCause() instanceof VerifyError) { System.out.println("Caught wrapped VerifyError."); } else { - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/146-bad-interface/src/Main.java b/test/146-bad-interface/src/Main.java index 5534bb4bba..958ec7c3c4 100644 --- a/test/146-bad-interface/src/Main.java +++ b/test/146-bad-interface/src/Main.java @@ -37,7 +37,7 @@ public class Main { } catch (Throwable t) { System.out.println("Error occurred"); System.out.println(t); - t.printStackTrace(); + t.printStackTrace(System.out); } } } diff --git a/test/155-java-set-resolved-type/src/Main.java b/test/155-java-set-resolved-type/src/Main.java index 8f79bd7ecd..44278a1c9a 100644 --- a/test/155-java-set-resolved-type/src/Main.java +++ b/test/155-java-set-resolved-type/src/Main.java @@ -61,7 +61,7 @@ public class Main { // to be resolved and found through simple lookup. timpl.newInstance(); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } diff --git a/test/156-register-dex-file-multi-loader/src/Main.java b/test/156-register-dex-file-multi-loader/src/Main.java index ff5a2bd570..6aa1d780d3 100644 --- a/test/156-register-dex-file-multi-loader/src/Main.java +++ b/test/156-register-dex-file-multi-loader/src/Main.java @@ -81,7 +81,7 @@ public class Main { !message.endsWith(" with multiple class loaders"); } if (unexpected) { - cnfe.getCause().printStackTrace(); + cnfe.getCause().printStackTrace(System.out); } } } diff --git a/test/158-app-image-class-table/src/Main.java b/test/158-app-image-class-table/src/Main.java index 804468fe91..97aa14d4b1 100644 --- a/test/158-app-image-class-table/src/Main.java +++ b/test/158-app-image-class-table/src/Main.java @@ -39,7 +39,7 @@ public class Main { // to be resolved and found through simple lookup. timpl.newInstance(); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } diff --git a/test/159-app-image-fields/src/Main.java b/test/159-app-image-fields/src/Main.java index d06a50204a..47d0116a19 100644 --- a/test/159-app-image-fields/src/Main.java +++ b/test/159-app-image-fields/src/Main.java @@ -57,7 +57,7 @@ public class Main { System.out.println("another_value: " + another_value); } } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } diff --git a/test/301-abstract-protected/src/Main.java b/test/301-abstract-protected/src/Main.java index 9b19a9d56b..f12026791e 100644 --- a/test/301-abstract-protected/src/Main.java +++ b/test/301-abstract-protected/src/Main.java @@ -16,7 +16,7 @@ public class Main { public static void main(String args[]) throws Exception { - System.err.println(new C().m()); + System.out.println(new C().m()); } } diff --git a/test/487-checker-inline-calls/src/Main.java b/test/487-checker-inline-calls/src/Main.java index 70384d5a7f..00694f359f 100644 --- a/test/487-checker-inline-calls/src/Main.java +++ b/test/487-checker-inline-calls/src/Main.java @@ -20,7 +20,7 @@ public class Main { try { doTopCall(); } catch (Error e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/488-checker-inline-recursive-calls/src/Main.java b/test/488-checker-inline-recursive-calls/src/Main.java index 441dbbfcb6..1137837048 100644 --- a/test/488-checker-inline-recursive-calls/src/Main.java +++ b/test/488-checker-inline-recursive-calls/src/Main.java @@ -20,7 +20,7 @@ public class Main { try { doTopCall(true); } catch (Error e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/492-checker-inline-invoke-interface/src/Main.java b/test/492-checker-inline-invoke-interface/src/Main.java index a919690000..785c0db0eb 100644 --- a/test/492-checker-inline-invoke-interface/src/Main.java +++ b/test/492-checker-inline-invoke-interface/src/Main.java @@ -21,7 +21,7 @@ interface Itf { class ForceStatic { static { System.out.println("Hello from clinit"); - new Exception().printStackTrace(); + new Exception().printStackTrace(System.out); } static int field; } diff --git a/test/493-checker-inline-invoke-interface/src/Main.java b/test/493-checker-inline-invoke-interface/src/Main.java index 171405ca44..0570b20a40 100644 --- a/test/493-checker-inline-invoke-interface/src/Main.java +++ b/test/493-checker-inline-invoke-interface/src/Main.java @@ -21,7 +21,7 @@ interface Itf { class ForceStatic { static { System.out.println("Hello from clinit"); - new Exception().printStackTrace(); + new Exception().printStackTrace(System.out); } static int field; } diff --git a/test/497-inlining-and-class-loader/src/Main.java b/test/497-inlining-and-class-loader/src/Main.java index 1e27e77786..01b4bcd391 100644 --- a/test/497-inlining-and-class-loader/src/Main.java +++ b/test/497-inlining-and-class-loader/src/Main.java @@ -121,7 +121,7 @@ class Main { // Because we cleared dex cache entries, we will have to find // classes again, which require to use the correct class loader // in the presence of inlining. - new Exception().printStackTrace(); + new Exception().printStackTrace(System.out); } static Object savedResolvedMethods; diff --git a/test/522-checker-regression-monitor-exit/src/Main.java b/test/522-checker-regression-monitor-exit/src/Main.java index c4f80fc9c6..5c26f36fe8 100644 --- a/test/522-checker-regression-monitor-exit/src/Main.java +++ b/test/522-checker-regression-monitor-exit/src/Main.java @@ -43,8 +43,8 @@ public class Main { Method m = c.getMethod("synchronizedHashCode", Object.class); result = (Integer) m.invoke(null, m_obj); } catch (Exception e) { - System.err.println("Hash code query exception"); - e.printStackTrace(); + System.out.println("Hash code query exception"); + e.printStackTrace(System.out); result = -1; } return result; @@ -77,7 +77,7 @@ public class Main { } pool.shutdown(); } catch (CancellationException ex) { - System.err.println("Job timeout"); + System.out.println("Job timeout"); System.exit(1); } } diff --git a/test/570-checker-osr/src/DeoptimizationController.java b/test/570-checker-osr/src/DeoptimizationController.java index 907d133d3b..e272607ec4 100644 --- a/test/570-checker-osr/src/DeoptimizationController.java +++ b/test/570-checker-osr/src/DeoptimizationController.java @@ -53,7 +53,7 @@ public class DeoptimizationController { throw new IllegalStateException("Not tracing."); } } catch (Exception exc) { - exc.printStackTrace(System.err); + exc.printStackTrace(System.out); } finally { if (tempFile != null) { tempFile.delete(); @@ -68,7 +68,7 @@ public class DeoptimizationController { throw new IllegalStateException("Still tracing."); } } catch (Exception exc) { - exc.printStackTrace(System.err); + exc.printStackTrace(System.out); } } diff --git a/test/596-app-images/src/Main.java b/test/596-app-images/src/Main.java index 674ba4d037..88d95f4162 100644 --- a/test/596-app-images/src/Main.java +++ b/test/596-app-images/src/Main.java @@ -101,7 +101,7 @@ class Main { assertEqual(StaticInternString.getIntent(), getIntent.invoke(staticInternString), "Dynamically loaded app image's literal strings not interned properly."); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } diff --git a/test/602-deoptimizeable/src/Main.java b/test/602-deoptimizeable/src/Main.java index 743a5796c9..d995923f88 100644 --- a/test/602-deoptimizeable/src/Main.java +++ b/test/602-deoptimizeable/src/Main.java @@ -99,7 +99,7 @@ public class Main { System.exit(0); } } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } }); @@ -127,7 +127,7 @@ public class Main { map.put(new DummyObject(10), Long.valueOf(100)); assertIsInterpreted(); // Every deoptimizeable method is deoptimized. } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } }); diff --git a/test/617-clinit-oome/src/Main.java b/test/617-clinit-oome/src/Main.java index 749a2325ef..94cb7ce7db 100644 --- a/test/617-clinit-oome/src/Main.java +++ b/test/617-clinit-oome/src/Main.java @@ -37,7 +37,7 @@ public class Main { Other.print(); } catch (OutOfMemoryError e) { } catch (Exception e) { - System.err.println(e); + System.out.println(e); } } } diff --git a/test/626-const-class-linking/src/RacyMisbehavingHelper.java b/test/626-const-class-linking/src/RacyMisbehavingHelper.java index 45252789e4..9acd3c3ff6 100644 --- a/test/626-const-class-linking/src/RacyMisbehavingHelper.java +++ b/test/626-const-class-linking/src/RacyMisbehavingHelper.java @@ -26,7 +26,7 @@ public class RacyMisbehavingHelper { Method reportAfterLoading = loader.getClass().getDeclaredMethod("reportAfterLoading"); reportAfterLoading.invoke(loader); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } return new ClassPair(helper1_class, test_class); } diff --git a/test/638-no-line-number/src/Main.java b/test/638-no-line-number/src/Main.java index 7fe0404204..851f049ba6 100644 --- a/test/638-no-line-number/src/Main.java +++ b/test/638-no-line-number/src/Main.java @@ -19,12 +19,12 @@ public class Main { try { doThrow(new Error()); } catch (Error e) { - e.printStackTrace(); + e.printStackTrace(System.out); } try { doThrow(null); } catch (Throwable t) { - t.printStackTrace(); + t.printStackTrace(System.out); } } diff --git a/test/802-deoptimization/src/DeoptimizationController.java b/test/802-deoptimization/src/DeoptimizationController.java index d6e662d04d..88579ded07 100644 --- a/test/802-deoptimization/src/DeoptimizationController.java +++ b/test/802-deoptimization/src/DeoptimizationController.java @@ -50,7 +50,7 @@ public class DeoptimizationController { throw new IllegalStateException("Not tracing."); } } catch (Exception exc) { - exc.printStackTrace(System.err); + exc.printStackTrace(System.out); } finally { if (tempFile != null) { tempFile.delete(); @@ -65,7 +65,7 @@ public class DeoptimizationController { throw new IllegalStateException("Still tracing."); } } catch (Exception exc) { - exc.printStackTrace(System.err); + exc.printStackTrace(System.out); } } diff --git a/test/909-attach-agent/src/Main.java b/test/909-attach-agent/src/Main.java index 569b89ad7d..25ebd57236 100644 --- a/test/909-attach-agent/src/Main.java +++ b/test/909-attach-agent/src/Main.java @@ -19,17 +19,17 @@ import java.io.IOException; public class Main { public static void main(String[] args) { - System.err.println("Hello, world!"); + System.out.println("Hello, world!"); for(String a : args) { if(a.startsWith("agent:")) { String agent = a.substring(6); try { VMDebug.attachAgent(agent); } catch(IOException e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } } - System.err.println("Goodbye!"); + System.out.println("Goodbye!"); } } diff --git a/test/916-obsolete-jit/src/Main.java b/test/916-obsolete-jit/src/Main.java index 17a7a86ccc..d7b32ba102 100644 --- a/test/916-obsolete-jit/src/Main.java +++ b/test/916-obsolete-jit/src/Main.java @@ -132,7 +132,7 @@ public class Main { "sayHi", Runnable.class, Consumer.class); } catch (Exception e) { System.out.println("Unable to find methods!"); - e.printStackTrace(); + e.printStackTrace(System.out); return; } // Makes sure the stack is the way we want it for the test and does the redefinition. It will diff --git a/test/934-load-transform/src/Main.java b/test/934-load-transform/src/Main.java index 1401b7df01..2d0c2978e2 100644 --- a/test/934-load-transform/src/Main.java +++ b/test/934-load-transform/src/Main.java @@ -86,7 +86,7 @@ class Main { run_test.invoke(null); } catch (Exception e) { System.out.println(e.toString()); - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/935-non-retransformable/src/Main.java b/test/935-non-retransformable/src/Main.java index f240224977..5098712044 100644 --- a/test/935-non-retransformable/src/Main.java +++ b/test/935-non-retransformable/src/Main.java @@ -97,7 +97,7 @@ class Main { run_test.invoke(null); } catch (Exception e) { System.out.println(e.toString()); - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/938-load-transform-bcp/src-ex/TestMain.java b/test/938-load-transform-bcp/src-ex/TestMain.java index 3757a0f778..b60fe36556 100644 --- a/test/938-load-transform-bcp/src-ex/TestMain.java +++ b/test/938-load-transform-bcp/src-ex/TestMain.java @@ -29,7 +29,7 @@ public class TestMain { System.out.println( "Exception occured (did something load OptionalLong before this test method!: " + e.toString()); - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/938-load-transform-bcp/src/Main.java b/test/938-load-transform-bcp/src/Main.java index 69658c0cec..939bdbe02b 100644 --- a/test/938-load-transform-bcp/src/Main.java +++ b/test/938-load-transform-bcp/src/Main.java @@ -111,7 +111,7 @@ class Main { run_test.invoke(null); } catch (Exception e) { System.out.println(e.toString()); - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/941-recurive-obsolete-jit/src/Main.java b/test/941-recurive-obsolete-jit/src/Main.java index 89d593b7cd..e3065a7117 100644 --- a/test/941-recurive-obsolete-jit/src/Main.java +++ b/test/941-recurive-obsolete-jit/src/Main.java @@ -116,7 +116,7 @@ public class Main { "sayHi", int.class, Consumer.class, Runnable.class); } catch (Exception e) { System.out.println("Unable to find methods!"); - e.printStackTrace(); + e.printStackTrace(System.out); return; } // Makes sure the stack is the way we want it for the test and does the redefinition. It will diff --git a/test/943-private-recursive-jit/src/Main.java b/test/943-private-recursive-jit/src/Main.java index 871c63674f..09337bae26 100644 --- a/test/943-private-recursive-jit/src/Main.java +++ b/test/943-private-recursive-jit/src/Main.java @@ -129,7 +129,7 @@ public class Main { "privateSayHi", int.class, Consumer.class, Runnable.class); } catch (Exception e) { System.out.println("Unable to find methods!"); - e.printStackTrace(); + e.printStackTrace(System.out); return; } // Makes sure the stack is the way we want it for the test and does the redefinition. It will diff --git a/test/947-reflect-method/src/art/Test947.java b/test/947-reflect-method/src/art/Test947.java index 8cb515e492..90e0f81989 100644 --- a/test/947-reflect-method/src/art/Test947.java +++ b/test/947-reflect-method/src/art/Test947.java @@ -76,7 +76,7 @@ public class Test947 { Redefinition.doCommonClassRedefinition(Transform.class, CLASS_BYTES, DEX_BYTES); say_hi_method.invoke(t); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/953-invoke-polymorphic-compiler/src/Main.java b/test/953-invoke-polymorphic-compiler/src/Main.java index 20a8fec112..ce3f4db5d4 100644 --- a/test/953-invoke-polymorphic-compiler/src/Main.java +++ b/test/953-invoke-polymorphic-compiler/src/Main.java @@ -70,30 +70,30 @@ public class Main { } public static void fail() { - System.err.println("fail"); + System.out.println("fail"); Thread.dumpStack(); } public static void fail(String message) { - System.err.println("fail: " + message); + System.out.println("fail: " + message); Thread.dumpStack(); } public static int Min2Print2(int a, int b) { int[] values = new int[] { a, b }; - System.err.println("Running Main.Min2Print2(" + Arrays.toString(values) + ")"); + System.out.println("Running Main.Min2Print2(" + Arrays.toString(values) + ")"); return a > b ? a : b; } public static int Min2Print3(int a, int b, int c) { int[] values = new int[] { a, b, c }; - System.err.println("Running Main.Min2Print3(" + Arrays.toString(values) + ")"); + System.out.println("Running Main.Min2Print3(" + Arrays.toString(values) + ")"); return a > b ? a : b; } public static int Min2Print6(int a, int b, int c, int d, int e, int f) { int[] values = new int[] { a, b, c, d, e, f }; - System.err.println("Running Main.Min2Print6(" + Arrays.toString(values) + ")"); + System.out.println("Running Main.Min2Print6(" + Arrays.toString(values) + ")"); return a > b ? a : b; } @@ -106,7 +106,7 @@ public class Main { int y, int z) { int[] values = new int[] { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }; - System.err.println("Running Main.Min2Print26(" + Arrays.toString(values) + ")"); + System.out.println("Running Main.Min2Print26(" + Arrays.toString(values) + ")"); return a > b ? a : b; } @@ -176,7 +176,7 @@ public class Main { fail("No NPE for you"); } catch (NullPointerException npe) {} - System.err.println("BasicTest done."); + System.out.println("BasicTest done."); } private static boolean And(boolean lhs, boolean rhs) { @@ -248,7 +248,7 @@ public class Main { assertEquals(true, (boolean) mh.invoke(false, true)); assertEquals(false, (boolean) mh.invoke(false, false)); - System.err.println("$opt$ReturnBooleanTest done."); + System.out.println("$opt$ReturnBooleanTest done."); } public static void $opt$ReturnCharTest() throws Throwable { @@ -257,7 +257,7 @@ public class Main { MethodType.methodType(char.class, char.class)); assertEquals('B', (char) mh.invokeExact('A')); assertEquals((char) -55, (char) mh.invokeExact((char) -56)); - System.err.println("$opt$ReturnCharTest done."); + System.out.println("$opt$ReturnCharTest done."); } public static void $opt$ReturnByteTest() throws Throwable { @@ -266,7 +266,7 @@ public class Main { MethodType.methodType(byte.class, byte.class, byte.class)); assertEquals((byte) 30, (byte) mh.invokeExact((byte) 10, (byte) 3)); assertEquals((byte) -90, (byte) mh.invoke((byte) -10, (byte) 9)); - System.err.println("$opt$ReturnByteTest done."); + System.out.println("$opt$ReturnByteTest done."); } public static void $opt$ReturnShortTest() throws Throwable { @@ -275,7 +275,7 @@ public class Main { MethodType.methodType(short.class, short.class, short.class)); assertEquals((short) 3000, (short) mh.invokeExact((short) 1000, (short) 3)); assertEquals((short) -3000, (short) mh.invoke((short) -1000, (short) 3)); - System.err.println("$opt$ReturnShortTest done."); + System.out.println("$opt$ReturnShortTest done."); } public static void $opt$ReturnIntTest() throws Throwable { @@ -284,7 +284,7 @@ public class Main { MethodType.methodType(int.class, int.class, int.class)); assertEquals(3_000_000, (int) mh.invokeExact(1_000_000, 3)); assertEquals(-3_000_000, (int) mh.invoke(-1_000, 3_000)); - System.err.println("$opt$ReturnIntTest done."); + System.out.println("$opt$ReturnIntTest done."); } public static void $opt$ReturnLongTest() throws Throwable { @@ -293,7 +293,7 @@ public class Main { MethodType.methodType(long.class, long.class, long.class)); assertEquals(4_294_967_295_000L, (long) mh.invokeExact(1000L, 4_294_967_295L)); assertEquals(-4_294_967_295_000L, (long) mh.invoke(-1000L, 4_294_967_295L)); - System.err.println("$opt$ReturnLongTest done."); + System.out.println("$opt$ReturnLongTest done."); } public static void $opt$ReturnFloatTest() throws Throwable { @@ -302,7 +302,7 @@ public class Main { MethodType.methodType(float.class, float.class, float.class)); assertEquals(3.0F, (float) mh.invokeExact(1000.0F, 3e-3F)); assertEquals(-3.0F, (float) mh.invoke(-1000.0F, 3e-3F)); - System.err.println("$opt$ReturnFloatTest done."); + System.out.println("$opt$ReturnFloatTest done."); } public static void $opt$ReturnDoubleTest() throws Throwable { @@ -311,7 +311,7 @@ public class Main { MethodType.methodType(double.class, double.class, double.class)); assertEquals(3033000.0, (double) mh.invokeExact(1000.0, 3.033e3)); assertEquals(-3033000.0, (double) mh.invoke(-1000.0, 3.033e3)); - System.err.println("$opt$ReturnDoubleTest done."); + System.out.println("$opt$ReturnDoubleTest done."); } public static void $opt$ReturnStringTest() throws Throwable { @@ -320,7 +320,7 @@ public class Main { MethodType.methodType(String.class, String.class, int.class)); assertEquals("100010001000", (String) mh.invokeExact("1000", 3)); assertEquals("100010001000", (String) mh.invoke("1000", 3)); - System.err.println("$opt$ReturnStringTest done."); + System.out.println("$opt$ReturnStringTest done."); } public static void ReturnValuesTest() throws Throwable { @@ -333,7 +333,7 @@ public class Main { $opt$ReturnFloatTest(); $opt$ReturnDoubleTest(); $opt$ReturnStringTest(); - System.err.println("ReturnValuesTest done."); + System.out.println("ReturnValuesTest done."); } static class ValueHolder { diff --git a/test/972-default-imt-collision/src/Main.java b/test/972-default-imt-collision/src/Main.java index 6819e43ae7..043cef1147 100644 --- a/test/972-default-imt-collision/src/Main.java +++ b/test/972-default-imt-collision/src/Main.java @@ -24,7 +24,7 @@ public class Main { Method test = c.getMethod("testMe", iface); test.invoke(null, o); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); System.out.println("FAILED: could not run testMe!"); } } diff --git a/test/972-iface-super-multidex/src/Main.java b/test/972-iface-super-multidex/src/Main.java index 3fb3f45428..dea5f1db68 100644 --- a/test/972-iface-super-multidex/src/Main.java +++ b/test/972-iface-super-multidex/src/Main.java @@ -22,7 +22,7 @@ public class Main { c = Class.forName("ConcreteClass"); } catch (Exception e) { System.out.println("Could not load class"); - e.printStackTrace(); + e.printStackTrace(System.out); return; } try { @@ -30,7 +30,7 @@ public class Main { System.out.println((String)m.invoke(c.newInstance(), new Object[0])); } catch (Exception e) { System.out.println("Unknown exception occurred"); - e.printStackTrace(); + e.printStackTrace(System.out); } try { Method m = c.getMethod("runConflict"); @@ -41,15 +41,15 @@ public class Main { } } catch (AbstractMethodError e) { System.out.println("Unexpected AME caught"); - e.printStackTrace(); + e.printStackTrace(System.out); } catch (NoSuchMethodError e) { System.out.println("Unexpected NSME caught"); - e.printStackTrace(); + e.printStackTrace(System.out); } catch (IncompatibleClassChangeError e) { System.out.println("Expected ICCE caught"); } catch (Throwable e) { System.out.println("Unknown exception caught!"); - e.printStackTrace(); + e.printStackTrace(System.out); } } } diff --git a/test/973-default-multidex/src/Main.java b/test/973-default-multidex/src/Main.java index b93265a5b8..c7dd6dc9a3 100644 --- a/test/973-default-multidex/src/Main.java +++ b/test/973-default-multidex/src/Main.java @@ -23,7 +23,7 @@ public class Main { Method m = c.getMethod("callMethod"); System.out.println(m.invoke(c.newInstance(), new Object[0])); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(System.out); System.out.println("FAILED: Could not call method"); return; } |