diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java index fd857d1ec91..1b8b7077ed8 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -160,17 +160,6 @@ public class JavaCompiler { * it does not depend on any unrelated errors that might have occurred. */ protected static enum CompilePolicy { - /** - * Just attribute the parse trees. - */ - ATTR_ONLY, - - /** - * Just attribute and do flow analysis on the parse trees. - * This should catch most user errors. - */ - CHECK_ONLY, - /** * Attribute everything, then do flow analysis for everything, * then desugar everything, and only then generate output. @@ -198,10 +187,6 @@ public class JavaCompiler { static CompilePolicy decode(String option) { if (option == null) return DEFAULT_COMPILE_POLICY; - else if (option.equals("attr")) - return ATTR_ONLY; - else if (option.equals("check")) - return CHECK_ONLY; else if (option.equals("simple")) return SIMPLE; else if (option.equals("byfile")) @@ -443,11 +428,7 @@ public class JavaCompiler { verboseCompilePolicy = options.isSet("verboseCompilePolicy"); - if (options.isSet("should-stop.at") && - CompileState.valueOf(options.get("should-stop.at")) == CompileState.ATTR) - compilePolicy = CompilePolicy.ATTR_ONLY; - else - compilePolicy = CompilePolicy.decode(options.get("compilePolicy")); + compilePolicy = CompilePolicy.decode(options.get("compilePolicy")); implicitSourcePolicy = ImplicitSourcePolicy.decode(options.get("-implicit")); @@ -948,14 +929,6 @@ public class JavaCompiler { if (!CompileState.ATTR.isAfter(shouldStopPolicyIfNoError)) { switch (compilePolicy) { - case ATTR_ONLY: - attribute(todo); - break; - - case CHECK_ONLY: - flow(attribute(todo)); - break; - case SIMPLE: generate(desugar(flow(attribute(todo)))); break; diff --git a/test/langtools/tools/javac/6199662/Tree.java b/test/langtools/tools/javac/6199662/Tree.java index 8711066aa96..416ba459564 100644 --- a/test/langtools/tools/javac/6199662/Tree.java +++ b/test/langtools/tools/javac/6199662/Tree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,11 +38,11 @@ * @compile -XDcompilePolicy=simple Tree.java TreeScanner.java TreeInfo.java * @compile -XDcompilePolicy=simple TreeInfo.java TreeScanner.java Tree.java * - * @compile -XDcompilePolicy=check Tree.java TreeScanner.java TreeInfo.java - * @compile -XDcompilePolicy=check TreeInfo.java TreeScanner.java Tree.java + * @compile -XDshould-stop.ifError=FLOW -XDshould-stop.ifNoError=FLOW Tree.java TreeScanner.java TreeInfo.java + * @compile -XDshould-stop.ifError=FLOW -XDshould-stop.ifNoError=FLOW TreeInfo.java TreeScanner.java Tree.java * - * @compile -XDcompilePolicy=attr Tree.java TreeScanner.java TreeInfo.java - * @compile -XDcompilePolicy=attr TreeInfo.java TreeScanner.java Tree.java + * @compile -XDshould-stop.ifError=ATTR -XDshould-stop.ifNoError=ATTR Tree.java TreeScanner.java TreeInfo.java + * @compile -XDshould-stop.ifError=ATTR -XDshould-stop.ifNoError=ATTR TreeInfo.java TreeScanner.java Tree.java */ package p; diff --git a/test/langtools/tools/javac/failover/CheckAttributedTree.java b/test/langtools/tools/javac/failover/CheckAttributedTree.java index b2f7a13e1fb..1969a97df05 100644 --- a/test/langtools/tools/javac/failover/CheckAttributedTree.java +++ b/test/langtools/tools/javac/failover/CheckAttributedTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -315,7 +315,8 @@ public class CheckAttributedTree { totalNumberOfCompilations++; newCompilationTask() .withWriter(pw) - .withOption("--should-stop=at=ATTR") + .withOption("--should-stop=ifError=ATTR") + .withOption("--should-stop=ifNoError=ATTR") .withOption("-XDverboseCompilePolicy") .withOption("-Xdoclint:none") .withSource(files.iterator().next()) diff --git a/test/langtools/tools/javac/importscope/T8193717.java b/test/langtools/tools/javac/importscope/T8193717.java index a1a49051e85..34aa9c9b02d 100644 --- a/test/langtools/tools/javac/importscope/T8193717.java +++ b/test/langtools/tools/javac/importscope/T8193717.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,8 @@ public class T8193717 { try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) { fm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, List.of(Paths.get("."))); new JavacTask(tb).sources(source) - .options("-XDshould-stop.at=ATTR") //the source is too big for a classfile + .options("-XDshould-stop.ifError=ATTR", + "-XDshould-stop.ifNoError=ATTR") //the source is too big for a classfile .fileManager(new TestJFM(fm)) .run(); } diff --git a/test/langtools/tools/javac/lambda/MostSpecific09.java b/test/langtools/tools/javac/lambda/MostSpecific09.java index ef685ab541e..1a6456d897a 100644 --- a/test/langtools/tools/javac/lambda/MostSpecific09.java +++ b/test/langtools/tools/javac/lambda/MostSpecific09.java @@ -2,7 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8029718 8065800 * @summary Should always use lambda body structure to disambiguate overload resolution - * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics --should-stop=at=ATTR --debug=verboseResolution=applicable,success MostSpecific09.java + * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics --should-stop=ifError=ATTR --should-stop=ifNoError=ATTR --debug=verboseResolution=applicable,success MostSpecific09.java */ class MostSpecific09 { diff --git a/test/langtools/tools/javac/modules/AnnotationProcessing.java b/test/langtools/tools/javac/modules/AnnotationProcessing.java index aa0a7df12d3..6bc952a5559 100644 --- a/test/langtools/tools/javac/modules/AnnotationProcessing.java +++ b/test/langtools/tools/javac/modules/AnnotationProcessing.java @@ -1716,7 +1716,8 @@ public class AnnotationProcessing extends ModuleTestBase { "-AlookupClass=+test.Test", "-AlookupPackage=+test", "--add-modules=m2x", - "-XDshould-stop.at=ATTR", + "-XDshould-stop.ifError=ATTR", + "-XDshould-stop.ifNoError=ATTR", "-XDrawDiagnostics") .outdir(srcClasses) .files(findJavaFiles(src)) diff --git a/test/langtools/tools/javac/resolve/ResolveHarness.java b/test/langtools/tools/javac/resolve/ResolveHarness.java index 23cfa776b3b..b5ddd3fd76e 100644 --- a/test/langtools/tools/javac/resolve/ResolveHarness.java +++ b/test/langtools/tools/javac/resolve/ResolveHarness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,9 +131,9 @@ public class ResolveHarness implements javax.tools.DiagnosticListener