test/java/lang/invoke/LFCaching/LFCachingTestCase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/test/java/lang/invoke/LFCaching/LFCachingTestCase.java	Tue Dec  2 20:15:06 2014
--- new/test/java/lang/invoke/LFCaching/LFCachingTestCase.java	Tue Dec  2 20:15:05 2014

*** 61,76 **** --- 61,81 ---- if (lambdaForm0 == null || lambdaForm1 == null) { throw new Error("Unexpected error: One or both lambda forms of the method handles are null"); } if (lambdaForm0 != lambdaForm1) { + // Since LambdaForm caches are based on SoftReferences, GC can cause element eviction. + if (noGCHappened()) { System.err.println("Lambda form 0 toString is:"); System.err.println(lambdaForm0); System.err.println("Lambda form 1 toString is:"); System.err.println(lambdaForm1); throw new AssertionError("Error: Lambda forms of the two method handles" + " are not the same. LF cahing does not work"); + } else { + System.err.println("LambdaForms differ, but there was a GC in between. Ignore the failure."); + } } } catch (IllegalAccessException | IllegalArgumentException | SecurityException | InvocationTargetException ex) { throw new Error("Unexpected exception: ", ex); }

test/java/lang/invoke/LFCaching/LFCachingTestCase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File