changeset 1824:e701af23a095

8016607: javac, avoid analyzing lambdas for source 7 compilation Reviewed-by: jjg Contributed-by: maurizio.cimadamore@oracle.com
author vromero
date Tue, 18 Jun 2013 18:57:52 +0100
parents 455be95bd1b5
children 9851071b551a
files src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Jun 17 20:29:31 2013 -0700
+++ b/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;