src/java.base/share/classes/java/lang/ClassLoader.java
changeset 49037 dc68aeea4840
parent 48671 a47ee8b3d308
child 49067 c153e9daadce
equal deleted inserted replaced
49036:bc92debe57e4 49037:dc68aeea4840
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   648             }
   648             }
   649         }
   649         }
   650         return lock;
   650         return lock;
   651     }
   651     }
   652 
   652 
   653     // This method is invoked by the virtual machine to load a class.
       
   654     private Class<?> loadClassInternal(String name)
       
   655         throws ClassNotFoundException
       
   656     {
       
   657         // For backward compatibility, explicitly lock on 'this' when
       
   658         // the current class loader is not parallel capable.
       
   659         if (parallelLockMap == null) {
       
   660             synchronized (this) {
       
   661                  return loadClass(name);
       
   662             }
       
   663         } else {
       
   664             return loadClass(name);
       
   665         }
       
   666     }
       
   667 
       
   668     // Invoked by the VM after loading class with this loader.
   653     // Invoked by the VM after loading class with this loader.
   669     private void checkPackageAccess(Class<?> cls, ProtectionDomain pd) {
   654     private void checkPackageAccess(Class<?> cls, ProtectionDomain pd) {
   670         final SecurityManager sm = System.getSecurityManager();
   655         final SecurityManager sm = System.getSecurityManager();
   671         if (sm != null) {
   656         if (sm != null) {
   672             if (ReflectUtil.isNonPublicProxyClass(cls)) {
   657             if (ReflectUtil.isNonPublicProxyClass(cls)) {