From c9d23c39405ae3ed90e837753fdaec90c40129b8 Mon Sep 17 00:00:00 2001 From: Aggelos Biboudis Date: Mon, 30 Oct 2023 10:28:48 +0000 Subject: [PATCH] 8315532: Compiler Implementation for Unnamed Variables & Patterns 8317221: Implementation for javax.lang.model for Unnamed Variables & Patterns Co-authored-by: Jan Lahoda Co-authored-by: Maurizio Cimadamore Co-authored-by: Gavin Bierman Co-authored-by: Brian Goetz Co-authored-by: Joe Darcy Co-authored-by: Aggelos Biboudis Reviewed-by: jlahoda, mcimadamore --- .../jdk/internal/javac/PreviewFeature.java | 2 - .../lang/model/element/VariableElement.java | 3 +- .../com/sun/source/tree/AnyPatternTree.java | 3 +- .../classes/com/sun/source/tree/Tree.java | 3 +- .../com/sun/source/tree/TreeVisitor.java | 3 +- .../sun/source/util/SimpleTreeVisitor.java | 3 +- .../com/sun/tools/javac/code/Preview.java | 1 - .../com/sun/tools/javac/code/Source.java | 2 +- .../sun/tools/javac/parser/JavacParser.java | 4 +- .../tools/javac/resources/compiler.properties | 8 +- .../com/sun/tools/javac/tree/TreeScanner.java | 1 - test/langtools/tools/javac/T8312163.java | 2 +- test/langtools/tools/javac/T8312163.out | 2 - test/langtools/tools/javac/T8314216.java | 2 +- test/langtools/tools/javac/T8314216.out | 2 - test/langtools/tools/javac/T8314423.java | 4 +- test/langtools/tools/javac/T8314423.out | 4 +- .../TryWithResources/TwrLintUnderscore.java | 3 +- .../TryWithResources/TwrLintUnderscore.out | 2 - .../examples/UnderscoreAsIdentifierError.java | 1 + .../UnderscoreInLambdaExpression.java | 5 +- .../diags/examples/UnnamedVariables.java | 32 ++++++++ .../examples/UseOfUnderscoreNotAllowed.java | 5 +- .../UseOfUnderscoreNotAllowedNonVar.java | 30 ++++++++ ...UseOfUnderscoreNotAllowedWithBrackets.java | 3 - .../tools/javac/lambda/IdentifierTest.java | 4 +- ...ntifierTest21.out => IdentifierTest22.out} | 74 +++++++++---------- .../tools/javac/lambda/IdentifierTest9.out | 2 +- .../tools/javac/lambda/UnderscoreAsIdent.java | 4 +- ...eAsIdent21.out => UnderscoreAsIdent22.out} | 32 ++++---- .../tools/javac/lambda/UnderscoreAsIdent9.out | 2 +- .../tools/javac/parser/JavacParserTest.java | 6 +- .../tools/javac/patterns/T8314578.out | 2 - .../tools/javac/patterns/T8314632.java | 2 +- .../tools/javac/patterns/T8314632.out | 2 - .../tools/javac/patterns/Unnamed.java | 6 +- .../tools/javac/patterns/UnnamedErrors.java | 9 ++- .../tools/javac/patterns/UnnamedErrors.out | 71 +++++++++--------- 38 files changed, 195 insertions(+), 151 deletions(-) delete mode 100644 test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.out create mode 100644 test/langtools/tools/javac/diags/examples/UnnamedVariables.java create mode 100644 test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedNonVar.java rename test/langtools/tools/javac/lambda/{IdentifierTest21.out => IdentifierTest22.out} (77%) rename test/langtools/tools/javac/lambda/{UnderscoreAsIdent21.out => UnderscoreAsIdent22.out} (74%) diff --git a/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java b/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java index 71c0fbc16bf..75a628310b9 100644 --- a/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java +++ b/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java @@ -70,8 +70,6 @@ public @interface PreviewFeature { @JEP(number=430, title="String Templates") STRING_TEMPLATES, - @JEP(number=443, title="Unnamed Patterns and Variables") - UNNAMED, @JEP(number=445, title="Unnamed Classes and Instance Main Methods") UNNAMED_CLASSES, @JEP(number=446, title="Scoped Values", status="Preview") diff --git a/src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java b/src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java index d663e7d2b38..07e8c25b8f7 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java @@ -111,8 +111,7 @@ public interface VariableElement extends Element { * @jls 6.1 Declarations * @jls 14.4 Local Variable Declarations * - * @since 21 + * @since 22 */ - @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED, reflective = true) default boolean isUnnamed() { return getSimpleName().isEmpty(); } } diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/AnyPatternTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/AnyPatternTree.java index 4533f7ccb9d..36d295f50be 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/AnyPatternTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/AnyPatternTree.java @@ -38,8 +38,7 @@ import jdk.internal.javac.PreviewFeature; * * @jls 14.30.1 Kinds of Patterns * - * @since 21 + * @since 22 */ -@PreviewFeature(feature=PreviewFeature.Feature.UNNAMED) public interface AnyPatternTree extends PatternTree { } diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java index cf3853035db..e33929b1936 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java @@ -230,9 +230,8 @@ public interface Tree { /** * Used for instances of {@link BindingPatternTree}. * - * @since 21 + * @since 22 */ - @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED) ANY_PATTERN(AnyPatternTree.class), /** diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java index 855783f65a4..4b73728f55e 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java @@ -273,9 +273,8 @@ public interface TreeVisitor { * @param node the node being visited * @param p a parameter value * @return a result value - * @since 21 + * @since 22 */ - @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED) R visitAnyPattern(AnyPatternTree node, P p); /** diff --git a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java index 569b38478b0..0aaf6c8c07d 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java +++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java @@ -649,10 +649,9 @@ public class SimpleTreeVisitor implements TreeVisitor { * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of {@code defaultAction} - * @since 21 + * @since 22 */ @Override - @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED) public R visitAnyPattern(AnyPatternTree node, P p) { return defaultAction(node, p); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java index bb1c736904f..cdbd57047ff 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java @@ -211,7 +211,6 @@ public class Preview { return switch (feature) { case STRING_TEMPLATES -> true; case UNNAMED_CLASSES -> true; - case UNNAMED_VARIABLES -> true; //Note: this is a backdoor which allows to optionally treat all features as 'preview' (for testing). //When real preview features will be added, this method can be implemented to return 'true' //for those selected features, and 'false' for all the others. diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java index 8aa9b65bf6e..017400adcfc 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java @@ -247,7 +247,7 @@ public enum Source { STRING_TEMPLATES(JDK21, Fragments.FeatureStringTemplates, DiagKind.PLURAL), UNNAMED_CLASSES(JDK21, Fragments.FeatureUnnamedClasses, DiagKind.PLURAL), WARN_ON_ILLEGAL_UTF8(MIN, JDK21), - UNNAMED_VARIABLES(JDK21, Fragments.FeatureUnnamedVariables, DiagKind.PLURAL), + UNNAMED_VARIABLES(JDK22, Fragments.FeatureUnnamedVariables, DiagKind.PLURAL), ; enum DiagKind { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index bea4b1f6fce..0713739050a 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -653,8 +653,8 @@ public class JavacParser implements Parser { log.error(DiagnosticFlag.SYNTAX, token.pos, Errors.UseOfUnderscoreNotAllowedWithBrackets); } } else { - if (preview.isEnabled() && Feature.UNNAMED_VARIABLES.allowedInSource(source)) { - log.error(DiagnosticFlag.SYNTAX, token.pos, Errors.UseOfUnderscoreNotAllowed); + if (Feature.UNNAMED_VARIABLES.allowedInSource(source)) { + log.error(DiagnosticFlag.SYNTAX, token.pos, Errors.UseOfUnderscoreNotAllowedNonVariable); } else { log.error(DiagnosticFlag.SYNTAX, token.pos, Errors.UnderscoreAsIdentifier); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index 1ff2f8d9314..d378c9fae10 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -3204,8 +3204,12 @@ compiler.err.underscore.as.identifier=\ as of release 9, ''_'' is a keyword, and may not be used as an identifier compiler.err.use.of.underscore.not.allowed=\ - as of release 21, the underscore keyword ''_'' is only allowed to declare\n\ - unnamed patterns, local variables, exception parameters or lambda parameters + underscore not allowed here\n\ + as of release 9, ''_'' is a keyword, and may not be used as an identifier\n\ + as of release 22, ''_'' can be used as a name in the declaration of unnamed patterns, local variables, exception parameters or lambda parameters + +compiler.err.use.of.underscore.not.allowed.non.variable=\ + underscore not allowed here compiler.err.use.of.underscore.not.allowed.with.brackets=\ the underscore keyword ''_'' is not allowed to be followed by brackets diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java index 2639be58ada..f07871eff24 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java @@ -324,7 +324,6 @@ public class TreeScanner extends Visitor { } @Override - @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED) public void visitAnyPattern(JCAnyPattern that) { } diff --git a/test/langtools/tools/javac/T8312163.java b/test/langtools/tools/javac/T8312163.java index 3554522f401..6badde81f84 100644 --- a/test/langtools/tools/javac/T8312163.java +++ b/test/langtools/tools/javac/T8312163.java @@ -2,9 +2,9 @@ * @test /nodynamiccopyright/ * @bug 8312163 * @summary Crash in dominance check when compiling unnamed patterns - * @enablePreview * @compile/fail/ref=T8312163.out -XDrawDiagnostics T8312163.java */ + public class T8312163 { sealed interface A permits B {} record B() implements A {} diff --git a/test/langtools/tools/javac/T8312163.out b/test/langtools/tools/javac/T8312163.out index 80ec36552c0..5a6180f5a74 100644 --- a/test/langtools/tools/javac/T8312163.out +++ b/test/langtools/tools/javac/T8312163.out @@ -4,6 +4,4 @@ T8312163.java:33:18: compiler.err.pattern.dominated T8312163.java:39:18: compiler.err.pattern.dominated T8312163.java:49:18: compiler.err.pattern.dominated T8312163.java:54:18: compiler.err.pattern.dominated -- compiler.note.preview.filename: T8312163.java, DEFAULT -- compiler.note.preview.recompile 6 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/T8314216.java b/test/langtools/tools/javac/T8314216.java index c71aed3273a..2611538761a 100644 --- a/test/langtools/tools/javac/T8314216.java +++ b/test/langtools/tools/javac/T8314216.java @@ -2,7 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8314216 * @summary Multiple patterns without unnamed variables - * @compile/fail/ref=T8314216.out -XDrawDiagnostics --enable-preview --source ${jdk.version} T8314216.java + * @compile/fail/ref=T8314216.out -XDrawDiagnostics T8314216.java */ public class T8314216 { diff --git a/test/langtools/tools/javac/T8314216.out b/test/langtools/tools/javac/T8314216.out index 0dde8fbb11f..1cfee1fcd5a 100644 --- a/test/langtools/tools/javac/T8314216.out +++ b/test/langtools/tools/javac/T8314216.out @@ -1,5 +1,3 @@ T8314216.java:13:23: compiler.err.invalid.case.label.combination T8314216.java:14:28: compiler.err.invalid.case.label.combination -- compiler.note.preview.filename: T8314216.java, DEFAULT -- compiler.note.preview.recompile 2 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/T8314423.java b/test/langtools/tools/javac/T8314423.java index 43301682af8..f4754aa6e65 100644 --- a/test/langtools/tools/javac/T8314423.java +++ b/test/langtools/tools/javac/T8314423.java @@ -2,8 +2,8 @@ * @test /nodynamiccopyright/ * @bug 8314423 * @summary Multiple patterns without unnamed variables - * @compile/fail/ref=T8314423.out -XDrawDiagnostics T8314423.java - * @compile --enable-preview --source ${jdk.version} T8314423.java + * @compile/fail/ref=T8314423.out -XDrawDiagnostics --release 21 T8314423.java + * @compile T8314423.java */ public class T8314423 { diff --git a/test/langtools/tools/javac/T8314423.out b/test/langtools/tools/javac/T8314423.out index ee23eecf224..ee9939445a5 100644 --- a/test/langtools/tools/javac/T8314423.out +++ b/test/langtools/tools/javac/T8314423.out @@ -1,2 +1,2 @@ -T8314423.java:15:24: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.unnamed.variables) -1 error \ No newline at end of file +T8314423.java:15:24: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.unnamed.variables), 21, 22 +1 error diff --git a/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.java b/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.java index 14621db7861..7724a336fc7 100644 --- a/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.java +++ b/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.java @@ -2,8 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8304246 * @summary Compiler Implementation for Unnamed patterns and variables - * @enablePreview - * @compile/ref=TwrLintUnderscore.out --enable-preview -source ${jdk.version} -Xlint:try -XDrawDiagnostics TwrLintUnderscore.java + * @compile -Xlint:try -XDrawDiagnostics TwrLintUnderscore.java */ class TwrLintUnderscore implements AutoCloseable { private static void test1() { diff --git a/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.out b/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.out deleted file mode 100644 index 7973bce7711..00000000000 --- a/test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.out +++ /dev/null @@ -1,2 +0,0 @@ -- compiler.note.preview.filename: TwrLintUnderscore.java, DEFAULT -- compiler.note.preview.recompile diff --git a/test/langtools/tools/javac/diags/examples/UnderscoreAsIdentifierError.java b/test/langtools/tools/javac/diags/examples/UnderscoreAsIdentifierError.java index 1600d5cc2ca..db572bd5007 100644 --- a/test/langtools/tools/javac/diags/examples/UnderscoreAsIdentifierError.java +++ b/test/langtools/tools/javac/diags/examples/UnderscoreAsIdentifierError.java @@ -22,6 +22,7 @@ */ // key: compiler.err.underscore.as.identifier +// options: --release 21 class UnderscoreAsIdentifierError { String _ = null; diff --git a/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java b/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java index cd50a199737..dd68a2c2128 100644 --- a/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java +++ b/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java @@ -21,9 +21,10 @@ * questions. */ +// key: compiler.err.feature.not.supported.in.source.plural // key: compiler.misc.feature.unnamed.variables -// key: compiler.warn.preview.feature.use.plural -// options: --enable-preview -source ${jdk.version} -Xlint:preview +// key: compiler.warn.source.no.system.modules.path +// options: -source 21 public class UnderscoreInLambdaExpression { java.util.function.Function f = _ -> "x"; diff --git a/test/langtools/tools/javac/diags/examples/UnnamedVariables.java b/test/langtools/tools/javac/diags/examples/UnnamedVariables.java new file mode 100644 index 00000000000..7d1463fcd46 --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/UnnamedVariables.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013, 2014, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.feature.not.supported.in.source.plural +// key: compiler.misc.feature.unnamed.variables +// options: -Xlint:-options --source 21 + +class UnnamedVariables { + void test() { + String _ = null; + } +} diff --git a/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowed.java b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowed.java index 8510fce09e5..eeb6fbd6795 100644 --- a/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowed.java +++ b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowed.java @@ -22,10 +22,7 @@ */ // key: compiler.err.use.of.underscore.not.allowed -// options: --enable-preview -source ${jdk.version} -Xlint:preview - -import java.util.function.*; class UseOfUnderscoreNotAllowed { - IntBinaryOperator f = (int x, int y) -> _ + x; + private int a = 0, _ = 1; } diff --git a/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedNonVar.java b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedNonVar.java new file mode 100644 index 00000000000..e75bb20b4e9 --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedNonVar.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.use.of.underscore.not.allowed.non.variable + +import java.util.function.*; + +class UseOfUnderscoreNotAllowedNonVar { + IntBinaryOperator f = (int x, int y) -> _ + x; +} diff --git a/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedWithBrackets.java b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedWithBrackets.java index 77289f743ef..e3b6dba4360 100644 --- a/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedWithBrackets.java +++ b/test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedWithBrackets.java @@ -22,9 +22,6 @@ */ // key: compiler.err.use.of.underscore.not.allowed.with.brackets -// key: compiler.misc.feature.unnamed.variables -// key: compiler.warn.preview.feature.use.plural -// options: --enable-preview -source ${jdk.version} -Xlint:preview class UseOfUnderscoreNotAllowedWithBrackets { void test() { diff --git a/test/langtools/tools/javac/lambda/IdentifierTest.java b/test/langtools/tools/javac/lambda/IdentifierTest.java index 2e84e16d929..6ae615243dd 100644 --- a/test/langtools/tools/javac/lambda/IdentifierTest.java +++ b/test/langtools/tools/javac/lambda/IdentifierTest.java @@ -4,8 +4,8 @@ * @author sogoel * @summary Test generation of warnings when '_' is used an identifier * @compile/fail/ref=IdentifierTest8.out --release 8 -Werror -XDrawDiagnostics -Xlint:-options IdentifierTest.java - * @compile/fail/ref=IdentifierTest9.out -XDrawDiagnostics IdentifierTest.java - * @compile/fail/ref=IdentifierTest21.out -source ${jdk.version} --enable-preview -XDrawDiagnostics IdentifierTest.java + * @compile/fail/ref=IdentifierTest9.out --release 9 -XDrawDiagnostics IdentifierTest.java + * @compile/fail/ref=IdentifierTest22.out -XDrawDiagnostics IdentifierTest.java */ import java.util.List; diff --git a/test/langtools/tools/javac/lambda/IdentifierTest21.out b/test/langtools/tools/javac/lambda/IdentifierTest22.out similarity index 77% rename from test/langtools/tools/javac/lambda/IdentifierTest21.out rename to test/langtools/tools/javac/lambda/IdentifierTest22.out index 801584fafbc..9accea3c6fe 100644 --- a/test/langtools/tools/javac/lambda/IdentifierTest21.out +++ b/test/langtools/tools/javac/lambda/IdentifierTest22.out @@ -1,40 +1,38 @@ -IdentifierTest.java:42:11: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:45:16: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:47:22: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:52:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:52:23: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:54:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:56:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:64:67: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:71:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:72:14: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:73:18: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:80:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:80:15: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:82:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:82:15: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:89:10: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:89:38: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:95:14: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:102:17: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:102:26: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:119:20: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:124:10: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:129:17: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:132:17: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:139:24: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:139:33: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:140:39: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:145:15: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:146:13: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:151:15: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:152:17: compiler.err.use.of.underscore.not.allowed +IdentifierTest.java:42:11: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:45:16: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:47:22: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:52:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:52:23: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:54:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:56:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:64:67: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:71:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:72:14: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:73:18: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:80:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:80:15: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:82:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:82:15: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:89:10: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:89:38: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:95:14: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:102:17: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:102:26: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:119:20: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:124:10: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:129:17: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:132:17: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:139:24: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:139:33: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:140:39: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:145:15: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:146:13: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:151:15: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:152:17: compiler.err.use.of.underscore.not.allowed.non.variable IdentifierTest.java:158:16: compiler.err.use.of.underscore.not.allowed.with.brackets -IdentifierTest.java:160:25: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:169:5: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:173:26: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:175:19: compiler.err.use.of.underscore.not.allowed -IdentifierTest.java:181:11: compiler.err.use.of.underscore.not.allowed -- compiler.note.preview.filename: IdentifierTest.java, DEFAULT -- compiler.note.preview.recompile +IdentifierTest.java:160:25: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:169:5: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:173:26: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:175:19: compiler.err.use.of.underscore.not.allowed.non.variable +IdentifierTest.java:181:11: compiler.err.use.of.underscore.not.allowed.non.variable 37 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/lambda/IdentifierTest9.out b/test/langtools/tools/javac/lambda/IdentifierTest9.out index 654bdad02d8..45560ff4267 100644 --- a/test/langtools/tools/javac/lambda/IdentifierTest9.out +++ b/test/langtools/tools/javac/lambda/IdentifierTest9.out @@ -1,6 +1,6 @@ IdentifierTest.java:42:11: compiler.err.underscore.as.identifier IdentifierTest.java:45:16: compiler.err.underscore.as.identifier -IdentifierTest.java:46:20: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.unnamed.variables) +IdentifierTest.java:46:20: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.unnamed.variables), 9, 22 IdentifierTest.java:47:22: compiler.err.underscore.as.identifier IdentifierTest.java:52:13: compiler.err.underscore.as.identifier IdentifierTest.java:52:23: compiler.err.underscore.as.identifier diff --git a/test/langtools/tools/javac/lambda/UnderscoreAsIdent.java b/test/langtools/tools/javac/lambda/UnderscoreAsIdent.java index 4630ec4cb8d..0f3400e4f93 100644 --- a/test/langtools/tools/javac/lambda/UnderscoreAsIdent.java +++ b/test/langtools/tools/javac/lambda/UnderscoreAsIdent.java @@ -2,8 +2,8 @@ * @test /nodynamiccopyright/ * @summary Check usages of underscore as identifier generate warnings * @compile/fail/ref=UnderscoreAsIdent8.out --release 8 -XDrawDiagnostics -Xlint:-options -Werror UnderscoreAsIdent.java - * @compile/fail/ref=UnderscoreAsIdent9.out -XDrawDiagnostics -Werror UnderscoreAsIdent.java - * @compile/fail/ref=UnderscoreAsIdent21.out -source ${jdk.version} --enable-preview -XDrawDiagnostics UnderscoreAsIdent.java + * @compile/fail/ref=UnderscoreAsIdent9.out --release 9 -XDrawDiagnostics -Werror UnderscoreAsIdent.java + * @compile/fail/ref=UnderscoreAsIdent22.out -XDrawDiagnostics UnderscoreAsIdent.java */ package _._; diff --git a/test/langtools/tools/javac/lambda/UnderscoreAsIdent21.out b/test/langtools/tools/javac/lambda/UnderscoreAsIdent22.out similarity index 74% rename from test/langtools/tools/javac/lambda/UnderscoreAsIdent21.out rename to test/langtools/tools/javac/lambda/UnderscoreAsIdent22.out index b364c95fa3d..9a51b64eae0 100644 --- a/test/langtools/tools/javac/lambda/UnderscoreAsIdent21.out +++ b/test/langtools/tools/javac/lambda/UnderscoreAsIdent22.out @@ -1,17 +1,15 @@ -UnderscoreAsIdent.java:8:9: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:8:11: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:10:8: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:10:10: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:12:7: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:13:12: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:14:10: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:14:19: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:19:25: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:19:33: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:25:9: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:27:19: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:29:9: compiler.err.use.of.underscore.not.allowed -UnderscoreAsIdent.java:31:22: compiler.err.use.of.underscore.not.allowed -- compiler.note.preview.filename: UnderscoreAsIdent.java, DEFAULT -- compiler.note.preview.recompile -14 errors +UnderscoreAsIdent.java:8:9: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:8:11: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:10:8: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:10:10: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:12:7: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:13:12: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:14:10: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:14:19: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:19:25: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:19:33: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:25:9: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:27:19: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:29:9: compiler.err.use.of.underscore.not.allowed.non.variable +UnderscoreAsIdent.java:31:22: compiler.err.use.of.underscore.not.allowed.non.variable +14 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/lambda/UnderscoreAsIdent9.out b/test/langtools/tools/javac/lambda/UnderscoreAsIdent9.out index 263ff9af33a..a7460c9605f 100644 --- a/test/langtools/tools/javac/lambda/UnderscoreAsIdent9.out +++ b/test/langtools/tools/javac/lambda/UnderscoreAsIdent9.out @@ -6,7 +6,7 @@ UnderscoreAsIdent.java:12:7: compiler.err.underscore.as.identifier UnderscoreAsIdent.java:13:12: compiler.err.underscore.as.identifier UnderscoreAsIdent.java:14:10: compiler.err.underscore.as.identifier UnderscoreAsIdent.java:14:19: compiler.err.underscore.as.identifier -UnderscoreAsIdent.java:16:16: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.unnamed.variables) +UnderscoreAsIdent.java:16:16: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.unnamed.variables), 9, 22 UnderscoreAsIdent.java:19:25: compiler.err.underscore.as.identifier UnderscoreAsIdent.java:19:33: compiler.err.underscore.as.identifier UnderscoreAsIdent.java:25:9: compiler.err.underscore.as.identifier diff --git a/test/langtools/tools/javac/parser/JavacParserTest.java b/test/langtools/tools/javac/parser/JavacParserTest.java index d1bb23091aa..14f0c506cd1 100644 --- a/test/langtools/tools/javac/parser/JavacParserTest.java +++ b/test/langtools/tools/javac/parser/JavacParserTest.java @@ -2206,7 +2206,7 @@ public class JavacParserTest extends TestCase { /*public static final*/ _ /* = new Test() */ /*enum*/ ; } """, """ - Test.java:3:5: compiler.err.underscore.as.identifier + Test.java:3:5: compiler.err.use.of.underscore.not.allowed.non.variable """), new TestCase(""" package t; @@ -2241,7 +2241,7 @@ public class JavacParserTest extends TestCase { /*public static final*/ _ /* = new Test() */ /*enum*/ ; } """, """ - Test.java:3:5: compiler.err.underscore.as.identifier + Test.java:3:5: compiler.err.use.of.underscore.not.allowed.non.variable """), new TestCase(""" package t; @@ -2330,7 +2330,7 @@ public class JavacParserTest extends TestCase { /*public static final*/ A /* = new Test() */ /*enum*/ ; } """, """ - Test.java:3:5: compiler.err.underscore.as.identifier + Test.java:3:5: compiler.err.use.of.underscore.not.allowed.non.variable """), }; for (TestCase testCase : testCases) { diff --git a/test/langtools/tools/javac/patterns/T8314578.out b/test/langtools/tools/javac/patterns/T8314578.out index 6d6acf6d48b..1f09c496f57 100644 --- a/test/langtools/tools/javac/patterns/T8314578.out +++ b/test/langtools/tools/javac/patterns/T8314578.out @@ -1,6 +1,4 @@ T8314578.java:14:18: compiler.err.flows.through.from.pattern T8314578.java:15:18: compiler.err.flows.through.to.pattern T8314578.java:27:18: compiler.err.flows.through.to.pattern -- compiler.note.preview.filename: T8314578.java, DEFAULT -- compiler.note.preview.recompile 3 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/patterns/T8314632.java b/test/langtools/tools/javac/patterns/T8314632.java index 407fba6466a..acbcbc11422 100644 --- a/test/langtools/tools/javac/patterns/T8314632.java +++ b/test/langtools/tools/javac/patterns/T8314632.java @@ -2,9 +2,9 @@ * @test /nodynamiccopyright/ * @bug 8314632 * @summary Intra-case dominance check fails in the presence of a guard - * @enablePreview * @compile/fail/ref=T8314632.out -XDrawDiagnostics T8314632.java */ + public class T8314632 { void test1(Object obj) { switch (obj) { diff --git a/test/langtools/tools/javac/patterns/T8314632.out b/test/langtools/tools/javac/patterns/T8314632.out index df3cafdb077..f7c616f0745 100644 --- a/test/langtools/tools/javac/patterns/T8314632.out +++ b/test/langtools/tools/javac/patterns/T8314632.out @@ -1,6 +1,4 @@ T8314632.java:12:45: compiler.err.pattern.dominated T8314632.java:20:45: compiler.err.pattern.dominated T8314632.java:36:29: compiler.err.pattern.dominated -- compiler.note.preview.filename: T8314632.java, DEFAULT -- compiler.note.preview.recompile 3 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/patterns/Unnamed.java b/test/langtools/tools/javac/patterns/Unnamed.java index cbdb486e48c..34e325642fd 100644 --- a/test/langtools/tools/javac/patterns/Unnamed.java +++ b/test/langtools/tools/javac/patterns/Unnamed.java @@ -21,11 +21,10 @@ * questions. */ -/** +/* * @test * @bug 8304246 * @summary Compiler Implementation for Unnamed patterns and variables - * @enablePreview * @compile Unnamed.java * @run main Unnamed */ @@ -98,6 +97,9 @@ public class Unnamed { try (final Lock _ = null) { } try (@Foo Lock _ = null) { } + try (Lock _ = null) { } + catch (Exception | Error _) { } + String[] strs = new String[] { "str1", "str2" }; for (var _ : strs) { for (var _ : strs) { diff --git a/test/langtools/tools/javac/patterns/UnnamedErrors.java b/test/langtools/tools/javac/patterns/UnnamedErrors.java index a87c2577eed..ed345343cd6 100644 --- a/test/langtools/tools/javac/patterns/UnnamedErrors.java +++ b/test/langtools/tools/javac/patterns/UnnamedErrors.java @@ -1,8 +1,7 @@ -/** +/* * @test /nodynamiccopyright/ * @bug 8304246 8309093 * @summary Compiler Implementation for Unnamed patterns and variables - * @enablePreview * @compile/fail/ref=UnnamedErrors.out -XDrawDiagnostics -XDshould-stop.at=FLOW UnnamedErrors.java */ public class UnnamedErrors { @@ -111,6 +110,12 @@ public class UnnamedErrors { for (int _[] : new int[][]{new int[]{1}, new int[]{2}}) { } } + void testUnderscoreInExpression() { + for(String s : _) { + int i = 1; + } + } + class Lock implements AutoCloseable { @Override public void close() {} diff --git a/test/langtools/tools/javac/patterns/UnnamedErrors.out b/test/langtools/tools/javac/patterns/UnnamedErrors.out index 430119db577..d0bc7514737 100644 --- a/test/langtools/tools/javac/patterns/UnnamedErrors.out +++ b/test/langtools/tools/javac/patterns/UnnamedErrors.out @@ -1,37 +1,36 @@ -UnnamedErrors.java:9:17: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:10:17: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:11:20: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:11:26: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:11:32: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:12:17: compiler.err.use.of.underscore.not.allowed +UnnamedErrors.java:8:17: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:9:17: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:10:20: compiler.err.use.of.underscore.not.allowed +UnnamedErrors.java:10:26: compiler.err.use.of.underscore.not.allowed +UnnamedErrors.java:10:32: compiler.err.use.of.underscore.not.allowed +UnnamedErrors.java:11:17: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:11:24: compiler.err.use.of.underscore.not.allowed UnnamedErrors.java:12:24: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:13:24: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:15:18: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:16:23: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:17:19: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:22:26: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:24:26: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:27:18: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:34:18: compiler.err.restricted.type.not.allowed.here: var -UnnamedErrors.java:77:18: compiler.err.use.of.underscore.not.allowed -UnnamedErrors.java:77:19: compiler.err.expected: token.identifier -UnnamedErrors.java:82:40: compiler.err.expected2: :, -> -UnnamedErrors.java:82:51: compiler.err.expected: = -UnnamedErrors.java:82:58: compiler.err.expected: ';' -UnnamedErrors.java:101:14: compiler.err.expected: = -UnnamedErrors.java:102:22: compiler.err.expected: = -UnnamedErrors.java:104:26: compiler.err.expected: = -UnnamedErrors.java:110:13: compiler.err.use.of.underscore.not.allowed.with.brackets -UnnamedErrors.java:111:18: compiler.err.use.of.underscore.not.allowed.with.brackets -UnnamedErrors.java:11:17: compiler.err.already.defined: kindname.variable, x, kindname.class, UnnamedErrors -UnnamedErrors.java:36:13: compiler.err.unconditional.pattern.and.default -UnnamedErrors.java:45:18: compiler.err.pattern.dominated -UnnamedErrors.java:54:29: compiler.err.flows.through.from.pattern -UnnamedErrors.java:61:29: compiler.err.flows.through.from.pattern -UnnamedErrors.java:68:32: compiler.err.flows.through.from.pattern -UnnamedErrors.java:82:56: compiler.err.already.defined: kindname.variable, x2, kindname.method, guardErrors(java.lang.Object,int,int) -UnnamedErrors.java:83:13: compiler.err.switch.mixing.case.types -UnnamedErrors.java:90:30: compiler.err.pattern.dominated -- compiler.note.preview.filename: UnnamedErrors.java, DEFAULT -- compiler.note.preview.recompile -34 errors \ No newline at end of file +UnnamedErrors.java:14:18: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:15:23: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:16:19: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:21:26: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:23:26: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:26:18: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:33:18: compiler.err.restricted.type.not.allowed.here: var +UnnamedErrors.java:76:18: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:76:19: compiler.err.expected: token.identifier +UnnamedErrors.java:81:40: compiler.err.expected2: :, -> +UnnamedErrors.java:81:51: compiler.err.expected: = +UnnamedErrors.java:81:58: compiler.err.expected: ';' +UnnamedErrors.java:100:14: compiler.err.expected: = +UnnamedErrors.java:101:22: compiler.err.expected: = +UnnamedErrors.java:103:26: compiler.err.expected: = +UnnamedErrors.java:109:13: compiler.err.use.of.underscore.not.allowed.with.brackets +UnnamedErrors.java:110:18: compiler.err.use.of.underscore.not.allowed.with.brackets +UnnamedErrors.java:114:24: compiler.err.use.of.underscore.not.allowed.non.variable +UnnamedErrors.java:10:17: compiler.err.already.defined: kindname.variable, x, kindname.class, UnnamedErrors +UnnamedErrors.java:35:13: compiler.err.unconditional.pattern.and.default +UnnamedErrors.java:44:18: compiler.err.pattern.dominated +UnnamedErrors.java:53:29: compiler.err.flows.through.from.pattern +UnnamedErrors.java:60:29: compiler.err.flows.through.from.pattern +UnnamedErrors.java:67:32: compiler.err.flows.through.from.pattern +UnnamedErrors.java:81:56: compiler.err.already.defined: kindname.variable, x2, kindname.method, guardErrors(java.lang.Object,int,int) +UnnamedErrors.java:82:13: compiler.err.switch.mixing.case.types +UnnamedErrors.java:89:30: compiler.err.pattern.dominated +35 errors \ No newline at end of file