langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 41629 9d203cde7d84
parent 41444 b61c805c6173
child 41931 d7c9720c4223
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Oct 18 16:00:32 2016 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Mar 02 18:25:01 2016 -0500
@@ -2398,6 +2398,7 @@
         try {
             if (needsRecovery && isSerializable(pt())) {
                 localEnv.info.isSerializable = true;
+                localEnv.info.isLambda = true;
             }
             List<Type> explicitParamTypes = null;
             if (that.paramKind == JCLambda.ParameterKind.EXPLICIT) {
@@ -2969,7 +2970,7 @@
                 }
 
                 if (isTargetSerializable) {
-                    chk.checkElemAccessFromSerializableLambda(that);
+                    chk.checkAccessFromSerializableElement(that, true);
                 }
             }
 
@@ -3364,7 +3365,7 @@
         }
 
         if (env.info.isSerializable) {
-            chk.checkElemAccessFromSerializableLambda(tree);
+            chk.checkAccessFromSerializableElement(tree, env.info.isLambda);
         }
 
         result = checkId(tree, env1.enclClass.sym.type, sym, env, resultInfo);
@@ -3507,7 +3508,7 @@
         }
 
         if (env.info.isSerializable) {
-            chk.checkElemAccessFromSerializableLambda(tree);
+            chk.checkAccessFromSerializableElement(tree, env.info.isLambda);
         }
 
         env.info.selectSuper = selectSuperPrev;