src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java

Print this page
rev 10452 : imported patch lang-Typos


  81     private static final String[] EMPTY_STRING_ARRAY = new String[0];
  82 
  83     // Used to ensure that each spun class name is unique
  84     private static final AtomicInteger counter = new AtomicInteger(0);
  85 
  86     // For dumping generated classes to disk, for debugging purposes
  87     private static final ProxyClassesDumper dumper;
  88 
  89     static {
  90         final String key = "jdk.internal.lambda.dumpProxyClasses";
  91         String path = AccessController.doPrivileged(
  92                 new GetPropertyAction(key), null,
  93                 new PropertyPermission(key , "read"));
  94         dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path);
  95     }
  96 
  97     // See context values in AbstractValidatingLambdaMetafactory
  98     private final String implMethodClassName;        // Name of type containing implementation "CC"
  99     private final String implMethodName;             // Name of implementation method "impl"
 100     private final String implMethodDesc;             // Type descriptor for implementation methods "(I)Ljava/lang/String;"
 101     private final Class<?> implMethodReturnClass;    // class for implementaion method return type "Ljava/lang/String;"
 102     private final MethodType constructorType;        // Generated class constructor type "(CC)void"
 103     private final ClassWriter cw;                    // ASM class writer
 104     private final String[] argNames;                 // Generated names for the constructor arguments
 105     private final String[] argDescs;                 // Type descriptors for the constructor arguments
 106     private final String lambdaClassName;            // Generated name for the generated class "X$$Lambda$1"
 107 
 108     /**
 109      * General meta-factory constructor, supporting both standard cases and
 110      * allowing for uncommon options such as serialization or bridging.
 111      *
 112      * @param caller Stacked automatically by VM; represents a lookup context
 113      *               with the accessibility privileges of the caller.
 114      * @param invokedType Stacked automatically by VM; the signature of the
 115      *                    invoked method, which includes the expected static
 116      *                    type of the returned lambda object, and the static
 117      *                    types of the captured arguments for the lambda.  In
 118      *                    the event that the implementation method is an
 119      *                    instance method, the first argument in the invocation
 120      *                    signature will correspond to the receiver.
 121      * @param samMethodName Name of the method in the functional interface to




  81     private static final String[] EMPTY_STRING_ARRAY = new String[0];
  82 
  83     // Used to ensure that each spun class name is unique
  84     private static final AtomicInteger counter = new AtomicInteger(0);
  85 
  86     // For dumping generated classes to disk, for debugging purposes
  87     private static final ProxyClassesDumper dumper;
  88 
  89     static {
  90         final String key = "jdk.internal.lambda.dumpProxyClasses";
  91         String path = AccessController.doPrivileged(
  92                 new GetPropertyAction(key), null,
  93                 new PropertyPermission(key , "read"));
  94         dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path);
  95     }
  96 
  97     // See context values in AbstractValidatingLambdaMetafactory
  98     private final String implMethodClassName;        // Name of type containing implementation "CC"
  99     private final String implMethodName;             // Name of implementation method "impl"
 100     private final String implMethodDesc;             // Type descriptor for implementation methods "(I)Ljava/lang/String;"
 101     private final Class<?> implMethodReturnClass;    // class for implementation method return type "Ljava/lang/String;"
 102     private final MethodType constructorType;        // Generated class constructor type "(CC)void"
 103     private final ClassWriter cw;                    // ASM class writer
 104     private final String[] argNames;                 // Generated names for the constructor arguments
 105     private final String[] argDescs;                 // Type descriptors for the constructor arguments
 106     private final String lambdaClassName;            // Generated name for the generated class "X$$Lambda$1"
 107 
 108     /**
 109      * General meta-factory constructor, supporting both standard cases and
 110      * allowing for uncommon options such as serialization or bridging.
 111      *
 112      * @param caller Stacked automatically by VM; represents a lookup context
 113      *               with the accessibility privileges of the caller.
 114      * @param invokedType Stacked automatically by VM; the signature of the
 115      *                    invoked method, which includes the expected static
 116      *                    type of the returned lambda object, and the static
 117      *                    types of the captured arguments for the lambda.  In
 118      *                    the event that the implementation method is an
 119      *                    instance method, the first argument in the invocation
 120      *                    signature will correspond to the receiver.
 121      * @param samMethodName Name of the method in the functional interface to