# HG changeset patch # User dcubed # Date 1432850637 25200 # Node ID c847a158d3ec025e7a0a448124543173e1addb6a # Parent c064fa28311d0ee3363cbc5372677335c135598b# Parent 49d006561bec9c05ab729065cfaa418dc3dc0533 Merge diff -r c064fa28311d -r c847a158d3ec jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java --- a/jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Thu May 28 11:37:14 2015 -0700 +++ b/jdk/test/java/lang/invoke/8022701/InvokeSeveralWays.java Thu May 28 15:03:57 2015 -0700 @@ -38,12 +38,19 @@ failures++; } catch (InvocationTargetException e) { Throwable c = e.getCause(); - if (expected.isInstance(c)) - System.out.println("EXPECTED: " + expected.getName() + ", "+ c); - else { - failures++; - System.out.println("FAIL: Unexpected wrapped exception " + c); - e.printStackTrace(System.out); + if (BootstrapMethodError.class.isInstance(c)) { + c = c.getCause(); + if (expected.isInstance(c)) + System.out.println("EXPECTED: " + expected.getName() + ", "+ c); + else { + failures++; + System.out.println("FAIL: Unexpected wrapped exception " + c); + e.printStackTrace(System.out); + } + } else { + failures++; + System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + c); + e.printStackTrace(System.out); } } catch (Throwable e) { failures++; @@ -74,14 +81,19 @@ Invoker.invoke(); System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier"); failures++; - } catch (Throwable e) { - if (expected.isInstance(e)) - System.out.println("EXPECTED: " + expected.getName() + ", "+ e); + } catch (BootstrapMethodError e) { + Throwable c = e.getCause(); + if (expected.isInstance(c)) + System.out.println("EXPECTED: " + expected.getName() + ", "+ c); else { + failures++; + System.out.println("FAIL: Unexpected exception has been caught " + c); + e.printStackTrace(System.out); + } + } catch (Throwable e) { failures++; - System.out.println("FAIL: Unexpected exception has been caught " + e); + System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + e); e.printStackTrace(System.out); - } } System.out.println(); try {