< prev index next >

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

Print this page
@@ -370,11 +370,11 @@
          }
  
          //create the method declaration hoisting the lambda body
          JCMethodDecl lambdaDecl = make.MethodDef(make.Modifiers(sym.flags_field),
                  sym.name,
-                 make.QualIdent(lambdaType.getReturnType().tsym),
+                 make.QualIdent(lambdaType.getReturnType().tsym).setType(lambdaType.getReturnType()),
                  List.nil(),
                  localContext.syntheticParams,
                  lambdaType.getThrownTypes() == null ?
                      List.nil() :
                      make.Types(lambdaType.getThrownTypes()),

@@ -1861,11 +1861,11 @@
              /** does this functional expression require serialization support? */
              boolean isSerializable() {
                  if (forceSerializable) {
                      return true;
                  }
-                 return types.asSuper(tree.target, syms.serializableType.tsym) != null;
+                 return types.asSuper(tree.target.referenceProjectionOrSelf(), syms.serializableType.tsym) != null;
              }
  
              /**
               * @return Name of the enclosing method to be folded into synthetic
               * method name

@@ -2338,11 +2338,11 @@
                          (!nestmateLambdas && isPrivateInOtherClass()) ||
                          isProtectedInSuperClassOfEnclosingClassInOtherPackage(tree.sym, owner) ||
                          !receiverAccessible() ||
                          (tree.getMode() == ReferenceMode.NEW &&
                            tree.kind != ReferenceKind.ARRAY_CTOR &&
-                           (tree.sym.owner.isDirectlyOrIndirectlyLocal() || tree.sym.owner.isInner()));
+                           (tree.sym.owner.isDirectlyOrIndirectlyLocal() || tree.sym.owner.isInner() || tree.sym.owner.isValueClass()));
              }
  
              Type generatedRefSig() {
                  return types.erasure(tree.sym.type);
              }
< prev index next >