提交 e2b974de 编写于 作者: A aeriksso

8080428: [TESTBUG] java/lang/invoke/8022701/MHIllegalAccess.java - FAIL:...

8080428: [TESTBUG] java/lang/invoke/8022701/MHIllegalAccess.java - FAIL: Unexpected wrapped exception java.lang.BootstrapMethodError
Reviewed-by: vlivanov
上级 e12c2af3
...@@ -38,12 +38,19 @@ public class InvokeSeveralWays { ...@@ -38,12 +38,19 @@ public class InvokeSeveralWays {
failures++; failures++;
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
Throwable c = e.getCause(); Throwable c = e.getCause();
if (expected.isInstance(c)) if (BootstrapMethodError.class.isInstance(c)) {
System.out.println("EXPECTED: " + expected.getName() + ", "+ c); c = c.getCause();
else { if (expected.isInstance(c))
failures++; System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
System.out.println("FAIL: Unexpected wrapped exception " + c); else {
e.printStackTrace(System.out); 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) { } catch (Throwable e) {
failures++; failures++;
...@@ -74,14 +81,19 @@ public class InvokeSeveralWays { ...@@ -74,14 +81,19 @@ public class InvokeSeveralWays {
Invoker.invoke(); Invoker.invoke();
System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier"); System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier");
failures++; failures++;
} catch (Throwable e) { } catch (BootstrapMethodError e) {
if (expected.isInstance(e)) Throwable c = e.getCause();
System.out.println("EXPECTED: " + expected.getName() + ", "+ e); if (expected.isInstance(c))
System.out.println("EXPECTED: " + expected.getName() + ", "+ c);
else { else {
failures++;
System.out.println("FAIL: Unexpected exception has been caught " + c);
e.printStackTrace(System.out);
}
} catch (Throwable e) {
failures++; 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); e.printStackTrace(System.out);
}
} }
System.out.println(); System.out.println();
try { try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册