changeset 10851:c182b643516f

8129532: LFMultiThreadCachingTest.java failed with ConcurrentModificationException Reviewed-by: vlivanov
author kshefov
date Tue, 23 Jun 2015 17:00:41 +0300
parents 3d488a752d8d
children fddcb008fd1d
files test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java	Sat Jun 20 10:03:42 2015 -0400
+++ b/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java	Tue Jun 23 17:00:41 2015 +0300
@@ -79,23 +79,18 @@
         CountDownLatch end = new CountDownLatch(CORES);
         final Map<Thread, Throwable> threadUncaughtExceptions
                 = Collections.synchronizedMap(new HashMap<Thread, Throwable>(CORES));
-        Thread.UncaughtExceptionHandler exHandler = (t, e) -> {
-            threadUncaughtExceptions.put(t, e);
-        };
         for (int i = 0; i < CORES; ++i) {
             TestMethods.Kind kind = KINDS[i % KINDS.length];
             Thread t = new Thread(() -> {
                 try {
                     begin.await();
                     adapters.add(getTestMethod().getTestCaseMH(data, kind));
-                } catch (InterruptedException | BrokenBarrierException
-                        | IllegalAccessException | NoSuchMethodException ex) {
-                    throw new Error("Unexpected exception", ex);
+                } catch (Throwable ex) {
+                    threadUncaughtExceptions.put(Thread.currentThread(), ex);
                 } finally {
                     end.countDown();
                 }
             });
-            t.setUncaughtExceptionHandler(exHandler);
             t.start();
         }
         try {