< prev index next >

test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexUpdate.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -215,11 +215,11 @@
         Reference<? extends Logger> ref2;
         int max = 3;
         barChild = null;
         while ((ref2 = queue.poll()) == null) {
             System.gc();
-            Thread.sleep(100);
+            Thread.sleep(1000);
             if (--max == 0) break;
         }
 
         Throwable failed = null;
         try {

@@ -314,10 +314,11 @@
                 } catch(Exception x) {
                     if (suppressed != null) x.addSuppressed(suppressed);
                     throw new RuntimeException(x);
                 }
             });
+            try {
             fooChild = null;
             System.out.println("Setting fooChild to: " + fooChild);
             while ((ref2 = queue.poll()) == null) {
                 System.gc();
                 Thread.sleep(1000);

@@ -328,11 +329,14 @@
             }
             if (ref2.get() != null) {
                 throw new RuntimeException("Referent not cleared: " + ref2.get());
             }
             System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
-
+           } catch (Throwable t) {
+               if (failed != null) t.addSuppressed(failed);
+               throw t;
+           }
         }
         if (failed != null) {
             // should rarely happen...
             throw new RuntimeException(failed);
         }
< prev index next >