--- old/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java 2018-07-07 20:00:20.421001000 -0700 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java 2018-07-07 20:00:20.285001000 -0700 @@ -200,10 +200,7 @@ private final JCDiagnostic.Factory diags; private Env attrEnv; private Lint lint; - private final boolean allowImprovedRethrowAnalysis; - private final boolean allowImprovedCatchAnalysis; private final boolean allowEffectivelyFinalInInnerClasses; - private final boolean enforceThisDotInit; public static Flow instance(Context context) { Flow instance = context.get(flowKey); @@ -294,10 +291,7 @@ rs = Resolve.instance(context); diags = JCDiagnostic.Factory.instance(context); Source source = Source.instance(context); - allowImprovedRethrowAnalysis = Feature.IMPROVED_RETHROW_ANALYSIS.allowedInSource(source); - allowImprovedCatchAnalysis = Feature.IMPROVED_CATCH_ANALYSIS.allowedInSource(source); allowEffectivelyFinalInInnerClasses = Feature.EFFECTIVELY_FINAL_IN_INNER_CLASSES.allowedInSource(source); - enforceThisDotInit = Feature.ENFORCE_THIS_DOT_INIT.allowedInSource(source); } /** @@ -1106,9 +1100,7 @@ } } scan(tree.body); - List thrownInTry = allowImprovedCatchAnalysis ? - chk.union(thrown, List.of(syms.runtimeExceptionType, syms.errorType)) : - thrown; + List thrownInTry = chk.union(thrown, List.of(syms.runtimeExceptionType, syms.errorType)); thrown = thrownPrev; caught = caughtPrev; @@ -1177,7 +1169,7 @@ !isExceptionOrThrowable(exc) && !chk.intersects(exc, thrownInTry)) { log.error(pos, Errors.ExceptNeverThrownInTry(exc)); - } else if (allowImprovedCatchAnalysis) { + } else { List catchableThrownTypes = chk.intersect(List.of(exc), thrownInTry); // 'catchableThrownTypes' cannnot possibly be empty - if 'exc' was an // unchecked exception, the result list would not be empty, as the augmented @@ -1217,8 +1209,7 @@ if (sym != null && sym.kind == VAR && (sym.flags() & (FINAL | EFFECTIVELY_FINAL)) != 0 && - preciseRethrowTypes.get(sym) != null && - allowImprovedRethrowAnalysis) { + preciseRethrowTypes.get(sym) != null) { for (Type t : preciseRethrowTypes.get(sym)) { markThrown(tree, t); } @@ -2401,9 +2392,8 @@ // assigned before reading their value public void visitSelect(JCFieldAccess tree) { super.visitSelect(tree); - if (enforceThisDotInit && - TreeInfo.isThisQualifier(tree.selected) && - tree.sym.kind == VAR) { + if (TreeInfo.isThisQualifier(tree.selected) && + tree.sym.kind == VAR) { checkInit(tree.pos(), (VarSymbol)tree.sym); } }