RFR: JDK-8164012: com/sun/jdi/CatchPatternTest.sh fails on jdk9/hs with Required output "Exception occurred: java.lang.IllegalMonitorStateException" not found
Staffan Larsen
staffan.larsen at oracle.com
Mon Aug 15 18:15:49 UTC 2016
All,
Please review this fix for a test that starting failing after recent changes to java.lang.invoke.
The test instructs jdb to break on all exceptions matching "java.lang.I*" (that's a capital 'i'). The semantics of that operation actually means "break on all exceptions which have a class name or superclass name matching this string".
Some of the recent changes in java.lang.invoke now causes the code to throw numerous java.lang.NoSuchMethodErrors. This is a subclass of java.lang.IncompatibleClassChangeError, which matches "java.lang.I*".
The net result is that jdb will break on a lot more places (all the NoSuchMethodError exceptions) than the test expects and the test fails.
We can work around this in the test by changing this line:
cmd catch all java.lang.I*
to the following two lines:
cmd catch all java.lang.Il*
cmd catch all java.lang.Ind*
This will still match the exception types the test is looking for (IllegalArgumentException, IllegalMonitorStateException, and IndexOutOfBoundsException), but it will not match IncompatibleClassChangeError.
Thanks,
/Staffan
diff --git a/test/com/sun/jdi/CatchPatternTest.sh b/test/com/sun/jdi/CatchPatternTest.sh
--- a/test/com/sun/jdi/CatchPatternTest.sh
+++ b/test/com/sun/jdi/CatchPatternTest.sh
@@ -87,7 +87,12 @@
cmd stop in ${classname}.partTwo
runToBkpt
cmd ignore uncaught java.lang.Throwable
- cmd catch all java.lang.I*
+ # Instead of matching java.lang.I* we use two more specific
+ # patterns here. The reason is to avoid matching IncompatibleClassChangeError
+ # (or the subclass NoSuchMethodError) thrown by the
+ # java.lang.invoke infrastructure.
+ cmd catch all java.lang.Il*
+ cmd catch all java.lang.Ind*
cmd cont
cmd cont
cmd cont
More information about the serviceability-dev
mailing list