8016607: javac, avoid analyzing lambdas for source 7 compilation

Tue, 18 Jun 2013 18:57:52 +0100

author
vromero
date
Tue, 18 Jun 2013 18:57:52 +0100
changeset 1825
e701af23a095
parent 1824
455be95bd1b5
child 1826
9851071b551a

8016607: javac, avoid analyzing lambdas for source 7 compilation
Reviewed-by: jjg
Contributed-by: maurizio.cimadamore@oracle.com

src/share/classes/com/sun/tools/javac/main/JavaCompiler.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Jun 17 20:29:31 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Jun 18 18:57:52 2013 +0100
     1.3 @@ -1435,11 +1435,13 @@
     1.4              env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
     1.5              compileStates.put(env, CompileState.TRANSTYPES);
     1.6  
     1.7 -            if (shouldStop(CompileState.UNLAMBDA))
     1.8 -                return;
     1.9 +            if (source.allowLambda()) {
    1.10 +                if (shouldStop(CompileState.UNLAMBDA))
    1.11 +                    return;
    1.12  
    1.13 -            env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
    1.14 -            compileStates.put(env, CompileState.UNLAMBDA);
    1.15 +                env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
    1.16 +                compileStates.put(env, CompileState.UNLAMBDA);
    1.17 +            }
    1.18  
    1.19              if (shouldStop(CompileState.LOWER))
    1.20                  return;

mercurial