changeset 50748:246b7535f8e9 jep-334

use Lookup.findClass instead of Class.forName
author vromero
date Wed, 30 May 2018 10:39:19 -0700
parents 1cc4bc0f03e9
children ad2dac9ef560 a33890943673
files src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java	Wed May 30 10:04:06 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantClassDesc.java	Wed May 30 10:39:19 2018 -0700
@@ -75,10 +75,9 @@
             c = c.componentType();
 
         if (c.descriptorString().length() == 1)
-            return Class.forName(descriptorString(), true, lookup.lookupClass().getClassLoader());
+            return lookup.findClass(descriptorString());
         else {
-            Class<?> clazz = Class.forName(internalToBinary(dropFirstAndLastChar(c.descriptorString())),
-                                           true, lookup.lookupClass().getClassLoader());
+            Class<?> clazz = lookup.findClass(internalToBinary(dropFirstAndLastChar(c.descriptorString())));
             for (int i = 0; i < depth; i++)
                 clazz = Array.newInstance(clazz, 0).getClass();
             return clazz;