Review request for the incorrect check for "getClassLoader" permission

Mandy Chung mandy.chung at oracle.com
Thu Jun 21 19:24:10 PDT 2012



On 6/21/2012 5:08 PM, David Holmes wrote:
> Hi Mandy,
>
> On 22/06/2012 5:02 AM, Mandy Chung wrote:
>> David, Paul,
>>
>> I have a fix for the incorrect check w.r.t. "getClassLoader" permission
>> [1] and also update j.u.c.atomic for module mode.
>>
>> Webrev at:
>> http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/getclassloader-permission-fix/ 
>>
>
> I think ClassLoader.doClassLoaderPermissionCheck should be renamed 
> ClassLoader.needsClassLoaderPermissionCheck. When I see "do" I expect 
> it to actually check the permission which it doesn't.
>

Okay and will rename it - "needsClassLoaderPermissionCheck" was what I 
had initially :)

> I don't understand the Atomic changes if the parent is going away. The 
> whole isAncestor check becomes undefined.
>

The main motivation of this fix is to change the check "cl == null" to 
determine if it's trusted i.e. a loader for loading system classes in 
module mode that can be non-null.   The isAncestor check will be dealt 
with separately.

> I also find it odd that a java.* class relies on an org.openjdk.jigsaw 
> class. Will Platform eventually move into a core package like 
> java.lang.modules ?
>

Yes, these static methods, if not the Platform class, will eventually 
move into an appropriate package.  Paul, Alan and I have also discussed 
that we want to integrate jdk modularization changes to jdk8 (those not 
tied with jigsaw) periodically.  We expect that some jdk changes will 
depend on these utility methods that may likely be moved to sun.misc.

Thanks
Mandy



More information about the jigsaw-dev mailing list