1.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Mon Jan 21 11:16:28 2013 -0800 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Mon Jan 21 20:13:56 2013 +0000 1.3 @@ -253,7 +253,7 @@ 1.4 int refKind = referenceKind(sym); 1.5 1.6 //convert to an invokedynamic call 1.7 - result = makeMetaFactoryIndyCall(tree, tree.targetType, refKind, sym, indy_args); 1.8 + result = makeMetaFactoryIndyCall(tree, refKind, sym, indy_args); 1.9 } 1.10 1.11 private JCIdent makeThis(Type type, Symbol owner) { 1.12 @@ -314,7 +314,7 @@ 1.13 1.14 1.15 //build a sam instance using an indy call to the meta-factory 1.16 - result = makeMetaFactoryIndyCall(tree, tree.targetType, localContext.referenceKind(), refSym, indy_args); 1.17 + result = makeMetaFactoryIndyCall(tree, localContext.referenceKind(), refSym, indy_args); 1.18 } 1.19 1.20 /** 1.21 @@ -503,19 +503,6 @@ 1.22 1.23 // </editor-fold> 1.24 1.25 - private MethodSymbol makeSamDescriptor(Type targetType) { 1.26 - return (MethodSymbol)types.findDescriptorSymbol(targetType.tsym); 1.27 - } 1.28 - 1.29 - private Type makeFunctionalDescriptorType(Type targetType, MethodSymbol samDescriptor, boolean erased) { 1.30 - Type descType = types.memberType(targetType, samDescriptor); 1.31 - return erased ? types.erasure(descType) : descType; 1.32 - } 1.33 - 1.34 - private Type makeFunctionalDescriptorType(Type targetType, boolean erased) { 1.35 - return makeFunctionalDescriptorType(targetType, makeSamDescriptor(targetType), erased); 1.36 - } 1.37 - 1.38 /** 1.39 * Generate an adapter method "bridge" for a method reference which cannot 1.40 * be used directly. 1.41 @@ -698,12 +685,12 @@ 1.42 /** 1.43 * Generate an indy method call to the meta factory 1.44 */ 1.45 - private JCExpression makeMetaFactoryIndyCall(JCExpression tree, Type targetType, int refKind, Symbol refSym, List<JCExpression> indy_args) { 1.46 + private JCExpression makeMetaFactoryIndyCall(JCFunctionalExpression tree, int refKind, Symbol refSym, List<JCExpression> indy_args) { 1.47 //determine the static bsm args 1.48 - Type mtype = makeFunctionalDescriptorType(targetType, true); 1.49 + Type mtype = types.erasure(tree.descriptorType); 1.50 + MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.type.tsym); 1.51 List<Object> staticArgs = List.<Object>of( 1.52 - new Pool.MethodHandle(ClassFile.REF_invokeInterface, 1.53 - types.findDescriptorSymbol(targetType.tsym), types), 1.54 + new Pool.MethodHandle(ClassFile.REF_invokeInterface, types.findDescriptorSymbol(tree.type.tsym), types), 1.55 new Pool.MethodHandle(refKind, refSym, types), 1.56 new MethodType(mtype.getParameterTypes(), 1.57 mtype.getReturnType(), 1.58 @@ -1165,7 +1152,7 @@ 1.59 * This class is used to store important information regarding translation of 1.60 * lambda expression/method references (see subclasses). 1.61 */ 1.62 - private abstract class TranslationContext<T extends JCTree> { 1.63 + private abstract class TranslationContext<T extends JCFunctionalExpression> { 1.64 1.65 /** the underlying (untranslated) tree */ 1.66 T tree; 1.67 @@ -1329,7 +1316,7 @@ 1.68 } 1.69 1.70 Type generatedLambdaSig() { 1.71 - return types.erasure(types.findDescriptorType(tree.targetType)); 1.72 + return types.erasure(tree.descriptorType); 1.73 } 1.74 } 1.75 1.76 @@ -1385,7 +1372,7 @@ 1.77 } 1.78 1.79 Type bridgedRefSig() { 1.80 - return types.erasure(types.findDescriptorSymbol(tree.targetType.tsym).type); 1.81 + return types.erasure(types.findDescriptorSymbol(tree.targets.head).type); 1.82 } 1.83 } 1.84 }