hg: jigsaw/jigsaw/jdk: 4 new changesets

Mandy Chung mandy.chung at oracle.com
Mon May 21 08:11:19 PDT 2012



On 5/21/2012 1:45 AM, Paul Sandoz wrote:
> 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.

I was thinking the same thing when I think of the context of getting the 
jdk changes be module-loader aware to jdk8 before jigsaw is integrated.

> 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.

Good suggestion.   In module mode, it's an open issue which loaders 
requires the permission to get a class loader, context class loader or 
its parent since it's not the parent delegation hierarchy, so isAncestor 
might need to be replaced with something that makes sense in module mode 
(I'll add a comment).

Mandy
> Paul.



More information about the jigsaw-dev mailing list