1.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Wed Apr 01 13:23:01 2015 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Tue Jan 13 10:25:24 2015 +0100 1.3 @@ -265,7 +265,7 @@ 1.4 @Override 1.5 public void visitLambda(JCLambda tree) { 1.6 LambdaTranslationContext localContext = (LambdaTranslationContext)context; 1.7 - MethodSymbol sym = (MethodSymbol)localContext.translatedSym; 1.8 + MethodSymbol sym = localContext.translatedSym; 1.9 MethodType lambdaType = (MethodType) sym.type; 1.10 1.11 { 1.12 @@ -1755,7 +1755,7 @@ 1.13 Map<LambdaSymbolKind, Map<Symbol, Symbol>> translatedSymbols; 1.14 1.15 /** the synthetic symbol for the method hoisting the translated lambda */ 1.16 - Symbol translatedSym; 1.17 + MethodSymbol translatedSym; 1.18 1.19 List<JCVariableDecl> syntheticParams; 1.20 1.21 @@ -1997,6 +1997,7 @@ 1.22 1.23 //compute synthetic params 1.24 ListBuffer<JCVariableDecl> params = new ListBuffer<>(); 1.25 + ListBuffer<VarSymbol> parameterSymbols = new ListBuffer<>(); 1.26 1.27 // The signature of the method is augmented with the following 1.28 // synthetic parameters: 1.29 @@ -2005,19 +2006,16 @@ 1.30 // 2) enclosing locals captured by the lambda expression 1.31 for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) { 1.32 params.append(make.VarDef((VarSymbol) thisSym, null)); 1.33 - } 1.34 - if (methodReferenceReceiver != null) { 1.35 - params.append(make.VarDef( 1.36 - make.Modifiers(PARAMETER|FINAL), 1.37 - names.fromString("$rcvr$"), 1.38 - make.Type(methodReferenceReceiver.type), 1.39 - null)); 1.40 + parameterSymbols.append((VarSymbol) thisSym); 1.41 } 1.42 for (Symbol thisSym : getSymbolMap(PARAM).values()) { 1.43 params.append(make.VarDef((VarSymbol) thisSym, null)); 1.44 + parameterSymbols.append((VarSymbol) thisSym); 1.45 } 1.46 syntheticParams = params.toList(); 1.47 1.48 + translatedSym.params = parameterSymbols.toList(); 1.49 + 1.50 // Compute and set the lambda name 1.51 translatedSym.name = isSerializable() 1.52 ? serializedLambdaName()