OSDN Git Service

Revert "Fix 030-bad-finalizer & 059-finalizer-throw."
authorNarayan Kamath <narayan@google.com>
Tue, 24 Nov 2015 19:02:48 +0000 (19:02 +0000)
committerNarayan Kamath <narayan@google.com>
Tue, 24 Nov 2015 19:02:48 +0000 (19:02 +0000)
This reverts commit 13ca74fed068a6a49221b5213ce0b1bebeda3ed6.

This is now not needed, and the libcore side of this cleanup has
been reverted as it's problematic. The test passes without this
cleanup.

test/030-bad-finalizer/expected.txt
test/030-bad-finalizer/src/Main.java
test/059-finalizer-throw/expected.txt
test/059-finalizer-throw/src/Main.java

index c1f3f4f..ee9cfff 100644 (file)
@@ -2,4 +2,3 @@ About to null reference and request GC.
 Finalizer started and spinning...
 Finalizer done spinning.
 Finalizer sleeping forever now.
-Caught exception: Main$BadFinalizer.finalize() timed out after 10 seconds
index 79b53ef..942ee25 100644 (file)
@@ -21,15 +21,6 @@ public class Main {
     public static void main(String[] args) {
         BadFinalizer bf = new BadFinalizer();
 
-        Thread.setDefaultUncaughtExceptionHandler(
-            new Thread.UncaughtExceptionHandler() {
-                @Override
-                public void uncaughtException(Thread t, Throwable e) {
-                    System.out.println("Caught exception: " + e.getMessage());
-                    System.exit(0);
-                }
-            });
-
         System.out.println("About to null reference and request GC.");
         bf = null;
         Runtime.getRuntime().gc();
index e863e83..fa80fe3 100644 (file)
@@ -30,14 +30,6 @@ public class Main {
     }
 
     public static void main(String[] args) {
-        Thread.setDefaultUncaughtExceptionHandler(
-            new Thread.UncaughtExceptionHandler() {
-                @Override
-                public void uncaughtException(Thread t, Throwable e) {
-                    System.out.println("Caught exception: " + e.getMessage());
-                }
-            });
-
         createAndForget();
 
         System.gc();
@@ -64,6 +56,8 @@ public class Main {
         } catch (InterruptedException ie) {
             System.err.println(ie);
         }
+
+        System.out.println("done");
     }
 
     protected void finalize() throws Throwable {