< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java

Print this page
@@ -976,11 +976,19 @@
                      make.at(prevPos);
                  }
              }
          }
  
-         return makeIndyCall(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, indyType, indy_args, samSym.name);
+         Name lambdaName = samSym.name;
+         if (tree.codeReflectionInfo != null) {
+             JCMethodDecl codeModel = tree.codeReflectionInfo.codeModel();
+             codeModel.name = codeModel.sym.name = names.fromString("op$").append(refSym.name);
+             kInfo.addMethod(codeModel);
+         }
+         Type lambdaMetafactory = tree.codeReflectionInfo != null ?
+                 tree.codeReflectionInfo.reflectableLambdaMetafactory() : syms.lambdaMetafactory;
+         return makeIndyCall(tree, lambdaMetafactory, metafactoryName, staticArgs, indyType, indy_args, lambdaName);
      }
  
      /**
       * Generate an indy method call with given name, type and static bootstrap
       * arguments types
< prev index next >