8016607: javac, avoid analyzing lambdas for source 7 compilation
authorvromero
Tue, 18 Jun 2013 18:57:52 +0100
changeset 18394 e7e0700732ad
parent 18393 3672b286337e
child 18395 d56a5fbf0b32
8016607: javac, avoid analyzing lambdas for source 7 compilation Reviewed-by: jjg Contributed-by: maurizio.cimadamore@oracle.com
langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Jun 17 20:29:31 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Jun 18 18:57:52 2013 +0100
@@ -1435,11 +1435,13 @@
             env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
             compileStates.put(env, CompileState.TRANSTYPES);
 
-            if (shouldStop(CompileState.UNLAMBDA))
-                return;
+            if (source.allowLambda()) {
+                if (shouldStop(CompileState.UNLAMBDA))
+                    return;
 
-            env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
-            compileStates.put(env, CompileState.UNLAMBDA);
+                env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
+                compileStates.put(env, CompileState.UNLAMBDA);
+            }
 
             if (shouldStop(CompileState.LOWER))
                 return;