test/sun/misc/Cleaner/ExitOnThrow.java

Print this page

        

@@ -26,23 +26,19 @@
 import sun.misc.*;
 
 
 public class ExitOnThrow {
 
-    private static volatile boolean ran = false;
-
     public static void main(String[] args) throws Exception {
         Cleaner.create(new Object(),
                        new Runnable() {
                                public void run() {
-                                   ran = true;
                                    throw new RuntimeException("Foo!");
                                }
                            });
-        while (!ran) {
+        while (true) {
             System.gc();
             Thread.sleep(100);
         }
-        System.exit(0);
     }
 
 }