hg: jigsaw/jigsaw/jdk: 4 new changesets

Paul Sandoz paul.sandoz at oracle.com
Mon May 21 01:45:07 PDT 2012


On May 19, 2012, at 7:32 AM, Mandy Chung wrote:

> uOn 5/18/2012 7:57 PM, David Holmes wrote:
>> Mandy,
>> 
>> In Class.java:
>> 
>> @@ -617,7 +617,8 @@ public final class Class<T>
>> SecurityManager sm = System.getSecurityManager();
>> if (sm != null) {
>>  ClassLoader ccl = ClassLoader.getCallerClassLoader();
>> - if (ccl != null && ccl != cl && !cl.isAncestor(ccl)) {
>>  + // ## Revisit: permission required in module mode
>> + if (ClassLoader.isPlatformClassLoader(ccl) && ccl != cl && !cl.isAncestor(ccl)) {
>> sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
>> }
>> 
>> Shouldn't that be !ClassLoader.isPlatformClassLoader(ccl)
> 
> You are right and same bug in ClassLoader.java.  

And Thread.java.

I dunno if it would make sense to have:

  Platform.isXLoader();

Where "X" == "NotPlatform" but with a better name.

And/or perhaps the pattern:

            if (!ClassLoader.isPlatformClassLoader(ccl) && ccl != cl && !cl.isAncestor(ccl)) {
                sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
            }

could be encapsulated in a static method of ClassLoader? especially if changes in j.u.c do the same.

Paul.


More information about the jigsaw-dev mailing list