< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java

Print this page
rev 3947 : imported patch xmodule-to-patch-module


1431         return stopIfError(CompileState.FLOW, results);
1432     }
1433 
1434     HashMap<Env<AttrContext>, Queue<Pair<Env<AttrContext>, JCClassDecl>>> desugaredEnvs = new HashMap<>();
1435 
1436     /**
1437      * Prepare attributed parse trees, in conjunction with their attribution contexts,
1438      * for source or code generation. If the file was not listed on the command line,
1439      * the current implicitSourcePolicy is taken into account.
1440      * The preparation stops as soon as an error is found.
1441      */
1442     protected void desugar(final Env<AttrContext> env, Queue<Pair<Env<AttrContext>, JCClassDecl>> results) {
1443         if (shouldStop(CompileState.TRANSTYPES))
1444             return;
1445 
1446         if (implicitSourcePolicy == ImplicitSourcePolicy.NONE
1447                 && !inputFiles.contains(env.toplevel.sourcefile)) {
1448             return;
1449         }
1450 





1451         if (compileStates.isDone(env, CompileState.LOWER)) {
1452             results.addAll(desugaredEnvs.get(env));
1453             return;
1454         }
1455 
1456         /**
1457          * Ensure that superclasses of C are desugared before C itself. This is
1458          * required for two reasons: (i) as erasure (TransTypes) destroys
1459          * information needed in flow analysis and (ii) as some checks carried
1460          * out during lowering require that all synthetic fields/methods have
1461          * already been added to C and its superclasses.
1462          */
1463         class ScanNested extends TreeScanner {
1464             Set<Env<AttrContext>> dependencies = new LinkedHashSet<>();
1465             protected boolean hasLambdas;
1466             @Override
1467             public void visitClassDef(JCClassDecl node) {
1468                 Type st = types.supertype(node.sym.type);
1469                 boolean envForSuperTypeFound = false;
1470                 while (!envForSuperTypeFound && st.hasTag(CLASS)) {




1431         return stopIfError(CompileState.FLOW, results);
1432     }
1433 
1434     HashMap<Env<AttrContext>, Queue<Pair<Env<AttrContext>, JCClassDecl>>> desugaredEnvs = new HashMap<>();
1435 
1436     /**
1437      * Prepare attributed parse trees, in conjunction with their attribution contexts,
1438      * for source or code generation. If the file was not listed on the command line,
1439      * the current implicitSourcePolicy is taken into account.
1440      * The preparation stops as soon as an error is found.
1441      */
1442     protected void desugar(final Env<AttrContext> env, Queue<Pair<Env<AttrContext>, JCClassDecl>> results) {
1443         if (shouldStop(CompileState.TRANSTYPES))
1444             return;
1445 
1446         if (implicitSourcePolicy == ImplicitSourcePolicy.NONE
1447                 && !inputFiles.contains(env.toplevel.sourcefile)) {
1448             return;
1449         }
1450 
1451         if (!modules.multiModuleMode && env.toplevel.modle != modules.getDefaultModule()) {
1452             //can only generate classfiles for a single module:
1453             return;
1454         }
1455 
1456         if (compileStates.isDone(env, CompileState.LOWER)) {
1457             results.addAll(desugaredEnvs.get(env));
1458             return;
1459         }
1460 
1461         /**
1462          * Ensure that superclasses of C are desugared before C itself. This is
1463          * required for two reasons: (i) as erasure (TransTypes) destroys
1464          * information needed in flow analysis and (ii) as some checks carried
1465          * out during lowering require that all synthetic fields/methods have
1466          * already been added to C and its superclasses.
1467          */
1468         class ScanNested extends TreeScanner {
1469             Set<Env<AttrContext>> dependencies = new LinkedHashSet<>();
1470             protected boolean hasLambdas;
1471             @Override
1472             public void visitClassDef(JCClassDecl node) {
1473                 Type st = types.supertype(node.sym.type);
1474                 boolean envForSuperTypeFound = false;
1475                 while (!envForSuperTypeFound && st.hasTag(CLASS)) {


< prev index next >