[10] RFR (S): 8196022: java.lang.VerifyError is thrown instead of java.lang.IllegalAccessError

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Jan 26 00:49:17 UTC 2018


It's a followup on JDK-8188145 [1] which fixed what exceptions are 
thrown. It (unexpectedly :-)) fixed inaccuracy there: MemberName 
resolution code on JDK side converted most of LinkageErrors into 
IllegalAccessErrors, but after JDK-8188145 [1] there's no upcall anymore 
when resolution fails, so exceptions are reported as is which is the 
right thing.

The fix cleans JDK part to behave the same way.

Also, fixed MethodHandles::resolve_MemberName() to handle corner cases 
when empty handle is returned, but no exception is thrown. An exception 
should be thrown in that case as it is in MHN_resolve_Mem.

As a simplifying change, converting ClassNotFoundException to 
NoClassDefFoundError was added to avoid dealing with it on JDK side.

Testing: hs-tier1, hs-tier2, vm.defmeth, jck-runtime-10, 
jdk/java/lang/invoke/, hotspot/runtime/invokedynamic/


Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8188145

More information about the hotspot-runtime-dev mailing list