[8] RFR (XS): 8032585: JSR292: IllegalAccessError when attempting to invoke protected method from different package
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Mon Jan 27 16:05:32 UTC 2014
http://cr.openjdk.java.net/~vlivanov/8032585/webrev.00/
https://bugs.openjdk.java.net/browse/JDK-8032585
JSR292 access verification logic refuses method handle lookup access to
methods which are defined on inaccessible classes. This is usually
correct, but in the corner case of inheritance through a public class,
it is wrong. 8029507 makes the JVM provide more correct information
about the defining class of a looked-up method and this corrected
information is causing the old and wrong checks to fail where they
didn't fail before.
The fix is to relax the check: don't require the class where protected
member is declared to be public. It is enough to check that defining
class is a super class of the class lookup request comes from to ensure
there are enough privileges to access protected member.
Testing: regression test, enumeration tests on access checks,
jdk/test/java/lang/invoke, vm.mlvm.testlist
Thanks!
Best regards,
Vladimir Ivanov
More information about the core-libs-dev
mailing list