[Nestmates] RFR: 8197395: [Nestmates] VerifyAccess.isMemberAccessible must not allow private access between legacy nested types (original) (raw)

mandy chung mandy.chung at oracle.com
Fri Feb 9 00:13:35 UTC 2018


On 2/7/18 11:53 PM, David Holmes wrote:

bug: https://bugs.openjdk.java.net/browse/JDK-8197395 webrev: http://cr.openjdk.java.net/~dholmes/8197395/webrev/

With the fix for JDK-8196320 however, isSamePackageMember() (now renamed to areNestMates) first checks Reflection.areNestMates() and then if that is false, the old enclosing-class check. Consequently the check can now return true for both nestmate classfiles and earlier classfiles! That is wrong. To fix this we replace the call to VerifyAccess.areNestMates() with Reflection.areNestMates().

The fix looks fine.   Thanks for the clear description of the issue.  These two methods could cause confusion to the reader and always need to go the javadoc.  What about renaming VerifyAccess::areNestMates to areNestmatesOrPreNestmates?

There is also a temporary psuedo-assertion verifying that if we've granted private nestmate access then refc==defc (which should be assured by the resolution of the member being accessed).

Why do you want myassert?

Mandy



More information about the valhalla-dev mailing list