< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, 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. --- 1,7 ---- /* ! * 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,225 **** Reference<? extends Logger> ref2; int max = 3; barChild = null; while ((ref2 = queue.poll()) == null) { System.gc(); ! Thread.sleep(100); if (--max == 0) break; } Throwable failed = null; try { --- 215,225 ---- Reference<? extends Logger> ref2; int max = 3; barChild = null; while ((ref2 = queue.poll()) == null) { System.gc(); ! Thread.sleep(1000); if (--max == 0) break; } Throwable failed = null; try {
*** 326,335 **** --- 326,336 ---- } 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);
*** 340,350 **** } if (ref2.get() != null) { throw new RuntimeException("Referent not cleared: " + ref2.get()); } System.out.println("Got fooRef after reset(), fooChild is " + fooChild); ! } if (failed != null) { // should rarely happen... throw new RuntimeException(failed); } --- 341,354 ---- } 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 >