Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java93
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java293
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java17
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java84
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java19
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java50
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java31
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java41
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java31
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java52
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java73
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java124
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java38
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java19
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java23
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java67
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java47
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java43
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java15
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java23
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java53
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java13
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java (renamed from org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java)31
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java11
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java25
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IComponent.java54
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IRecordComponent.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceType.java13
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java91
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java65
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java22
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java202
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtendedTagBits.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java11
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java346
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java94
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java70
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java1217
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java28
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java363
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java132
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java191
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rscbin36162 -> 35878 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rscbin626 -> 626 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rscbin626 -> 626 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rscbin2446 -> 2446 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rscbin1590 -> 1598 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rscbin2396 -> 2416 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rscbin908 -> 919 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rscbin16226 -> 16876 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rscbin626 -> 626 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rscbin34346 -> 34040 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rscbin17806 -> 18318 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rscbin7264 -> 7352 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rscbin838 -> 848 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rscbin100 -> 100 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rscbin838 -> 848 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rscbin2396 -> 2416 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rscbin3548 -> 3804 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rscbin2396 -> 2416 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rscbin1578 -> 1586 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rscbin266 -> 272 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rscbin838 -> 848 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rscbin16042 -> 16848 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part0.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part1.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part14.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part2.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part3.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start0.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start1.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start2.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start3.rscbin0 -> 8192 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java437
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties42
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Messages.java6
109 files changed, 3514 insertions, 1423 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index e5440af744..c9ff4d220a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -780,8 +780,7 @@ void setSourceStart(int sourceStart);
/** @since 3.10 */
int MissingTypeInLambda = MethodRelated + 271;
- /** @since 3.20
- * @noreference preview related error */
+ /** @since 3.23 */
int UnterminatedTextBlock = PreviewRelated + 272;
// type related problems
/** @since 3.1 */
@@ -1222,6 +1221,8 @@ void setSourceStart(int sourceStart);
int JavadocInvalidProvidesClassName = Javadoc + Internal + 1808;
/** @since 3.20 */
int JavadocInvalidProvidesClass = Javadoc + Internal + 1809;
+ /** @since 3.23 */
+ int JavadocInvalidModuleQualification = Javadoc + Internal + 1810;
/**
* Generics
@@ -2118,6 +2119,8 @@ void setSourceStart(int sourceStart);
int PreviewFeatureNotSupported = Compliance + 1105;
/** @since 3.20*/
int PreviewFeaturesNotAllowed = PreviewRelated + 1106;
+ /** @since 3.23 */
+ int FeatureNotSupported = Compliance + 1107;
/** @since 3.13 */
int UnlikelyCollectionMethodArgumentType = 1200;
@@ -2247,6 +2250,9 @@ void setSourceStart(int sourceStart);
int SwitchExpressionsContinueOutOfSwitchExpression = Syntax + 1723;
/** @since 3.22 */
int SwitchExpressionsReturnWithinSwitchExpression = Syntax + 1724;
+
+ /* Java 14 errors end */
+ /* Java 15 errors begin */
/* records - begin */
/** @since 3.22
@@ -2269,9 +2275,9 @@ void setSourceStart(int sourceStart);
/** @since 3.22
* @noreference preview feature error */
int RecordCanonicalConstructorHasThrowsClause = PreviewRelated + 1735;
- /** @since 3.22
+ /** @since 3.23
* @noreference preview feature error */
- int RecordCanonicalConstructorShouldBePublic = PreviewRelated + 1736;
+ int RecordCanonicalConstructorVisibilityReduced = PreviewRelated + 1736;
/** @since 3.22
* @noreference preview feature error */
int RecordMultipleCanonicalConstructors = PreviewRelated + 1737;
@@ -2287,9 +2293,9 @@ void setSourceStart(int sourceStart);
/** @since 3.22
* @noreference preview feature error */
int RecordInstanceInitializerBlockInRecord = PreviewRelated + 1741;
- /** @since 3.22
+ /** @since 3.23
* @noreference preview feature error */
- int RecordIsAReservedTypeName = PreviewRelated + 1742;
+ int RestrictedTypeName = PreviewRelated + 1742;
/** @since 3.22
* @noreference preview feature error */
int RecordIllegalAccessorReturnType = PreviewRelated + 1743;
@@ -2334,11 +2340,80 @@ void setSourceStart(int sourceStart);
int RecordCannotDefineRecordInLocalType= PreviewRelated + 1756;
/** @since 3.23
* @noreference preview feature error */
- int RecordMissingExplicitConstructorCallInNonCanonicalConstructor= PreviewRelated + 1757;
+ int RecordComponentsCannotHaveModifiers= PreviewRelated + 1757;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int RecordIllegalParameterNameInCanonicalConstructor = PreviewRelated + 1758;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int RecordIllegalExplicitFinalFieldAssignInCompactConstructor = PreviewRelated + 1759;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int RecordMissingExplicitConstructorCallInNonCanonicalConstructor= PreviewRelated + 1760;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int RecordIllegalStaticModifierForLocalClassOrInterface = PreviewRelated + 1761;
+
+ /** @since 3.23
+ * @noreference preview feature error */
+ int LocalStaticsIllegalVisibilityModifierForInterfaceLocalType = PreviewRelated + 1765;
/* records - end */
+
+
/* instanceof pattern: */
/** @since 3.22
+ * @deprecated problem no longer generated */
+ int PatternVariableNotInScope = PreviewRelated + 1780;
+
+
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedMissingClassModifier = PreviewRelated + 1850;
+ /** @since 3.23
* @noreference preview feature error */
- int PatternVariableNotInScope = PreviewRelated + 1760;
- /* Java14 errors - end */
+ int SealedDisAllowedNonSealedModifierInClass = PreviewRelated + 1851;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedSuperClassDoesNotPermit = PreviewRelated + 1852;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedSuperInterfaceDoesNotPermit = PreviewRelated + 1853;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedMissingSealedModifier = PreviewRelated + 1854;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedMissingInterfaceModifier = PreviewRelated + 1855;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedDuplicateTypeInPermits = PreviewRelated + 1856;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedNotDirectSuperClass = PreviewRelated + 1857;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedPermittedTypeOutsideOfModule = PreviewRelated + 1858;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedPermittedTypeOutsideOfPackage = PreviewRelated + 1859;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedSealedTypeMissingPermits = PreviewRelated + 1860;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedInterfaceIsSealedAndNonSealed = PreviewRelated + 1861;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedDisAllowedNonSealedModifierInInterface = PreviewRelated + 1862;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedNotDirectSuperInterface = PreviewRelated + 1863;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedLocalDirectSuperTypeSealed = PreviewRelated + 1864;
+ /** @since 3.23
+ * @noreference preview feature error */
+ int SealedAnonymousClassCannotExtendSealedType = PreviewRelated + 1865;
+ /* Java15 errors - end */
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
index abc6f8a15a..00e93e6c95 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -244,6 +244,12 @@ public abstract class ASTVisitor {
public void endVisit(JavadocQualifiedTypeReference typeRef, ClassScope scope) {
// do nothing by default
}
+ public void endVisit(JavadocModuleReference moduleRef, BlockScope scope) {
+ // do nothing by default
+ }
+ public void endVisit(JavadocModuleReference moduleRef, ClassScope scope) {
+ // do nothing by default
+ }
public void endVisit(JavadocReturnStatement statement, BlockScope scope) {
// do nothing by default
}
@@ -740,6 +746,12 @@ public abstract class ASTVisitor {
public boolean visit(JavadocQualifiedTypeReference typeRef, ClassScope scope) {
return true; // do nothing by default, keep traversing
}
+ public boolean visit(JavadocModuleReference moduleRef, BlockScope scope) {
+ return true; // do nothing by default, keep traversing
+ }
+ public boolean visit(JavadocModuleReference moduleRef, ClassScope scope) {
+ return true; // do nothing by default, keep traversing
+ }
public boolean visit(JavadocReturnStatement statement, BlockScope scope) {
return true; // do nothing by default, keep traversing
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
index 73582801a2..d097483e07 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -42,6 +42,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
@@ -139,7 +142,6 @@ import org.eclipse.jdt.internal.compiler.util.Util;
* information. Those bytes are decodable with a regular class file reader,
* such as DietClassFileReader
*/
-@SuppressWarnings({"rawtypes", "unchecked"})
public class ClassFile implements TypeConstants, TypeIds {
private byte[] bytes;
@@ -174,7 +176,7 @@ public class ClassFile implements TypeConstants, TypeIds {
public List<TypeBinding> missingTypes = null;
- public Set visitedTypes;
+ public Set<TypeBinding> visitedTypes;
public static final int INITIAL_CONTENTS_SIZE = 400;
public static final int INITIAL_HEADER_SIZE = 1500;
@@ -431,16 +433,18 @@ public class ClassFile implements TypeConstants, TypeIds {
if (this.bootstrapMethods != null && !this.bootstrapMethods.isEmpty()) {
attributesNumber += generateBootstrapMethods(this.bootstrapMethods);
}
+ if (this.targetJDK >= ClassFileConstants.JDK15) {
+ // add record attributes
+ attributesNumber += generatePermittedTypeAttributes();
+ }
// Inner class attribute
int numberOfInnerClasses = this.innerClassesBindings == null ? 0 : this.innerClassesBindings.size();
if (numberOfInnerClasses != 0) {
ReferenceBinding[] innerClasses = new ReferenceBinding[numberOfInnerClasses];
this.innerClassesBindings.keySet().toArray(innerClasses);
- Arrays.sort(innerClasses, new Comparator() {
+ Arrays.sort(innerClasses, new Comparator<ReferenceBinding>() {
@Override
- public int compare(Object o1, Object o2) {
- TypeBinding binding1 = (TypeBinding) o1;
- TypeBinding binding2 = (TypeBinding) o2;
+ public int compare(ReferenceBinding o1, ReferenceBinding o2) {
Boolean onBottom1 = ClassFile.this.innerClassesBindings.get(o1);
Boolean onBottom2 = ClassFile.this.innerClassesBindings.get(o2);
if (onBottom1) {
@@ -452,7 +456,7 @@ public class ClassFile implements TypeConstants, TypeIds {
return -1;
}
}
- return CharOperation.compareTo(binding1.constantPoolName(), binding2.constantPoolName());
+ return CharOperation.compareTo(o1.constantPoolName(), o2.constantPoolName());
}
});
attributesNumber += generateInnerClassAttribute(numberOfInnerClasses, innerClasses);
@@ -579,7 +583,9 @@ public class ClassFile implements TypeConstants, TypeIds {
try {
if (fieldDeclaration.isARecordComponent) {
long rcMask = TagBits.AnnotationForField | TagBits.AnnotationForTypeUse;
- fieldDeclaration.annotations = getAnnotationsFromAssociatedRecordComponent(fieldBinding.declaringClass, fieldBinding.name, rcMask);
+ RecordComponent comp = getRecordComponent(fieldBinding.declaringClass, fieldBinding.name);
+ if (comp != null)
+ fieldDeclaration.annotations = ASTNode.getRelevantAnnotations(comp.annotations, rcMask, null);
}
Annotation[] annotations = fieldDeclaration.annotations;
if (annotations != null) {
@@ -587,35 +593,19 @@ public class ClassFile implements TypeConstants, TypeIds {
}
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
- List allTypeAnnotationContexts = new ArrayList();
+ List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
if (annotations != null && (fieldDeclaration.bits & ASTNode.HasTypeAnnotations) != 0) {
fieldDeclaration.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
}
- int invisibleTypeAnnotationsCounter = 0;
- int visibleTypeAnnotationsCounter = 0;
TypeReference fieldType = fieldDeclaration.type;
if (fieldType != null && ((fieldType.bits & ASTNode.HasTypeAnnotations) != 0)) {
fieldType.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
}
int size = allTypeAnnotationContexts.size();
- if (size != 0) {
- AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
- allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
- for (int i = 0, max = allTypeAnnotationContextsArray.length; i < max; i++) {
- AnnotationContext annotationContext = allTypeAnnotationContextsArray[i];
- if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
- invisibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- } else {
- visibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- }
- }
- attributesNumber += generateRuntimeTypeAnnotations(
- allTypeAnnotationContextsArray,
- visibleTypeAnnotationsCounter,
- invisibleTypeAnnotationsCounter);
- }
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ null,
+ (node) -> size > 0,
+ () -> allTypeAnnotationContexts);
}
} finally {
if (fieldDeclaration.isARecordComponent) {
@@ -629,15 +619,13 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return attributesNumber;
}
- private Annotation[] getAnnotationsFromAssociatedRecordComponent(ReferenceBinding declaringClass,
- char[] name, long rcMask) {
+ private RecordComponent getRecordComponent(ReferenceBinding declaringClass, char[] name) {
if (declaringClass instanceof SourceTypeBinding) {
SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) declaringClass;
RecordComponentBinding rcb = sourceTypeBinding.getRecordComponent(name);
if (rcb != null) {
RecordComponent recordComponent = rcb.sourceRecordComponent();
- assert recordComponent != null;
- return ASTNode.getRelevantAnnotations(recordComponent.annotations, rcMask, null);
+ return recordComponent;
}
}
return null;
@@ -658,35 +646,20 @@ public class ClassFile implements TypeConstants, TypeIds {
}
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
- List allTypeAnnotationContexts = new ArrayList();
+ List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
if (annotations != null && (recordComponent.bits & ASTNode.HasTypeAnnotations) != 0) {
recordComponent.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
}
- int invisibleTypeAnnotationsCounter = 0;
- int visibleTypeAnnotationsCounter = 0;
TypeReference recordComponentType = recordComponent.type;
if (recordComponentType != null && ((recordComponentType.bits & ASTNode.HasTypeAnnotations) != 0)) {
recordComponentType.getAllAnnotationContexts(AnnotationTargetTypeConstants.RECORD_COMPONENT, allTypeAnnotationContexts);
}
int size = allTypeAnnotationContexts.size();
- if (size != 0) {
- AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
- allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
- for (int i = 0, max = allTypeAnnotationContextsArray.length; i < max; i++) {
- AnnotationContext annotationContext = allTypeAnnotationContextsArray[i];
- if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
- invisibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- } else {
- visibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- }
- }
- attributesNumber += generateRuntimeTypeAnnotations(
- allTypeAnnotationContextsArray,
- visibleTypeAnnotationsCounter,
- invisibleTypeAnnotationsCounter);
- }
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ null,
+ (node) -> size > 0,
+ () -> allTypeAnnotationContexts);
+
}
}
if ((recordComponentBinding.tagBits & TagBits.HasMissingType) != 0) {
@@ -1717,9 +1690,7 @@ public class ClassFile implements TypeConstants, TypeIds {
public int generateTypeAnnotationsOnCodeAttribute() {
int attributesNumber = 0;
- List allTypeAnnotationContexts = ((TypeAnnotationCodeStream) this.codeStream).allTypeAnnotationContexts;
- int invisibleTypeAnnotationsCounter = 0;
- int visibleTypeAnnotationsCounter = 0;
+ List<AnnotationContext> allTypeAnnotationContexts = ((TypeAnnotationCodeStream) this.codeStream).allTypeAnnotationContexts;
for (int i = 0, max = this.codeStream.allLocalsCounter; i < max; i++) {
LocalVariableBinding localVariable = this.codeStream.locals[i];
@@ -1742,24 +1713,11 @@ public class ClassFile implements TypeConstants, TypeIds {
exceptionLabel.exceptionTypeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.EXCEPTION_PARAMETER, i, allTypeAnnotationContexts, exceptionLabel.se7Annotations);
}
}
-
int size = allTypeAnnotationContexts.size();
- if (size != 0) {
- AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
- allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
- for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
- AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
- if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
- invisibleTypeAnnotationsCounter++;
- } else {
- visibleTypeAnnotationsCounter++;
- }
- }
- attributesNumber += generateRuntimeTypeAnnotations(
- allTypeAnnotationContextsArray,
- visibleTypeAnnotationsCounter,
- invisibleTypeAnnotationsCounter);
- }
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ null,
+ (node) -> size > 0,
+ () -> allTypeAnnotationContexts);
return attributesNumber;
}
@@ -2399,7 +2357,7 @@ public class ClassFile implements TypeConstants, TypeIds {
((SourceTypeBinding) binding.declaringClass).scope);
}
- private void completeArgumentAnnotationInfo(Argument[] arguments, List allAnnotationContexts) {
+ private void completeArgumentAnnotationInfo(Argument[] arguments, List<AnnotationContext> allAnnotationContexts) {
for (int i = 0, max = arguments.length; i < max; i++) {
Argument argument = arguments[i];
if ((argument.bits & ASTNode.HasTypeAnnotations) != 0) {
@@ -2421,9 +2379,7 @@ public class ClassFile implements TypeConstants, TypeIds {
int attributesNumber) {
if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
- List allTypeAnnotationContexts = new ArrayList();
- int invisibleTypeAnnotationsCounter = 0;
- int visibleTypeAnnotationsCounter = 0;
+ List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
AbstractMethodDeclaration methodDeclaration = binding.sourceMethod();
if (methodDeclaration != null) {
if ((methodDeclaration.bits & ASTNode.HasTypeAnnotations) != 0) {
@@ -2471,22 +2427,10 @@ public class ClassFile implements TypeConstants, TypeIds {
}
}
int size = allTypeAnnotationContexts.size();
- if (size != 0) {
- AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
- allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
- for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
- AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
- if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
- invisibleTypeAnnotationsCounter++;
- } else {
- visibleTypeAnnotationsCounter++;
- }
- }
- attributesNumber += generateRuntimeTypeAnnotations(
- allTypeAnnotationContextsArray,
- visibleTypeAnnotationsCounter,
- invisibleTypeAnnotationsCounter);
- }
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ null,
+ (node) -> size > 0,
+ () -> allTypeAnnotationContexts);
}
if ((this.produceAttributes & ClassFileConstants.ATTR_METHOD_PARAMETERS) != 0) {
attributesNumber += generateMethodParameters(binding);
@@ -2919,6 +2863,38 @@ public class ClassFile implements TypeConstants, TypeIds {
nAttrs += generateNestHostAttribute();
return nAttrs;
}
+ private int generatePermittedTypeAttributes() {
+ SourceTypeBinding type = this.referenceBinding;
+ int localContentsOffset = this.contentsOffset;
+ ReferenceBinding[] permittedTypes = type.permittedTypes();
+ int l = permittedTypes != null ? permittedTypes.length : 0;
+ if (l == 0)
+ return 0;
+
+ int exSize = 8 + 2 * l;
+ if (exSize + localContentsOffset >= this.contents.length) {
+ resizeContents(exSize);
+ }
+ int attributeNameIndex =
+ this.constantPool.literalIndex(AttributeNamesConstants.PermittedSubclasses);
+ this.contents[localContentsOffset++] = (byte) (attributeNameIndex >> 8);
+ this.contents[localContentsOffset++] = (byte) attributeNameIndex;
+ int value = (l << 1) + 2;
+ this.contents[localContentsOffset++] = (byte) (value >> 24);
+ this.contents[localContentsOffset++] = (byte) (value >> 16);
+ this.contents[localContentsOffset++] = (byte) (value >> 8);
+ this.contents[localContentsOffset++] = (byte) value;
+ this.contents[localContentsOffset++] = (byte) (l >> 8);
+ this.contents[localContentsOffset++] = (byte) l;
+
+ for (int i = 0; i < l; i++) {
+ int permittedTypeIndex = this.constantPool.literalIndexForType(permittedTypes[i]);
+ this.contents[localContentsOffset++] = (byte) (permittedTypeIndex >> 8);
+ this.contents[localContentsOffset++] = (byte) permittedTypeIndex;
+ }
+ this.contentsOffset = localContentsOffset;
+ return 1;
+ }
private int generateRecordAttributes() {
SourceTypeBinding record = this.referenceBinding;
if (record == null || !record.isRecord())
@@ -4134,11 +4110,24 @@ public class ClassFile implements TypeConstants, TypeIds {
assert methodDeclaration == null;
long rcMask = TagBits.AnnotationForMethod | TagBits.AnnotationForTypeUse;
// record component (field) accessor method
- Annotation[] annotations = getAnnotationsFromAssociatedRecordComponent(methodBinding.declaringClass,
- methodBinding.selector, rcMask);
- if (annotations != null) {
- assert !methodBinding.isConstructor();
- attributesNumber += generateRuntimeAnnotations(annotations, rcMask);
+ ReferenceBinding declaringClass = methodBinding.declaringClass;
+ RecordComponent comp = getRecordComponent(declaringClass, methodBinding.selector);
+ if (comp != null) {
+ Annotation[] annotations = ASTNode.getRelevantAnnotations(comp.annotations, rcMask, null);
+ if (annotations != null) {
+ assert !methodBinding.isConstructor();
+ attributesNumber += generateRuntimeAnnotations(annotations, TagBits.AnnotationForMethod);
+ // Now type annotations
+ Supplier<List<AnnotationContext>> collector = () -> {
+ List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
+ comp.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
+ return allTypeAnnotationContexts;
+ };
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ comp,
+ (node) -> (comp.bits & ASTNode.HasTypeAnnotations) != 0,
+ collector);
+ }
}
}
}
@@ -4179,6 +4168,33 @@ public class ClassFile implements TypeConstants, TypeIds {
}
return attributesNumber;
}
+ private int completeRuntimeTypeAnnotations(int attributesNumber,
+ ASTNode node,
+ Predicate<ASTNode> condition,
+ Supplier<List<AnnotationContext>> supplier) {
+ int invisibleTypeAnnotationsCounter = 0;
+ int visibleTypeAnnotationsCounter = 0;
+ if (condition.test(node)) {
+ List<AnnotationContext> allTypeAnnotationContexts = supplier.get();
+ if (allTypeAnnotationContexts.size() > 0) {
+ AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[allTypeAnnotationContexts.size()];
+ allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
+ for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
+ AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
+ if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
+ invisibleTypeAnnotationsCounter++;
+ } else {
+ visibleTypeAnnotationsCounter++;
+ }
+ }
+ attributesNumber += generateRuntimeTypeAnnotations(
+ allTypeAnnotationContextsArray,
+ visibleTypeAnnotationsCounter,
+ invisibleTypeAnnotationsCounter);
+ }
+ }
+ return attributesNumber;
+ }
private void propagateRecordComponentArguments(AbstractMethodDeclaration methodDeclaration) {
if ((methodDeclaration.bits & (ASTNode.IsCanonicalConstructor | ASTNode.IsImplicit)) == 0)
return;
@@ -4354,12 +4370,10 @@ public class ClassFile implements TypeConstants, TypeIds {
int[] missingTypesIndexes = new int[initialSize];
int numberOfMissingTypes = 0;
if (initialSize > 1) {
- Collections.sort(this.missingTypes, new Comparator() {
+ Collections.sort(this.missingTypes, new Comparator<TypeBinding>() {
@Override
- public int compare(Object o1, Object o2) {
- TypeBinding typeBinding1 = (TypeBinding) o1;
- TypeBinding typeBinding2 = (TypeBinding) o2;
- return CharOperation.compareTo(typeBinding1.constantPoolName(), typeBinding2.constantPoolName());
+ public int compare(TypeBinding o1, TypeBinding o2) {
+ return CharOperation.compareTo(o1.constantPoolName(), o2.constantPoolName());
}
});
}
@@ -4963,8 +4977,8 @@ public class ClassFile implements TypeConstants, TypeIds {
StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream;
stackMapFrameCodeStream.removeFramePosition(code_length);
if (stackMapFrameCodeStream.hasFramePositions()) {
- Map frames = new HashMap();
- List realFrames = traverse(isClinit ? null : methodBinding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, isClinit, scope);
+ Map<Integer, StackMapFrame> frames = new HashMap<>();
+ List<StackMapFrame> realFrames = traverse(isClinit ? null : methodBinding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, isClinit, scope);
int numberOfFrames = realFrames.size();
if (numberOfFrames > 1) {
int stackMapTableAttributeOffset = localContentsOffset;
@@ -4988,10 +5002,10 @@ public class ClassFile implements TypeConstants, TypeIds {
if (localContentsOffset + 2 >= this.contents.length) {
resizeContents(2);
}
- StackMapFrame currentFrame = (StackMapFrame) realFrames.get(0);
+ StackMapFrame currentFrame = realFrames.get(0);
for (int j = 1; j < numberOfFrames; j++) {
// select next frame
- currentFrame = (StackMapFrame) realFrames.get(j);
+ currentFrame = realFrames.get(j);
// generate current frame
// need to find differences between the current frame and the previous frame
int frameOffset = currentFrame.pc;
@@ -5141,8 +5155,8 @@ public class ClassFile implements TypeConstants, TypeIds {
StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream;
stackMapFrameCodeStream.removeFramePosition(code_length);
if (stackMapFrameCodeStream.hasFramePositions()) {
- Map frames = new HashMap();
- List realFrames = traverse(isClinit ? null: methodBinding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, isClinit, scope);
+ Map<Integer, StackMapFrame> frames = new HashMap<>();
+ List<StackMapFrame> realFrames = traverse(isClinit ? null: methodBinding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, isClinit, scope);
int numberOfFrames = realFrames.size();
if (numberOfFrames > 1) {
int stackMapTableAttributeOffset = localContentsOffset;
@@ -5166,12 +5180,12 @@ public class ClassFile implements TypeConstants, TypeIds {
if (localContentsOffset + 2 >= this.contents.length) {
resizeContents(2);
}
- StackMapFrame currentFrame = (StackMapFrame) realFrames.get(0);
+ StackMapFrame currentFrame = realFrames.get(0);
StackMapFrame prevFrame = null;
for (int j = 1; j < numberOfFrames; j++) {
// select next frame
prevFrame = currentFrame;
- currentFrame = (StackMapFrame) realFrames.get(j);
+ currentFrame = realFrames.get(j);
// generate current frame
// need to find differences between the current frame and the previous frame
int offsetDelta = currentFrame.getOffsetDelta(prevFrame);
@@ -5532,10 +5546,8 @@ public class ClassFile implements TypeConstants, TypeIds {
return 0;
}
int attributesNumber = 0;
- int visibleTypeAnnotationsCounter = 0;
- int invisibleTypeAnnotationsCounter = 0;
TypeReference superclass = typeDeclaration.superclass;
- List allTypeAnnotationContexts = new ArrayList();
+ List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
if (superclass != null && (superclass.bits & ASTNode.HasTypeAnnotations) != 0) {
superclass.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, -1, allTypeAnnotationContexts);
}
@@ -5549,6 +5561,7 @@ public class ClassFile implements TypeConstants, TypeIds {
superInterface.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, i, allTypeAnnotationContexts);
}
}
+ // TODO: permittedTypes codegen
TypeParameter[] typeParameters = typeDeclaration.typeParameters;
if (typeParameters != null) {
for (int i = 0, max = typeParameters.length; i < max; i++) {
@@ -5559,24 +5572,10 @@ public class ClassFile implements TypeConstants, TypeIds {
}
}
int size = allTypeAnnotationContexts.size();
- if (size != 0) {
- AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
- allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
- for (int j = 0, max = allTypeAnnotationContextsArray.length; j < max; j++) {
- AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
- if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
- invisibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- } else {
- visibleTypeAnnotationsCounter++;
- allTypeAnnotationContexts.add(annotationContext);
- }
- }
- attributesNumber += generateRuntimeTypeAnnotations(
- allTypeAnnotationContextsArray,
- visibleTypeAnnotationsCounter,
- invisibleTypeAnnotationsCounter);
- }
+ attributesNumber = completeRuntimeTypeAnnotations(attributesNumber,
+ null,
+ (node) -> size > 0,
+ () -> allTypeAnnotationContexts);
return attributesNumber;
}
@@ -6017,7 +6016,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
public void recordInnerClasses(TypeBinding binding, boolean onBottomForBug445231) {
if (this.innerClassesBindings == null) {
- this.innerClassesBindings = new HashMap(INNER_CLASSES_SIZE);
+ this.innerClassesBindings = new HashMap<>(INNER_CLASSES_SIZE);
}
ReferenceBinding innerClass = (ReferenceBinding) binding;
this.innerClassesBindings.put(innerClass.erasure().unannotated(), onBottomForBug445231); // should not emit yet another inner class for Outer.@Inner Inner.
@@ -6031,7 +6030,7 @@ public class ClassFile implements TypeConstants, TypeIds {
public int recordBootstrapMethod(FunctionalExpression expression) {
if (this.bootstrapMethods == null) {
- this.bootstrapMethods = new ArrayList();
+ this.bootstrapMethods = new ArrayList<>();
}
if (expression instanceof ReferenceExpression) {
for (int i = 0; i < this.bootstrapMethods.size(); i++) {
@@ -6160,23 +6159,21 @@ public class ClassFile implements TypeConstants, TypeIds {
this.contentsOffset += 2;
}
- private List filterFakeFrames(Set realJumpTargets, Map frames, int codeLength) {
+ private List<StackMapFrame> filterFakeFrames(Set<Integer> realJumpTargets, Map<Integer, StackMapFrame> frames, int codeLength) {
// no more frame to generate
// filter out "fake" frames
realJumpTargets.remove(Integer.valueOf(codeLength));
- List result = new ArrayList();
- for (Iterator iterator = realJumpTargets.iterator(); iterator.hasNext(); ) {
- Integer jumpTarget = (Integer) iterator.next();
- StackMapFrame frame = (StackMapFrame) frames.get(jumpTarget);
+ List<StackMapFrame> result = new ArrayList<>();
+ for (Iterator<Integer> iterator = realJumpTargets.iterator(); iterator.hasNext(); ) {
+ Integer jumpTarget = iterator.next();
+ StackMapFrame frame = frames.get(jumpTarget);
if (frame != null) {
result.add(frame);
}
}
- Collections.sort(result, new Comparator() {
+ Collections.sort(result, new Comparator<StackMapFrame>() {
@Override
- public int compare(Object o1, Object o2) {
- StackMapFrame frame = (StackMapFrame) o1;
- StackMapFrame frame2 = (StackMapFrame) o2;
+ public int compare(StackMapFrame frame, StackMapFrame frame2) {
return frame.pc - frame2.pc;
}
});
@@ -6397,7 +6394,7 @@ public class ClassFile implements TypeConstants, TypeIds {
}
}
- public List traverse(
+ public List<StackMapFrame> traverse(
MethodBinding methodBinding,
int maxLocals,
byte[] bytecodes,
@@ -6406,7 +6403,7 @@ public class ClassFile implements TypeConstants, TypeIds {
Map<Integer, StackMapFrame> frames,
boolean isClinit,
Scope scope) {
- Set realJumpTarget = new HashSet();
+ Set<Integer> realJumpTarget = new HashSet<>();
StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream;
int[] framePositions = stackMapFrameCodeStream.getFramePositions();
@@ -7481,11 +7478,11 @@ public class ClassFile implements TypeConstants, TypeIds {
return dimensions;
}
- private void addRealJumpTarget(Set realJumpTarget, int pc) {
+ private void addRealJumpTarget(Set<Integer> realJumpTarget, int pc) {
realJumpTarget.add(Integer.valueOf(pc));
}
- private void addRealJumpTarget(Set realJumpTarget, int pc, Map frames, StackMapFrame frame, Scope scope) {
+ private void addRealJumpTarget(Set<Integer> realJumpTarget, int pc, Map<Integer, StackMapFrame> frames, StackMapFrame frame, Scope scope) {
realJumpTarget.add(Integer.valueOf(pc));
add(frames, frame, scope);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java
index 422cc4420f..478d32d408 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java
@@ -272,7 +272,21 @@ public class AND_AND_Expression extends BinaryExpression {
codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.mergedInitStateIndex);
}
}
+ @Override
+ public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.left.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+
+ variables = this.left.getPatternVariablesWhenTrue();
+ this.addPatternVariablesWhenTrue(variables);
+ this.right.addPatternVariablesWhenTrue(variables);
+ variables = this.left.getPatternVariablesWhenFalse();
+ this.right.addPatternVariablesWhenFalse(variables);
+
+ this.right.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+ variables = this.right.getPatternVariablesWhenTrue();
+ this.addPatternVariablesWhenTrue(variables);
+ }
@Override
public boolean isCompactableOperation() {
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 35f1d8a40b..5db2554a15 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -176,8 +176,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
public static final int GenerateCheckcast = Bit7;
public static final int UnsafeCast = Bit8;
- // for name references (Java 14 addition - Records preview - Bit18)
- public static final int RestrictiveFlagMASK = Bit1 | Bit2 | Bit3 | Bit18 ;
+ public static final int RestrictiveFlagMASK = Bit1 | Bit2 | Bit3 ;
// for local decls
public static final int IsTypeElided = Bit2; // type elided lambda argument.
@@ -676,6 +675,10 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
output.append("abstract "); //$NON-NLS-1$
if ((modifiers & ExtraCompilerModifiers.AccDefaultMethod) != 0)
output.append("default "); //$NON-NLS-1$
+ if ((modifiers & ExtraCompilerModifiers.AccNonSealed) != 0)
+ output.append("non-sealed "); //$NON-NLS-1$
+ if ((modifiers & ExtraCompilerModifiers.AccSealed) != 0)
+ output.append("sealed "); //$NON-NLS-1$
return output;
}
@@ -1239,7 +1242,6 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
// TODO: Null Analysis Address via bug 562478?
- recipientTargetMask |= TagBits.AnnotationForTypeUse;
List<AnnotationBinding> relevantAnnotations = new ArrayList<>();
Annotation[] filteredAnnotations = ASTNode.getRelevantAnnotations(annotations, recipientTargetMask, relevantAnnotations);
AnnotationBinding [] recipientAnnotations = relevantAnnotations.toArray(new AnnotationBinding[relevantAnnotations.size()]);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 9963153f79..55d41fd830 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -240,9 +240,6 @@ public abstract class AbstractMethodDeclaration
}
}
}
- if (methodArguments[i].duplicateCheckObligation != null) {
- methodArguments[i].duplicateCheckObligation.accept(flowInfo);
- }
// tag parameters as being set:
flowInfo.markAsDefinitelyAssigned(methodArguments[i].binding);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
index 2a00cbc764..68c36417b2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -80,9 +80,13 @@ public class Argument extends LocalDeclaration {
if ((this.binding.tagBits & TagBits.AnnotationResolved) == 0) {
Annotation[] annots = this.annotations;
long sourceLevel = scope.compilerOptions().sourceLevel;
- if (sourceLevel >= ClassFileConstants.JDK14 && annots == null)
+ if (sourceLevel >= ClassFileConstants.JDK14 && annots == null) {
annots = getCorrespondingRecordComponentAnnotationsIfApplicable(scope.referenceMethod());
- resolveAnnotations(scope, annots, this.binding, true);
+ annots = ASTNode.copyRecordComponentAnnotations(scope,
+ this.binding, annots);
+ }
+ if (annots != null)
+ resolveAnnotations(scope, annots, this.binding, true);
if (sourceLevel >= ClassFileConstants.JDK1_8) {
Annotation.isTypeUseCompatible(this.type, scope, annots);
scope.validateNullAnnotation(this.binding.tagBits, this.type, annots);
@@ -100,11 +104,13 @@ public class Argument extends LocalDeclaration {
ReferenceBinding referenceBinding = methodBinding== null ? null : methodBinding.declaringClass;
if (referenceBinding instanceof SourceTypeBinding) {
SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) referenceBinding;
- assert (sourceTypeBinding.isRecord());
+ assert (sourceTypeBinding.isRecord()); // CHECK: Is this really necessary?
sourceTypeBinding.components();
RecordComponentBinding recordComponentBinding = sourceTypeBinding.getRecordComponent(this.name);
- RecordComponent recordComponent = recordComponentBinding.sourceRecordComponent();
- return recordComponent.annotations;
+ if (recordComponentBinding != null) {
+ RecordComponent recordComponent = recordComponentBinding.sourceRecordComponent();
+ return recordComponent.annotations;
+ }
}
}
return null;
@@ -118,15 +124,7 @@ public class Argument extends LocalDeclaration {
final boolean localExists = existingVariable instanceof LocalVariableBinding;
if (localExists && this.hiddenVariableDepth == 0) {
if ((this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) {
- if ((((LocalVariableBinding) existingVariable).modifiers & ExtraCompilerModifiers.AccPatternVariable) != 0) {
- this.duplicateCheckObligation = (flowInfo) -> {
- if (flowInfo.isDefinitelyAssigned((LocalVariableBinding) existingVariable)) {
- scope.problemReporter().lambdaRedeclaresArgument(this);
- }
- };
- } else {
- scope.problemReporter().lambdaRedeclaresArgument(this);
- }
+ scope.problemReporter().lambdaRedeclaresArgument(this);
} else if (scope.referenceContext instanceof CompactConstructorDeclaration) {
// skip error reporting - hidden params - already reported in record components
} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
index 1ad2696207..5c5b8bdaaf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -31,7 +31,6 @@ import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
-@SuppressWarnings({"rawtypes"})
public class ArrayAllocationExpression extends Expression {
public TypeReference type;
@@ -230,7 +229,7 @@ public class ArrayAllocationExpression extends Expression {
visitor.endVisit(this, scope);
}
- public void getAllAnnotationContexts(int targetType, int info, List allTypeAnnotationContexts) {
+ public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allTypeAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allTypeAnnotationContexts);
this.type.traverse(collector, (BlockScope) null);
if (this.annotationsOnDimensions != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
index 6736fcdca0..12dde6fd9a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java
@@ -1821,9 +1821,26 @@ public boolean containsPatternVariable() {
return this.left.containsPatternVariable() || this.right.containsPatternVariable();
}
@Override
+public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.addPatternVariablesWhenTrue(variables);
+ this.left.addPatternVariablesWhenTrue(this.patternVarsWhenTrue);
+ this.right.addPatternVariablesWhenTrue(this.patternVarsWhenTrue);
+ this.left.addPatternVariablesWhenFalse(this.patternVarsWhenFalse);
+ this.right.addPatternVariablesWhenFalse(this.patternVarsWhenFalse);
+ this.left.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+ this.right.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+}
+@Override
public TypeBinding resolveType(BlockScope scope) {
// keep implementation in sync with CombinedBinaryExpression#resolveType
// and nonRecursiveResolveTypeUpwards
+ if(this.patternVarsWhenFalse == null && this.patternVarsWhenTrue == null &&
+ this.containsPatternVariable()) {
+ // the null check is to guard against a second round of collection.
+ // This usually doesn't happen,
+ // except when we call collectPatternVariablesToScope() from here
+ this.collectPatternVariablesToScope(null, scope);
+ }
boolean leftIsCast, rightIsCast;
if ((leftIsCast = this.left instanceof CastExpression) == true) this.left.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
TypeBinding leftType = this.left.resolveType(scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
index 88fa4f59fc..d91dea4afc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompactConstructorDeclaration.java
@@ -12,9 +12,14 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
+import org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext;
+import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.parser.Parser;
@@ -31,39 +36,58 @@ public class CompactConstructorDeclaration extends ConstructorDeclaration {
this.containsSwitchWithTry = parser.switchWithTry;
}
@Override
- protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo flowInfo, FieldBinding field) {
- if (field.isStatic() ||
- flowInfo.isDefinitelyAssigned(field) || flowInfo.isPotentiallyAssigned(field))
+ public void analyseCode(ClassScope classScope, InitializationFlowContext initializerFlowContext, FlowInfo flowInfo, int initialReachMode) {
+ try {
+ this.scope.isCompactConstructorScope = true;
+ super.analyseCode(classScope, initializerFlowContext, flowInfo, initialReachMode);
+ } finally {
+ this.scope.isCompactConstructorScope = false;
+ }
+ }
+ @Override
+ protected void doFieldReachAnalysis(FlowInfo flowInfo, FieldBinding[] fields) {
+ // do nothing
+ }
+ @Override
+ protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo flowInfo, FieldBinding[] fields) {
+ this.scope.isCompactConstructorScope = false;
+ if (fields == null)
return;
- assert field.isFinal();
- /* JLS 14 8.10.5 Compact Record Constructor Declarations
- * In addition, at the end of the body of the compact constructor, all the fields
- * corresponding to the record components of R that are definitely unassigned
- * (16 (Definite Assignment)) are implicitly initialized to the value of the
- * corresponding formal parameter. These fields are implicitly initialized in the
- * order that they are declared in the record component list.
+ /* JLS 15 Record addendum Sec 8.10.4 All fields corresponding to the record components of the
+ * record class are implicitly initialized to the value of the corresponding formal
+ * parameter after the body of the compact constructor.
+ * These fields are implicitly initialized in the order that they are declared
+ * in the record component list.
*/
- FieldReference lhs = new FieldReference(field.name,0);
- lhs.receiver = new ThisReference(0, 0);
- //TODO: Check whether anything has to be done for null analysis.
- Assignment assignment = new Assignment(lhs, new SingleNameReference(field.name, 0), 0);
- assignment.resolveType(this.scope);
- assignment.analyseCode(this.scope, flowContext, flowInfo);
- assignment.bits |= ASTNode.IsImplicit;
- assert flowInfo.isDefinitelyAssigned(field);
- Statement[] stmts = this.statements;
+ List<Statement> fieldAssignments = new ArrayList<>();
+ for (FieldBinding field : fields) {
+ if (field.isStatic())
+ continue;
+ assert field.isFinal();
+
+ FieldReference lhs = new FieldReference(field.name,0);
+ lhs.receiver = new ThisReference(0, 0);
+ //TODO: Check whether anything has to be done for null analysis.
+ Assignment assignment = new Assignment(lhs, new SingleNameReference(field.name, 0), 0);
+ assignment.resolveType(this.scope);
+ assignment.analyseCode(this.scope, flowContext, flowInfo);
+ assignment.bits |= ASTNode.IsImplicit;
+ assert flowInfo.isDefinitelyAssigned(field);
+ fieldAssignments.add(assignment);
+ }
+ if (fieldAssignments.isEmpty())
+ return;
+
+ Statement[] fa = fieldAssignments.toArray(new Statement[0]);
if (this.statements == null) {
- this.statements = new Statement[] { assignment };
- } else {
- int len = this.statements.length;
- System.arraycopy(
- this.statements,
- 0,
- stmts = new Statement[len + 1],
- 0,
- len);
- stmts[len] = assignment;
- this.statements = stmts;
+ this.statements = fa;
+ return;
}
+ int len = this.statements.length;
+ int fLen = fa.length;
+ Statement[] stmts = new Statement[len + fLen];
+ System.arraycopy(this.statements, 0, stmts, 0, len);
+ System.arraycopy(fa, 0, stmts, len, fLen);
+ this.statements = stmts;
}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index 1685e69a74..1ce669c2ab 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -453,7 +453,20 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.valueIfTrue.addPatternVariables(scope, codeStream);
this.valueIfFalse.addPatternVariables(scope, codeStream);
}
-
+ @Override
+ public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.condition.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+
+ variables = this.condition.getPatternVariablesWhenTrue();
+ this.valueIfTrue.addPatternVariablesWhenTrue(variables);
+ this.valueIfFalse.addPatternVariablesWhenFalse(variables);
+ this.valueIfTrue.collectPatternVariablesToScope(variables, scope);
+
+ variables = this.condition.getPatternVariablesWhenFalse();
+ this.valueIfTrue.addPatternVariablesWhenFalse(variables);
+ this.valueIfFalse.addPatternVariablesWhenTrue(variables);
+ this.valueIfFalse.collectPatternVariablesToScope(variables, scope);
+ }
@Override
public TypeBinding resolveType(BlockScope scope) {
// JLS3 15.25
@@ -470,7 +483,9 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
this.valueIfFalse.setExpectedType(this.expectedType);
}
}
-
+ if (this.condition.containsPatternVariable()) {
+ collectPatternVariablesToScope(null, scope);
+ }
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
TypeBinding conditionType = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
index af3344f5da..e03607f2f0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
@@ -104,7 +104,8 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
// otherwise default super constructor exists, so go ahead and complain unused.
}
// complain unused
- this.scope.problemReporter().unusedPrivateConstructor(this);
+ if ((this.bits & ASTNode.IsImplicit) == 0)
+ this.scope.problemReporter().unusedPrivateConstructor(this);
}
// check constructor recursion, once all constructor got resolved
@@ -203,27 +204,8 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
&& (this.constructorCall.accessMode != ExplicitConstructorCall.This)) {
flowInfo = flowInfo.mergedWith(constructorContext.initsOnReturn);
FieldBinding[] fields = this.binding.declaringClass.fields();
- for (int i = 0, count = fields.length; i < count; i++) {
- FieldBinding field = fields[i];
- checkAndGenerateFieldAssignment(initializerFlowContext, flowInfo, field);
- if (!field.isStatic() && !flowInfo.isDefinitelyAssigned(field)) {
- if (field.isFinal()) {
- this.scope.problemReporter().uninitializedBlankFinalField(
- field,
- ((this.bits & ASTNode.IsDefaultConstructor) != 0)
- ? (ASTNode) this.scope.referenceType().declarationOf(field.original())
- : this);
- } else if (field.isNonNull() || field.type.isFreeTypeVariable()) {
- FieldDeclaration fieldDecl = this.scope.referenceType().declarationOf(field.original());
- if (!isValueProvidedUsingAnnotation(fieldDecl))
- this.scope.problemReporter().uninitializedNonNullField(
- field,
- ((this.bits & ASTNode.IsDefaultConstructor) != 0)
- ? (ASTNode) fieldDecl
- : this);
- }
- }
- }
+ checkAndGenerateFieldAssignment(initializerFlowContext, flowInfo, fields);
+ doFieldReachAnalysis(flowInfo, fields);
}
// check unreachable catch blocks
constructorContext.complainIfUnusedExceptionHandlers(this);
@@ -234,8 +216,30 @@ public void analyseCode(ClassScope classScope, InitializationFlowContext initial
this.ignoreFurtherInvestigation = true;
}
}
+protected void doFieldReachAnalysis(FlowInfo flowInfo, FieldBinding[] fields) {
+ for (int i = 0, count = fields.length; i < count; i++) {
+ FieldBinding field = fields[i];
+ if (!field.isStatic() && !flowInfo.isDefinitelyAssigned(field)) {
+ if (field.isFinal()) {
+ this.scope.problemReporter().uninitializedBlankFinalField(
+ field,
+ ((this.bits & ASTNode.IsDefaultConstructor) != 0)
+ ? (ASTNode) this.scope.referenceType().declarationOf(field.original())
+ : this);
+ } else if (field.isNonNull() || field.type.isFreeTypeVariable()) {
+ FieldDeclaration fieldDecl = this.scope.referenceType().declarationOf(field.original());
+ if (!isValueProvidedUsingAnnotation(fieldDecl))
+ this.scope.problemReporter().uninitializedNonNullField(
+ field,
+ ((this.bits & ASTNode.IsDefaultConstructor) != 0)
+ ? (ASTNode) fieldDecl
+ : this);
+ }
+ }
+ }
+}
-protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo flowInfo, FieldBinding field) {
+protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo flowInfo, FieldBinding[] fields) {
return;
}
boolean isValueProvidedUsingAnnotation(FieldDeclaration fieldDecl) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
index 3c13922f01..35d30676e2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -227,10 +227,22 @@ public StringBuffer printStatement(int indent, StringBuffer output) {
@Override
public void resolve(BlockScope scope) {
- TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
- this.condition.computeConversion(scope, type, type);
- if (this.action != null)
- this.action.resolve(scope);
+ if (this.condition.containsPatternVariable()) {
+ this.condition.collectPatternVariablesToScope(null, scope);
+ LocalVariableBinding[] patternVariablesInFalseScope = this.condition.getPatternVariablesWhenFalse();
+ TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
+ this.condition.computeConversion(scope, type, type);
+ if (this.action != null) {
+ this.action.resolve(scope);
+ this.action.injectPatternVariablesIfApplicable(patternVariablesInFalseScope, scope,
+ (statement) -> { return !statement.breaksOut(null);});
+ }
+ } else {
+ TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
+ this.condition.computeConversion(scope, type, type);
+ if (this.action != null)
+ this.action.resolve(scope);
+ }
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 0192774c46..64971275ee 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -791,6 +791,37 @@ public void addPatternVariables(BlockScope scope, CodeStream codeStream) {
public boolean containsPatternVariable() {
return false;
}
+public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ new ASTVisitor() {
+ LocalVariableBinding[] patternVariablesInScope;
+ @Override
+ public boolean visit(Argument argument, BlockScope skope) {
+ // Most likely to be a lambda parameter
+ argument.addPatternVariablesWhenTrue(this.patternVariablesInScope);
+ return true;
+ }
+ @Override
+ public boolean visit(
+ QualifiedNameReference nameReference,
+ BlockScope skope) {
+ nameReference.addPatternVariablesWhenTrue(this.patternVariablesInScope);
+ return true;
+ }
+ @Override
+ public boolean visit(
+ SingleNameReference nameReference,
+ BlockScope skope) {
+ nameReference.addPatternVariablesWhenTrue(this.patternVariablesInScope);
+ return true;
+ }
+
+ public void propagatePatternVariablesInScope(LocalVariableBinding[] vars, BlockScope skope) {
+ this.patternVariablesInScope = vars;
+ Expression.this.traverse(this, skope);
+ }
+ }.propagatePatternVariablesInScope(variables, scope);
+}
+
/**
* Default generation of a boolean value
* @param currentScope
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index 94e6096079..57f022a973 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -39,7 +39,6 @@ import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.eclipse.jdt.internal.compiler.util.Util;
-@SuppressWarnings("rawtypes")
public class FieldDeclaration extends AbstractVariableDeclaration {
public FieldBinding binding;
@@ -154,7 +153,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
// }
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+public void getAllAnnotationContexts(int targetType, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this.type, targetType, allAnnotationContexts);
for (int i = 0, max = this.annotations.length; i < max; i++) {
Annotation annotation = this.annotations[i];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
index e5113e716b..3fa15be439 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
@@ -114,7 +114,8 @@ public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowConte
&& this.receiver.isThis()
&& !(this.receiver instanceof QualifiedThisReference)
&& ((this.receiver.bits & ASTNode.ParenthesizedMASK) == 0) // (this).x is forbidden
- && currentScope.allowBlankFinalFieldAssignment(this.binding)) {
+ && currentScope.allowBlankFinalFieldAssignment(this.binding)
+ && !currentScope.methodScope().isCompactConstructorScope) {
if (flowInfo.isPotentiallyAssigned(this.binding)) {
currentScope.problemReporter().duplicateInitializationOfBlankFinalField(
this.binding,
@@ -124,8 +125,11 @@ public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowConte
}
flowInfo.markAsDefinitelyAssigned(this.binding);
} else {
+ if (currentScope.methodScope().isCompactConstructorScope)
+ currentScope.problemReporter().recordIllegalExplicitFinalFieldAssignInCompactConstructor(this.binding, this);
+ else
// assigning a final field outside an initializer or constructor or wrong reference
- currentScope.problemReporter().cannotAssignToFinalField(this.binding, this);
+ currentScope.problemReporter().cannotAssignToFinalField(this.binding, this);
}
} else if (this.binding.isNonNull() || this.binding.type.isTypeVariable()) {
// in a context where it can be assigned?
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
index 8e059b8dc3..5f9c904633 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
@@ -21,10 +21,16 @@ package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.eclipse.jdt.internal.compiler.codegen.*;
-import org.eclipse.jdt.internal.compiler.flow.*;
+import org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
+import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
+import org.eclipse.jdt.internal.compiler.flow.FlowContext;
+import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
+import org.eclipse.jdt.internal.compiler.flow.LoopingFlowContext;
+import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
import org.eclipse.jdt.internal.compiler.impl.Constant;
-import org.eclipse.jdt.internal.compiler.lookup.*;
+import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public class ForStatement extends Statement {
@@ -244,7 +250,6 @@ public class ForStatement extends Statement {
this.condition.updateFlowOnBooleanResult(mergedInfo, false);
return mergedInfo;
}
-
/**
* For statement code generation
*
@@ -403,16 +408,13 @@ public class ForStatement extends Statement {
@Override
public void resolve(BlockScope upperScope) {
+ LocalVariableBinding[] patternVariablesInTrueScope = null;
+ LocalVariableBinding[] patternVariablesInFalseScope = null;
+
if (this.condition != null && this.condition.containsPatternVariable()) {
- this.condition.traverse(new ASTVisitor() {
- @Override
- public boolean visit(
- InstanceOfExpression instanceOfExpression,
- BlockScope sc) {
- instanceOfExpression.resolvePatternVariable(upperScope);
- return true; // We want to resolve all pattern variables if any inside the condition
- }
- }, upperScope);
+ this.condition.collectPatternVariablesToScope(null, upperScope);
+ patternVariablesInTrueScope = this.condition.getPatternVariablesWhenTrue();
+ patternVariablesInFalseScope = this.condition.getPatternVariablesWhenFalse();
}
// use the scope that will hold the init declarations
this.scope = (this.bits & ASTNode.NeededScope) != 0 ? new BlockScope(upperScope) : upperScope;
@@ -424,10 +426,15 @@ public class ForStatement extends Statement {
this.condition.computeConversion(this.scope, type, type);
}
if (this.increments != null)
- for (int i = 0, length = this.increments.length; i < length; i++)
- this.increments[i].resolve(this.scope);
- if (this.action != null)
- this.action.resolve(this.scope);
+ for (int i = 0, length = this.increments.length; i < length; i++) {
+ this.increments[i].resolveWithPatternVariablesInScope(patternVariablesInTrueScope, this.scope);
+ }
+
+ if (this.action != null) {
+ this.action.resolveWithPatternVariablesInScope(patternVariablesInTrueScope, this.scope);
+ this.action.injectPatternVariablesIfApplicable(patternVariablesInFalseScope, this.scope,
+ (statement) -> { return !statement.breaksOut(null);});
+ }
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
index 1cb95e1394..f569e37a3b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
@@ -158,7 +158,6 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
flowContext.conditionalLevel--;
return mergedInfo;
}
-
/**
* If code generation
*
@@ -217,7 +216,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) {
// May loose some local variable initializations : affecting the local variable attributes
if (this.elseInitStateIndex != -1) {
codeStream.removeNotDefinitelyAssignedVariables(
- currentScope,
+ currentScope,
this.elseInitStateIndex);
codeStream.addDefinitelyAssignedVariables(currentScope, this.elseInitStateIndex);
}
@@ -276,8 +275,7 @@ public StringBuffer printStatement(int indent, StringBuffer output) {
}
return output;
}
-@Override
-public void resolve(BlockScope scope) {
+private void resolveIfStatement(BlockScope scope) {
TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
this.condition.computeConversion(scope, type, type);
if (this.thenStatement != null)
@@ -285,6 +283,31 @@ public void resolve(BlockScope scope) {
if (this.elseStatement != null)
this.elseStatement.resolve(scope);
}
+@Override
+public void resolve(BlockScope scope) {
+ if (this.condition.containsPatternVariable()) {
+ this.condition.collectPatternVariablesToScope(null, scope);
+ LocalVariableBinding[] patternVariablesInTrueScope = this.condition.getPatternVariablesWhenTrue();
+ LocalVariableBinding[] patternVariablesInFalseScope = this.condition.getPatternVariablesWhenFalse();
+ TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
+ this.condition.computeConversion(scope, type, type);
+
+ if (this.thenStatement != null) {
+ this.thenStatement.resolveWithPatternVariablesInScope(patternVariablesInTrueScope, scope);
+ }
+ if (this.elseStatement != null) {
+ this.elseStatement.resolveWithPatternVariablesInScope(patternVariablesInFalseScope, scope);
+ }
+ if (this.thenStatement != null)
+ this.thenStatement.injectPatternVariablesIfApplicable(patternVariablesInFalseScope, scope,
+ (statement) -> { return statement.doesNotCompleteNormally();});
+ if (this.elseStatement != null)
+ this.elseStatement.injectPatternVariablesIfApplicable(patternVariablesInTrueScope, scope,
+ (statement) -> { return statement.doesNotCompleteNormally();});
+ } else {
+ resolveIfStatement(scope);
+ }
+}
@Override
public void traverse(ASTVisitor visitor, BlockScope blockScope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
index 418fd906e1..f23a3c4f89 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
@@ -24,6 +24,7 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -91,9 +92,6 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
}
if (this.elementVariable != null) {
- if (this.elementVariable.duplicateCheckObligation != null) {
- this.elementVariable.duplicateCheckObligation.accept(flowInfo);
- }
initsWhenTrue.markAsDefinitelyAssigned(this.elementVariable.binding);
}
return (initsWhenTrue == null) ? flowInfo :
@@ -250,14 +248,58 @@ public void addPatternVariables(BlockScope currentScope, CodeStream codeStream)
codeStream.addVisibleLocalVariable(this.elementVariable.binding);
}
}
-public void resolvePatternVariable(BlockScope scope) {
- if (this.elementVariable != null && this.elementVariable.binding == null) {
+public boolean resolvePatternVariable(BlockScope scope) {
+ if (this.elementVariable == null) return false;
+ if (this.elementVariable.binding == null) {
this.elementVariable.resolve(scope, true);
+ // Kludge - to remove the AccBlankFinal added by the LocalDeclaration#resolve() due to the
+ // missing initializer
+ this.elementVariable.modifiers &= ~ExtraCompilerModifiers.AccBlankFinal;
this.elementVariable.binding.modifiers |= ExtraCompilerModifiers.AccPatternVariable;
+ this.elementVariable.binding.modifiers |= ExtraCompilerModifiers.AccUnresolved; // TODO: Change to a different mechanism
this.elementVariable.binding.useFlag = LocalVariableBinding.USED;
// Why cant this be done in the constructor?
this.type = this.elementVariable.type;
}
+ return true;
+}
+@Override
+public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.expression.collectPatternVariablesToScope(this.patternVarsWhenTrue, scope);
+ if (this.elementVariable != null) {
+ if (this.elementVariable.binding == null) {
+ resolvePatternVariable(scope);
+ if (variables != null) {
+ for (LocalVariableBinding variable : variables) {
+ if (CharOperation.equals(this.elementVariable.name, variable.name)) {
+ scope.problemReporter().redefineLocal(this.elementVariable);
+ }
+ }
+ }
+ }
+ if (this.patternVarsWhenTrue == null) {
+ this.patternVarsWhenTrue = new LocalVariableBinding[1];
+ this.patternVarsWhenTrue[0] = this.elementVariable.binding;
+ } else {
+ this.addPatternVariablesWhenTrue(new LocalVariableBinding[] {this.elementVariable.binding});
+ }
+ }
+
+}
+@Override
+public void addPatternVariablesWhenTrue(LocalVariableBinding[] vars) {
+ if (this.patternVarsWhenTrue == null) {
+ this.getPatternVariablesWhenTrue();
+ }
+ if (vars == null || vars.length == 0) return;
+ if (this.patternVarsWhenTrue == null) {
+ this.patternVarsWhenTrue = vars;
+ } else {
+ int oldSize = this.patternVarsWhenTrue.length;
+ int newLength = oldSize + vars.length;
+ System.arraycopy(this.patternVarsWhenTrue, 0, (this.patternVarsWhenTrue = new LocalVariableBinding[newLength]), 0, oldSize);
+ System.arraycopy(vars, 0, this.patternVarsWhenTrue, oldSize, vars.length);
+ }
}
@Override
public boolean containsPatternVariable() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index ceb1307c0f..cd8de06778 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -146,6 +146,27 @@ public class Javadoc extends ASTNode {
}
}
}
+ } else if (expression instanceof JavadocModuleReference) {
+ JavadocModuleReference modRef = (JavadocModuleReference) expression;
+ if (modRef.typeReference != null) {
+ if (modRef.typeReference.sourceStart == start) {
+ return modRef.typeReference;
+ }
+ }
+ } else if (expression instanceof JavadocFieldReference) {
+ JavadocFieldReference fieldRef = (JavadocFieldReference) expression;
+ if (fieldRef.receiver instanceof JavadocModuleReference) {
+ JavadocModuleReference modRef = (JavadocModuleReference) fieldRef.receiver;
+ if (modRef.sourceStart == start) {
+ return modRef;
+ } else {
+ if (modRef.typeReference != null) {
+ if (modRef.typeReference.sourceStart == start) {
+ return modRef.typeReference;
+ }
+ }
+ }
+ }
}
}
}
@@ -478,6 +499,22 @@ public class Javadoc extends ASTNode {
verifyTypeReference(reference, reference, scope, source15, resolvedType, resolvedType.modifiers);
}
+ if (!hasProblems && (reference instanceof JavadocModuleReference)) {
+ JavadocModuleReference ref= (JavadocModuleReference)reference;
+ ref.resolve(scope);
+ ModuleReference mRef = ref.getModuleReference();
+ if (mRef != null) {
+ ModuleBinding mType = mRef.resolve(scope);
+ if (mType != null && verifyModuleReference(reference, reference, scope, source15, mType, mType.modifiers)) {
+ TypeReference tRef= ref.getTypeReference();
+ if ((tRef instanceof JavadocSingleTypeReference || tRef instanceof JavadocQualifiedTypeReference) && tRef.resolvedType instanceof ReferenceBinding) {
+ ReferenceBinding resolvedType = (ReferenceBinding) tRef.resolvedType;
+ verifyTypeReference(reference, reference, scope, source15, resolvedType, resolvedType.modifiers);
+ }
+ }
+ }
+ }
+
// Verify that message reference are not used for @value tags
if (reference instanceof JavadocMessageSend) {
JavadocMessageSend msgSend = (JavadocMessageSend) reference;
@@ -1143,6 +1180,40 @@ public class Javadoc extends ASTNode {
}
}
+ private boolean verifyModuleReference(Expression reference, Expression typeReference, Scope scope, boolean source15, ModuleBinding moduleType, int modifiers) {
+ boolean bindingFound = false;
+ if (moduleType!= null && moduleType.isValidBinding()) {
+ int scopeModifiers = -1;
+
+ ModuleBinding mBinding = scope.module();
+
+ if (mBinding == null) {
+ scope.problemReporter().javadocInvalidModuleQualification(typeReference.sourceStart, typeReference.sourceEnd, scopeModifiers);
+ return bindingFound;
+ }
+
+ if (mBinding.equals(moduleType)) {
+ bindingFound = true;
+ } else {
+ ModuleBinding[] bindings = mBinding.getAllRequiredModules();
+ for (ModuleBinding binding : bindings) {
+ if (moduleType.equals(binding)) {
+ bindingFound = true;
+ break;
+ }
+ }
+ }
+
+ if (!bindingFound) {
+ if (!canBeSeen(scope.problemReporter().options.reportInvalidJavadocTagsVisibility, moduleType.modifiers)) {
+ scope.problemReporter().javadocHiddenReference(typeReference.sourceStart, typeReference.sourceEnd, scope, moduleType.modifiers);
+ return bindingFound;
+ }
+ }
+ }
+ return bindingFound;
+ }
+
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java
new file mode 100644
index 0000000000..5876d9bdb8
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2020 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.ast;
+
+import org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+
+
+public class JavadocModuleReference extends Expression implements IJavadocTypeReference {
+
+ public int tagSourceStart, tagSourceEnd;
+ public TypeReference typeReference;
+ public ModuleReference moduleReference;
+
+ public JavadocModuleReference(char[][] sources, long[] pos, int tagStart, int tagEnd) {
+ super();
+ this.moduleReference = new ModuleReference(sources, pos);
+ this.tagSourceStart = tagStart;
+ this.tagSourceEnd = tagEnd;
+ this.sourceStart = this.moduleReference.sourceStart;
+ this.sourceEnd = this.moduleReference.sourceEnd;
+ this.bits |= ASTNode.InsideJavadoc;
+ }
+
+ /* (non-Javadoc)
+ * Redefine to capture javadoc specific signatures
+ * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
+ */
+ @Override
+ public void traverse(ASTVisitor visitor, BlockScope scope) {
+ visitor.visit(this, scope);
+ visitor.endVisit(this, scope);
+ }
+
+ @Override
+ public int getTagSourceStart() {
+ return this.tagSourceStart;
+ }
+
+ @Override
+ public int getTagSourceEnd() {
+ return this.tagSourceEnd;
+ }
+
+ public TypeReference getTypeReference() {
+ return this.typeReference;
+ }
+
+ public void setTypeReference(TypeReference typeReference) {
+ this.typeReference = typeReference;
+ if (this.typeReference != null) {
+ this.sourceEnd = this.typeReference.sourceEnd;
+ }
+ }
+
+ public ModuleReference getModuleReference() {
+ return this.moduleReference;
+ }
+
+ public void setModuleReference(ModuleReference moduleReference) {
+ this.moduleReference = moduleReference;
+ this.sourceStart = this.moduleReference.sourceStart;
+ this.sourceStart = this.moduleReference.sourceEnd;
+ }
+
+ @Override
+ public StringBuffer printExpression(int indent, StringBuffer output) {
+ if (this.moduleReference != null) {
+ output.append(this.moduleReference.moduleName);
+ }
+ output.append('/');
+ if (this.typeReference != null) {
+ this.typeReference.printExpression(indent, output);
+ }
+ return output;
+ }
+
+ public ModuleBinding resolve(Scope scope) {
+ return this.moduleReference.resolve(scope);
+ }
+
+ private ModuleBinding resolveModule(BlockScope scope) {
+ return this.moduleReference.resolve(scope);
+ }
+
+ private ModuleBinding resolveModule(ClassScope scope) {
+ return this.moduleReference.resolve(scope);
+ }
+
+ @Override
+ public TypeBinding resolveType(BlockScope blockScope) {
+ this.resolveModule(blockScope);
+ if (this.moduleReference.binding != null
+ && this.typeReference != null) {
+ return this.typeReference.resolveType(blockScope);
+ }
+ return null;
+ }
+
+ @Override
+ public TypeBinding resolveType(ClassScope classScope) {
+ this.resolveModule(classScope);
+ assert(this.moduleReference.binding != null);
+ if (this.typeReference != null) {
+ return this.typeReference.resolveType(classScope, -1);
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java
index 5987709196..a59e0a28e9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java
@@ -37,7 +37,7 @@ public class JavadocSingleNameReference extends SingleNameReference {
*/
public void resolve(BlockScope scope, boolean warn, boolean considerParamRefAsUsage) {
- LocalVariableBinding variableBinding = scope.findVariable(this.token);
+ LocalVariableBinding variableBinding = scope.findVariable(this.token, this);
if (variableBinding != null && variableBinding.isValidBinding() && ((variableBinding.tagBits & TagBits.IsArgument) != 0)) {
this.binding = variableBinding;
if (considerParamRefAsUsage) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index de737e275e..0b6454b354 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -45,7 +45,6 @@ import static org.eclipse.jdt.internal.compiler.ast.ExpressionContext.VANILLA_CO
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.function.Consumer;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.impl.*;
@@ -56,17 +55,10 @@ import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
-@SuppressWarnings("rawtypes")
public class LocalDeclaration extends AbstractVariableDeclaration {
public LocalVariableBinding binding;
- /**
- * For pattern variable, resolve() may store here an obligation to be checked when we have
- * a flow info that tells us whether a potential duplicates is in fact in scope.
- */
- Consumer<FlowInfo> duplicateCheckObligation;
-
public LocalDeclaration(
char[] name,
int sourceStart,
@@ -125,9 +117,6 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
// no need to inform enclosing try block since its locals won't get
// known by the finally block
}
- if (this.duplicateCheckObligation != null) {
- this.duplicateCheckObligation.accept(flowInfo);
- }
return flowInfo;
}
@@ -197,13 +186,13 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
// for local variables
- public void getAllAnnotationContexts(int targetType, LocalVariableBinding localVariable, List allAnnotationContexts) {
+ public void getAllAnnotationContexts(int targetType, LocalVariableBinding localVariable, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, localVariable, allAnnotationContexts);
this.traverseWithoutInitializer(collector, (BlockScope) null);
}
// for arguments
- public void getAllAnnotationContexts(int targetType, int parameterIndex, List allAnnotationContexts) {
+ public void getAllAnnotationContexts(int targetType, int parameterIndex, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, parameterIndex, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
@@ -309,23 +298,12 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/);
if (existingVariable != null && existingVariable.isValidBinding()){
boolean localExists = existingVariable instanceof LocalVariableBinding;
- if (localExists && (isPatternVariable
- || (((LocalVariableBinding) existingVariable).modifiers & ExtraCompilerModifiers.AccPatternVariable) != 0))
- {
- // Do this only if either one of them is a pattern variable.
- this.duplicateCheckObligation = (flowInfo) -> {
- if (flowInfo.isDefinitelyAssigned((LocalVariableBinding) existingVariable)) {
- scope.problemReporter().redefineLocal(this);
- }
- };
+ if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope() && this.hiddenVariableDepth == 0) {
+ scope.problemReporter().lambdaRedeclaresLocal(this);
+ } else if (localExists && this.hiddenVariableDepth == 0) {
+ scope.problemReporter().redefineLocal(this);
} else {
- if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope() && this.hiddenVariableDepth == 0) {
- scope.problemReporter().lambdaRedeclaresLocal(this);
- } else if (localExists && this.hiddenVariableDepth == 0) {
- scope.problemReporter().redefineLocal(this);
- } else {
- scope.problemReporter().localVariableHiding(this, existingVariable, false);
- }
+ scope.problemReporter().localVariableHiding(this, existingVariable, false);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index 86d5f9069a..61bbfc1044 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -279,7 +279,8 @@ public class MethodDeclaration extends AbstractMethodDeclaration {
// check @Override annotation
final CompilerOptions compilerOptions = this.scope.compilerOptions();
checkOverride: {
- if (this.binding == null) break checkOverride;
+ // For a record component accessor method, don't bother with checking for override (JLS 15 9.6.4.4)
+ if (this.binding == null || recordComponent != null) break checkOverride;
long complianceLevel = compilerOptions.complianceLevel;
if (complianceLevel < ClassFileConstants.JDK1_5) break checkOverride;
int bindingModifiers = this.binding.modifiers;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java
index e35c399cc7..aeaab4f884 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java
@@ -277,7 +277,26 @@ public class OR_OR_Expression extends BinaryExpression {
codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.mergedInitStateIndex);
}
}
+ @Override
+ public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.left.collectPatternVariablesToScope(variables, scope);
+
+ // Just keep the ones in false scope
+ variables = this.left.getPatternVariablesWhenFalse();
+ this.addPatternVariablesWhenFalse(variables);
+
+ this.right.collectPatternVariablesToScope(variables, scope);
+ variables = this.right.getPatternVariablesWhenFalse();
+ this.addPatternVariablesWhenFalse(variables);
+ // do this at the end, otherwise we will end up with
+ // same variable we just added from left to right
+ variables = this.left.getPatternVariablesWhenTrue();
+ this.right.addPatternVariablesWhenFalse(variables);
+
+ variables = this.left.getPatternVariablesWhenFalse();
+ this.right.addPatternVariablesWhenTrue(variables);
+ }
@Override
public boolean isCompactableOperation() {
return false;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java
index e9853b8412..b76b50c3fe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java
@@ -21,7 +21,6 @@ import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
-@SuppressWarnings("rawtypes")
public class RecordComponent extends AbstractVariableDeclaration {
public RecordComponentBinding binding;
@@ -80,7 +79,7 @@ public class RecordComponent extends AbstractVariableDeclaration {
return RECORD_COMPONENT;
}
- public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+ public void getAllAnnotationContexts(int targetType, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
index 5a054b5ff6..e1cc9a41f5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
@@ -1031,12 +1031,7 @@ public TypeBinding resolveType(BlockScope scope) {
if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) // for 8, defer till effective finality could be ascertained.
scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
}
- if (this.actualReceiverType.isRecord() && this.actualReceiverType.isLocalType()) {// JLS 14 Sec 14.3
- if ((variable.modifiers & ClassFileConstants.AccStatic) == 0 &&
- (this.bits & ASTNode.IsCapturedOuterLocal) != 0) {
- scope.problemReporter().recordStaticReferenceToOuterLocalVariable((LocalVariableBinding)variable, this);
- }
- }
+ checkLocalStaticClassVariables(scope, variable);
variableType = variable.type;
this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant(scope) : Constant.NotAConstant;
} else {
@@ -1077,6 +1072,22 @@ public TypeBinding resolveType(BlockScope scope) {
return this.resolvedType = reportError(scope);
}
+private void checkLocalStaticClassVariables(BlockScope scope, VariableBinding variable) {
+ if (this.actualReceiverType.isStatic() && this.actualReceiverType.isLocalType()) {
+ if ((variable.modifiers & ClassFileConstants.AccStatic) == 0 &&
+ (this.bits & ASTNode.IsCapturedOuterLocal) != 0) {
+ BlockScope declaringScope = ((LocalVariableBinding) this.binding).declaringScope;
+ MethodScope declaringMethodScope = declaringScope instanceof MethodScope ? (MethodScope)declaringScope :
+ declaringScope.enclosingMethodScope();
+ MethodScope currentMethodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope();
+ ClassScope declaringClassScope = declaringMethodScope != null ? declaringMethodScope.classScope() : null;
+ ClassScope currentClassScope = currentMethodScope != null ? currentMethodScope.classScope() : null;
+ if (declaringClassScope != currentClassScope)
+ scope.problemReporter().recordStaticReferenceToOuterLocalVariable((LocalVariableBinding)variable, this);
+ }
+ }
+}
+
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
visitor.visit(this, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
index fac3135ca3..be633b6dfc 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -41,6 +41,8 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.function.Predicate;
+
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.CheckMode;
@@ -85,7 +87,6 @@ public abstract class Statement extends ASTNode {
return false;
}
public abstract FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo);
-
/** Lambda shape analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement.
For blocks, we don't perform intra-reachability analysis. We assume the lambda body is free of intrinsic control flow errors (if such errors
exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
@@ -124,6 +125,8 @@ public boolean continueCompletes() {
public static final int NOT_COMPLAINED = 0;
public static final int COMPLAINED_FAKE_REACHABLE = 1;
public static final int COMPLAINED_UNREACHABLE = 2;
+ LocalVariableBinding[] patternVarsWhenTrue = null;
+ LocalVariableBinding[] patternVarsWhenFalse = null;
/** Analysing arguments of MessageSend, ExplicitConstructorCall, AllocationExpression. */
@@ -483,7 +486,65 @@ public StringBuffer print(int indent, StringBuffer output) {
public abstract StringBuffer printStatement(int indent, StringBuffer output);
public abstract void resolve(BlockScope scope);
-
+public LocalVariableBinding[] getPatternVariablesWhenTrue() {
+ return this.patternVarsWhenTrue;
+}
+public LocalVariableBinding[] getPatternVariablesWhenFalse() {
+ return this.patternVarsWhenFalse;
+}
+public void addPatternVariablesWhenTrue(LocalVariableBinding[] vars) {
+ this.patternVarsWhenTrue = addPatternVariables(this.patternVarsWhenTrue, vars);
+}
+public void addPatternVariablesWhenFalse(LocalVariableBinding[] vars) {
+ this.patternVarsWhenFalse = addPatternVariables(this.patternVarsWhenFalse, vars);
+}
+private LocalVariableBinding[] addPatternVariables(LocalVariableBinding[] current, LocalVariableBinding[] add) {
+ if (add == null || add.length == 0)
+ return current;
+ if (current == null) {
+ current = add;
+ } else {
+ for (LocalVariableBinding local : add) {
+ current = addPatternVariables(current, local);
+ }
+ }
+ return current;
+}
+private LocalVariableBinding[] addPatternVariables(LocalVariableBinding[] current, LocalVariableBinding add) {
+ int oldSize = current.length;
+ // it's odd that we only look at the last element, but in most cases
+ // we will only have one in the array. In the unlikely case of having two
+ // distinct pattern variables, the cost is nothing but setting the same
+ // bit twice on the same object.
+ if (oldSize > 0 && current[oldSize - 1] == add) {
+ return current;
+ }
+ int newLength = current.length + 1;
+ System.arraycopy(current, 0, (current = new LocalVariableBinding[newLength]), 0, oldSize);
+ current[oldSize] = add;
+ return current;
+}
+public void injectPatternVariablesIfApplicable(LocalVariableBinding[] patternVariablesInScope, BlockScope scope,
+ Predicate<Statement> condition) {
+ if (patternVariablesInScope != null && condition.test(this)) {
+ for (LocalVariableBinding binding : patternVariablesInScope) {
+ binding.modifiers &= ~ExtraCompilerModifiers.AccUnresolved;
+ }
+ }
+}
+public void resolveWithPatternVariablesInScope(LocalVariableBinding[] patternVariablesInScope, BlockScope scope) {
+ if (patternVariablesInScope != null) {
+ for (LocalVariableBinding binding : patternVariablesInScope) {
+ binding.modifiers &= ~ExtraCompilerModifiers.AccUnresolved;
+ }
+ this.resolve(scope);
+ for (LocalVariableBinding binding : patternVariablesInScope) {
+ binding.modifiers |= ExtraCompilerModifiers.AccUnresolved;
+ }
+ } else {
+ resolve(scope);
+ }
+}
/**
* Returns case constant associated to this statement (NotAConstant if none)
* parameter statement has to be either a SwitchStatement or a SwitchExpression
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index e6e22c8815..af9e1087a9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -72,7 +72,7 @@ public class TypeDeclaration extends Statement implements ProblemSeverities, Ref
public int maxFieldCount;
public int declarationSourceStart;
public int declarationSourceEnd;
- public int restrictedIdentifierStart; // used only for records
+ public int restrictedIdentifierStart = -1; // used only for record and permits restricted keywords.
public int bodyStart;
public int bodyEnd; // doesn't include the trailing comment if any.
public CompilationResult compilationResult;
@@ -91,8 +91,11 @@ public class TypeDeclaration extends Statement implements ProblemSeverities, Ref
// 14 Records preview support
public RecordComponent[] recordComponents;
public int nRecordComponents;
- public boolean isLocalRecord;
public static Set<String> disallowedComponentNames;
+
+ // 15 Sealed Type preview support
+ public TypeReference[] permittedTypes;
+
static {
disallowedComponentNames = new HashSet<>(6);
disallowedComponentNames.add("clone"); //$NON-NLS-1$
@@ -304,14 +307,6 @@ public void analyseCode(CompilationUnitScope unitScope) {
}
}
-public static void checkAndFlagRecordNameErrors(char[] typeName, ASTNode node, Scope skope) {
- if (CharOperation.equals(typeName, TypeConstants.RECORD_RESTRICTED_IDENTIFIER)) {
- if (skope.compilerOptions().sourceLevel == ClassFileConstants.JDK14) {
- skope.problemReporter().recordIsAReservedTypeName(node);
- }
- }
-}
-
/**
* Check for constructor vs. method with no return type.
* Answers true if at least one constructor is defined
@@ -367,9 +362,9 @@ public ConstructorDeclaration createDefaultConstructorForRecord(boolean needExpl
ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult);
constructor.bits |= ASTNode.IsCanonicalConstructor | ASTNode.IsImplicit;
constructor.selector = this.name;
-// constructor.modifiers = this.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
- constructor.modifiers = this.modifiers & ClassFileConstants.AccPublic;
- constructor.modifiers |= ClassFileConstants.AccPublic; // JLS 14 8.10.5
+ constructor.modifiers = this.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
+// constructor.modifiers = this.modifiers & ClassFileConstants.AccPublic;
+// constructor.modifiers |= ClassFileConstants.AccPublic; // JLS 14 8.10.5
constructor.arguments = getArgumentsFromComponents(this.recordComponents);
constructor.declarationSourceStart = constructor.sourceStart =
@@ -430,7 +425,7 @@ private Argument[] getArgumentsFromComponents(RecordComponent[] comps) {
int count = 0;
for (RecordComponent comp : comps) {
Argument argument = new Argument(comp.name, ((long)comp.sourceStart) << 32 | comp.sourceEnd,
- comp.type, comp.modifiers);
+ comp.type, 0); // no modifiers allowed for record components - enforce
args2[count++] = argument;
}
return args2;
@@ -1264,6 +1259,13 @@ public StringBuffer printHeader(int indent, StringBuffer output) {
this.superInterfaces[i].print(0, output);
}
}
+ if (this.permittedTypes != null && this.permittedTypes.length > 0) {
+ output.append(" permits "); //$NON-NLS-1$
+ for (int i = 0; i < this.permittedTypes.length; i++) {
+ if (i > 0) output.append( ", "); //$NON-NLS-1$
+ this.permittedTypes[i].print(0, output);
+ }
+ }
return output;
}
@@ -1294,7 +1296,7 @@ public void resolve() {
this.scope.problemReporter().varIsReservedTypeName(this);
}
}
- TypeDeclaration.checkAndFlagRecordNameErrors(this.name, this, this.scope);
+ this.scope.problemReporter().validateRestrictedKeywords(this.name, this);
// resolve annotations and check @Deprecated annotation
long annotationTagBits = sourceType.getAnnotationTagBits();
if ((annotationTagBits & TagBits.AnnotationDeprecated) == 0
@@ -1648,6 +1650,11 @@ public void traverse(ASTVisitor visitor, CompilationUnitScope unitScope) {
for (int i = 0; i < length; i++)
this.superInterfaces[i].traverse(visitor, this.scope);
}
+ if (this.permittedTypes != null) {
+ int length = this.permittedTypes.length;
+ for (int i = 0; i < length; i++)
+ this.permittedTypes[i].traverse(visitor, this.scope);
+ }
if (this.typeParameters != null) {
int length = this.typeParameters.length;
for (int i = 0; i < length; i++) {
@@ -1709,6 +1716,11 @@ public void traverse(ASTVisitor visitor, BlockScope blockScope) {
for (int i = 0; i < length; i++)
this.superInterfaces[i].traverse(visitor, this.scope);
}
+ if (this.permittedTypes != null) {
+ int length = this.permittedTypes.length;
+ for (int i = 0; i < length; i++)
+ this.permittedTypes[i].traverse(visitor, this.scope);
+ }
if (this.typeParameters != null) {
int length = this.typeParameters.length;
for (int i = 0; i < length; i++) {
@@ -1770,6 +1782,11 @@ public void traverse(ASTVisitor visitor, ClassScope classScope) {
for (int i = 0; i < length; i++)
this.superInterfaces[i].traverse(visitor, this.scope);
}
+ if (this.permittedTypes != null) {
+ int length = this.permittedTypes.length;
+ for (int i = 0; i < length; i++)
+ this.permittedTypes[i].traverse(visitor, this.scope);
+ }
if (this.typeParameters != null) {
int length = this.typeParameters.length;
for (int i = 0; i < length; i++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
index d15b4c0f6c..8a75fd7d02 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -24,6 +24,7 @@ import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.codegen.AnnotationContext;
import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
@@ -37,7 +38,6 @@ import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
-@SuppressWarnings("rawtypes")
public class TypeParameter extends AbstractVariableDeclaration {
public TypeVariableBinding binding;
@@ -63,7 +63,7 @@ public class TypeParameter extends AbstractVariableDeclaration {
}
}
- public void getAllAnnotationContexts(int targetType, int typeParameterIndex, List allAnnotationContexts) {
+ public void getAllAnnotationContexts(int targetType, int typeParameterIndex, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, typeParameterIndex, allAnnotationContexts);
if (this.annotations != null) {
int annotationsLength = this.annotations.length;
@@ -120,7 +120,7 @@ public class TypeParameter extends AbstractVariableDeclaration {
scope.problemReporter().varIsNotAllowedHere(this);
}
}
- TypeDeclaration.checkAndFlagRecordNameErrors(this.name, this, scope);
+ scope.problemReporter().validateRestrictedKeywords(this.name, this);
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
index 3363eb9910..435597c06d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -69,7 +69,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
-@SuppressWarnings({"rawtypes", "unchecked"})
+@SuppressWarnings({})
public abstract class TypeReference extends Expression {
public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0];
@@ -91,7 +91,7 @@ public abstract class TypeReference extends Expression {
}
static class AnnotationCollector extends ASTVisitor {
- List annotationContexts;
+ List<AnnotationContext> annotationContexts;
Expression typeReference;
int targetType;
int info = 0;
@@ -106,7 +106,7 @@ static class AnnotationCollector extends ASTVisitor {
TypeParameter typeParameter,
int targetType,
int typeParameterIndex,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = typeParameter.type;
this.targetType = targetType;
@@ -117,7 +117,7 @@ static class AnnotationCollector extends ASTVisitor {
LocalDeclaration localDeclaration,
int targetType,
LocalVariableBinding localVariable,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = localDeclaration.type;
this.targetType = targetType;
@@ -128,7 +128,7 @@ static class AnnotationCollector extends ASTVisitor {
LocalDeclaration localDeclaration,
int targetType,
int parameterIndex,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = localDeclaration.type;
this.targetType = targetType;
@@ -138,7 +138,7 @@ static class AnnotationCollector extends ASTVisitor {
public AnnotationCollector(
TypeReference typeReference,
int targetType,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = typeReference;
this.targetType = targetType;
@@ -147,7 +147,7 @@ static class AnnotationCollector extends ASTVisitor {
Expression typeReference,
int targetType,
int info,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = typeReference;
this.info = info;
@@ -158,7 +158,7 @@ static class AnnotationCollector extends ASTVisitor {
int targetType,
int info,
int typeIndex,
- List annotationContexts) {
+ List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = typeReference;
this.info = info;
@@ -169,7 +169,7 @@ static class AnnotationCollector extends ASTVisitor {
TypeReference typeReference,
int targetType,
int info,
- List annotationContexts,
+ List<AnnotationContext> annotationContexts,
Annotation[][] annotationsOnDimensions,
int dimensions) {
this.annotationContexts = annotationContexts;
@@ -185,7 +185,7 @@ static class AnnotationCollector extends ASTVisitor {
this.dimensions = dimensions;
}
- public AnnotationCollector(RecordComponent recordComponent, int targetType, List annotationContexts) {
+ public AnnotationCollector(RecordComponent recordComponent, int targetType, List<AnnotationContext> annotationContexts) {
this.annotationContexts = annotationContexts;
this.typeReference = recordComponent.type;
this.targetType = targetType;
@@ -425,10 +425,10 @@ public int extraDimensions() {
}
public AnnotationContext[] getAllAnnotationContexts(int targetType) {
- List allAnnotationContexts = new ArrayList();
+ List<AnnotationContext> allAnnotationContexts = new ArrayList<>();
AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
- return (AnnotationContext[]) allAnnotationContexts.toArray(new AnnotationContext[allAnnotationContexts.size()]);
+ return allAnnotationContexts.toArray(new AnnotationContext[allAnnotationContexts.size()]);
}
/**
* info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
@@ -436,11 +436,11 @@ public AnnotationContext[] getAllAnnotationContexts(int targetType) {
* @param info
* @param allAnnotationContexts
*/
-public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts) {
+public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
-public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts, Annotation [] se7Annotations) {
+public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts, Annotation [] se7Annotations) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts);
for (int i = 0, length = se7Annotations == null ? 0 : se7Annotations.length; i < length; i++) {
Annotation annotation = se7Annotations[i];
@@ -451,7 +451,7 @@ public void getAllAnnotationContexts(int targetType, int info, List allAnnotatio
/**
* info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
*/
-public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts, Annotation[][] annotationsOnDimensions, int dimensions) {
+public void getAllAnnotationContexts(int targetType, int info, List<AnnotationContext> allAnnotationContexts, Annotation[][] annotationsOnDimensions, int dimensions) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts, annotationsOnDimensions, dimensions);
this.traverse(collector, (BlockScope) null);
if (annotationsOnDimensions != null) {
@@ -465,11 +465,11 @@ public void getAllAnnotationContexts(int targetType, int info, List allAnnotatio
}
}
}
-public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List allAnnotationContexts) {
+public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, info, typeIndex, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
-public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+public void getAllAnnotationContexts(int targetType, List<AnnotationContext> allAnnotationContexts) {
AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
this.traverse(collector, (BlockScope) null);
}
@@ -532,17 +532,16 @@ protected TypeBinding internalResolveType(Scope scope, int location) {
}
}
}
- boolean hasError;
+ boolean hasError = false;
TypeBinding type = this.resolvedType = getTypeBinding(scope);
if (type == null) {
return null; // detected cycle while resolving hierarchy
} else if ((hasError = !type.isValidBinding()) == true) {
if (this.isTypeNameVar(scope)) {
reportVarIsNotAllowedHere(scope);
- } else {
+ } else if (!scope.problemReporter().validateRestrictedKeywords(getLastToken(), this)) {
reportInvalidType(scope);
}
- TypeDeclaration.checkAndFlagRecordNameErrors(getTypeName(0), this, scope);
switch (type.problemId()) {
case ProblemReasons.NotFound :
case ProblemReasons.NotVisible :
@@ -553,6 +552,8 @@ protected TypeBinding internalResolveType(Scope scope, int location) {
default :
return null;
}
+ } else { // check anyway - to cover a illegally declared "permits" type
+ scope.problemReporter().validateRestrictedKeywords(getLastToken(), this);
}
if (type.isArrayType() && ((ArrayBinding) type).leafComponentType == TypeBinding.VOID) {
scope.problemReporter().cannotAllocateVoidArray(this);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
index c43e55c983..9037694a11 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java
@@ -224,7 +224,22 @@ public class UnaryExpression extends OperatorExpression {
output.append(operatorToString()).append(' ');
return this.expression.printExpression(0, output);
}
+ @Override
+ public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope) {
+ this.expression.collectPatternVariablesToScope(variables, scope);
+ if (((this.bits & OperatorMASK) >> OperatorSHIFT) == NOT) {
+ variables = this.expression.getPatternVariablesWhenTrue();
+ this.addPatternVariablesWhenFalse(variables);
+ variables = this.expression.getPatternVariablesWhenFalse();
+ this.addPatternVariablesWhenTrue(variables);
+ } else {
+ variables = this.expression.getPatternVariablesWhenTrue();
+ this.addPatternVariablesWhenTrue(variables);
+ variables = this.expression.getPatternVariablesWhenFalse();
+ this.addPatternVariablesWhenFalse(variables);
+ }
+ }
@Override
public TypeBinding resolveType(BlockScope scope) {
boolean expressionIsCast;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
index a02b59d849..958887b700 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
@@ -275,10 +275,25 @@ public class WhileStatement extends Statement {
@Override
public void resolve(BlockScope scope) {
- TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
- this.condition.computeConversion(scope, type, type);
- if (this.action != null)
- this.action.resolve(scope);
+ if (this.condition.containsPatternVariable()) {
+ this.condition.collectPatternVariablesToScope(null, scope);
+ LocalVariableBinding[] patternVariablesInTrueScope = this.condition.getPatternVariablesWhenTrue();
+ LocalVariableBinding[] patternVariablesInFalseScope = this.condition.getPatternVariablesWhenFalse();
+
+ TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
+ this.condition.computeConversion(scope, type, type);
+ if (this.action != null) {
+ this.action.resolveWithPatternVariablesInScope(patternVariablesInTrueScope, scope);
+ this.action.injectPatternVariablesIfApplicable(patternVariablesInFalseScope, scope,
+ (statement) -> { return !statement.breaksOut(null);});
+ }
+ } else {
+ TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
+ this.condition.computeConversion(scope, type, type);
+ if (this.action != null)
+ this.action.resolve(scope);
+ }
+
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index 9cdfe85d0a..536aaae96c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -131,9 +131,10 @@ public interface ClassFileConstants {
int MAJOR_VERSION_12 = 56;
int MAJOR_VERSION_13 = 57;
int MAJOR_VERSION_14 = 58;
+ int MAJOR_VERSION_15 = 59;
int MAJOR_VERSION_0 = 44;
- int MAJOR_LATEST_VERSION = MAJOR_VERSION_14;
+ int MAJOR_LATEST_VERSION = MAJOR_VERSION_15;
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
@@ -158,6 +159,7 @@ public interface ClassFileConstants {
long JDK12 = ((long)ClassFileConstants.MAJOR_VERSION_12 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK13 = ((long)ClassFileConstants.MAJOR_VERSION_13 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK14 = ((long)ClassFileConstants.MAJOR_VERSION_14 << 16) + ClassFileConstants.MINOR_VERSION_0;
+ long JDK15 = ((long)ClassFileConstants.MAJOR_VERSION_15 << 16) + ClassFileConstants.MINOR_VERSION_0;
public static long getLatestJDKLevel() {
return ((long)ClassFileConstants.MAJOR_LATEST_VERSION << 16) + ClassFileConstants.MINOR_VERSION_0;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
index c34c9db424..66d99ac551 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -37,6 +37,7 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
import org.eclipse.jdt.internal.compiler.env.IModule;
+import org.eclipse.jdt.internal.compiler.env.IRecordComponent;
import org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus;
@@ -67,6 +68,8 @@ public class ClassFileReader extends ClassFileStruct implements IBinaryType {
private InnerClassInfo[] innerInfos;
private char[][] interfaceNames;
private int interfacesCount;
+ private char[][] permittedSubtypesNames;
+ private int permittedSubtypesCount;
private MethodInfo[] methods;
private int methodsCount;
private char[] signature;
@@ -84,7 +87,7 @@ public class ClassFileReader extends ClassFileStruct implements IBinaryType {
private char[][] nestMembers;
private boolean isRecord;
private int recordComponentsCount;
- private ComponentInfo[] recordComponents;
+ private RecordComponentInfo[] recordComponents;
private static String printTypeModifiers(int modifiers) {
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
@@ -96,6 +99,7 @@ private static String printTypeModifiers(int modifiers) {
if ((modifiers & ClassFileConstants.AccSuper) != 0) print.print("super "); //$NON-NLS-1$
if ((modifiers & ClassFileConstants.AccInterface) != 0) print.print("interface "); //$NON-NLS-1$
if ((modifiers & ClassFileConstants.AccAbstract) != 0) print.print("abstract "); //$NON-NLS-1$
+ if ((modifiers & ExtraCompilerModifiers.AccSealed) != 0) print.print("sealed "); //$NON-NLS-1$
print.flush();
return out.toString();
}
@@ -470,6 +474,23 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit
}
}
break;
+ case 'P' :
+ if (CharOperation.equals(attributeName, AttributeNamesConstants.PermittedSubclasses)) {
+ int offset = readOffset + 6;
+ this.permittedSubtypesCount = u2At(offset);
+ if (this.permittedSubtypesCount != 0) {
+ this.accessFlags |= ExtraCompilerModifiers.AccSealed;
+ offset += 2;
+ this.permittedSubtypesNames = new char[this.permittedSubtypesCount][];
+ for (int j = 0; j < this.permittedSubtypesCount; j++) {
+ utf8Offset =
+ this.constantPoolOffsets[u2At(this.constantPoolOffsets[u2At(offset)] + 1)];
+ this.permittedSubtypesNames[j] = utf8At(utf8Offset + 3, u2At(utf8Offset + 1));
+ offset += 2;
+ }
+ }
+ }
+ break;
}
readOffset += (6 + u4At(readOffset + 2));
}
@@ -497,9 +518,9 @@ private void decodeRecords(int readOffset, char[] attributeName) {
this.recordComponentsCount = u2At(offset);
if (this.recordComponentsCount != 0) {
offset += 2;
- this.recordComponents = new ComponentInfo[this.recordComponentsCount];
+ this.recordComponents = new RecordComponentInfo[this.recordComponentsCount];
for (int j = 0; j < this.recordComponentsCount; j++) {
- ComponentInfo component = ComponentInfo.createComponent(this.reference, this.constantPoolOffsets, offset, this.version);
+ RecordComponentInfo component = RecordComponentInfo.createComponent(this.reference, this.constantPoolOffsets, offset, this.version);
this.recordComponents[j] = component;
offset += component.sizeInBytes();
}
@@ -733,6 +754,11 @@ public char[][] getInterfaceNames() {
}
@Override
+public char[][] getPermittedSubtypeNames() {
+ return this.permittedSubtypesNames;
+}
+
+@Override
public IBinaryNestedType[] getMemberTypes() {
// we might have some member types of the current type
if (this.innerInfos == null) return null;
@@ -858,6 +884,8 @@ public int getModifiers() {
} else {
modifiers = this.accessFlags;
}
+ if (this.permittedSubtypesCount > 0)
+ modifiers |= ExtraCompilerModifiers.AccSealed;
return modifiers;
}
@@ -1039,6 +1067,17 @@ public boolean hasStructuralChanges(byte[] newBytes, boolean orderRequired, bool
return true;
}
+ // permitted sub-types
+ char[][] newPermittedSubtypeNames = newClassFile.getPermittedSubtypeNames();
+ if (this.permittedSubtypesNames != newPermittedSubtypeNames) {
+ int newPermittedSubtypesLength = newPermittedSubtypeNames == null ? 0 : newPermittedSubtypeNames.length;
+ if (newPermittedSubtypesLength != this.permittedSubtypesCount)
+ return true;
+ for (int i = 0, max = this.permittedSubtypesCount; i < max; i++)
+ if (!CharOperation.equals(this.permittedSubtypesNames[i], newPermittedSubtypeNames[i]))
+ return true;
+ }
+
// member types
IBinaryNestedType[] currentMemberTypes = getMemberTypes();
IBinaryNestedType[] otherMemberTypes = newClassFile.getMemberTypes();
@@ -1412,7 +1451,13 @@ public String toString() {
return out.toString();
}
+@Override
public boolean isRecord() {
return this.isRecord;
}
+
+@Override
+public IRecordComponent[] getRecordComponents() {
+ return this.recordComponents;
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java
index 29414f4c2e..0ca00b6d14 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 IBM Corporation and others.
+ * Copyright (c) 2019, 2020 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,10 +12,10 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.classfmt;
-public class ComponentInfoWithAnnotation extends ComponentInfo {
+public class ComponentInfoWithAnnotation extends RecordComponentInfo {
private AnnotationInfo[] annotations;
- ComponentInfoWithAnnotation(ComponentInfo info, AnnotationInfo[] annos) {
+ ComponentInfoWithAnnotation(RecordComponentInfo info, AnnotationInfo[] annos) {
super(info.reference, info.constantPoolOffsets, info.structOffset, info.version);
this.attributeBytes = info.attributeBytes;
this.constantPoolOffsets = info.constantPoolOffsets;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java
index 73441a89c0..18b5b22f73 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java
@@ -17,7 +17,7 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
public final class ComponentInfoWithTypeAnnotation extends ComponentInfoWithAnnotation {
private TypeAnnotationInfo[] typeAnnotations;
-ComponentInfoWithTypeAnnotation(ComponentInfo info, AnnotationInfo[] annos, TypeAnnotationInfo[] typeAnnos) {
+ComponentInfoWithTypeAnnotation(RecordComponentInfo info, AnnotationInfo[] annos, TypeAnnotationInfo[] typeAnnos) {
super(info, annos);
this.typeAnnotations = typeAnnos;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
index afcef9d875..1f4318a48a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2017 Google, Inc. and others.
+ * Copyright (c) 2016, 2020 Google, Inc. and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -27,6 +27,7 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.eclipse.jdt.internal.compiler.env.IRecordComponent;
import org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus;
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
@@ -96,6 +97,11 @@ public class ExternalAnnotationDecorator implements IBinaryType {
}
@Override
+ public IRecordComponent[] getRecordComponents() {
+ return this.inputType.getRecordComponents();
+ }
+
+ @Override
public char[] getGenericSignature() {
return this.inputType.getGenericSignature();
}
@@ -149,6 +155,10 @@ public class ExternalAnnotationDecorator implements IBinaryType {
public boolean isLocal() {
return this.inputType.isLocal();
}
+ @Override
+ public boolean isRecord() {
+ return this.inputType.isRecord();
+ }
@Override
public boolean isMember() {
@@ -298,4 +308,5 @@ public class ExternalAnnotationDecorator implements IBinaryType {
}
return ExternalAnnotationStatus.TYPE_IS_ANNOTATED;
}
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java
index f357ad2dc6..b15c6aeab9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 IBM Corporation and others.
+ * Copyright (c) 2019, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -17,7 +17,8 @@ import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
-import org.eclipse.jdt.internal.compiler.env.IComponent;
+import org.eclipse.jdt.internal.compiler.env.IRecordComponent;
+import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.lookup.TagBits;
/*
@@ -26,7 +27,7 @@ import org.eclipse.jdt.internal.compiler.lookup.TagBits;
* it is too early to disturb the field_info code. To be done if this gets standardized.
*/
@SuppressWarnings("rawtypes")
-public class ComponentInfo extends ClassFileStruct implements IComponent, Comparable {
+public class RecordComponentInfo extends ClassFileStruct implements IRecordComponent, Comparable {
protected int attributeBytes;
protected char[] descriptor;
protected char[] name;
@@ -35,8 +36,8 @@ public class ComponentInfo extends ClassFileStruct implements IComponent, Compar
protected long tagBits;
protected long version;
-public static ComponentInfo createComponent(byte classFileBytes[], int offsets[], int offset, long version) {
- ComponentInfo componentInfo = new ComponentInfo(classFileBytes, offsets, offset, version);
+public static RecordComponentInfo createComponent(byte classFileBytes[], int offsets[], int offset, long version) {
+ RecordComponentInfo componentInfo = new RecordComponentInfo(classFileBytes, offsets, offset, version);
int attributesCount = componentInfo.u2At(4);
int readOffset = 6;
@@ -104,7 +105,7 @@ public static ComponentInfo createComponent(byte classFileBytes[], int offsets[]
* @param offset int
* @param version class file version
*/
-protected ComponentInfo (byte classFileBytes[], int offsets[], int offset, long version) {
+protected RecordComponentInfo (byte classFileBytes[], int offsets[], int offset, long version) {
super(classFileBytes, offsets, offset);
this.signatureUtf8Offset = -1;
this.version = version;
@@ -156,14 +157,14 @@ TypeAnnotationInfo[] decodeTypeAnnotations(int offset, boolean runtimeVisible) {
@Override
public int compareTo(Object o) {
- return new String(getName()).compareTo(new String(((ComponentInfo) o).getName()));
+ return new String(getName()).compareTo(new String(((RecordComponentInfo) o).getName()));
}
@Override
public boolean equals(Object o) {
- if (!(o instanceof ComponentInfo)) {
+ if (!(o instanceof RecordComponentInfo)) {
return false;
}
- return CharOperation.equals(getName(), ((ComponentInfo) o).getName());
+ return CharOperation.equals(getName(), ((RecordComponentInfo) o).getName());
}
@Override
public int hashCode() {
@@ -266,4 +267,16 @@ protected void toStringContent(StringBuffer buffer) {
.append('}')
.toString();
}
+
+@Override
+public Constant getConstant() {
+ // Doesn't really apply to a record component.
+ return null;
+}
+
+@Override
+public int getModifiers() {
+ // Doesn't really apply to a record component.
+ return 0;
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
index b069105dcf..9adffd1801 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -55,4 +55,5 @@ public interface AttributeNamesConstants {
final char[] NestMembers = "NestMembers".toCharArray(); //$NON-NLS-1$
// jep 359 records
final char[] RecordClass = "Record".toCharArray(); //$NON-NLS-1$
+ final char[] PermittedSubclasses = "PermittedSubclasses".toCharArray(); //$NON-NLS-1$
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
index 447651540a..30722b013b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 IBM Corporation and others.
+ * Copyright (c) 2012, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -30,14 +30,13 @@ import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
-@SuppressWarnings({"rawtypes"})
public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
- public List allTypeAnnotationContexts;
+ public List<AnnotationContext> allTypeAnnotationContexts;
public TypeAnnotationCodeStream(ClassFile givenClassFile) {
super(givenClassFile);
this.generateAttributes |= ClassFileConstants.ATTR_TYPE_ANNOTATION;
- this.allTypeAnnotationContexts = new ArrayList();
+ this.allTypeAnnotationContexts = new ArrayList<>();
}
private void addAnnotationContext(TypeReference typeReference, int info, int targetType, ArrayAllocationExpression allocationExpression) {
@@ -162,12 +161,12 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream {
@Override
public void reset(ClassFile givenClassFile) {
super.reset(givenClassFile);
- this.allTypeAnnotationContexts = new ArrayList();
+ this.allTypeAnnotationContexts = new ArrayList<>();
}
@Override
public void init(ClassFile targetClassFile) {
super.init(targetClassFile);
- this.allTypeAnnotationContexts = new ArrayList();
+ this.allTypeAnnotationContexts = new ArrayList<>();
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
index c3f8b8c779..87b2eafdf0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -62,6 +62,11 @@ char[] getEnclosingTypeName();
IBinaryField[] getFields();
/**
+ * Answer the receiver's record components or null if the array is empty.
+ */
+
+IRecordComponent[] getRecordComponents();
+/**
* Answer the module to which this type belongs.
* {@code null} if the type is associated to the unnamed module.
*
@@ -86,6 +91,18 @@ char[] getGenericSignature();
*/
char[][] getInterfaceNames();
+
+/**
+ * Answer the unresolved names of the receiver's permitted sub types
+ * or null if the array is empty.
+ *
+ * A name is a simple name or a qualified, dot separated name.
+ * For example, Hashtable or java.util.Hashtable.
+ */
+default char[][] getPermittedSubtypeNames() {
+ return null;
+}
+
/**
* Answer the receiver's nested types or null if the array is empty.
*
@@ -150,6 +167,12 @@ boolean isAnonymous();
boolean isLocal();
/**
+ * Answer true if the receiver is a record.
+ * false otherwise
+ */
+boolean isRecord();
+
+/**
* Answer true if the receiver is a member class.
* false otherwise
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IComponent.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IComponent.java
deleted file mode 100644
index c3f6f09243..0000000000
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IComponent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2019 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.internal.compiler.env;
-
-public interface IComponent {
-/**
- * Answer the runtime visible and invisible annotations for this component or null if none.
- */
-IBinaryAnnotation[] getAnnotations();
-
-/**
- * Answer the runtime visible and invisible type annotations for this component or null if none.
- */
-IBinaryTypeAnnotation[] getTypeAnnotations();
-
-/**
- * Answer the receiver's componentSignature, which describes the component's type
- * as specified in "4.7.9.1 Signatures" of the Java SE 8 VM spec.
- */
-char[] getGenericSignature();
-
-/**
- * Answer the name of the component.
- */
-char[] getName();
-
-/**
- * Answer the tagbits set according to the bits for annotations.
- */
-long getTagBits();
-
-/**
- * Answer the resolved name of the receiver's type in the
- * class file format as specified in section 4.3.2 of the Java 2 VM spec.
- *
- * For example:
- * - java.lang.String is Ljava/lang/String;
- * - an int is I
- * - a 2 dimensional array of strings is [[Ljava/lang/String;
- * - an array of floats is [F
- */
-char[] getTypeName();
-}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IRecordComponent.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IRecordComponent.java
new file mode 100644
index 0000000000..276e4a61f1
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IRecordComponent.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2019, 2020 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.env;
+
+public interface IRecordComponent extends IBinaryField {
+ // Nothing new here
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceType.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceType.java
index a032122191..c53e6ba811 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceType.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -48,6 +48,17 @@ ISourceField[] getFields();
char[][] getInterfaceNames();
/**
+ * Answer the unresolved names of the receiver's permitted sub types
+ * or null if the array is empty.
+ *
+ * A name is a simple name or a qualified, dot separated name.
+ * For example, Hashtable or java.util.Hashtable.
+ */
+default char[][] getPermittedSubtypeNames() {
+ return null;
+}
+
+/**
* Answer the receiver's member types.
*/
ISourceType[] getMemberTypes();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index afb8d27a32..5f6a5d21b1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -234,6 +234,7 @@ public class CompilerOptions {
public static final String VERSION_12 = "12"; //$NON-NLS-1$
public static final String VERSION_13 = "13"; //$NON-NLS-1$
public static final String VERSION_14 = "14"; //$NON-NLS-1$
+ public static final String VERSION_15 = "15"; //$NON-NLS-1$
/*
* Note: Whenever a new version is added, make sure getLatestVersion()
* is updated with it.
@@ -604,7 +605,7 @@ public class CompilerOptions {
* Return the latest Java language version supported by the Eclipse compiler
*/
public static String getLatestVersion() {
- return VERSION_14;
+ return VERSION_15;
}
/**
* Return the most specific option key controlling this irritant. Note that in some case, some irritant is controlled by
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
new file mode 100644
index 0000000000..813c3b75aa
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2020 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.impl;
+
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
+import org.eclipse.jdt.internal.compiler.util.Messages;
+
+/**
+ * An internal enumeration of all Java language features that were introduced as
+ * standard feature or preview feature from Java 15. The idea is to have one
+ * location where the applicability of a feature, such as version supported in,
+ * whether or not a preview, what are the restricted keywords introduced by a
+ * feature etc. This is expected to be updated every time there's a new Java
+ * version and the change is expected to be one of the following kinds:
+ * <ul>
+ * <li>The preview feature continues to be a preview in the next version</li>
+ * <li>The preview feature is upgraded to a standard feature</li>
+ * <li>The preview feature is removed</li>
+ * </ul>
+ *
+ * @author jay
+ */
+public enum JavaFeature {
+
+ TEXT_BLOCKS(ClassFileConstants.JDK15,
+ Messages.bind(Messages.text_block),
+ new char[][] {},
+ false),
+
+ PATTERN_MATCHING_IN_INSTANCEOF(ClassFileConstants.JDK15,
+ Messages.bind(Messages.pattern_matching_instanceof),
+ new char[][] {},
+ true),
+
+ RECORDS(ClassFileConstants.JDK15,
+ Messages.bind(Messages.records),
+ new char[][] {TypeConstants.RECORD_RESTRICTED_IDENTIFIER},
+ true),
+
+ SEALED_CLASSES(ClassFileConstants.JDK15,
+ Messages.bind(Messages.sealed_types),
+ new char[][] {TypeConstants.SEALED, TypeConstants.PERMITS},
+ true),
+ ;
+
+ final long compliance;
+ final String name;
+ final boolean isPreview;
+ char[][] restrictedKeywords;
+
+ public boolean isPreview() {
+ return this.isPreview;
+ }
+ public String getName() {
+ return this.name;
+ }
+ public long getCompliance() {
+ return this.compliance;
+ }
+ public char[][] getRestrictedKeywords() {
+ return this.restrictedKeywords;
+ }
+ public boolean isSupported(CompilerOptions options) {
+ if (this.isPreview)
+ return options.enablePreviewFeatures;
+ return this.getCompliance() <= options.sourceLevel;
+ }
+ public boolean isSupported(long comp, boolean preview) {
+ if (this.isPreview)
+ return preview;
+ return this.getCompliance() <= comp;
+ }
+
+ JavaFeature(long compliance, String name, char[][] restrictedKeywords, boolean isPreview) {
+ this.compliance = compliance;
+ this.name = name;
+ this.isPreview = isPreview;
+ this.restrictedKeywords = restrictedKeywords;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index 593832352a..f44a6c60e5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -97,6 +97,7 @@ public class BinaryTypeBinding extends ReferenceBinding {
protected ReferenceBinding superclass;
protected ReferenceBinding enclosingType;
protected ReferenceBinding[] superInterfaces;
+ protected ReferenceBinding[] permittedSubtypes;
protected FieldBinding[] fields;
protected MethodBinding[] methods;
protected ReferenceBinding[] memberTypes;
@@ -261,6 +262,7 @@ public BinaryTypeBinding(BinaryTypeBinding prototype) {
this.superclass = prototype.superclass;
this.enclosingType = prototype.enclosingType;
this.superInterfaces = prototype.superInterfaces;
+ this.permittedSubtypes = prototype.permittedSubtypes;
this.fields = prototype.fields;
this.methods = prototype.methods;
this.memberTypes = prototype.memberTypes;
@@ -442,6 +444,7 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
// and still want to use binaries passed that point (e.g. type hierarchy resolver, see bug 63748).
this.typeVariables = Binding.NO_TYPE_VARIABLES;
this.superInterfaces = Binding.NO_SUPERINTERFACES;
+ this.permittedSubtypes = Binding.NO_PERMITTEDTYPES;
// must retrieve member types in case superclass/interfaces need them
this.memberTypes = Binding.NO_MEMBER_TYPES;
@@ -526,6 +529,20 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
}
}
+
+ this.permittedSubtypes = Binding.NO_PERMITTEDTYPES;
+ char[][] permittedSubtypeNames = binaryType.getPermittedSubtypeNames();
+ if (permittedSubtypeNames != null) {
+ this.modifiers |= ExtraCompilerModifiers.AccSealed;
+ int size = permittedSubtypeNames.length;
+ if (size > 0) {
+ this.permittedSubtypes = new ReferenceBinding[size];
+ for (short i = 0; i < size; i++)
+ // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
+ this.permittedSubtypes[i] = this.environment.getTypeFromConstantPoolName(permittedSubtypeNames[i], 0, -1, false, missingTypeNames, toplevelWalker.toSupertype(i, superclassName));
+ this.extendedTagBits |= ExtendedTagBits.HasUnresolvedPermittedSubtypes;
+ }
+ }
} else {
// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
this.superclass = (ReferenceBinding) this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames,
@@ -544,6 +561,20 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
types.toArray(this.superInterfaces);
this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
}
+
+ this.permittedSubtypes = Binding.NO_PERMITTEDTYPES;
+ if (!wrapper.atEnd()) {
+ // attempt to find each permitted type if it exists in the cache (otherwise - resolve it when requested)
+ java.util.ArrayList types = new java.util.ArrayList(2);
+ short rank = 0;
+ do {
+ types.add(this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames, toplevelWalker.toSupertype(rank++, wrapper.peekFullType())));
+ } while (!wrapper.atEnd());
+ this.permittedSubtypes = new ReferenceBinding[types.size()];
+ types.toArray(this.permittedSubtypes);
+ this.extendedTagBits |= ExtendedTagBits.HasUnresolvedPermittedSubtypes;
+ }
+
}
boolean canUseNullTypeAnnotations = this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled && this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8;
if (canUseNullTypeAnnotations && this.externalAnnotationStatus.isPotentiallyUnannotatedLib()) {
@@ -556,6 +587,12 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
break;
}
}
+ for (TypeBinding permsub : this.permittedSubtypes) {
+ if (permsub.hasNullTypeAnnotations()) {
+ this.externalAnnotationStatus = ExternalAnnotationStatus.TYPE_IS_ANNOTATED;
+ break;
+ }
+ }
}
}
@@ -1267,6 +1304,7 @@ public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes
refScope.recordTypeReference(this.superclass);
return this.superclass.getExactMethod(selector, argumentTypes, refScope);
}
+ // NOTE: not adding permitted types here since the search is up the hierarchy while permitted ones are down.
}
return null;
}
@@ -2200,6 +2238,18 @@ public ReferenceBinding[] superInterfaces() {
return this.superInterfaces;
}
@Override
+public ReferenceBinding[] permittedTypes() {
+
+ if (!isPrototype()) {
+ return this.permittedSubtypes = this.prototype.permittedTypes();
+ }
+ for (int i = this.permittedSubtypes.length; --i >= 0;)
+ this.permittedSubtypes[i] = (ReferenceBinding) resolveType(this.permittedSubtypes[i], this.environment, false);
+
+ // Note: unlike for superinterfaces() hierarchy check not required here since these are subtypes
+ return this.permittedSubtypes;
+}
+@Override
public TypeVariableBinding[] typeVariables() {
if (!isPrototype()) {
@@ -2267,6 +2317,19 @@ public String toString() {
buffer.append("NULL SUPERINTERFACES"); //$NON-NLS-1$
}
+ if (this.permittedSubtypes != null) {
+ if (this.permittedSubtypes != Binding.NO_PERMITTEDTYPES) {
+ buffer.append("\n\tpermits : "); //$NON-NLS-1$
+ for (int i = 0, length = this.permittedSubtypes.length; i < length; i++) {
+ if (i > 0)
+ buffer.append(", "); //$NON-NLS-1$
+ buffer.append((this.permittedSubtypes[i] != null) ? this.permittedSubtypes[i].debugName() : "NULL TYPE"); //$NON-NLS-1$
+ }
+ }
+ } else {
+ buffer.append("NULL PERMITTEDSUBTYPES"); //$NON-NLS-1$
+ }
+
if (this.enclosingType != null) {
buffer.append("\n\tenclosing type : "); //$NON-NLS-1$
buffer.append(this.enclosingType.debugName());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index e59aca9a59..be075cc361 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -61,6 +61,7 @@ public abstract class Binding {
public static final ReferenceBinding[] ANY_EXCEPTION = new ReferenceBinding[] { null }; // special handler for all exceptions
public static final FieldBinding[] NO_FIELDS = new FieldBinding[0];
public static final MethodBinding[] NO_METHODS = new MethodBinding[0];
+ public static final ReferenceBinding[] NO_PERMITTEDTYPES = new ReferenceBinding[0];
public static final ReferenceBinding[] NO_SUPERINTERFACES = new ReferenceBinding[0];
public static final ReferenceBinding[] NO_MEMBER_TYPES = new ReferenceBinding[0];
public static final TypeVariableBinding[] NO_TYPE_VARIABLES = new TypeVariableBinding[0];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index 34b0fc31f1..a5b92f16c8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -477,9 +477,19 @@ public LocalDeclaration[] findLocalVariableDeclarations(int position) {
}
return null;
}
-
+private boolean isPatternVariableInScope(InvocationSite invocationSite, LocalVariableBinding variable) {
+ LocalVariableBinding[] patternVariablesInScope = invocationSite.getPatternVariablesWhenTrue();
+ if (patternVariablesInScope == null)
+ return false;
+ for (LocalVariableBinding v : patternVariablesInScope) {
+ if (v == variable) {
+ return true;
+ }
+ }
+ return false;
+}
@Override
-public LocalVariableBinding findVariable(char[] variableName) {
+public LocalVariableBinding findVariable(char[] variableName, InvocationSite invocationSite) {
int varLength = variableName.length;
for (int i = this.localIndex-1; i >= 0; i--) { // lookup backward to reach latest additions first
LocalVariableBinding local = this.locals[i];
@@ -495,8 +505,14 @@ public LocalVariableBinding findVariable(char[] variableName) {
if ((local.modifiers & ExtraCompilerModifiers.AccPatternVariable) == 0)
continue;
char[] localName;
- if ((localName = local.name).length == varLength && CharOperation.equals(localName, variableName))
+ if ((localName = local.name).length != varLength || !CharOperation.equals(localName, variableName))
+ continue;
+ if ((local.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) {
return local;
+ }
+ if (isPatternVariableInScope(invocationSite, local)) {
+ return local;
+ }
}
return null;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index 9031bf0790..72a1921d91 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -35,7 +35,11 @@ package org.eclipse.jdt.internal.compiler.lookup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
+
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
@@ -82,6 +86,7 @@ public class ClassScope extends Scope {
}
}
anonymousType.typeBits |= inheritedBits;
+ anonymousType.setPermittedTypes(Binding.NO_PERMITTEDTYPES); // JLS 15 JEP 360 Preview - Sec 15.9.5
if (supertype.isInterface()) {
anonymousType.setSuperClass(getJavaLangObject());
anonymousType.setSuperInterfaces(new ReferenceBinding[] { supertype });
@@ -97,6 +102,7 @@ public class ClassScope extends Scope {
} else {
anonymousType.setSuperClass(supertype);
anonymousType.setSuperInterfaces(Binding.NO_SUPERINTERFACES);
+ checkForEnumSealedPreview(supertype, anonymousType);
TypeReference typeReference = this.referenceContext.allocation.type;
if (typeReference != null) { // no check for enum constant body
this.referenceContext.superclass = typeReference;
@@ -118,6 +124,10 @@ public class ClassScope extends Scope {
problemReporter().superTypeCannotUseWildcard(anonymousType, typeReference, supertype);
anonymousType.tagBits |= TagBits.HierarchyHasProblems;
anonymousType.setSuperClass(getJavaLangObject());
+ } else if (supertype.isSealed()) {
+ problemReporter().sealedAnonymousClassCannotExtendSealedType(typeReference, supertype);
+ anonymousType.tagBits |= TagBits.HierarchyHasProblems;
+ anonymousType.setSuperClass(getJavaLangObject());
}
}
}
@@ -127,6 +137,27 @@ public class ClassScope extends Scope {
anonymousType.verifyMethods(environment().methodVerifier());
}
+ private void checkForEnumSealedPreview(ReferenceBinding supertype, LocalTypeBinding anonymousType) {
+ if (compilerOptions().sourceLevel < ClassFileConstants.JDK15
+ || !compilerOptions().enablePreviewFeatures
+ || !supertype.isEnum()
+ || !(supertype instanceof SourceTypeBinding))
+ return;
+
+ SourceTypeBinding sourceSuperType = (SourceTypeBinding) supertype;
+ ReferenceBinding[] permTypes = sourceSuperType.permittedTypes();
+ int sz = permTypes == null ? 0 : permTypes.length;
+ if (sz == 0) {
+ permTypes = new ReferenceBinding[] {anonymousType};
+ } else {
+ System.arraycopy(permTypes, 0,
+ permTypes = new ReferenceBinding[sz + 1], 0,
+ sz);
+ permTypes[sz] = anonymousType;
+ }
+ sourceSuperType.setPermittedTypes(permTypes);
+ }
+
void buildComponents() {
SourceTypeBinding sourceType = this.referenceContext.binding;
if (!sourceType.isRecord()) return;
@@ -178,8 +209,11 @@ public class ClassScope extends Scope {
sourceType.setComponents(componentBindings);
}
private void checkAndSetModifiersForComponents(RecordComponentBinding compBinding, RecordComponent comp) {
- // TODO Auto-generated method stub
-
+ int modifiers = compBinding.modifiers;
+ int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag;
+ if (realModifiers != 0 && comp != null){
+ problemReporter().recordComponentsCannotHaveModifiers(comp);
+ }
}
void buildFields() {
@@ -319,6 +353,7 @@ public class ClassScope extends Scope {
LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage);
connectTypeHierarchy();
+ connectImplicitPermittedTypes();
if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
checkParameterizedTypeBounds();
checkParameterizedSuperTypeCollisions();
@@ -525,6 +560,8 @@ public class ClassScope extends Scope {
private void checkAndSetModifiers() {
SourceTypeBinding sourceType = this.referenceContext.binding;
int modifiers = sourceType.modifiers;
+ boolean isPreviewEnabled = compilerOptions().sourceLevel == ClassFileConstants.getLatestJDKLevel() &&
+ compilerOptions().enablePreviewFeatures;
if (sourceType.isRecord()) {
/* JLS 14 Records Sec 8.10 - A record declaration is implicitly final. */
modifiers |= ClassFileConstants.AccFinal;
@@ -553,14 +590,26 @@ public class ClassScope extends Scope {
}
} else if (sourceType.isLocalType()) {
if (sourceType.isEnum()) {
- problemReporter().illegalLocalTypeDeclaration(this.referenceContext);
- sourceType.modifiers = 0;
- return;
+ if (!isPreviewEnabled) {
+ problemReporter().illegalLocalTypeDeclaration(this.referenceContext);
+ sourceType.modifiers = 0;
+ return;
+ }
+ if ((modifiers & ClassFileConstants.AccStatic) != 0) {
+ problemReporter().recordIllegalStaticModifierForLocalClassOrInterface(sourceType);
+ return;
+ }
+ modifiers |= ClassFileConstants.AccStatic;
} else if (sourceType.isRecord()) {
if (enclosingType != null && enclosingType.isLocalType()) {
problemReporter().illegalLocalTypeDeclaration(this.referenceContext);
return;
}
+ if ((modifiers & ClassFileConstants.AccStatic) != 0) {
+ problemReporter().recordIllegalStaticModifierForLocalClassOrInterface(sourceType);
+ return;
+ }
+ modifiers |= ClassFileConstants.AccStatic;
}
if (sourceType.isAnonymousType()) {
if (compilerOptions().complianceLevel < ClassFileConstants.JDK9)
@@ -634,6 +683,15 @@ public class ClassScope extends Scope {
if ((realModifiers & unexpectedModifiers) != 0)
problemReporter().illegalModifierForLocalInterface(sourceType);
*/
+ } else if (isPreviewEnabled && sourceType.isLocalType()) {
+ final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface
+ | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
+ if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
+ problemReporter().localStaticsIllegalVisibilityModifierForInterfaceLocalType(sourceType);
+// if ((modifiers & ClassFileConstants.AccStatic) != 0) {
+// problemReporter().recordIllegalStaticModifierForLocalClassOrInterface(sourceType);
+// }
+ modifiers |= ClassFileConstants.AccStatic;
} else {
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccStrictfp | ClassFileConstants.AccAnnotation);
if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
@@ -650,11 +708,13 @@ public class ClassScope extends Scope {
modifiers |= ClassFileConstants.AccSynthetic;
}
modifiers |= ClassFileConstants.AccAbstract;
- } else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
+ } else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
+ boolean flagSealedNonModifiers = isPreviewEnabled &&
+ (modifiers & (ExtraCompilerModifiers.AccSealed | ExtraCompilerModifiers.AccNonSealed)) != 0;
// detect abnormal cases for enums
if (isMemberType) { // includes member types defined inside local types
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStatic | ClassFileConstants.AccStrictfp | ClassFileConstants.AccEnum);
- if ((realModifiers & UNEXPECTED_MODIFIERS) != 0) {
+ if ((realModifiers & UNEXPECTED_MODIFIERS) != 0 || flagSealedNonModifiers) {
problemReporter().illegalModifierForMemberEnum(sourceType);
modifiers &= ~ClassFileConstants.AccAbstract; // avoid leaking abstract modifier
realModifiers &= ~ClassFileConstants.AccAbstract;
@@ -665,7 +725,7 @@ public class ClassScope extends Scope {
// each enum constant is an anonymous local type and its modifiers were already checked as an enum constant field
} else {
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccStrictfp | ClassFileConstants.AccEnum);
- if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
+ if ((realModifiers & UNEXPECTED_MODIFIERS) != 0 || flagSealedNonModifiers)
problemReporter().illegalModifierForEnum(sourceType);
}
if (!sourceType.isAnonymousType()) {
@@ -721,6 +781,8 @@ public class ClassScope extends Scope {
}
modifiers |= ClassFileConstants.AccFinal;
}
+ if (isPreviewEnabled && (modifiers & ClassFileConstants.AccFinal) == 0)
+ modifiers |= ExtraCompilerModifiers.AccSealed;
}
} else if (sourceType.isRecord()) {
if (isMemberType) {
@@ -733,7 +795,9 @@ public class ClassScope extends Scope {
problemReporter().illegalModifierForLocalClass(sourceType);
} else {
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccFinal | ClassFileConstants.AccStrictfp);
- if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
+ if ((realModifiers & UNEXPECTED_MODIFIERS) != 0
+ || (modifiers & ExtraCompilerModifiers.AccNonSealed) != 0
+ || (modifiers & ExtraCompilerModifiers.AccSealed) != 0)
problemReporter().illegalModifierForRecord(sourceType);
}
// JLS 14 8.10 : It is a compile-time error if a record declaration has the modifier abstract.
@@ -760,8 +824,11 @@ public class ClassScope extends Scope {
if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
problemReporter().illegalModifierForMemberClass(sourceType);
} else if (sourceType.isLocalType()) {
+ boolean flagSealedNonModifiers = compilerOptions().sourceLevel >= ClassFileConstants.JDK15 &&
+ compilerOptions().enablePreviewFeatures &&
+ (modifiers & (ExtraCompilerModifiers.AccSealed | ExtraCompilerModifiers.AccNonSealed)) != 0;
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccFinal | ClassFileConstants.AccStrictfp);
- if ((realModifiers & UNEXPECTED_MODIFIERS) != 0)
+ if ((realModifiers & UNEXPECTED_MODIFIERS) != 0 || flagSealedNonModifiers)
problemReporter().illegalModifierForLocalClass(sourceType);
} else {
final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract | ClassFileConstants.AccFinal | ClassFileConstants.AccStrictfp);
@@ -1053,6 +1120,7 @@ public class ClassScope extends Scope {
if (sourceType.id == TypeIds.T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
sourceType.setSuperClass(null);
sourceType.setSuperInterfaces(Binding.NO_SUPERINTERFACES);
+ sourceType.setPermittedTypes(Binding.NO_PERMITTEDTYPES);
if (!sourceType.isClass())
problemReporter().objectMustBeClass(sourceType);
if (this.referenceContext.superclass != null || (this.referenceContext.superInterfaces != null && this.referenceContext.superInterfaces.length > 0))
@@ -1140,6 +1208,99 @@ public class ClassScope extends Scope {
}
return !foundCycle;
}
+ // Call only when we know there's no explicit permits clause and this is a sealed type
+ private void connectImplicitPermittedTypes(SourceTypeBinding sourceType) {
+ List<SourceTypeBinding> types = new ArrayList<>();
+ for (TypeDeclaration typeDecl : this.referenceCompilationUnit().types) {
+ types.addAll(sourceType.collectAllTypeBindings(typeDecl, this.compilationUnitScope()));
+ }
+ Set<ReferenceBinding> permSubTypes = new LinkedHashSet<>();
+ for (ReferenceBinding type : types) {
+ if (!TypeBinding.equalsEquals(type, sourceType) && type.findSuperTypeOriginatingFrom(sourceType) != null) {
+ permSubTypes.add(type);
+ }
+ }
+ if (permSubTypes.size() == 0) {
+ problemReporter().sealedSealedTypeMissingPermits(sourceType, this.referenceContext);
+ return;
+ }
+ sourceType.setPermittedTypes(permSubTypes.toArray(new ReferenceBinding[0]));
+ }
+/**
+ * @see #connectPermittedTypes()
+ */
+ void connectImplicitPermittedTypes() {
+ TypeDeclaration typeDecl = this.referenceContext;
+ SourceTypeBinding sourceType = typeDecl.binding;
+ if (sourceType.id == TypeIds.T_JavaLangObject || sourceType.isEnum() || sourceType.isRecord()) // already handled
+ return;
+ if (sourceType.isSealed() && (typeDecl.permittedTypes == null ||
+ typeDecl.permittedTypes.length == 0)) {
+ connectImplicitPermittedTypes(sourceType);
+ }
+ ReferenceBinding[] memberTypes = sourceType.memberTypes;
+ if (memberTypes != null && memberTypes != Binding.NO_MEMBER_TYPES) {
+ for (int i = 0, size = memberTypes.length; i < size; i++)
+ ((SourceTypeBinding) memberTypes[i]).scope.connectImplicitPermittedTypes();
+ }
+ }
+ /**
+ * This method only deals with the permitted types that are explicitly declared
+ * in a type's permits clause. The implicitly permitted types are all filled in
+ * in {@link #connectImplicitPermittedTypes()}. The reason being, the implicitly
+ * permitted types require the complete type hierarchy to be ready. Therefore, this
+ * method is called inside {@link #connectTypeHierarchy()} and connectImplicitPermittedTypes()
+ * is called after the connectTypeHierarchy(). Why can't we do both after connectTypeHierarchy()?
+ * That is because, in a very specific case of one of an explicitly permitted type also being
+ * a member type and is referenced in the permits clause without type qualifier, we would allow
+ * the following incorrect code:
+ * <pre>
+ * public sealed class X permits Y {
+ * final class Y extends X {}
+ * }
+ * </pre>
+ * If we were to resolve <code>Y</code> in <code>permits Y</code> after resolving
+ * the hierarchy, Y is resolved in current scope. However, Y should only be
+ * allowed with the qualifier, in this case, X.Y.
+ */
+ void connectPermittedTypes() {
+ SourceTypeBinding sourceType = this.referenceContext.binding;
+ sourceType.setPermittedTypes(Binding.NO_PERMITTEDTYPES);
+ if (this.referenceContext.permittedTypes == null) {
+ return;
+ }
+ if (sourceType.id == TypeIds.T_JavaLangObject || sourceType.isEnum()) // already handled
+ return;
+
+ int length = this.referenceContext.permittedTypes.length;
+ ReferenceBinding[] permittedTypeBindings = new ReferenceBinding[length];
+ int count = 0;
+ nextPermittedType : for (int i = 0; i < length; i++) {
+ TypeReference permittedTypeRef = this.referenceContext.permittedTypes[i];
+ ReferenceBinding permittedType = findPermittedtype(permittedTypeRef);
+ if (permittedType == null) { // detected cycle
+ continue nextPermittedType;
+ }
+ // check for simple interface collisions
+ // Check for a duplicate interface once the name is resolved, otherwise we may be confused (i.e. a.b.I and c.d.I)
+ for (int j = 0; j < i; j++) {
+ if (TypeBinding.equalsEquals(permittedTypeBindings[j], permittedType)) {
+ problemReporter().sealedDuplicateTypeInPermits(sourceType, permittedTypeRef, permittedType);
+ continue nextPermittedType;
+ }
+ }
+ // only want to reach here when no errors are reported
+ permittedTypeBindings[count++] = permittedType;
+ }
+ // hold onto all correctly resolved superinterfaces
+ if (count > 0) {
+ if (count != length)
+ System.arraycopy(permittedTypeBindings, 0, permittedTypeBindings = new ReferenceBinding[count], 0, count);
+ sourceType.setPermittedTypes(permittedTypeBindings);
+ } else {
+ sourceType.setPermittedTypes(Binding.NO_PERMITTEDTYPES);
+ }
+ }
private boolean connectRecordSuperclass() {
SourceTypeBinding sourceType = this.referenceContext.binding;
@@ -1245,6 +1406,7 @@ public class ClassScope extends Scope {
environment().typesBeingConnected.add(sourceType);
boolean noProblems = connectSuperclass();
noProblems &= connectSuperInterfaces();
+ connectPermittedTypes();
environment().typesBeingConnected.remove(sourceType);
sourceType.tagBits |= TagBits.EndHierarchyCheck;
noProblems &= connectTypeVariables(this.referenceContext.typeParameters, false);
@@ -1303,6 +1465,7 @@ public class ClassScope extends Scope {
environment().typesBeingConnected.add(sourceType);
boolean noProblems = connectSuperclass();
noProblems &= connectSuperInterfaces();
+ connectPermittedTypes();
environment().typesBeingConnected.remove(sourceType);
sourceType.tagBits |= TagBits.EndHierarchyCheck;
noProblems &= connectTypeVariables(this.referenceContext.typeParameters, false);
@@ -1462,6 +1625,7 @@ public class ClassScope extends Scope {
} catch (AbortCompilation e) {
SourceTypeBinding sourceType = this.referenceContext.binding;
if (sourceType.superInterfaces == null) sourceType.setSuperInterfaces(Binding.NO_SUPERINTERFACES); // be more resilient for hierarchies (144976)
+ if (sourceType.permittedTypes == null) sourceType.setPermittedTypes(Binding.NO_PERMITTEDTYPES);
e.updateContext(typeReference, referenceCompilationUnit().compilationResult);
throw e;
} finally {
@@ -1470,6 +1634,24 @@ public class ClassScope extends Scope {
}
}
+ private ReferenceBinding findPermittedtype(TypeReference typeReference) {
+ CompilationUnitScope unitScope = compilationUnitScope();
+ LookupEnvironment env = unitScope.environment;
+ try {
+ env.missingClassFileLocation = typeReference;
+ typeReference.aboutToResolve(this); // allows us to trap completion & selection nodes
+ unitScope.recordQualifiedReference(typeReference.getTypeName());
+ ReferenceBinding permittedType = (ReferenceBinding) typeReference.resolveType(this);
+ return permittedType;
+ } catch (AbortCompilation e) {
+ SourceTypeBinding sourceType = this.referenceContext.binding;
+ if (sourceType.permittedTypes == null) sourceType.setPermittedTypes(Binding.NO_PERMITTEDTYPES);
+ e.updateContext(typeReference, referenceCompilationUnit().compilationResult);
+ throw e;
+ } finally {
+ env.missingClassFileLocation = null;
+ }
+ }
/* Answer the problem reporter to use for raising new problems.
*
* Note that as a side-effect, this updates the current reference context
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index 2d3d952226..4d577a7785 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -365,6 +365,10 @@ public char[] computeConstantPoolName(LocalTypeBinding localType) {
void connectTypeHierarchy() {
for (int i = 0, length = this.topLevelTypes.length; i < length; i++)
this.topLevelTypes[i].scope.connectTypeHierarchy();
+ // Wait for all hierarchy information to be built before
+ // checking on permitted types
+ for (int i = 0, length = this.topLevelTypes.length; i < length; i++)
+ this.topLevelTypes[i].scope.connectImplicitPermittedTypes();
}
void faultInImports() {
if (this.tempImports != null)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtendedTagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtendedTagBits.java
index 42a43d4905..c7c7dcf478 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtendedTagBits.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtendedTagBits.java
@@ -18,5 +18,6 @@ import org.eclipse.jdt.internal.compiler.ast.ASTNode;
public interface ExtendedTagBits {
int AreRecordComponentsComplete = ASTNode.Bit1;
+ int HasUnresolvedPermittedSubtypes = ASTNode.Bit2;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
index e142a5896e..1c0cb5f2ac 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
@@ -45,12 +45,14 @@ public interface ExtraCompilerModifiers { // modifier constant
final int AccUnresolved = ASTNode.Bit26;
final int AccBlankFinal = ASTNode.Bit27; // for blank final variables
final int AccIsDefaultConstructor = ASTNode.Bit27; // for default constructor
+ final int AccNonSealed = ASTNode.Bit27; // for class/interface
final int AccLocallyUsed = ASTNode.Bit28; // used to diagnose unused (a) private/local members or (b) members of private classes
// generally set when actual usage has been detected
// or, (b) when member of a private class is exposed via a non-private subclass
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=328281
final int AccVisibilityMASK = ClassFileConstants.AccPublic | ClassFileConstants.AccProtected | ClassFileConstants.AccPrivate;
+ final int AccSealed = ASTNode.Bit29; // used for class/interface to set sealed
final int AccOverriding = ASTNode.Bit29; // record fact a method overrides another one
final int AccImplementing = ASTNode.Bit30; // record fact a method implements another one (it is concrete and overrides an abstract one)
final int AccGenericSignature = ASTNode.Bit31; // record fact a type/method/field involves generics in its signature (and need special signature attr)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
index afb5f22e0d..b37cc5a28f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -40,6 +40,9 @@ public interface InvocationSite {
boolean receiverIsImplicitThis();
boolean checkingPotentialCompatibility();
void acceptPotentiallyCompatibleMethods(MethodBinding [] methods);
+ public default LocalVariableBinding[] getPatternVariablesWhenTrue() {
+ return null;
+ }
/** When inference for this invocationSite starts, get a fresh inference context, initialized from this site. */
InferenceContext18 freshInferenceContext(Scope scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
index c251ad855c..a09a3f0a7b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
@@ -8,7 +8,6 @@
*
* SPDX-License-Identifier: EPL-2.0
*
- * Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contributions for
* bug 349326 - [1.7] new warning for missing try-with-resources
@@ -67,6 +66,8 @@ public class MethodScope extends BlockScope {
// remember suppressed warning re missing 'default:' to give hints on possibly related flow problems
public boolean hasMissingSwitchDefault; // TODO(stephan): combine flags to a bitset?
+ public boolean isCompactConstructorScope = false;
+
static {
if (Boolean.getBoolean("jdt.flow.test.extra")) { //$NON-NLS-1$
baseAnalysisIndex = 64;
@@ -115,7 +116,9 @@ private void checkAndSetModifiersForConstructor(MethodBinding methodBinding) {
if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0)
problemReporter().duplicateModifierForMethod(declaringClass, (AbstractMethodDeclaration) this.referenceContext);
- if ((((ConstructorDeclaration) this.referenceContext).bits & ASTNode.IsDefaultConstructor) != 0) {
+ int astNodeBits = ((ConstructorDeclaration) this.referenceContext).bits;
+ if ((astNodeBits & ASTNode.IsDefaultConstructor) != 0
+ ||((astNodeBits & ASTNode.IsImplicit) != 0 && (astNodeBits & ASTNode.IsCanonicalConstructor) != 0)) {
// certain flags are propagated from declaring class onto constructor
final int DECLARING_FLAGS = ClassFileConstants.AccEnum|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
final int VISIBILITY_FLAGS = ClassFileConstants.AccPrivate|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
@@ -152,10 +155,6 @@ private void checkAndSetModifiersForConstructor(MethodBinding methodBinding) {
} else if ((((AbstractMethodDeclaration) this.referenceContext).modifiers & ClassFileConstants.AccStrictfp) != 0) {
// must check the parse node explicitly
problemReporter().illegalModifierForMethod((AbstractMethodDeclaration) this.referenceContext);
- } else if (this.referenceContext instanceof CompactConstructorDeclaration) {
- if ((((AbstractMethodDeclaration) this.referenceContext).modifiers & ClassFileConstants.AccPublic) == 0) {
- problemReporter().recordCanonicalConstructorNotPublic((AbstractMethodDeclaration) this.referenceContext);
- }
}
// check for incompatible modifiers in the visibility bits, isolate the visibility bits
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java
index 2ba5a784a1..389d8d49e3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -38,6 +38,7 @@ public MissingTypeBinding(PackageBinding packageBinding, char[][] compoundName,
this.modifiers = ClassFileConstants.AccPublic;
this.superclass = null; // will be fixed up using #setMissingSuperclass(...)
this.superInterfaces = Binding.NO_SUPERINTERFACES;
+ this.permittedSubtypes = Binding.NO_PERMITTEDTYPES;
this.typeVariables = Binding.NO_TYPE_VARIABLES;
this.memberTypes = Binding.NO_MEMBER_TYPES;
this.fields = Binding.NO_FIELDS;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
index 90f7a9beef..15462264d4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
@@ -82,7 +82,8 @@ public SyntheticArgumentBinding addSyntheticArgument(LocalVariableBinding actual
public SyntheticArgumentBinding addSyntheticArgument(ReferenceBinding targetEnclosingType) {
if (!isPrototype()) throw new IllegalStateException();
if (isStatic()) {
- assert this.isRecord();// a local record is implicitly static; no other local type can be static
+ // Ref JLS 6.1 due to record preview add-on doc: Local Static Interfaces and Enum Classes
+ // a local record, enum and interface allowed, and will be implicitly static
return null;
}
SyntheticArgumentBinding synthLocal = null;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 47efd2fbe7..b978c92403 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -1509,6 +1509,19 @@ private boolean isCompatibleWith0(TypeBinding otherType, /*@Nullable*/ Scope cap
return false;
}
}
+/**
+ * Answer true if the receiver has non-sealed modifier
+ */
+public final boolean isNonSealed() {
+ return (this.modifiers & ExtraCompilerModifiers.AccNonSealed) != 0;
+}
+
+/**
+ * Answer true if the receiver has sealed modifier
+ */
+public boolean isSealed() {
+ return (this.modifiers & ExtraCompilerModifiers.AccSealed) != 0;
+}
@Override
public boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527) {
@@ -2040,6 +2053,11 @@ public ReferenceBinding superclass() {
}
@Override
+public ReferenceBinding[] permittedTypes() {
+ return Binding.NO_PERMITTEDTYPES;
+}
+
+@Override
public ReferenceBinding[] superInterfaces() {
return Binding.NO_SUPERINTERFACES;
}
@@ -2402,6 +2420,8 @@ public ModuleBinding module() {
public boolean hasEnclosingInstanceContext() {
if (isMemberType() && !isStatic())
return true;
+ if (isLocalType() && isStatic())
+ return false;
MethodBinding enclosingMethod = enclosingMethod();
if (enclosingMethod != null)
return !enclosingMethod.isStatic();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index a328f9b517..c61885761e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -2034,8 +2034,7 @@ public abstract class Scope {
return typeBinding;
}
- public LocalVariableBinding findVariable(char[] variable) {
-
+ public LocalVariableBinding findVariable(char[] variable, InvocationSite invocationSite) {
return null;
}
@@ -2090,7 +2089,7 @@ public abstract class Scope {
//$FALL-THROUGH$ could duplicate the code below to save a cast - questionable optimization
case BLOCK_SCOPE :
- LocalVariableBinding variableBinding = scope.findVariable(name);
+ LocalVariableBinding variableBinding = scope.findVariable(name, invocationSite);
// looks in this scope only
if (variableBinding != null) {
if (foundField != null && foundField.isValidBinding())
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 8fc628dc63..58fcc42f33 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -53,6 +53,7 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
+import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -60,7 +61,9 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
@@ -103,6 +106,7 @@ public class SourceTypeBinding extends ReferenceBinding {
private MethodBinding[] methods; // MUST NOT be modified directly, use setter !
public ReferenceBinding[] memberTypes; // MUST NOT be modified directly, use setter !
public TypeVariableBinding[] typeVariables; // MUST NOT be modified directly, use setter !
+ public ReferenceBinding[] permittedTypes; // MUST NOT be modified directly, use setter !
public ClassScope scope;
protected SourceTypeBinding prototype;
@@ -902,7 +906,7 @@ public List<MethodBinding> checkAndAddSyntheticRecordComponentAccessors(MethodBi
accessors = Arrays.stream(methodBindings)
.filter(m -> m.selector != null && m.selector.length > 0)
.filter(m -> filteredComponents.contains(new String(m.selector)))
- .filter(m -> m.parameters == null || m.parameters.length == 0)
+ .filter(m -> m.parameterNames == null || m.parameterNames.length == 0)
.collect(Collectors.toList());
List<String> candidates = accessors.stream()
@@ -913,8 +917,8 @@ public List<MethodBinding> checkAndAddSyntheticRecordComponentAccessors(MethodBi
int missingCount = filteredComponents.size();
for (int i = 0; i < missingCount; ++i) {
RecordComponentBinding rcb = this.getRecordComponent(filteredComponents.get(i).toCharArray());
- assert rcb != null;
- implicitMethods.add(addSyntheticRecordComponentAccessor(rcb, i));
+ if (rcb != null)
+ implicitMethods.add(addSyntheticRecordComponentAccessor(rcb, i));
}
accessors.addAll(implicitMethods);
this.recordComponentAccessors = accessors.toArray(new MethodBinding[0]);
@@ -1067,9 +1071,195 @@ private void checkAnnotationsInType() {
void faultInTypesForFieldsAndMethods() {
if (!isPrototype()) throw new IllegalStateException();
+ checkPermitsInType();
checkAnnotationsInType();
internalFaultInTypeForFieldsAndMethods();
}
+
+private Map.Entry<TypeReference, ReferenceBinding> getFirstSealedSuperTypeOrInterface(TypeDeclaration typeDecl) {
+ boolean isAnySuperTypeSealed = this.superclass != null ? this.superclass.isSealed() : false;
+ if (isAnySuperTypeSealed)
+ return new AbstractMap.SimpleEntry<>(typeDecl.superclass, this.superclass);
+
+ ReferenceBinding[] superInterfaces1 = this.superInterfaces();
+ int l = superInterfaces1 != null ? superInterfaces1.length : 0;
+ for (int i = 0; i < l; ++i) {
+ ReferenceBinding superInterface = superInterfaces1[i];
+ if (superInterface.isSealed()) {
+ return new AbstractMap.SimpleEntry<>(typeDecl.superInterfaces[i], superInterface);
+ }
+ }
+ return null;
+}
+// TODO: Optimize the multiple loops - defer until the feature becomes standard.
+private void checkPermitsInType() {
+ if (this.isRecordDeclaration || this.isEnum())
+ return; // handled separately
+ TypeDeclaration typeDecl = this.scope.referenceContext;
+ if (this.isInterface()) {
+ if (isSealed() && isNonSealed()) {
+ this.scope.problemReporter().sealedInterfaceIsSealedAndNonSealed(this, typeDecl);
+ return;
+ }
+ }
+ boolean hasPermittedTypes = this.permittedTypes != null && this.permittedTypes.length > 0;
+ if (hasPermittedTypes) {
+ if (!this.isSealed())
+ this.scope.problemReporter().sealedMissingSealedModifier(this, typeDecl);
+ ModuleBinding sourceModuleBinding = this.module();
+ boolean isUnnamedModule = sourceModuleBinding.isUnnamed();
+ if (isUnnamedModule) {
+ PackageBinding sourceTypePackage = this.getPackage();
+ for (int i =0, l = this.permittedTypes.length; i < l; i++) {
+ ReferenceBinding permType = this.permittedTypes[i];
+ if (!permType.isValidBinding()) continue;
+ if (sourceTypePackage != permType.getPackage()) {
+ TypeReference permittedTypeRef = typeDecl.permittedTypes[i];
+ this.scope.problemReporter().sealedPermittedTypeOutsideOfPackage(permType, this, permittedTypeRef, sourceTypePackage);
+ }
+ }
+ } else {
+ for (int i = 0, l = this.permittedTypes.length; i < l; i++) {
+ ReferenceBinding permType = this.permittedTypes[i];
+ if (!permType.isValidBinding()) continue;
+ ModuleBinding permTypeModule = permType.module();
+ if (sourceModuleBinding != permTypeModule) {
+ TypeReference permittedTypeRef = typeDecl.permittedTypes[i];
+ this.scope.problemReporter().sealedPermittedTypeOutsideOfModule(permType, this, permittedTypeRef, sourceModuleBinding);
+ }
+ }
+ }
+ }
+
+// ReferenceBinding superType = this.superclass();
+ Map.Entry<TypeReference, ReferenceBinding> sealedEntry = getFirstSealedSuperTypeOrInterface(typeDecl);
+ boolean foundSealedSuperTypeOrInterface = sealedEntry != null;
+ if (this.isLocalType()) {
+ if (this.isSealed() || this.isNonSealed())
+ return; // already handled elsewhere
+ if (foundSealedSuperTypeOrInterface) {
+ this.scope.problemReporter().sealedLocalDirectSuperTypeSealed(this, sealedEntry.getKey(), sealedEntry.getValue());
+ return;
+ }
+ } else if (this.isNonSealed()) {
+ if (!foundSealedSuperTypeOrInterface) {
+ if (this.isClass())
+ this.scope.problemReporter().sealedDisAllowedNonSealedModifierInClass(this, typeDecl);
+ else if (this.isInterface())
+ this.scope.problemReporter().sealedDisAllowedNonSealedModifierInInterface(this, typeDecl);
+ }
+ }
+ if (foundSealedSuperTypeOrInterface) {
+ if (!(this.isFinal() || this.isSealed() || this.isNonSealed())) {
+ if (this.isClass())
+ this.scope.problemReporter().sealedMissingClassModifier(this, typeDecl, sealedEntry.getValue());
+ else if (this.isInterface())
+ this.scope.problemReporter().sealedMissingInterfaceModifier(this, typeDecl, sealedEntry.getValue());
+ }
+ List<SourceTypeBinding> typesInCU = collectAllTypeBindings(typeDecl, this.scope.compilationUnitScope());
+ if (typeDecl.superclass != null && !checkPermitsAndAdd(this.superclass, typesInCU))
+ this.scope.problemReporter().sealedSuperClassDoesNotPermit(this, typeDecl.superclass, this.superclass);
+ for (int i = 0, l = this.superInterfaces.length; i < l; ++i) {
+ ReferenceBinding superInterface = this.superInterfaces[i];
+ if (superInterface != null && !checkPermitsAndAdd(superInterface, typesInCU)) {
+ TypeReference superInterfaceRef = typeDecl.superInterfaces[i];
+ if (this.isClass())
+ this.scope.problemReporter().sealedSuperClassDoesNotPermit(this, superInterfaceRef, superInterface);
+ else if (this.isInterface())
+ this.scope.problemReporter().sealedSuperInterfaceDoesNotPermit(this, superInterfaceRef, superInterface);
+ }
+ }
+ }
+ for (int i = 0, length = this.memberTypes.length; i < length; i++)
+ ((SourceTypeBinding) this.memberTypes[i]).checkPermitsInType();
+
+ if (this.scope.referenceContext.permittedTypes == null) {
+ // Ignore implicitly permitted case
+ return;
+ }
+ // In case of errors, be safe.
+ int l = this.permittedTypes.length <= this.scope.referenceContext.permittedTypes.length ?
+ this.permittedTypes.length : this.scope.referenceContext.permittedTypes.length;
+ for (int i = 0; i < l; i++) {
+ TypeReference permittedTypeRef = this.scope.referenceContext.permittedTypes[i];
+ ReferenceBinding permittedType = this.permittedTypes[i];
+ if (permittedType == null || !permittedType.isValidBinding())
+ continue;
+ if (this.isClass()) {
+ ReferenceBinding permSuperType = permittedType.superclass();
+ if (!TypeBinding.equalsEquals(this, permSuperType)) {
+ this.scope.problemReporter().sealedNotDirectSuperClass(permittedType, permittedTypeRef, this);
+ continue;
+ }
+ } else if (this.isInterface()) {
+ ReferenceBinding[] permSuperInterfaces = permittedType.superInterfaces();
+ boolean foundSuperInterface = false;
+ if (permSuperInterfaces != null) {
+ for (ReferenceBinding psi : permSuperInterfaces) {
+ if (TypeBinding.equalsEquals(this, psi)) {
+ foundSuperInterface = true;
+ break;
+ }
+ }
+ if (!foundSuperInterface) {
+ this.scope.problemReporter().sealedNotDirectSuperInterface(permittedType, permittedTypeRef, this);
+ continue;
+ }
+ }
+ }
+ }
+ return;
+}
+public List<SourceTypeBinding> collectAllTypeBindings(TypeDeclaration typeDecl, CompilationUnitScope unitScope) {
+ class TypeBindingsCollector extends ASTVisitor {
+ List<SourceTypeBinding> types = new ArrayList<>();
+ @Override
+ public boolean visit(
+ TypeDeclaration localTypeDeclaration,
+ BlockScope scope1) {
+ checkAndAddBinding(localTypeDeclaration.binding);
+ return true;
+ }
+ @Override
+ public boolean visit(
+ TypeDeclaration memberTypeDeclaration,
+ ClassScope scope1) {
+ checkAndAddBinding(memberTypeDeclaration.binding);
+ return true;
+ }
+ @Override
+ public boolean visit(
+ TypeDeclaration typeDeclaration,
+ CompilationUnitScope scope1) {
+ checkAndAddBinding(typeDeclaration.binding);
+ return true; // do nothing by default, keep traversing
+ }
+ private void checkAndAddBinding(SourceTypeBinding stb) {
+ if (stb != null)
+ this.types.add(stb);
+ }
+ }
+ TypeBindingsCollector typeCollector = new TypeBindingsCollector();
+ typeDecl.traverse(typeCollector, unitScope);
+ return typeCollector.types;
+}
+
+private boolean checkPermitsAndAdd(ReferenceBinding superType, List<SourceTypeBinding> types) {
+ if (superType == null
+ || superType.equals(this.scope.getJavaLangObject()))
+ return true;
+ if (superType.isSealed()) {
+ if (superType.isParameterizedType() || superType.isRawType())
+ superType = superType.actualType();
+ ReferenceBinding[] superPermittedTypes = superType.permittedTypes();
+ for (ReferenceBinding permittedType : superPermittedTypes) {
+ if (permittedType.isValidBinding() && TypeBinding.equalsEquals(this, permittedType))
+ return true;
+ }
+ }
+ return false;
+}
+
public RecordComponentBinding[] components() {
if (!this.isRecordDeclaration)
@@ -1111,7 +1301,8 @@ public RecordComponentBinding[] components() {
if (rcb.type instanceof TypeVariableBinding ||
rcb.type instanceof ParameterizedTypeBinding)
smb.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
- smb.returnType = rcb.type;
+ // Don't copy the annotations to the accessor method's return type from record component
+ smb.returnType = rcb.type.unannotated();
// add code for implicit canonical constructor argument annotations also
for (FieldBinding f : this.fields) {
if (f.isRecordComponent() && CharOperation.equals(f.name, rcb.name)) {
@@ -1879,32 +2070,38 @@ private int getImplicitCanonicalConstructor() {
}
return -1;
}
-private MethodBinding[] checkAndGetExplicitCanonicalConstructors() {
- List<MethodBinding> ec = new ArrayList<>();
- if (!this.isRecordDeclaration)
- return ec.toArray(new MethodBinding[0]);
-
+private void checkAndGetExplicitCanonicalConstructors() {
RecordComponentBinding[] recComps = this.components;
int nRecordComponents = recComps.length;
- if (this.methods != null && this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK14) {
- for (MethodBinding method : this.methods) {
- if (!method.isConstructor() || (method.tagBits & TagBits.isImplicit) != 0
- || method.parameters.length != nRecordComponents)
- continue;
- boolean isEC = true;
- for (int j = 0; j < nRecordComponents; ++j) {
- if (TypeBinding.notEquals(method.parameters[j], recComps[j].type)) {
- isEC = false;
- break;
- }
- }
- if (isEC) {
- ec.add(method);
- checkRecordCanonicalConstructor(method);
+ MethodBinding implicitCanConstr = null;
+ MethodBinding explictCanConstr = null;
+ for (MethodBinding method : this.methods) {
+ if (!method.isConstructor())
+ continue;
+ if ((method.tagBits & TagBits.isImplicit) != 0) {
+ implicitCanConstr = method;
+ continue;
+ }
+ if (method.parameters.length != nRecordComponents)
+ continue;
+ boolean isEC = true;
+ for (int j = 0; j < nRecordComponents; ++j) {
+ if (TypeBinding.notEquals(method.parameters[j], recComps[j].type)) {
+ isEC = false;
+ break;
}
}
+ if (isEC) {
+ checkRecordCanonicalConstructor(method);
+ // Just exit after sighting the first explicit canonical constructor,
+ // because there can only be one.
+ explictCanConstr = method;
+ break;
+ }
+ }
+ if (explictCanConstr == null && implicitCanConstr != null) {
+ checkAndFlagHeapPollution(implicitCanConstr, implicitCanConstr.sourceMethod());
}
- return ec.toArray(new MethodBinding[0]);
}
private int getImplicitMethod(char[] name) {
if (this.methods != null && this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK14) {
@@ -1968,9 +2165,12 @@ public MethodBinding[] methods() {
// find & report collision cases
boolean complyTo15OrAbove = this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5;
boolean compliance16 = this.scope.compilerOptions().complianceLevel == ClassFileConstants.JDK1_6;
- int recordCanonIndex = getImplicitCanonicalConstructor();
- computeRecordComponents();
- checkAndGetExplicitCanonicalConstructors();
+ int recordCanonIndex = -1;
+ if (this.isRecordDeclaration) {
+ recordCanonIndex = getImplicitCanonicalConstructor();
+ computeRecordComponents();
+ checkAndGetExplicitCanonicalConstructors();
+ }
int recordEqualsIndex = getImplicitMethod(TypeConstants.EQUALS);
for (int i = 0, length = this.methods.length; i < length; i++) {
@@ -2176,16 +2376,49 @@ public MethodBinding[] methods() {
return this.methods;
}
+static boolean isAtleastAsAccessibleAsRecord(MethodBinding canonicalConstructor) {
+ ReferenceBinding enclosingRecord = canonicalConstructor.declaringClass;
+ if (enclosingRecord.isPublic())
+ return canonicalConstructor.isPublic();
+
+ if (enclosingRecord.isProtected())
+ return canonicalConstructor.isPublic() || canonicalConstructor.isProtected();
+
+ if (enclosingRecord.isPrivate())
+ return true;
+
+ /* package visibility */
+ return !canonicalConstructor.isPrivate();
+}
+
+private void checkCanonicalConstructorParameterNames(MethodBinding explicitCanonicalConstructor,
+ AbstractMethodDeclaration methodDecl) {
+ int l = explicitCanonicalConstructor.parameters != null ? explicitCanonicalConstructor.parameters.length : 0;
+ if (l == 0) return;
+ ReferenceBinding enclosingRecord = explicitCanonicalConstructor.declaringClass;
+ assert enclosingRecord.isRecord();
+ assert enclosingRecord instanceof SourceTypeBinding;
+ SourceTypeBinding recordBinding = (SourceTypeBinding) enclosingRecord;
+ RecordComponentBinding[] comps = recordBinding.components();
+ Argument[] args = methodDecl.arguments;
+ for (int i = 0; i < l; ++i) {
+ if (!CharOperation.equals(args[i].name, comps[i].name))
+ this.scope.problemReporter().recordIllegalParameterNameInCanonicalConstructor(comps[i], args[i]);
+ }
+}
+
private void checkRecordCanonicalConstructor(MethodBinding explicitCanonicalConstructor) {
AbstractMethodDeclaration methodDecl = explicitCanonicalConstructor.sourceMethod();
- if (!explicitCanonicalConstructor.isPublic())
- this.scope.problemReporter().recordCanonicalConstructorNotPublic(methodDecl);
+
+ if (!SourceTypeBinding.isAtleastAsAccessibleAsRecord(explicitCanonicalConstructor))
+ this.scope.problemReporter().recordCanonicalConstructorVisibilityReduced(methodDecl);
TypeParameter[] typeParameters = methodDecl.typeParameters();
if (typeParameters != null && typeParameters.length > 0)
this.scope.problemReporter().recordCanonicalConstructorShouldNotBeGeneric(methodDecl);
if (explicitCanonicalConstructor.thrownExceptions != null && explicitCanonicalConstructor.thrownExceptions.length > 0)
this.scope.problemReporter().recordCanonicalConstructorHasThrowsClause(methodDecl);
+ checkCanonicalConstructorParameterNames(explicitCanonicalConstructor, methodDecl);
explicitCanonicalConstructor.tagBits |= TagBits.IsCanonicalConstructor;
ASTVisitor visitor = new ASTVisitor() {
boolean isInsideCCD = methodDecl instanceof CompactConstructorDeclaration;
@@ -2220,6 +2453,11 @@ private void checkRecordCanonicalConstructor(MethodBinding explicitCanonicalCons
}
@Override
+public ReferenceBinding[] permittedTypes() {
+ return this.permittedTypes;
+}
+
+@Override
public TypeBinding prototype() {
return this.prototype;
}
@@ -2309,9 +2547,9 @@ public FieldBinding resolveTypeFor(FieldBinding field) {
// copy annotations from record component if applicable
if (field.isRecordComponent()) {
RecordComponentBinding rcb = getRecordComponent(field.name);
- assert rcb != null;
- relevantRecordComponentAnnotations = ASTNode.copyRecordComponentAnnotations(initializationScope,
- field, rcb.sourceRecordComponent().annotations);
+ if (rcb != null)
+ relevantRecordComponentAnnotations = ASTNode.copyRecordComponentAnnotations(initializationScope,
+ field, rcb.sourceRecordComponent().annotations);
}
}
if (sourceLevel >= ClassFileConstants.JDK1_8) {
@@ -2500,10 +2738,8 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
&& !(sourceLevel >= ClassFileConstants.JDK9 && method.isPrivate())) {
methodDecl.scope.problemReporter().safeVarargsOnNonFinalInstanceMethod(method);
}
- } else if (method.parameters != null && method.parameters.length > 0 && method.isVarargs()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
- if (!method.parameters[method.parameters.length - 1].isReifiable()) {
- methodDecl.scope.problemReporter().possibleHeapPollutionFromVararg(methodDecl.arguments[methodDecl.arguments.length - 1]);
- }
+ } else if ((method.tagBits & TagBits.IsCanonicalConstructor) == 0) {
+ checkAndFlagHeapPollution(method, methodDecl);
}
}
@@ -2599,6 +2835,14 @@ private MethodBinding resolveTypesWithSuspendedTempErrorHandlingPolicy(MethodBin
}
return method;
}
+
+private void checkAndFlagHeapPollution(MethodBinding method, AbstractMethodDeclaration methodDecl) {
+ if (method.parameters != null && method.parameters.length > 0 && method.isVarargs()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337795
+ if (!method.parameters[method.parameters.length - 1].isReifiable()) {
+ methodDecl.scope.problemReporter().possibleHeapPollutionFromVararg(methodDecl.arguments[methodDecl.arguments.length - 1]);
+ }
+ }
+}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391108
private static void rejectTypeAnnotatedVoidMethod(AbstractMethodDeclaration methodDecl) {
Annotation[] annotations = methodDecl.annotations;
@@ -2829,6 +3073,22 @@ public MethodBinding [] setMethods(MethodBinding[] methods) {
return this.methods = methods;
}
+//Propagate writes to all annotated variants so the clones evolve along.
+public ReferenceBinding [] setPermittedTypes(ReferenceBinding [] permittedTypes) {
+
+ if (!isPrototype())
+ return this.prototype.setPermittedTypes(permittedTypes);
+
+ if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
+ TypeBinding [] annotatedTypes = this.scope.environment().getAnnotatedTypes(this);
+ for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
+ SourceTypeBinding annotatedType = (SourceTypeBinding) annotatedTypes[i];
+ annotatedType.permittedTypes = permittedTypes;
+ }
+ }
+ return this.permittedTypes = permittedTypes;
+}
+
// Propagate writes to all annotated variants so the clones evolve along.
public ReferenceBinding setSuperClass(ReferenceBinding superClass) {
@@ -3211,15 +3471,13 @@ public MethodBinding getRecordComponentAccessor(char[] name) {
return accessor;
}
public void computeRecordComponents() {
- if (!this.isRecordDeclaration || this.implicitComponentFields != null)
+ if (!this.isRecord() || this.implicitComponentFields != null)
return;
- RecordComponent[] recComps = this.scope.referenceContext.recordComponents;
+ List<String> recordComponentNames = Stream.of(this.components)
+ .map(arg -> new String(arg.name))
+ .collect(Collectors.toList());
List<FieldBinding> list = new ArrayList<>();
- if (recComps != null && recComps.length > 0 && this.fields != null) {
- List<String> recordComponentNames = new ArrayList<>(0);
- recordComponentNames = Arrays.stream(recComps)
- .map(arg -> new String(arg.name))
- .collect(Collectors.toList());
+ if (recordComponentNames != null && recordComponentNames.size() > 0 && this.fields != null) {
for (String rc : recordComponentNames) {
for (FieldBinding f : this.fields) {
if (rc.equals(new String(f.name))) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
index 53cece980a..3104ee8495 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
@@ -469,7 +469,7 @@ public class SyntheticMethodBinding extends MethodBinding {
SourceTypeBinding declaringSourceType = (SourceTypeBinding) declaringClass;
assert declaringSourceType.isRecord();
this.declaringClass = declaringSourceType;
- this.modifiers = ClassFileConstants.AccPublic;
+ this.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccFinal;
if (this.declaringClass.isStrictfp())
this.modifiers |= ClassFileConstants.AccStrictfp;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
@@ -480,12 +480,10 @@ public class SyntheticMethodBinding extends MethodBinding {
this.parameters = Binding.NO_PARAMETERS;
this.purpose = SyntheticMethodBinding.RecordOverrideToString;
} else if (selector == TypeConstants.HASHCODE) {
- this.modifiers |= ClassFileConstants.AccFinal;
this.returnType = TypeBinding.INT;
this.parameters = Binding.NO_PARAMETERS;
this.purpose = SyntheticMethodBinding.RecordOverrideHashCode;
} else if (selector == TypeConstants.EQUALS) {
- this.modifiers |= ClassFileConstants.AccFinal;
this.returnType = TypeBinding.BOOLEAN;
this.parameters = new TypeBinding[] {declaringSourceType.scope.getJavaLangObject()};
this.purpose = SyntheticMethodBinding.RecordOverrideEquals;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
index 800ec93250..b85a71bf4f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -1722,6 +1722,10 @@ public ReferenceBinding superclass() {
return null;
}
+public ReferenceBinding[] permittedTypes() {
+ return Binding.NO_PERMITTEDTYPES;
+}
+
public ReferenceBinding[] superInterfaces() {
return Binding.NO_SUPERINTERFACES;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 9053c23bb0..1dd1f4f325 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -120,6 +120,9 @@ public interface TypeConstants {
// JEP 359 Records
char[] RECORD_RESTRICTED_IDENTIFIER = "record".toCharArray(); //$NON-NLS-1$
char[] RECORD_CLASS = "Record".toCharArray(); //$NON-NLS-1$
+ // JEP 360 Sealed
+ char[] PERMITS = "permits".toCharArray(); //$NON-NLS-1$
+ char[] SEALED = "sealed".toCharArray(); //$NON-NLS-1$
// jsr308
char[] TYPE_USE_TARGET = "TYPE_USE".toCharArray(); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties
index a56d61af06..69f9da09f4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/messages.properties
@@ -65,3 +65,9 @@ ast_missingCode = Missing code gen implementation
### constant
constant_cannotCastedInto = {0} constant cannot be casted into {1}
constant_cannotConvertedTo = {0} constant cannot be converted to {1}
+
+### Java Language Features
+text_block = Text Blocks
+pattern_matching_instanceof = Pattern Matching in instanceof Expressions
+records = Records
+sealed_types = Sealed Types
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index 436943cb79..26dc831e3a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -485,6 +485,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
protected Object createReturnStatement() { return null; }
protected abstract void createTag();
protected abstract Object createTypeReference(int primitiveToken);
+ protected abstract Object createModuleTypeReference(int primitiveToken, int moduleRefTokenCount);
private int getIndexPosition() {
if (this.index > this.lineEnd) {
@@ -1066,10 +1067,19 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
}
+ private boolean isTokenModule(int token, int moduleRefTokenCount) {
+ return ((token == TerminalTokens.TokenNameDIVIDE)
+ && (moduleRefTokenCount > 0));
+ }
+
+ protected Object parseQualifiedName(boolean reset) throws InvalidInputException {
+ return parseQualifiedName(reset, false);
+ }
+
/*
* Parse a qualified name and built a type reference if the syntax is valid.
*/
- protected Object parseQualifiedName(boolean reset) throws InvalidInputException {
+ protected Object parseQualifiedName(boolean reset, boolean allowModule) throws InvalidInputException {
// Reset identifier stack if requested
if (reset) {
@@ -1080,8 +1090,20 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
// Scan tokens
int primitiveToken = -1;
int parserKind = this.kind & PARSER_KIND;
+ int prevToken = TerminalTokens.TokenNameNotAToken;
+ int curToken = TerminalTokens.TokenNameNotAToken;
+ int moduleRefTokenCount = 0;
+ boolean lookForModule = false;
+ boolean parsingJava15Plus = this.scanner != null ? this.scanner.sourceLevel >= ClassFileConstants.JDK15 : false;
nextToken : for (int iToken = 0; ; iToken++) {
+ if (iToken == 0) {
+ lookForModule = false;
+ prevToken = TerminalTokens.TokenNameNotAToken;
+ } else {
+ prevToken = curToken;
+ }
int token = readTokenSafely();
+ curToken= token;
switch (token) {
case TerminalTokens.TokenNameIdentifier :
if (((iToken & 1) != 0)) { // identifiers must be odd tokens
@@ -1089,6 +1111,9 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
pushIdentifier(iToken == 0, false);
consumeToken();
+ if (allowModule && parsingJava15Plus && getChar() == '/') {
+ lookForModule = true;
+ }
break;
case TerminalTokens.TokenNameRestrictedIdentifierYield:
@@ -1130,11 +1155,14 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
case TerminalTokens.TokenNamelong:
case TerminalTokens.TokenNamenative:
case TerminalTokens.TokenNamenew:
+ case TerminalTokens.TokenNamenon_sealed:
case TerminalTokens.TokenNamenull:
case TerminalTokens.TokenNamepackage:
+ case TerminalTokens.TokenNameRestrictedIdentifierpermits:
case TerminalTokens.TokenNameprivate:
case TerminalTokens.TokenNameprotected:
case TerminalTokens.TokenNamepublic:
+ case TerminalTokens.TokenNameRestrictedIdentifiersealed:
case TerminalTokens.TokenNameshort:
case TerminalTokens.TokenNamestatic:
case TerminalTokens.TokenNamestrictfp:
@@ -1157,6 +1185,18 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
// Fall through default case to verify that we do not leave on a dot
//$FALL-THROUGH$
+ case TerminalTokens.TokenNameDIVIDE:
+ if (parsingJava15Plus && lookForModule) {
+ if (((iToken & 1) == 0) || (moduleRefTokenCount > 0)) { // '/' must be even token
+ throw new InvalidInputException();
+ }
+ moduleRefTokenCount = (iToken+1) / 2;
+ consumeToken();
+ lookForModule = false;
+ break;
+ } // else fall through
+ // Note: Add other cases before this case.
+ //$FALL-THROUGH$
default :
if (iToken == 0) {
if (this.identifierPtr>=0) {
@@ -1164,12 +1204,15 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
return null;
}
- if ((iToken & 1) == 0) { // cannot leave on a dot
+ if ((iToken & 1) == 0 && !isTokenModule(prevToken, moduleRefTokenCount)) { // cannot leave on a dot
switch (parserKind) {
case COMPLETION_PARSER:
if (this.identifierPtr>=0) {
this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr];
}
+ if (moduleRefTokenCount > 0) {
+ return syntaxRecoverModuleQualifiedName(primitiveToken, moduleRefTokenCount);
+ }
return syntaxRecoverQualifiedName(primitiveToken);
case DOM_PARSER:
if (this.currentTokenType != -1) {
@@ -1195,13 +1238,20 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
if (this.identifierPtr>=0) {
this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr];
}
+ if (moduleRefTokenCount > 0) {
+ return createModuleTypeReference(primitiveToken, moduleRefTokenCount);
+ }
return createTypeReference(primitiveToken);
}
+ protected boolean parseReference() throws InvalidInputException {
+ return parseReference(false);
+ }
+
/*
* Parse a reference in @see tag
*/
- protected boolean parseReference() throws InvalidInputException {
+ protected boolean parseReference(boolean allowModule) throws InvalidInputException {
int currentPosition = this.scanner.currentPosition;
try {
Object typeRef = null;
@@ -1291,7 +1341,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
case TerminalTokens.TokenNameIdentifier :
if (typeRef == null) {
typeRefStartPosition = this.scanner.getCurrentTokenStartPosition();
- typeRef = parseQualifiedName(true);
+ typeRef = parseQualifiedName(true, allowModule);
if (this.abort) return false; // May be aborted by specialized parser
break;
}
@@ -1546,6 +1596,32 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
/*
+ * get current character.
+ * Warning: scanner position is unchanged using this method!
+ */
+ private char getChar() {
+ int indexVal = this.index;
+ char c = this.source[indexVal++];
+ if (c == '\\' && this.source[indexVal] == 'u') {
+ int c1, c2, c3, c4;
+ int pos = indexVal;
+ indexVal++;
+ while (this.source[indexVal] == 'u')
+ indexVal++;
+ if (!(((c1 = ScannerHelper.getHexadecimalValue(this.source[indexVal++])) > 15 || c1 < 0)
+ || ((c2 = ScannerHelper.getHexadecimalValue(this.source[indexVal++])) > 15 || c2 < 0)
+ || ((c3 = ScannerHelper.getHexadecimalValue(this.source[indexVal++])) > 15 || c3 < 0)
+ || ((c4 = ScannerHelper.getHexadecimalValue(this.source[indexVal++])) > 15 || c4 < 0))) {
+ c = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
+ } else {
+ // TODO (frederic) currently reset to previous position, perhaps signal a syntax error would be more appropriate
+ indexVal = pos;
+ }
+ }
+ return c;
+ }
+
+ /*
* Read token only if previous was consumed
*/
protected int readToken() throws InvalidInputException {
@@ -1629,6 +1705,14 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
return null;
}
+ /*
+ * Entry point for recovery on invalid syntax
+ */
+ protected Object syntaxRecoverModuleQualifiedName(int primitiveToken, int moduleTokenCount) throws InvalidInputException {
+ // do nothing, just an entry point for recovery
+ return null;
+ }
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index 388eb092c6..98673749f4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -28,6 +28,7 @@ import org.eclipse.jdt.internal.compiler.ast.JavadocArraySingleTypeReference;
import org.eclipse.jdt.internal.compiler.ast.JavadocFieldReference;
import org.eclipse.jdt.internal.compiler.ast.JavadocImplicitTypeReference;
import org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend;
+import org.eclipse.jdt.internal.compiler.ast.JavadocModuleReference;
import org.eclipse.jdt.internal.compiler.ast.JavadocQualifiedTypeReference;
import org.eclipse.jdt.internal.compiler.ast.JavadocReturnStatement;
import org.eclipse.jdt.internal.compiler.ast.JavadocSingleNameReference;
@@ -203,14 +204,24 @@ public class JavadocParser extends AbstractCommentParser {
protected Object createFieldReference(Object receiver) throws InvalidInputException {
try {
// Get receiver type
- TypeReference typeRef = (TypeReference) receiver;
+ TypeReference typeRef = null;
+ boolean useReceiver = false;
+ if (receiver instanceof JavadocModuleReference) {
+ JavadocModuleReference jRef = (JavadocModuleReference)receiver;
+ if (jRef.typeReference != null) {
+ typeRef = jRef.typeReference;
+ useReceiver = true;
+ }
+ } else {
+ typeRef = (TypeReference) receiver;
+ }
if (typeRef == null) {
char[] name = this.sourceParser.compilationUnit.getMainTypeName();
typeRef = new JavadocImplicitTypeReference(name, this.memberStart);
}
// Create field
JavadocFieldReference field = new JavadocFieldReference(this.identifierStack[0], this.identifierPositionStack[0]);
- field.receiver = typeRef;
+ field.receiver = useReceiver ? (Expression)receiver : typeRef;
field.tagSourceStart = this.tagSourceStart;
field.tagSourceEnd = this.tagSourceEnd;
field.tagValue = this.tagValue;
@@ -225,7 +236,15 @@ public class JavadocParser extends AbstractCommentParser {
protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
try {
// Get receiver type
- TypeReference typeRef = (TypeReference) receiver;
+ TypeReference typeRef = null;
+ if (receiver instanceof JavadocModuleReference) {
+ JavadocModuleReference jRef = (JavadocModuleReference)receiver;
+ if (jRef.typeReference != null) {
+ typeRef = jRef.typeReference;
+ }
+ } else {
+ typeRef = (TypeReference) receiver;
+ }
// Decide whether we have a constructor or not
boolean isConstructor = false;
int length = this.identifierLengthStack[0]; // may be > 1 for member class constructor reference
@@ -347,6 +366,43 @@ public class JavadocParser extends AbstractCommentParser {
return typeRef;
}
+ protected JavadocModuleReference createModuleReference(int moduleRefTokenCount) {
+ JavadocModuleReference moduleRef = null;
+ char[][] tokens = new char[moduleRefTokenCount][];
+ System.arraycopy(this.identifierStack, 0, tokens, 0, moduleRefTokenCount);
+ long[] positions = new long[moduleRefTokenCount];
+ System.arraycopy(this.identifierPositionStack, 0, positions, 0, moduleRefTokenCount);
+ moduleRef = new JavadocModuleReference(tokens, positions, this.tagSourceStart, this.tagSourceEnd);
+ return moduleRef;
+ }
+
+ @Override
+ protected Object createModuleTypeReference(int primitiveToken, int moduleRefTokenCount) {
+ JavadocModuleReference moduleRef= createModuleReference(moduleRefTokenCount);
+
+ TypeReference typeRef = null;
+ int size = this.identifierLengthStack[this.identifierLengthPtr];
+ int newSize= size-moduleRefTokenCount;
+ if (newSize == 1) { // Single Type ref
+ typeRef = new JavadocSingleTypeReference(
+ this.identifierStack[this.identifierPtr],
+ this.identifierPositionStack[this.identifierPtr],
+ this.tagSourceStart,
+ this.tagSourceEnd);
+ } else if (newSize > 1) { // Qualified Type ref
+ char[][] tokens = new char[newSize][];
+ System.arraycopy(this.identifierStack, this.identifierPtr - newSize + 1, tokens, 0, newSize);
+ long[] positions = new long[newSize];
+ System.arraycopy(this.identifierPositionStack, this.identifierPtr - newSize + 1, positions, 0, newSize);
+ typeRef = new JavadocQualifiedTypeReference(tokens, positions, this.tagSourceStart, this.tagSourceEnd);
+ } else {
+ this.lastIdentifierEndPosition++;
+ }
+
+ moduleRef.setTypeReference(typeRef);
+ return moduleRef;
+ }
+
/*
* Get current parsed type declaration.
*/
@@ -626,12 +682,12 @@ public class JavadocParser extends AbstractCommentParser {
if (length == TAG_LINK_LENGTH && CharOperation.equals(TAG_LINK, tagName, 0, length)) {
this.tagValue = TAG_LINK_VALUE;
if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) {
- valid= parseReference();
+ valid= parseReference(true);
}
} else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName, 0, length)) {
this.tagValue = TAG_LINKPLAIN_VALUE;
if (this.inlineTagStarted) {
- valid = parseReference();
+ valid = parseReference(true);
}
} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName, 0, length)) {
this.tagValue = TAG_LITERAL_VALUE;
@@ -663,7 +719,7 @@ public class JavadocParser extends AbstractCommentParser {
if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName, 0, length)) {
this.tagValue = TAG_SEE_VALUE;
if (!this.inlineTagStarted) {
- valid = parseReference();
+ valid = parseReference(true);
}
} else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName, 0, length)) {
this.tagValue = TAG_SERIAL_VALUE;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index 19360cdbc4..7e9c736a09 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -198,6 +198,8 @@ public interface JavadocTagConstants {
//since 13
{},
//since 14
+ {},
+ //since 15
{}
};
public static final char[][][] INLINE_TAGS = {
@@ -230,6 +232,8 @@ public interface JavadocTagConstants {
//since 13
{},
//since 14
+ {},
+ //since 15
{}
};
public final static int INLINE_TAGS_LENGTH = INLINE_TAGS.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 6ee5aa96fa..e89e50d32e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.jdt.internal.compiler.impl.IrritantSet;
+import org.eclipse.jdt.internal.compiler.impl.JavaFeature;
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
@@ -229,6 +229,8 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte
compliance = ClassFileConstants.JDK13;
} else if("14".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK14;
+ } else if("15".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK15;
} else if("recovery".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK_DEFERRED;
}
@@ -966,6 +968,8 @@ private int stateStackLengthStack[] = new int[0];
protected boolean parsingJava8Plus;
protected boolean parsingJava9Plus;
protected boolean parsingJava14Plus;
+protected boolean parsingJava15Plus;
+protected boolean previewEnabled;
protected boolean parsingJava11Plus;
protected int unstackedAct = ERROR_ACTION;
private boolean haltOnSyntaxError = false;
@@ -987,8 +991,10 @@ public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) {
initializeScanner();
this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8;
this.parsingJava9Plus = this.options.sourceLevel >= ClassFileConstants.JDK9;
- this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14;
this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11;
+ this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14;
+ this.parsingJava15Plus = this.options.sourceLevel >= ClassFileConstants.JDK15;
+ this.previewEnabled = this.options.sourceLevel == ClassFileConstants.getLatestJDKLevel() && this.options.enablePreviewFeatures;
this.astLengthStack = new int[50];
this.patternLengthStack = new int[20];
this.expressionLengthStack = new int[30];
@@ -1216,6 +1222,10 @@ protected void checkAndSetModifiers(int flag){
if (this.currentElement != null) {
this.currentElement.addModifier(flag, this.modifiersSourceStart);
}
+ if (flag == ExtraCompilerModifiers.AccSealed || flag == ExtraCompilerModifiers.AccNonSealed) {
+ problemReporter().validateJavaFeatureSupport(JavaFeature.SEALED_CLASSES, this.scanner.startPosition,
+ this.scanner.currentPosition - 1);
+ }
}
public void checkComment() {
@@ -2265,6 +2275,7 @@ protected void consumeCaseLabel() {
}
this.casePtr--;
this.scanner.caseStartPosition = this.casePtr >= 0 ? this.caseStack[this.casePtr] : -1;
+
pushOnAstStack(caseStatement);
}
protected void consumeCastExpressionLL1() {
@@ -2681,7 +2692,9 @@ private void consumeClassOrRecordHeaderName1(boolean isRecord) {
// we want to keep the beginning position but get rid of the end position
// it is only used for the ClassLiteralAccess positions.
typeDecl.declarationSourceStart = this.intStack[this.intPtr--];
- typeDecl.restrictedIdentifierStart = typeDecl.declarationSourceStart;
+ if (isRecord) {
+ typeDecl.restrictedIdentifierStart = typeDecl.declarationSourceStart;
+ }
this.intPtr--; // remove the end position of the class token
typeDecl.modifiersSourceStart = this.intStack[this.intPtr--];
@@ -2728,6 +2741,9 @@ protected void consumeClassHeaderName1() {
// ClassHeaderName1 ::= Modifiersopt 'class' 'Identifier'
consumeClassOrRecordHeaderName1(false);
}
+protected void consumeClassHeaderPermittedSubclasses() {
+populatePermittedTypes();
+}
protected void consumeClassInstanceCreationExpression() {
// ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
classInstanceCreation(false);
@@ -4531,15 +4547,7 @@ private void consumeTypeTestPattern() {
type = getTypeReference(this.intStack[this.intPtr--]); //getTypeReference(0); // no type dimension
local.declarationSourceStart = type.sourceStart;
local.type = type;
- if (!this.parsingJava14Plus) {
- problemReporter().previewFeatureNotSupported(type.sourceStart, local.declarationEnd, "Instanceof Pattern", CompilerOptions.VERSION_13); //$NON-NLS-1$
- } else if (!this.options.enablePreviewFeatures){
- problemReporter().previewFeatureNotEnabled(type.sourceStart, local.declarationEnd, "Instanceof Pattern"); //$NON-NLS-1$
- } else {
- if (this.options.isAnyEnabled(IrritantSet.PREVIEW)) {
- problemReporter().previewFeatureUsed(type.sourceStart, local.declarationEnd);
- }
- }
+ problemReporter().validateJavaFeatureSupport(JavaFeature.PATTERN_MATCHING_IN_INSTANCEOF, type.sourceStart, local.declarationEnd);
local.modifiers |= ClassFileConstants.AccFinal;
pushOnPatternStack(local);
}
@@ -4738,6 +4746,35 @@ protected void consumeInterfaceHeaderName1() {
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
+protected void consumeInterfaceHeaderPermittedSubClassesAndSubInterfaces() {
+ // InterfaceHeaderPermittedSubClassesAndSubInterfaces ::= RestrictedIdentifierpermits ClassTypeList
+ populatePermittedTypes();
+}
+private void populatePermittedTypes() {
+ int length = this.astLengthStack[this.astLengthPtr--];
+ //permitted types
+ this.astPtr -= length;
+ TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
+ typeDecl.restrictedIdentifierStart= this.intStack[this.intPtr--];
+ System.arraycopy(
+ this.astStack,
+ this.astPtr + 1,
+ typeDecl.permittedTypes = new TypeReference[length],
+ 0,
+ length);
+ TypeReference[] permittedTypes = typeDecl.permittedTypes;
+ for (int i = 0, max = permittedTypes.length; i < max; i++) {
+ TypeReference typeReference = permittedTypes[i];
+ typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations); // TODO: Confirm with spec
+// typeReference.bits |= ASTNode.IsSuperType; // TODO: Check equivalent required
+ }
+ typeDecl.bodyStart = typeDecl.permittedTypes[length-1].sourceEnd + 1;
+ this.listLength = 0; // reset after having read super-interfaces
+ // recovery
+ if (this.currentElement != null) {
+ this.lastCheckPoint = typeDecl.bodyStart;
+ }
+}
protected void consumeInterfaceMemberDeclarations() {
// InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration
concatNodeLists();
@@ -4840,6 +4877,13 @@ protected void consumeInvalidConstructorDeclaration(boolean hasBody) {
}
protected void consumeInvalidEnumDeclaration() {
// BlockStatement ::= EnumDeclaration
+ if (this.previewEnabled) {
+ /* JLS 15 Local Static Interfaces and Enum Classes - Records preview - Sec 6.1
+ * A local class or interface (14.3), declared in one of the following: A class declaration, An enum declaration,
+ * An interface declaration
+ */
+ return;
+ }
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
// remove the ast node created in interface header
@@ -4850,6 +4894,13 @@ protected void consumeInvalidEnumDeclaration() {
protected void consumeInvalidInterfaceDeclaration() {
// BlockStatement ::= InvalidInterfaceDeclaration
//InterfaceDeclaration ::= Modifiersopt 'interface' 'Identifier' ExtendsInterfacesopt InterfaceHeader InterfaceBody
+ if (this.previewEnabled) {
+ /* JLS 15 Local Static Interfaces and Enum Classes - Records preview - Sec 6.1
+ * A local class or interface (14.3), declared in one of the following: A class declaration, An enum declaration,
+ * An interface declaration
+ */
+ return;
+ }
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
// remove the ast node created in interface header
@@ -6613,2202 +6664,2210 @@ protected void consumeZeroTypeAnnotations() {
// This method is part of an automatic generation : do NOT edit-modify
protected void consumeRule(int act) {
switch ( act ) {
- case 38 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
+ case 40 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
consumePrimitiveType();
break;
- case 52 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
+ case 54 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
consumeReferenceType();
break;
- case 56 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
+ case 58 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
consumeClassOrInterfaceName();
break;
- case 57 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
+ case 59 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
consumeClassOrInterface();
break;
- case 58 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
+ case 60 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
consumeGenericType();
break;
- case 59 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
+ case 61 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
consumeGenericTypeWithDiamond();
break;
- case 60 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
+ case 62 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
consumeArrayTypeWithTypeArgumentsName();
break;
- case 61 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
+ case 63 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
consumePrimitiveArrayType();
break;
- case 62 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
+ case 64 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
consumeNameArrayType();
break;
- case 63 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
+ case 65 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
consumeGenericTypeNameArrayType();
break;
- case 64 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
+ case 66 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
consumeGenericTypeArrayType();
break;
- case 66 : if (DEBUG) { System.out.println("Name ::= SimpleName"); } //$NON-NLS-1$
+ case 68 : if (DEBUG) { System.out.println("Name ::= SimpleName"); } //$NON-NLS-1$
consumeZeroTypeAnnotations();
break;
- case 71 : if (DEBUG) { System.out.println("UnannotatableName ::= UnannotatableName DOT SimpleName"); } //$NON-NLS-1$
+ case 73 : if (DEBUG) { System.out.println("UnannotatableName ::= UnannotatableName DOT SimpleName"); } //$NON-NLS-1$
consumeUnannotatableQualifiedName();
break;
- case 72 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); } //$NON-NLS-1$
+ case 74 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); } //$NON-NLS-1$
consumeQualifiedName(false);
break;
- case 73 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT TypeAnnotations SimpleName"); } //$NON-NLS-1$
+ case 75 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT TypeAnnotations SimpleName"); } //$NON-NLS-1$
consumeQualifiedName(true);
break;
- case 74 : if (DEBUG) { System.out.println("TypeAnnotationsopt ::="); } //$NON-NLS-1$
+ case 76 : if (DEBUG) { System.out.println("TypeAnnotationsopt ::="); } //$NON-NLS-1$
consumeZeroTypeAnnotations();
break;
- case 78 : if (DEBUG) { System.out.println("TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation"); } //$NON-NLS-1$
+ case 80 : if (DEBUG) { System.out.println("TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation"); } //$NON-NLS-1$
consumeOneMoreTypeAnnotation();
break;
- case 79 : if (DEBUG) { System.out.println("TypeAnnotation ::= NormalTypeAnnotation"); } //$NON-NLS-1$
+ case 81 : if (DEBUG) { System.out.println("TypeAnnotation ::= NormalTypeAnnotation"); } //$NON-NLS-1$
consumeTypeAnnotation();
break;
- case 80 : if (DEBUG) { System.out.println("TypeAnnotation ::= MarkerTypeAnnotation"); } //$NON-NLS-1$
+ case 82 : if (DEBUG) { System.out.println("TypeAnnotation ::= MarkerTypeAnnotation"); } //$NON-NLS-1$
consumeTypeAnnotation();
break;
- case 81 : if (DEBUG) { System.out.println("TypeAnnotation ::= SingleMemberTypeAnnotation"); } //$NON-NLS-1$
+ case 83 : if (DEBUG) { System.out.println("TypeAnnotation ::= SingleMemberTypeAnnotation"); } //$NON-NLS-1$
consumeTypeAnnotation();
break;
- case 82 : if (DEBUG) { System.out.println("TypeAnnotationName ::= AT308 UnannotatableName"); } //$NON-NLS-1$
+ case 84 : if (DEBUG) { System.out.println("TypeAnnotationName ::= AT308 UnannotatableName"); } //$NON-NLS-1$
consumeAnnotationName() ;
break;
- case 83 : if (DEBUG) { System.out.println("NormalTypeAnnotation ::= TypeAnnotationName LPAREN..."); } //$NON-NLS-1$
+ case 85 : if (DEBUG) { System.out.println("NormalTypeAnnotation ::= TypeAnnotationName LPAREN..."); } //$NON-NLS-1$
consumeNormalAnnotation(true) ;
break;
- case 84 : if (DEBUG) { System.out.println("MarkerTypeAnnotation ::= TypeAnnotationName"); } //$NON-NLS-1$
+ case 86 : if (DEBUG) { System.out.println("MarkerTypeAnnotation ::= TypeAnnotationName"); } //$NON-NLS-1$
consumeMarkerAnnotation(true) ;
break;
- case 85 : if (DEBUG) { System.out.println("SingleMemberTypeAnnotation ::= TypeAnnotationName LPAREN"); } //$NON-NLS-1$
+ case 87 : if (DEBUG) { System.out.println("SingleMemberTypeAnnotation ::= TypeAnnotationName LPAREN"); } //$NON-NLS-1$
consumeSingleMemberAnnotation(true) ;
break;
- case 86 : if (DEBUG) { System.out.println("RejectTypeAnnotations ::="); } //$NON-NLS-1$
+ case 88 : if (DEBUG) { System.out.println("RejectTypeAnnotations ::="); } //$NON-NLS-1$
consumeNonTypeUseName();
break;
- case 87 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
+ case 89 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
consumeZeroTypeAnnotations();
break;
- case 88 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
+ case 90 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
consumeExplicitThisParameter(false);
break;
- case 89 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= UnannotatableName DOT this"); } //$NON-NLS-1$
+ case 91 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= UnannotatableName DOT this"); } //$NON-NLS-1$
consumeExplicitThisParameter(true);
break;
- case 90 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
+ case 92 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
consumeVariableDeclaratorIdParameter();
break;
- case 91 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
+ case 93 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
consumeCompilationUnit();
break;
- case 92 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
+ case 94 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 93 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 95 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 94 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 96 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 95 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 97 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 96 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 98 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 97 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
+ case 99 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 98 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 100 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 99 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
+ case 101 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
consumeEmptyInternalCompilationUnit();
break;
- case 100 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 102 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithModuleDeclaration();
break;
- case 101 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ModuleDeclaration"); } //$NON-NLS-1$
+ case 103 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ModuleDeclaration"); } //$NON-NLS-1$
consumeInternalCompilationUnitWithModuleDeclaration();
break;
- case 102 : if (DEBUG) { System.out.println("ModuleDeclaration ::= ModuleHeader ModuleBody"); } //$NON-NLS-1$
+ case 104 : if (DEBUG) { System.out.println("ModuleDeclaration ::= ModuleHeader ModuleBody"); } //$NON-NLS-1$
consumeModuleDeclaration();
break;
- case 103 : if (DEBUG) { System.out.println("ModuleHeader ::= Modifiersopt ModuleModifieropt module"); } //$NON-NLS-1$
+ case 105 : if (DEBUG) { System.out.println("ModuleHeader ::= Modifiersopt ModuleModifieropt module"); } //$NON-NLS-1$
consumeModuleHeader();
break;
- case 105 : if (DEBUG) { System.out.println("ModuleModifieropt ::= ModuleModifier"); } //$NON-NLS-1$
+ case 107 : if (DEBUG) { System.out.println("ModuleModifieropt ::= ModuleModifier"); } //$NON-NLS-1$
consumeModuleModifiers();
break;
- case 108 : if (DEBUG) { System.out.println("ModuleStatementsOpt ::="); } //$NON-NLS-1$
+ case 110 : if (DEBUG) { System.out.println("ModuleStatementsOpt ::="); } //$NON-NLS-1$
consumeEmptyModuleStatementsOpt();
break;
- case 111 : if (DEBUG) { System.out.println("ModuleStatements ::= ModuleStatements ModuleStatement"); } //$NON-NLS-1$
+ case 113 : if (DEBUG) { System.out.println("ModuleStatements ::= ModuleStatements ModuleStatement"); } //$NON-NLS-1$
consumeModuleStatements();
break;
- case 117 : if (DEBUG) { System.out.println("RequiresStatement ::= SingleRequiresModuleName SEMICOLON"); } //$NON-NLS-1$
+ case 119 : if (DEBUG) { System.out.println("RequiresStatement ::= SingleRequiresModuleName SEMICOLON"); } //$NON-NLS-1$
consumeRequiresStatement();
break;
- case 118 : if (DEBUG) { System.out.println("SingleRequiresModuleName ::= requires..."); } //$NON-NLS-1$
+ case 120 : if (DEBUG) { System.out.println("SingleRequiresModuleName ::= requires..."); } //$NON-NLS-1$
consumeSingleRequiresModuleName();
break;
- case 119 : if (DEBUG) { System.out.println("RequiresModifiersopt ::= RequiresModifiers"); } //$NON-NLS-1$
+ case 121 : if (DEBUG) { System.out.println("RequiresModifiersopt ::= RequiresModifiers"); } //$NON-NLS-1$
consumeModifiers();
break;
- case 120 : if (DEBUG) { System.out.println("RequiresModifiersopt ::="); } //$NON-NLS-1$
+ case 122 : if (DEBUG) { System.out.println("RequiresModifiersopt ::="); } //$NON-NLS-1$
consumeDefaultModifiers();
break;
- case 122 : if (DEBUG) { System.out.println("RequiresModifiers ::= RequiresModifiers RequiresModifier"); } //$NON-NLS-1$
+ case 124 : if (DEBUG) { System.out.println("RequiresModifiers ::= RequiresModifiers RequiresModifier"); } //$NON-NLS-1$
consumeModifiers2();
break;
- case 125 : if (DEBUG) { System.out.println("ExportsStatement ::= ExportsHeader TargetModuleListopt"); } //$NON-NLS-1$
+ case 127 : if (DEBUG) { System.out.println("ExportsStatement ::= ExportsHeader TargetModuleListopt"); } //$NON-NLS-1$
consumeExportsStatement();
break;
- case 126 : if (DEBUG) { System.out.println("ExportsHeader ::= exports SinglePkgName"); } //$NON-NLS-1$
+ case 128 : if (DEBUG) { System.out.println("ExportsHeader ::= exports SinglePkgName"); } //$NON-NLS-1$
consumeExportsHeader();
break;
- case 128 : if (DEBUG) { System.out.println("TargetModuleListopt ::= to TargetModuleNameList"); } //$NON-NLS-1$
+ case 130 : if (DEBUG) { System.out.println("TargetModuleListopt ::= to TargetModuleNameList"); } //$NON-NLS-1$
consumeTargetModuleList();
break;
- case 129 : if (DEBUG) { System.out.println("TargetModuleName ::= UnannotatableName"); } //$NON-NLS-1$
+ case 131 : if (DEBUG) { System.out.println("TargetModuleName ::= UnannotatableName"); } //$NON-NLS-1$
consumeSingleTargetModuleName();
break;
- case 131 : if (DEBUG) { System.out.println("TargetModuleNameList ::= TargetModuleNameList COMMA..."); } //$NON-NLS-1$
+ case 133 : if (DEBUG) { System.out.println("TargetModuleNameList ::= TargetModuleNameList COMMA..."); } //$NON-NLS-1$
consumeTargetModuleNameList();
break;
- case 132 : if (DEBUG) { System.out.println("SinglePkgName ::= UnannotatableName"); } //$NON-NLS-1$
+ case 134 : if (DEBUG) { System.out.println("SinglePkgName ::= UnannotatableName"); } //$NON-NLS-1$
consumeSinglePkgName();
break;
- case 133 : if (DEBUG) { System.out.println("OpensStatement ::= OpensHeader TargetModuleListopt..."); } //$NON-NLS-1$
+ case 135 : if (DEBUG) { System.out.println("OpensStatement ::= OpensHeader TargetModuleListopt..."); } //$NON-NLS-1$
consumeOpensStatement();
break;
- case 134 : if (DEBUG) { System.out.println("OpensHeader ::= opens SinglePkgName"); } //$NON-NLS-1$
+ case 136 : if (DEBUG) { System.out.println("OpensHeader ::= opens SinglePkgName"); } //$NON-NLS-1$
consumeOpensHeader();
break;
- case 135 : if (DEBUG) { System.out.println("UsesStatement ::= UsesHeader SEMICOLON"); } //$NON-NLS-1$
+ case 137 : if (DEBUG) { System.out.println("UsesStatement ::= UsesHeader SEMICOLON"); } //$NON-NLS-1$
consumeUsesStatement();
break;
- case 136 : if (DEBUG) { System.out.println("UsesHeader ::= uses Name"); } //$NON-NLS-1$
+ case 138 : if (DEBUG) { System.out.println("UsesHeader ::= uses Name"); } //$NON-NLS-1$
consumeUsesHeader();
break;
- case 137 : if (DEBUG) { System.out.println("ProvidesStatement ::= ProvidesInterface WithClause..."); } //$NON-NLS-1$
+ case 139 : if (DEBUG) { System.out.println("ProvidesStatement ::= ProvidesInterface WithClause..."); } //$NON-NLS-1$
consumeProvidesStatement();
break;
- case 138 : if (DEBUG) { System.out.println("ProvidesInterface ::= provides Name"); } //$NON-NLS-1$
+ case 140 : if (DEBUG) { System.out.println("ProvidesInterface ::= provides Name"); } //$NON-NLS-1$
consumeProvidesInterface();
break;
- case 139 : if (DEBUG) { System.out.println("ServiceImplName ::= Name"); } //$NON-NLS-1$
+ case 141 : if (DEBUG) { System.out.println("ServiceImplName ::= Name"); } //$NON-NLS-1$
consumeSingleServiceImplName();
break;
- case 141 : if (DEBUG) { System.out.println("ServiceImplNameList ::= ServiceImplNameList COMMA..."); } //$NON-NLS-1$
+ case 143 : if (DEBUG) { System.out.println("ServiceImplNameList ::= ServiceImplNameList COMMA..."); } //$NON-NLS-1$
consumeServiceImplNameList();
break;
- case 142 : if (DEBUG) { System.out.println("WithClause ::= with ServiceImplNameList"); } //$NON-NLS-1$
+ case 144 : if (DEBUG) { System.out.println("WithClause ::= with ServiceImplNameList"); } //$NON-NLS-1$
consumeWithClause();
break;
- case 143 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
+ case 145 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
consumeReduceImports();
break;
- case 144 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
+ case 146 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
consumeEnterCompilationUnit();
break;
- case 167 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ case 169 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
consumeCatchHeader();
break;
- case 169 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 171 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeImportDeclarations();
break;
- case 171 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
+ case 173 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
consumeTypeDeclarations();
break;
- case 172 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
+ case 174 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
consumePackageDeclaration();
break;
- case 173 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
+ case 175 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
consumePackageDeclarationNameWithModifiers();
break;
- case 174 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
+ case 176 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
consumePackageDeclarationName();
break;
- case 175 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
+ case 177 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
consumePackageComment();
break;
- case 180 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
+ case 182 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 181 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name..."); } //$NON-NLS-1$
+ case 183 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name..."); } //$NON-NLS-1$
consumeSingleTypeImportDeclarationName();
break;
- case 182 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ case 184 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 183 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
+ case 185 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
consumeTypeImportOnDemandDeclarationName();
break;
- case 186 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ case 188 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyTypeDeclaration();
break;
- case 191 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
+ case 193 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
consumeModifiers2();
break;
- case 203 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
+ case 207 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
consumeAnnotationAsModifier();
break;
- case 204 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
+ case 208 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
consumeClassDeclaration();
break;
- case 205 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
+ case 209 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
consumeClassHeader();
break;
- case 206 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
+ case 210 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
consumeTypeHeaderNameWithTypeParameters();
break;
- case 208 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$
+ case 212 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$
consumeClassHeaderName1();
break;
- case 209 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
+ case 213 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
consumeClassHeaderExtends();
break;
- case 210 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
+ case 214 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
consumeClassHeaderImplements();
break;
- case 212 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
+ case 216 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
consumeInterfaceTypeList();
break;
- case 213 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
+ case 217 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
consumeInterfaceType();
break;
- case 216 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
+ case 220 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
consumeClassBodyDeclarations();
break;
- case 220 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
+ case 224 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
consumeClassBodyDeclaration();
break;
- case 221 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
+ case 225 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
consumeDiet();
break;
- case 222 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
+ case 226 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
consumeClassBodyDeclaration();
break;
- case 223 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
+ case 227 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
consumeCreateInitializer();
break;
- case 231 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ case 235 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyTypeDeclaration();
break;
- case 234 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 238 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeFieldDeclaration();
break;
- case 236 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
+ case 240 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
consumeVariableDeclarators();
break;
- case 239 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
+ case 243 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
consumeEnterVariable();
break;
- case 240 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
+ case 244 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
consumeExitVariableWithInitialization();
break;
- case 241 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
+ case 245 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
consumeExitVariableWithoutInitialization();
break;
- case 242 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
+ case 246 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
consumeForceNoDiet();
break;
- case 243 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
+ case 247 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
consumeRestoreDiet();
break;
- case 248 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ case 252 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
// set to true to consume a method with a body
consumeMethodDeclaration(true, false);
break;
- case 249 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$
+ case 253 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$
// set to true to consume a method with a body
consumeMethodDeclaration(true, true);
break;
- case 250 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
+ case 254 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
// set to false to consume a method without body
consumeMethodDeclaration(false, false);
break;
- case 251 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
+ case 255 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
consumeMethodHeader();
break;
- case 252 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$
+ case 256 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$
consumeMethodHeader();
break;
- case 253 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
+ case 257 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
consumeMethodHeaderNameWithTypeParameters(false);
break;
- case 254 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$
+ case 258 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$
consumeMethodHeaderName(false);
break;
- case 255 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
+ case 259 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
consumeMethodHeaderNameWithTypeParameters(false);
break;
- case 256 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$
+ case 260 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$
consumeMethodHeaderName(false);
break;
- case 257 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$
+ case 261 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$
consumePushCombineModifiers();
break;
- case 258 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
+ case 262 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
consumeMethodHeaderRightParen();
break;
- case 259 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
+ case 263 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
consumeMethodHeaderExtendedDims();
break;
- case 260 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
+ case 264 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
consumeMethodHeaderThrowsClause();
break;
- case 261 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
+ case 265 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
consumeConstructorHeader();
break;
- case 262 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
+ case 266 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
consumeConstructorHeaderNameWithTypeParameters();
break;
- case 263 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
+ case 267 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
consumeConstructorHeaderName();
break;
- case 265 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
+ case 269 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
consumeFormalParameterList();
break;
- case 266 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 270 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeFormalParameter(false);
break;
- case 267 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 271 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeFormalParameter(true);
break;
- case 268 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$
+ case 272 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$
consumeFormalParameter(true);
break;
- case 269 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
+ case 273 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
consumeCatchFormalParameter();
break;
- case 270 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
+ case 274 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
consumeCatchType();
break;
- case 271 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
+ case 275 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
consumeUnionTypeAsClassType();
break;
- case 272 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
+ case 276 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
consumeUnionType();
break;
- case 274 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
+ case 278 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
consumeClassTypeList();
break;
- case 275 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
+ case 279 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
consumeClassTypeElt();
break;
- case 276 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$
+ case 280 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$
consumeMethodBody();
break;
- case 277 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
+ case 281 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
consumeNestedMethod();
break;
- case 278 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
+ case 282 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
consumeStaticInitializer();
break;
- case 279 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
+ case 283 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
consumeStaticOnly();
break;
- case 280 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
+ case 284 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
consumeConstructorDeclaration() ;
break;
- case 281 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
+ case 285 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
consumeInvalidConstructorDeclaration() ;
break;
- case 282 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
+ case 286 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(0, THIS_CALL);
break;
- case 283 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
+ case 287 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
break;
- case 284 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
+ case 288 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(0,SUPER_CALL);
break;
- case 285 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
+ case 289 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
break;
- case 286 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
+ case 290 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(1, SUPER_CALL);
break;
- case 287 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ case 291 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
break;
- case 288 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
+ case 292 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(2, SUPER_CALL);
break;
- case 289 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ case 293 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
break;
- case 290 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
+ case 294 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(1, THIS_CALL);
break;
- case 291 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ case 295 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
break;
- case 292 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
+ case 296 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
consumeExplicitConstructorInvocation(2, THIS_CALL);
break;
- case 293 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ case 297 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
break;
- case 294 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
+ case 298 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
consumeInterfaceDeclaration();
break;
- case 295 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
+ case 299 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
consumeInterfaceHeader();
break;
- case 296 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
+ case 300 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
consumeTypeHeaderNameWithTypeParameters();
break;
- case 298 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
+ case 302 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
consumeInterfaceHeaderName1();
break;
- case 299 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
+ case 303 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
consumeInterfaceHeaderExtends();
break;
- case 302 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
+ case 306 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
consumeInterfaceMemberDeclarations();
break;
- case 303 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ case 307 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyTypeDeclaration();
break;
- case 305 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
+ case 309 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
consumeInterfaceMethodDeclaration(false);
break;
- case 306 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ case 310 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
consumeInterfaceMethodDeclaration(false);
break;
- case 307 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
+ case 311 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
consumeInterfaceMethodDeclaration(true);
break;
- case 308 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ case 312 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
consumeInvalidConstructorDeclaration(true);
break;
- case 309 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ case 313 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
consumeInvalidConstructorDeclaration(false);
break;
- case 320 : if (DEBUG) { System.out.println("RecordDeclaration ::= RecordHeaderPart RecordBody"); } //$NON-NLS-1$
+ case 324 : if (DEBUG) { System.out.println("RecordDeclaration ::= RecordHeaderPart RecordBody"); } //$NON-NLS-1$
consumeRecordDeclaration();
break;
- case 321 : if (DEBUG) { System.out.println("RecordHeaderPart ::= RecordHeaderName RecordHeader..."); } //$NON-NLS-1$
+ case 325 : if (DEBUG) { System.out.println("RecordHeaderPart ::= RecordHeaderName RecordHeader..."); } //$NON-NLS-1$
consumeRecordHeaderPart();
break;
- case 322 : if (DEBUG) { System.out.println("RecordHeaderName ::= RecordHeaderName1 TypeParameters"); } //$NON-NLS-1$
+ case 326 : if (DEBUG) { System.out.println("RecordHeaderName ::= RecordHeaderName1 TypeParameters"); } //$NON-NLS-1$
consumeRecordHeaderNameWithTypeParameters();
break;
- case 324 : if (DEBUG) { System.out.println("RecordHeaderName1 ::= Modifiersopt..."); } //$NON-NLS-1$
+ case 328 : if (DEBUG) { System.out.println("RecordHeaderName1 ::= Modifiersopt..."); } //$NON-NLS-1$
consumeRecordHeaderName1();
break;
- case 325 : if (DEBUG) { System.out.println("RecordComponentHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
+ case 329 : if (DEBUG) { System.out.println("RecordComponentHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
consumeRecordComponentHeaderRightParen();
break;
- case 326 : if (DEBUG) { System.out.println("RecordHeader ::= LPAREN RecordComponentsopt..."); } //$NON-NLS-1$
+ case 330 : if (DEBUG) { System.out.println("RecordHeader ::= LPAREN RecordComponentsopt..."); } //$NON-NLS-1$
consumeRecordHeader();
break;
- case 327 : if (DEBUG) { System.out.println("RecordComponentsopt ::="); } //$NON-NLS-1$
+ case 331 : if (DEBUG) { System.out.println("RecordComponentsopt ::="); } //$NON-NLS-1$
consumeRecordComponentsopt();
break;
- case 330 : if (DEBUG) { System.out.println("RecordComponents ::= RecordComponents COMMA..."); } //$NON-NLS-1$
+ case 334 : if (DEBUG) { System.out.println("RecordComponents ::= RecordComponents COMMA..."); } //$NON-NLS-1$
consumeRecordComponents();
break;
- case 332 : if (DEBUG) { System.out.println("RecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 336 : if (DEBUG) { System.out.println("RecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeRecordComponent(false);
break;
- case 333 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 337 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeRecordComponent(true);
break;
- case 334 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 338 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeRecordComponent(true);
break;
- case 335 : if (DEBUG) { System.out.println("RecordBody ::= LBRACE RecordBodyDeclarationopt RBRACE"); } //$NON-NLS-1$
+ case 339 : if (DEBUG) { System.out.println("RecordBody ::= LBRACE RecordBodyDeclarationopt RBRACE"); } //$NON-NLS-1$
consumeRecordBody();
break;
- case 336 : if (DEBUG) { System.out.println("RecordBodyDeclarationopt ::="); } //$NON-NLS-1$
+ case 340 : if (DEBUG) { System.out.println("RecordBodyDeclarationopt ::="); } //$NON-NLS-1$
consumeEmptyRecordBodyDeclaration();
break;
- case 339 : if (DEBUG) { System.out.println("RecordBodyDeclarations ::= RecordBodyDeclarations..."); } //$NON-NLS-1$
+ case 343 : if (DEBUG) { System.out.println("RecordBodyDeclarations ::= RecordBodyDeclarations..."); } //$NON-NLS-1$
consumeRecordBodyDeclarations();
break;
- case 340 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= ClassBodyDeclaration"); } //$NON-NLS-1$
+ case 344 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= ClassBodyDeclaration"); } //$NON-NLS-1$
consumeRecordBodyDeclaration();
break;
- case 341 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= CompactConstructorDeclaration"); } //$NON-NLS-1$
+ case 345 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= CompactConstructorDeclaration"); } //$NON-NLS-1$
consumeRecordBodyDeclaration();
break;
- case 342 : if (DEBUG) { System.out.println("CompactConstructorDeclaration ::=..."); } //$NON-NLS-1$
+ case 346 : if (DEBUG) { System.out.println("CompactConstructorDeclaration ::=..."); } //$NON-NLS-1$
consumeCompactConstructorDeclaration();
break;
- case 343 : if (DEBUG) { System.out.println("CompactConstructorHeader ::=..."); } //$NON-NLS-1$
+ case 347 : if (DEBUG) { System.out.println("CompactConstructorHeader ::=..."); } //$NON-NLS-1$
consumeCompactConstructorHeader();
break;
- case 344 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ case 348 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
consumeCompactConstructorHeaderName();
break;
- case 345 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ case 349 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
consumeCompactConstructorHeaderNameWithTypeParameters();
break;
- case 347 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
+ case 351 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
consumeInstanceOfExpression();
break;
- case 351 : if (DEBUG) { System.out.println("TypeTestPattern ::= Type Identifier"); } //$NON-NLS-1$
+ case 355 : if (DEBUG) { System.out.println("TypeTestPattern ::= Type Identifier"); } //$NON-NLS-1$
consumeTypeTestPattern();
break;
- case 353 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
+ case 357 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
consumePushLeftBrace();
break;
- case 354 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
+ case 358 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
consumeEmptyArrayInitializer();
break;
- case 355 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ case 359 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
consumeArrayInitializer();
break;
- case 356 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ case 360 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
consumeArrayInitializer();
break;
- case 358 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
+ case 362 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
consumeVariableInitializers();
break;
- case 359 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
+ case 363 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
consumeBlock();
break;
- case 360 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
+ case 364 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
consumeOpenBlock() ;
break;
- case 361 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$
+ case 365 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$
consumeBlockStatement() ;
break;
- case 362 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
+ case 366 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
consumeBlockStatements() ;
break;
- case 370 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
+ case 374 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
consumeInvalidInterfaceDeclaration();
break;
- case 371 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
+ case 375 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
consumeInvalidAnnotationTypeDeclaration();
break;
- case 372 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
+ case 376 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
consumeInvalidEnumDeclaration();
break;
- case 373 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
+ case 377 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
consumeLocalVariableDeclarationStatement();
break;
- case 374 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
+ case 378 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
consumeLocalVariableDeclaration();
break;
- case 375 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
+ case 379 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
consumeLocalVariableDeclaration();
break;
- case 376 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
+ case 380 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
consumePushModifiers();
break;
- case 377 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
+ case 381 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
consumePushModifiersForHeader();
break;
- case 378 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
+ case 382 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
consumePushRealModifiers();
break;
- case 406 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
+ case 410 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyStatement();
break;
- case 407 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
+ case 411 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
consumeStatementLabel() ;
break;
- case 408 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
+ case 412 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
consumeStatementLabel() ;
break;
- case 409 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$
+ case 413 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$
consumeLabel() ;
break;
- case 410 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
+ case 414 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
consumeExpressionStatement();
break;
- case 419 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ case 423 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
consumeStatementIfNoElse();
break;
- case 420 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ case 424 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
consumeStatementIfWithElse();
break;
- case 421 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
+ case 425 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
consumeStatementIfWithElse();
break;
- case 422 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ case 426 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
consumeStatementSwitch() ;
break;
- case 423 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
+ case 427 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
consumeEmptySwitchBlock() ;
break;
- case 426 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
+ case 430 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
consumeSwitchBlock() ;
break;
- case 428 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
+ case 432 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
consumeSwitchBlockStatements() ;
break;
- case 430 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
+ case 434 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
consumeSwitchBlockStatement() ;
break;
- case 432 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
+ case 436 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
consumeSwitchLabels() ;
break;
- case 433 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$
+ case 437 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$
consumeCaseLabel();
break;
- case 434 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
+ case 438 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
consumeDefaultLabel();
break;
- case 437 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ case 441 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
consumeSwitchExpression() ;
break;
- case 440 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$
+ case 444 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$
consumeSwitchLabeledRule();
break;
- case 441 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$
+ case 445 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$
consumeSwitchLabeledExpression();
break;
- case 442 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$
+ case 446 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$
consumeSwitchLabeledBlock();
break;
- case 443 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$
+ case 447 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$
consumeSwitchLabeledThrowStatement();
break;
- case 444 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$
+ case 448 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$
consumeDefaultLabelExpr();
break;
- case 445 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$
+ case 449 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$
consumeCaseLabelExpr();
break;
- case 446 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case ConstantExpressions"); } //$NON-NLS-1$
+ case 450 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case ConstantExpressions"); } //$NON-NLS-1$
consumeSwitchLabelCaseLhs();
break;
- case 447 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$
+ case 451 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$
consumeStatementYield() ;
break;
- case 448 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ case 452 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
consumeStatementWhile() ;
break;
- case 449 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
+ case 453 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
consumeStatementWhile() ;
break;
- case 450 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
+ case 454 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
consumeStatementDo() ;
break;
- case 451 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
+ case 455 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
consumeStatementFor() ;
break;
- case 452 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
+ case 456 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
consumeStatementFor() ;
break;
- case 453 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
+ case 457 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
consumeForInit() ;
break;
- case 457 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
+ case 461 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
consumeStatementExpressionList() ;
break;
- case 458 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
+ case 462 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
consumeSimpleAssertStatement() ;
break;
- case 459 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
+ case 463 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
consumeAssertStatement() ;
break;
- case 460 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
+ case 464 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
consumeStatementBreak() ;
break;
- case 461 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
+ case 465 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
consumeStatementBreakWithLabel() ;
break;
- case 462 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
+ case 466 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
consumeStatementContinue() ;
break;
- case 463 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
+ case 467 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
consumeStatementContinueWithLabel() ;
break;
- case 464 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
+ case 468 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
consumeStatementReturn() ;
break;
- case 465 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
+ case 469 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
consumeStatementThrow();
break;
- case 466 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$
+ case 470 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$
consumeThrowExpression() ;
break;
- case 467 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
+ case 471 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
consumeStatementSynchronized();
break;
- case 468 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
+ case 472 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
consumeOnlySynchronized();
break;
- case 469 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
+ case 473 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
consumeStatementTry(false, false);
break;
- case 470 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
+ case 474 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
consumeStatementTry(true, false);
break;
- case 471 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ case 475 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
consumeStatementTry(false, true);
break;
- case 472 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ case 476 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
consumeStatementTry(true, true);
break;
- case 473 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
+ case 477 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
consumeResourceSpecification();
break;
- case 474 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
+ case 478 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
consumeResourceOptionalTrailingSemiColon(false);
break;
- case 475 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
+ case 479 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
consumeResourceOptionalTrailingSemiColon(true);
break;
- case 476 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
+ case 480 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
consumeSingleResource();
break;
- case 477 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
+ case 481 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
consumeMultipleResources();
break;
- case 478 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
+ case 482 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
consumeResourceOptionalTrailingSemiColon(true);
break;
- case 479 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
+ case 483 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
consumeResourceAsLocalVariableDeclaration();
break;
- case 480 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
+ case 484 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
consumeResourceAsLocalVariableDeclaration();
break;
- case 481 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$
+ case 485 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$
consumeResourceAsLocalVariable();
break;
- case 482 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$
+ case 486 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$
consumeResourceAsFieldAccess();
break;
- case 484 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
+ case 488 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
consumeExitTryBlock();
break;
- case 486 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
+ case 490 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
consumeCatches();
break;
- case 487 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ case 491 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
consumeStatementCatch() ;
break;
- case 489 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
+ case 493 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
consumeLeftParen();
break;
- case 490 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
+ case 494 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
consumeRightParen();
break;
- case 495 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
+ case 499 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
consumePrimaryNoNewArrayThis();
break;
- case 496 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
+ case 500 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
consumePrimaryNoNewArray();
break;
- case 497 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
+ case 501 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
consumePrimaryNoNewArrayWithName();
break;
- case 500 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
+ case 504 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
consumePrimaryNoNewArrayNameThis();
break;
- case 501 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$
+ case 505 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$
consumeQualifiedSuperReceiver();
break;
- case 502 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
+ case 506 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayName();
break;
- case 503 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
+ case 507 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayArrayType();
break;
- case 504 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
+ case 508 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayPrimitiveArrayType();
break;
- case 505 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
+ case 509 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayPrimitiveType();
break;
- case 511 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
+ case 515 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
consumeReferenceExpressionTypeArgumentsAndTrunk(false);
break;
- case 512 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
+ case 516 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
consumeReferenceExpressionTypeArgumentsAndTrunk(true);
break;
- case 513 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
+ case 517 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
consumeReferenceExpressionTypeForm(true);
break;
- case 514 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
+ case 518 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
consumeReferenceExpressionTypeForm(false);
break;
- case 515 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$
+ case 519 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$
consumeReferenceExpressionGenericTypeForm();
break;
- case 516 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
+ case 520 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
consumeReferenceExpressionPrimaryForm();
break;
- case 517 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$
+ case 521 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$
consumeReferenceExpressionPrimaryForm();
break;
- case 518 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
+ case 522 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
consumeReferenceExpressionSuperForm();
break;
- case 519 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
+ case 523 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
consumeEmptyTypeArguments();
break;
- case 521 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
+ case 525 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
consumeIdentifierOrNew(false);
break;
- case 522 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
+ case 526 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
consumeIdentifierOrNew(true);
break;
- case 523 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$
+ case 527 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$
consumeLambdaExpression();
break;
- case 524 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$
+ case 528 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$
consumeNestedLambda();
break;
- case 525 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$
+ case 529 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$
consumeTypeElidedLambdaParameter(false);
break;
- case 531 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
+ case 535 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
consumeFormalParameterList();
break;
- case 532 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ case 536 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
consumeTypeElidedLambdaParameter(true);
break;
- case 535 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
+ case 539 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
consumeElidedLeftBraceAndReturn();
break;
- case 536 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
+ case 540 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
consumeAllocationHeader();
break;
- case 537 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
+ case 541 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionWithTypeArguments();
break;
- case 538 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
+ case 542 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpression();
break;
- case 539 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ case 543 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
break;
- case 540 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ case 544 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionQualified() ;
break;
- case 541 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ case 545 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionQualified() ;
break;
- case 542 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ case 546 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
break;
- case 543 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
+ case 547 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
consumeEnterInstanceCreationArgumentList();
break;
- case 544 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$
+ case 548 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$
consumeClassInstanceCreationExpressionName() ;
break;
- case 545 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ case 549 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
consumeClassBodyopt();
break;
- case 547 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ case 551 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
consumeEnterAnonymousClassBody(false);
break;
- case 548 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ case 552 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
consumeClassBodyopt();
break;
- case 550 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ case 554 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
consumeEnterAnonymousClassBody(true);
break;
- case 552 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
+ case 556 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
consumeArgumentList();
break;
- case 553 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
+ case 557 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
consumeArrayCreationHeader();
break;
- case 554 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
+ case 558 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
consumeArrayCreationHeader();
break;
- case 555 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ case 559 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
consumeArrayCreationExpressionWithoutInitializer();
break;
- case 556 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
+ case 560 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
consumeArrayCreationExpressionWithInitializer();
break;
- case 557 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ case 561 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
consumeArrayCreationExpressionWithoutInitializer();
break;
- case 558 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
+ case 562 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
consumeArrayCreationExpressionWithInitializer();
break;
- case 560 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
+ case 564 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
consumeDimWithOrWithOutExprs();
break;
- case 562 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$
+ case 566 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$
consumeDimWithOrWithOutExpr();
break;
- case 563 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
+ case 567 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
consumeDims();
break;
- case 566 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
+ case 570 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
consumeOneDimLoop(false);
break;
- case 567 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
+ case 571 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
consumeOneDimLoop(true);
break;
- case 568 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$
+ case 572 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$
consumeFieldAccess(false);
break;
- case 569 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$
+ case 573 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$
consumeFieldAccess(true);
break;
- case 570 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$
+ case 574 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$
consumeFieldAccess(false);
break;
- case 571 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
+ case 575 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
consumeMethodInvocationName();
break;
- case 572 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ case 576 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
consumeMethodInvocationNameWithTypeArguments();
break;
- case 573 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ case 577 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
consumeMethodInvocationPrimaryWithTypeArguments();
break;
- case 574 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ case 578 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$
consumeMethodInvocationPrimary();
break;
- case 575 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
+ case 579 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
consumeMethodInvocationPrimary();
break;
- case 576 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
+ case 580 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$
consumeMethodInvocationPrimaryWithTypeArguments();
break;
- case 577 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ case 581 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
consumeMethodInvocationSuperWithTypeArguments();
break;
- case 578 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ case 582 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$
consumeMethodInvocationSuper();
break;
- case 579 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
+ case 583 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
consumeArrayAccess(true);
break;
- case 580 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
+ case 584 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
consumeArrayAccess(false);
break;
- case 581 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
+ case 585 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
consumeArrayAccess(false);
break;
- case 583 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$
+ case 587 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$
consumePostfixExpression();
break;
- case 586 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
+ case 590 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.PLUS,true);
break;
- case 587 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
+ case 591 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.MINUS,true);
break;
- case 588 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
+ case 592 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
consumePushPosition();
break;
- case 591 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ case 595 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.PLUS);
break;
- case 592 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ case 596 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.MINUS);
break;
- case 594 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
+ case 598 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.PLUS,false);
break;
- case 595 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
+ case 599 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.MINUS,false);
break;
- case 597 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
+ case 601 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.TWIDDLE);
break;
- case 598 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
+ case 602 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.NOT);
break;
- case 600 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
+ case 604 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
consumeCastExpressionWithPrimitiveType();
break;
- case 601 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ case 605 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
consumeCastExpressionWithGenericsArray();
break;
- case 602 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ case 606 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
consumeCastExpressionWithQualifiedGenericsArray();
break;
- case 603 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
+ case 607 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
consumeCastExpressionLL1();
break;
- case 604 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$
+ case 608 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$
consumeCastExpressionLL1WithBounds();
break;
- case 605 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
+ case 609 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
consumeCastExpressionWithNameArray();
break;
- case 606 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$
+ case 610 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$
consumeZeroAdditionalBounds();
break;
- case 610 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
+ case 614 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
consumeOnlyTypeArgumentsForCastExpression();
break;
- case 611 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
+ case 615 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
consumeInsideCastExpression();
break;
- case 612 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
+ case 616 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
consumeInsideCastExpressionLL1();
break;
- case 613 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$
+ case 617 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$
consumeInsideCastExpressionLL1WithBounds ();
break;
- case 614 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
+ case 618 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
consumeInsideCastExpressionWithQualifiedGenerics();
break;
- case 616 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ case 620 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.MULTIPLY);
break;
- case 617 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ case 621 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.DIVIDE);
break;
- case 618 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ case 622 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.REMAINDER);
break;
- case 620 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
+ case 624 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.PLUS);
break;
- case 621 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
+ case 625 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.MINUS);
break;
- case 623 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
+ case 627 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
break;
- case 624 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
+ case 628 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
break;
- case 625 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ case 629 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
- case 627 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
+ case 631 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LESS);
break;
- case 628 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
+ case 632 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.GREATER);
break;
- case 629 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
+ case 633 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LESS_EQUAL);
break;
- case 630 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
+ case 634 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
break;
- case 632 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
+ case 636 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
break;
- case 633 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
+ case 637 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
consumeEqualityExpression(OperatorIds.NOT_EQUAL);
break;
- case 635 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
+ case 639 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.AND);
break;
- case 637 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
+ case 641 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.XOR);
break;
- case 639 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
+ case 643 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.OR);
break;
- case 641 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
+ case 645 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.AND_AND);
break;
- case 643 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ case 647 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.OR_OR);
break;
- case 645 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ case 649 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
break;
- case 648 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
+ case 652 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
consumeAssignment();
break;
- case 650 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
+ case 654 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
ignoreExpressionAssignment();
break;
- case 651 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
+ case 655 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(EQUAL);
break;
- case 652 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
+ case 656 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(MULTIPLY);
break;
- case 653 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
+ case 657 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(DIVIDE);
break;
- case 654 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
+ case 658 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(REMAINDER);
break;
- case 655 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
+ case 659 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(PLUS);
break;
- case 656 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
+ case 660 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(MINUS);
break;
- case 657 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ case 661 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(LEFT_SHIFT);
break;
- case 658 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ case 662 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(RIGHT_SHIFT);
break;
- case 659 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ case 663 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
break;
- case 660 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
+ case 664 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(AND);
break;
- case 661 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
+ case 665 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(XOR);
break;
- case 662 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
+ case 666 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
consumeAssignmentOperator(OR);
break;
- case 663 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
+ case 667 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
consumeExpression();
break;
- case 666 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
+ case 670 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
consumeEmptyExpression();
break;
- case 669 : if (DEBUG) { System.out.println("ConstantExpressions ::= ConstantExpressions COMMA..."); } //$NON-NLS-1$
+ case 673 : if (DEBUG) { System.out.println("ConstantExpressions ::= ConstantExpressions COMMA..."); } //$NON-NLS-1$
consumeConstantExpressions();
break;
- case 673 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ case 677 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
consumeEmptyClassBodyDeclarationsopt();
break;
- case 674 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ case 678 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
consumeClassBodyDeclarationsopt();
break;
- case 675 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
+ case 679 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
consumeDefaultModifiers();
break;
- case 676 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
+ case 680 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
consumeModifiers();
break;
- case 677 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
+ case 681 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
consumeEmptyBlockStatementsopt();
break;
- case 679 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
+ case 683 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
consumeEmptyDimsopt();
break;
- case 681 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
+ case 685 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
consumeEmptyArgumentListopt();
break;
- case 685 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
+ case 689 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
consumeFormalParameterListopt();
break;
- case 689 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ case 696 : if (DEBUG) { System.out.println("ClassHeaderPermittedSubclasses ::=..."); } //$NON-NLS-1$
+ consumeClassHeaderPermittedSubclasses();
+ break;
+
+ case 699 : if (DEBUG) { System.out.println("InterfaceHeaderPermittedSubClassesAndSubInterfaces ::="); } //$NON-NLS-1$
+ consumeInterfaceHeaderPermittedSubClassesAndSubInterfaces();
+ break;
+
+ case 700 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
consumeEmptyInterfaceMemberDeclarationsopt();
break;
- case 690 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ case 701 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
consumeInterfaceMemberDeclarationsopt();
break;
- case 691 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
+ case 702 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
consumeNestedType();
break;
- case 692 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
+ case 703 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
consumeEmptyForInitopt();
break;
- case 694 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
+ case 705 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
consumeEmptyForUpdateopt();
break;
- case 698 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
+ case 709 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
consumeEmptyCatchesopt();
break;
- case 700 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
+ case 711 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
consumeEnumDeclaration();
break;
- case 701 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
+ case 712 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
consumeEnumHeader();
break;
- case 702 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$
+ case 713 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$
consumeEnumHeaderName();
break;
- case 703 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$
+ case 714 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$
consumeEnumHeaderNameWithTypeParameters();
break;
- case 704 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
+ case 715 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
consumeEnumBodyNoConstants();
break;
- case 705 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
+ case 716 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
consumeEnumBodyNoConstants();
break;
- case 706 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
+ case 717 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
consumeEnumBodyWithConstants();
break;
- case 707 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
+ case 718 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
consumeEnumBodyWithConstants();
break;
- case 709 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
+ case 720 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
consumeEnumConstants();
break;
- case 710 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ case 721 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
consumeEnumConstantHeaderName();
break;
- case 711 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
+ case 722 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
consumeEnumConstantHeader();
break;
- case 712 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
+ case 723 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
consumeEnumConstantWithClassBody();
break;
- case 713 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
+ case 724 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
consumeEnumConstantNoClassBody();
break;
- case 714 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
+ case 725 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
consumeArguments();
break;
- case 715 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
+ case 726 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
consumeEmptyArguments();
break;
- case 717 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
+ case 728 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
consumeEnumDeclarations();
break;
- case 718 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ case 729 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
consumeEmptyEnumDeclarations();
break;
- case 720 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
+ case 731 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
consumeEnhancedForStatement();
break;
- case 721 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
+ case 732 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
consumeEnhancedForStatement();
break;
- case 722 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
+ case 733 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
consumeEnhancedForStatementHeaderInit(false);
break;
- case 723 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
+ case 734 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
consumeEnhancedForStatementHeaderInit(true);
break;
- case 724 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
+ case 735 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
consumeEnhancedForStatementHeader();
break;
- case 725 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
+ case 736 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 726 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
+ case 737 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
consumeSingleStaticImportDeclarationName();
break;
- case 727 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ case 738 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 728 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
+ case 739 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
consumeStaticImportOnDemandDeclarationName();
break;
- case 729 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ case 740 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
consumeTypeArguments();
break;
- case 730 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ case 741 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
consumeOnlyTypeArguments();
break;
- case 732 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ case 743 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
consumeTypeArgumentList1();
break;
- case 734 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
+ case 745 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
consumeTypeArgumentList();
break;
- case 735 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
+ case 746 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
consumeTypeArgument();
break;
- case 739 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
+ case 750 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
consumeReferenceType1();
break;
- case 740 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ case 751 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
consumeTypeArgumentReferenceType1();
break;
- case 742 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ case 753 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
consumeTypeArgumentList2();
break;
- case 745 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
+ case 756 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
consumeReferenceType2();
break;
- case 746 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ case 757 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
consumeTypeArgumentReferenceType2();
break;
- case 748 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ case 759 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
consumeTypeArgumentList3();
break;
- case 751 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ case 762 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
consumeReferenceType3();
break;
- case 752 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$
+ case 763 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$
consumeWildcard();
break;
- case 753 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$
+ case 764 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$
consumeWildcardWithBounds();
break;
- case 754 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
+ case 765 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
consumeWildcardBoundsExtends();
break;
- case 755 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
+ case 766 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
consumeWildcardBoundsSuper();
break;
- case 756 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$
+ case 767 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$
consumeWildcard1();
break;
- case 757 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ case 768 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
consumeWildcard1WithBounds();
break;
- case 758 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
+ case 769 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
consumeWildcardBounds1Extends();
break;
- case 759 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
+ case 770 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
consumeWildcardBounds1Super();
break;
- case 760 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
+ case 771 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
consumeWildcard2();
break;
- case 761 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ case 772 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
consumeWildcard2WithBounds();
break;
- case 762 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
+ case 773 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
consumeWildcardBounds2Extends();
break;
- case 763 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
+ case 774 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
consumeWildcardBounds2Super();
break;
- case 764 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ case 775 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
consumeWildcard3();
break;
- case 765 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ case 776 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
consumeWildcard3WithBounds();
break;
- case 766 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
+ case 777 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
consumeWildcardBounds3Extends();
break;
- case 767 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
+ case 778 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
consumeWildcardBounds3Super();
break;
- case 768 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$
+ case 779 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$
consumeTypeParameterHeader();
break;
- case 769 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
+ case 780 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
consumeTypeParameters();
break;
- case 771 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ case 782 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
consumeTypeParameterList();
break;
- case 773 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ case 784 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
consumeTypeParameterWithExtends();
break;
- case 774 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ case 785 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
consumeTypeParameterWithExtendsAndBounds();
break;
- case 776 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ case 787 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
consumeAdditionalBoundList();
break;
- case 777 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
+ case 788 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
consumeAdditionalBound();
break;
- case 779 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ case 790 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
consumeTypeParameterList1();
break;
- case 780 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
+ case 791 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
consumeTypeParameter1();
break;
- case 781 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ case 792 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
consumeTypeParameter1WithExtends();
break;
- case 782 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ case 793 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
consumeTypeParameter1WithExtendsAndBounds();
break;
- case 784 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ case 795 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
consumeAdditionalBoundList1();
break;
- case 785 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
+ case 796 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
consumeAdditionalBound1();
break;
- case 791 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
+ case 802 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.PLUS);
break;
- case 792 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
+ case 803 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.MINUS);
break;
- case 795 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
+ case 806 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.TWIDDLE);
break;
- case 796 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
+ case 807 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
consumeUnaryExpression(OperatorIds.NOT);
break;
- case 799 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 810 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.MULTIPLY);
break;
- case 800 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$
+ case 811 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
break;
- case 801 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 812 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.DIVIDE);
break;
- case 802 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$
+ case 813 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
break;
- case 803 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 814 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.REMAINDER);
break;
- case 804 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$
+ case 815 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
break;
- case 806 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 817 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.PLUS);
break;
- case 807 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$
+ case 818 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.PLUS);
break;
- case 808 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 819 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.MINUS);
break;
- case 809 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$
+ case 820 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.MINUS);
break;
- case 811 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ case 822 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
break;
- case 812 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$
+ case 823 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
break;
- case 813 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ case 824 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
break;
- case 814 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$
+ case 825 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
break;
- case 815 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ case 826 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
- case 816 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$
+ case 827 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
break;
- case 818 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ case 829 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LESS);
break;
- case 819 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
+ case 830 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.LESS);
break;
- case 820 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ case 831 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.GREATER);
break;
- case 821 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$
+ case 832 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.GREATER);
break;
- case 822 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 833 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.LESS_EQUAL);
break;
- case 823 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$
+ case 834 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
break;
- case 824 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 835 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
break;
- case 825 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$
+ case 836 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
break;
- case 827 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$
+ case 838 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$
consumeInstanceOfExpressionWithName();
break;
- case 828 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 839 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
consumeInstanceOfExpression();
break;
- case 830 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 841 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
break;
- case 831 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$
+ case 842 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$
consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
break;
- case 832 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 843 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
consumeEqualityExpression(OperatorIds.NOT_EQUAL);
break;
- case 833 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$
+ case 844 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$
consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
break;
- case 835 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
+ case 846 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.AND);
break;
- case 836 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$
+ case 847 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.AND);
break;
- case 838 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 849 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.XOR);
break;
- case 839 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$
+ case 850 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.XOR);
break;
- case 841 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 852 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.OR);
break;
- case 842 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$
+ case 853 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.OR);
break;
- case 844 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 855 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.AND_AND);
break;
- case 845 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$
+ case 856 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.AND_AND);
break;
- case 847 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 858 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
consumeBinaryExpression(OperatorIds.OR_OR);
break;
- case 848 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$
+ case 859 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$
consumeBinaryExpressionWithName(OperatorIds.OR_OR);
break;
- case 850 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
+ case 861 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
break;
- case 851 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$
+ case 862 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$
consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
break;
- case 855 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ case 866 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclarationHeaderName() ;
break;
- case 856 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ case 867 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
break;
- case 857 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ case 868 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
break;
- case 858 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ case 869 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclarationHeaderName() ;
break;
- case 859 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
+ case 870 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclarationHeader() ;
break;
- case 860 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
+ case 871 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
consumeAnnotationTypeDeclaration() ;
break;
- case 862 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ case 873 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
break;
- case 863 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ case 874 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
consumeAnnotationTypeMemberDeclarationsopt() ;
break;
- case 865 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
+ case 876 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
consumeAnnotationTypeMemberDeclarations() ;
break;
- case 866 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ case 877 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
consumeMethodHeaderNameWithTypeParameters(true);
break;
- case 867 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 878 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeMethodHeaderName(true);
break;
- case 868 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
+ case 879 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
consumeEmptyMethodHeaderDefaultValue() ;
break;
- case 869 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
+ case 880 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
consumeMethodHeaderDefaultValue();
break;
- case 870 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
+ case 881 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
consumeMethodHeader();
break;
- case 871 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
+ case 882 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
consumeAnnotationTypeMemberDeclaration() ;
break;
- case 879 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$
+ case 890 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$
consumeAnnotationName() ;
break;
- case 880 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ case 891 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
consumeNormalAnnotation(false) ;
break;
- case 881 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
+ case 892 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
consumeEmptyMemberValuePairsopt() ;
break;
- case 884 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
+ case 895 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
consumeMemberValuePairs() ;
break;
- case 885 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$
+ case 896 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$
consumeMemberValuePair() ;
break;
- case 886 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
+ case 897 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
consumeEnterMemberValue() ;
break;
- case 887 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
+ case 898 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
consumeExitMemberValue() ;
break;
- case 889 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$
+ case 900 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$
consumeMemberValueAsName() ;
break;
- case 892 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ case 903 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
consumeMemberValueArrayInitializer() ;
break;
- case 893 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ case 904 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
consumeMemberValueArrayInitializer() ;
break;
- case 894 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ case 905 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
consumeEmptyMemberValueArrayInitializer() ;
break;
- case 895 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ case 906 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
consumeEmptyMemberValueArrayInitializer() ;
break;
- case 896 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
+ case 907 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
consumeEnterMemberValueArrayInitializer() ;
break;
- case 898 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
+ case 909 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
consumeMemberValues() ;
break;
- case 899 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
+ case 910 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
consumeMarkerAnnotation(false) ;
break;
- case 900 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
+ case 911 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
consumeSingleMemberAnnotationMemberValue() ;
break;
- case 901 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ case 912 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
consumeSingleMemberAnnotation(false) ;
break;
- case 902 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
+ case 913 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
consumeRecoveryMethodHeaderNameWithTypeParameters();
break;
- case 903 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 914 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
consumeRecoveryMethodHeaderName();
break;
- case 904 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
+ case 915 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
consumeRecoveryMethodHeaderNameWithTypeParameters();
break;
- case 905 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$
+ case 916 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$
consumeRecoveryMethodHeaderName();
break;
- case 906 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ case 917 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
consumeMethodHeader();
break;
- case 907 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ case 918 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
consumeMethodHeader();
break;
@@ -9769,15 +9828,7 @@ protected void consumeStaticOnly() {
}
}
protected void consumeTextBlock() {
- if (!this.parsingJava14Plus) {
- problemReporter().previewFeatureNotSupported(this.scanner.startPosition, this.scanner.currentPosition - 1, "Text Blocks", CompilerOptions.VERSION_14); //$NON-NLS-1$
- } else if (!this.options.enablePreviewFeatures){
- problemReporter().previewFeatureNotEnabled(this.scanner.startPosition, this.scanner.currentPosition - 1, "Text Blocks"); //$NON-NLS-1$
- } else {
- if (this.options.isAnyEnabled(IrritantSet.PREVIEW)) {
- problemReporter().previewFeatureUsed(this.scanner.startPosition, this.scanner.currentPosition - 1);
- }
- }
+ problemReporter().validateJavaFeatureSupport(JavaFeature.TEXT_BLOCKS, this.scanner.startPosition, this.scanner.currentPosition - 1);
char[] textBlock2 = this.scanner.getCurrentTextBlock();
TextBlock textBlock;
if (this.recordStringLiterals &&
@@ -9791,8 +9842,6 @@ protected void consumeTextBlock() {
this.scanner.startPosition,
this.scanner.currentPosition - 1,
Util.getLineNumber(this.scanner.startPosition, this.scanner.lineEnds, 0, this.scanner.linePtr));
- // TODO
- //this.compilationUnit.recordStringLiteral(stringLiteral, this.currentElement != null);
} else {
textBlock = new TextBlock(
textBlock2,
@@ -10059,6 +10108,10 @@ protected void consumeToken(int type) {
checkAndSetModifiers(ClassFileConstants.AccNative);
pushOnExpressionStackLengthStack(0);
break;
+ case TokenNamenon_sealed :
+ checkAndSetModifiers(ExtraCompilerModifiers.AccNonSealed);
+ pushOnExpressionStackLengthStack(0);
+ break;
case TokenNameopen :
checkAndSetModifiers(ClassFileConstants.ACC_OPEN);
pushOnExpressionStackLengthStack(0);
@@ -10075,6 +10128,10 @@ protected void consumeToken(int type) {
checkAndSetModifiers(ClassFileConstants.AccPublic);
pushOnExpressionStackLengthStack(0);
break;
+ case TokenNameRestrictedIdentifiersealed :
+ checkAndSetModifiers(ExtraCompilerModifiers.AccSealed);
+ pushOnExpressionStackLengthStack(0);
+ break;
case TokenNametransient :
checkAndSetModifiers(ClassFileConstants.AccTransient);
pushOnExpressionStackLengthStack(0);
@@ -10241,7 +10298,6 @@ protected void consumeToken(int type) {
case TokenNamebreak :
case TokenNamecontinue :
case TokenNamereturn :
-// case TokenNamecase :
case TokenNamemodule:
case TokenNamerequires:
case TokenNameexports:
@@ -10251,6 +10307,10 @@ protected void consumeToken(int type) {
case TokenNameRestrictedIdentifierYield:
pushOnIntStack(this.scanner.startPosition);
break;
+ case TokenNameRestrictedIdentifierpermits:
+ problemReporter().validateJavaFeatureSupport(JavaFeature.SEALED_CLASSES, this.scanner.startPosition,this.scanner.currentPosition - 1);
+ pushOnIntStack(this.scanner.startPosition);
+ break;
case TokenNamecase :
this.caseLevel = this.switchNestingLevel;
pushOnIntStack(this.scanner.startPosition);
@@ -10832,13 +10892,7 @@ protected void consumeRecordDeclaration() {
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
this.recordNestedMethodLevels.remove(typeDecl);
- if (!this.options.enablePreviewFeatures){
- problemReporter().previewFeatureNotEnabled(typeDecl.sourceStart, typeDecl.sourceEnd, "Records"); //$NON-NLS-1$
- } else {
- if (this.options.isAnyEnabled(IrritantSet.PREVIEW)) {
- problemReporter().previewFeatureUsed(typeDecl.sourceStart, typeDecl.sourceEnd);
- }
- }
+ problemReporter().validateJavaFeatureSupport(JavaFeature.RECORDS, typeDecl.sourceStart, typeDecl.sourceEnd);
//convert constructor that do not have the type's name into methods
ConstructorDeclaration cd = typeDecl.getConstructor(this);
if (cd == null) {
@@ -10881,9 +10935,6 @@ protected void consumeRecordComponentHeaderRightParen() {
this.astPtr -= length;
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
int nestedMethodLevel = this.nestedMethod[this.nestedType];
- typeDecl.isLocalRecord = nestedMethodLevel > 0;
- if (typeDecl.isLocalRecord)
- typeDecl.modifiers |= ClassFileConstants.AccStatic; // JLS 14 Sec 14.3
this.recordNestedMethodLevels.put(typeDecl, new Integer[] {this.nestedType, nestedMethodLevel});
this.astStack[this.astPtr] = typeDecl;
// rd.sourceEnd = this.rParenPos;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
index 1ed47d1b76..a1a6383f3b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
@@ -20,22 +20,22 @@ public interface ParserBasicInformation {
public final static int
// BEGIN_AUTOGENERATED_REGION
- ERROR_SYMBOL = 132,
- MAX_NAME_LENGTH = 41,
- NUM_STATES = 1197,
+ ERROR_SYMBOL = 135,
+ MAX_NAME_LENGTH = 53,
+ NUM_STATES = 1207,
- NT_OFFSET = 132,
+ NT_OFFSET = 135,
SCOPE_UBOUND = 312,
SCOPE_SIZE = 313,
- LA_STATE_OFFSET = 18017,
+ LA_STATE_OFFSET = 17584,
MAX_LA = 1,
- NUM_RULES = 907,
- NUM_TERMINALS = 132,
- NUM_NON_TERMINALS = 418,
- NUM_SYMBOLS = 550,
- START_STATE = 981,
- EOFT_SYMBOL = 62,
- EOLT_SYMBOL = 62,
- ACCEPT_ACTION = 18016,
- ERROR_ACTION = 18017;
+ NUM_RULES = 918,
+ NUM_TERMINALS = 135,
+ NUM_NON_TERMINALS = 423,
+ NUM_SYMBOLS = 558,
+ START_STATE = 991,
+ EOFT_SYMBOL = 64,
+ EOLT_SYMBOL = 64,
+ ACCEPT_ACTION = 17583,
+ ERROR_ACTION = 17584;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
index ae1eba0042..82f5a2fb46 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
@@ -352,6 +352,9 @@ public boolean bodyStartsAtHeaderEnd(){
return this.typeDeclaration.bodyStart == this.typeDeclaration.superclass.sourceEnd+1;
}
} else {
+ if (this.typeDeclaration.permittedTypes != null)
+ return this.typeDeclaration.bodyStart
+ == this.typeDeclaration.permittedTypes[this.typeDeclaration.permittedTypes.length-1].sourceEnd+1;
return this.typeDeclaration.bodyStart
== this.typeDeclaration.superInterfaces[this.typeDeclaration.superInterfaces.length-1].sourceEnd+1;
}
@@ -797,6 +800,7 @@ public RecoveredElement updateOnOpeningBrace(int braceStart, int braceEnd){
case -1 :
case TokenNameextends :
case TokenNameimplements :
+ case TokenNameRestrictedIdentifierpermits:
case TokenNameGREATER :
case TokenNameRIGHT_SHIFT :
case TokenNameUNSIGNED_RIGHT_SHIFT :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index d2deedd0d8..02bf1d262f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -16,7 +16,10 @@
package org.eclipse.jdt.internal.compiler.parser;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.function.Predicate;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.InvalidInputException;
@@ -25,6 +28,7 @@ import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
import org.eclipse.jdt.internal.compiler.ast.Statement;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.internal.compiler.impl.JavaFeature;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.eclipse.jdt.internal.compiler.util.Util;
@@ -241,6 +245,9 @@ public class Scanner implements TerminalTokens {
// text block support - 13
/* package */ int rawStart = -1;
+ //Java 15 - first _ keyword appears
+ Map<String, Integer> _Keywords = null;
+
public Scanner() {
this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/, true /*taskCaseSensitive*/);
}
@@ -739,96 +746,100 @@ private char[] normalize(char[] content) {
// treat all the white space and line endings
private boolean getLineContent(StringBuilder result, char[] line, int start, int end, boolean merge, boolean lastLine) {
int lastPointer = 0;
- for(int i = start; i < end; i++) {
+ for(int i = start; i < end;) {
char c = line[i];
- if (c == '\\') {
- if (i < end) {
- if (lastPointer == i) {
- lastPointer = i+1;
- } else {
- result.append(CharOperation.subarray(line, lastPointer == 0 ? start : lastPointer+1, i));
- }
- switch (line[++i]) {
- case '\\' :
- result.append('\\');
- if (i == end)
- merge = false;
- //i = lastPointer;
- lastPointer = i;
- break;
- case 's' :
- result.append(' ');
- lastPointer = i;
- break;
- case 'n' :
- result.append('\n');
- lastPointer = i;
- break;
- case 'r' :
- result.append('\r');
- lastPointer = i;
- break;
- case 'f' :
- result.append('\f');
- lastPointer = i;
- break;
- default :
- // Direct copy from scanEscapeCharacter
- int pos = i;
- char ch = line[pos];
- int number = ScannerHelper.getHexadecimalValue(ch);
- if (number >= 0 && number <= 7) {
- boolean zeroToThreeNot = number > 3;
- try {
- if (ScannerHelper.isDigit(ch = line[++pos])) {
- int digit = ScannerHelper.getHexadecimalValue(ch);
- if (digit >= 0 && digit <= 7) {
- number = (number * 8) + digit;
- if (ScannerHelper.isDigit(ch = line[++pos])) {
- if (zeroToThreeNot) {
- // has read \NotZeroToThree OctalDigit Digit --> ignore last character
+ if (c != '\\') {
+ i++;
+ continue;
+ }
+ if (i < end) {
+ if (lastPointer + 1 <= i) {
+ result.append(CharOperation.subarray(line, lastPointer == 0 ? start : lastPointer, i));
+ }
+ char next = line[++i];
+ switch (next) {
+ case '\\' :
+ result.append('\\');
+ if (i == end)
+ merge = false;
+ break;
+ case 's' :
+ result.append(' ');
+ break;
+ case 'b' :
+ result.append('\b');
+ break;
+ case 'n' :
+ result.append('\n');
+ break;
+ case 'r' :
+ result.append('\r');
+ break;
+ case 't' :
+ result.append('\t');
+ break;
+ case 'f' :
+ result.append('\f');
+ break;
+ default :
+ // Direct copy from scanEscapeCharacter
+ int pos = i + 1;
+ int number = ScannerHelper.getHexadecimalValue(next);
+ if (number >= 0 && number <= 7) {
+ boolean zeroToThreeNot = number > 3;
+ try {
+ if (ScannerHelper.isDigit(next = line[pos])) {
+ pos++;
+ int digit = ScannerHelper.getHexadecimalValue(next);
+ if (digit >= 0 && digit <= 7) {
+ number = (number * 8) + digit;
+ if (ScannerHelper.isDigit(next = line[pos])) {
+ pos++;
+ if (zeroToThreeNot) {
+ // has read \NotZeroToThree OctalDigit Digit --> ignore last character
+ } else {
+ digit = ScannerHelper.getHexadecimalValue(next);
+ if (digit >= 0 && digit <= 7){ // has read \ZeroToThree OctalDigit OctalDigit
+ number = (number * 8) + digit;
} else {
- digit = ScannerHelper.getHexadecimalValue(ch);
- if (digit >= 0 && digit <= 7){ // has read \ZeroToThree OctalDigit OctalDigit
- number = (number * 8) + digit;
- } else {
- // has read \ZeroToThree OctalDigit NonOctalDigit --> ignore last character
- }
+ // has read \ZeroToThree OctalDigit NonOctalDigit --> ignore last character
}
- } else {
- // has read \OctalDigit NonDigit--> ignore last character
}
} else {
- // has read \OctalDigit NonOctalDigit--> ignore last character
+ // has read \OctalDigit NonDigit--> ignore last character
}
} else {
- // has read \OctalDigit --> ignore last character
+ // has read \OctalDigit NonOctalDigit--> ignore last character
}
- } catch (InvalidInputException e) {
- // Unlikely as this has already been processed in scanForStringLiteral()
- }
- if (number < 255) {
- ch = (char) number;
- //replaceEscapedChar(result, line, start, end, i, lastPointer, ch);
+ } else {
+ // has read \OctalDigit --> ignore last character
}
- result.append(ch);
- lastPointer = i = pos -1;
- } else {
- // Dealing with just '\'
- result.append(c);
- lastPointer = --i;
+ } catch (InvalidInputException e) {
+ // Unlikely as this has already been processed in scanForStringLiteral()
}
- }
+ if (number < 255) {
+ next = (char) number;
+ }
+ result.append(next);
+ lastPointer = i = pos;
+ continue;
+ } else {
+ // Dealing with just '\'
+ result.append(c);
+ lastPointer = i;
+ continue;
+ }
}
+ lastPointer = ++i;
}
}
end = merge ? end : end >= line.length ? end : end + 1;
char[] chars = lastPointer == 0 ?
CharOperation.subarray(line, start, end) :
- CharOperation.subarray(line, lastPointer + 1, end);
+ CharOperation.subarray(line, lastPointer, end);
// The below check is because CharOperation.subarray tend to return null when the
// boundaries produce a zero sized char[]
- if (chars != null)
+ if (chars != null && chars.length > 0)
result.append(chars);
return (!merge && !lastLine);
}
@@ -2108,28 +2119,28 @@ private int scanForStringLiteral() throws InvalidInputException {
int oldPos = this.currentPosition - 1;
scanEscapeCharacter();
switch (this.currentCharacter) {
- case ' ':
- if (this.withoutUnicodePtr == 0) {
- unicodeInitializeBuffer(this.currentPosition - this.startPosition);
- }
- // Kludge, retain the '\' and also
- // when scanEscapeCharacter reads space in form of \040 and
- // set the next character to 's'
- // so, we get an escaped scape, i.e. \s, which will later be
- // replaced by space
- unicodeStore('\\');
- this.currentCharacter = 's';
- break;
- case '\r':
- case '\n':
- if (this.withoutUnicodePtr == 0) {
- unicodeInitializeBuffer(this.currentPosition - this.startPosition);
+// case ' ':
+// if (this.withoutUnicodePtr == 0) {
+// unicodeInitializeBuffer(this.currentPosition - this.startPosition);
+// }
+// // Kludge, retain the '\' and also
+// // when scanEscapeCharacter reads space in form of \040 and
+// // set the next character to 's'
+// // so, we get an escaped scape, i.e. \s, which will later be
+// // replaced by space
+// unicodeStore('\\');
+// this.currentCharacter = 's';
+// break;
+ default:
+ if (ScannerHelper.isWhitespace(this.currentCharacter)) {
+ if (this.withoutUnicodePtr == 0) {
+ unicodeInitializeBuffer(this.currentPosition - this.startPosition);
+ }
+ unicodeStore('\\');
+ this.currentPosition = oldPos;
+ this.currentCharacter = this.source[this.currentPosition];
+ break outer;
}
- unicodeStore('\\');
- this.currentPosition = oldPos;
- this.currentCharacter = this.source[this.currentPosition];
- break outer;
-
}
}
if (this.withoutUnicodePtr != 0) {
@@ -3825,8 +3836,10 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
case 3 :
if ((data[++index] == 'e') && (data[++index] == 'w'))
return TokenNamenew;
- else
- return TokenNameIdentifier;
+ else {
+ int token = checkFor_KeyWord(index - 1, length, data);
+ return token != TokenNameNotAToken ? token : TokenNameIdentifier;
+ }
case 4 :
if ((data[++index] == 'u') && (data[++index] == 'l') && (data[++index] == 'l'))
return TokenNamenull;
@@ -3876,7 +3889,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
} else
return TokenNameIdentifier;
case 7 :
- if (data[++index] == 'a')
+ if (data[++index] == 'a') {
if ((data[++index] == 'c')
&& (data[++index] == 'k')
&& (data[++index] == 'a')
@@ -3885,7 +3898,7 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
return TokenNamepackage;
else
return TokenNameIdentifier;
- else
+ } else {
if ((data[index] == 'r')
&& (data[++index] == 'i')
&& (data[++index] == 'v')
@@ -3893,8 +3906,16 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
&& (data[++index] == 't')
&& (data[++index] == 'e')) {
return TokenNameprivate;
- } else
+ } else if ((data[index] == 'e')
+ && (data[++index] == 'r')
+ && (data[++index] == 'm')
+ && (data[++index] == 'i')
+ && (data[++index] == 't')
+ && (data[++index] == 's')) {
+ return disambiguatedRestrictedIdentifierpermits(TokenNameRestrictedIdentifierpermits);
+ } else
return TokenNameIdentifier;
+ }
case 8 :
if (areRestrictedModuleKeywordsActive()
&& (data[++index] == 'r')
@@ -3986,9 +4007,15 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
&& (data[++index] == 'i')
&& (data[++index] == 't')
&& (data[++index] == 'c')
- && (data[++index] == 'h'))
+ && (data[++index] == 'h')) {
return TokenNameswitch;
- else
+ } else if ((data[index] == 'e')
+ && (data[++index] == 'a')
+ && (data[++index] == 'l')
+ && (data[++index] == 'e')
+ && (data[++index] == 'd')) {
+ return disambiguatedRestrictedIdentifiersealed(TokenNameRestrictedIdentifiersealed);
+ } else
return TokenNameIdentifier;
case 8 :
if ((data[++index] == 't')
@@ -4167,6 +4194,25 @@ private int internalScanIdentifierOrKeyword(int index, int length, char[] data)
}
+private int checkFor_KeyWord(int index, int length, char[] data) {
+ if (this._Keywords == null) {
+ this._Keywords = new HashMap<>(0);
+ if (this.sourceLevel >= ClassFileConstants.JDK15) {
+ if (this.previewEnabled)
+ this._Keywords.put("non-sealed", TerminalTokens.TokenNamenon_sealed); //$NON-NLS-1$
+ }
+ }
+ for (String key : this._Keywords.keySet()) {
+ if (CharOperation.prefixEquals(key.toCharArray(), data, true /* isCaseSensitive */, index)) {
+ this.currentPosition = this.currentPosition - length + key.length();
+ if (this.currentPosition < this.eofPosition)
+ this.currentCharacter = data[this.currentPosition];
+ return this._Keywords.get(key);
+ }
+ }
+ return TokenNameNotAToken;
+}
+
public int scanNumber(boolean dotPrefix) throws InvalidInputException {
//when entering this method the currentCharacter is the first
@@ -4626,10 +4672,14 @@ public String toStringAction(int act) {
return "native"; //$NON-NLS-1$
case TokenNamenew :
return "new"; //$NON-NLS-1$
+ case TokenNamenon_sealed:
+ return "non-sealed"; //$NON-NLS-1$
case TokenNamenull :
return "null"; //$NON-NLS-1$
case TokenNamepackage :
return "package"; //$NON-NLS-1$
+ case TokenNameRestrictedIdentifierpermits:
+ return "permits"; //$NON-NLS-1$
case TokenNameprivate :
return "private"; //$NON-NLS-1$
case TokenNameprotected :
@@ -4638,6 +4688,8 @@ public String toStringAction(int act) {
return "public"; //$NON-NLS-1$
case TokenNamereturn :
return "return"; //$NON-NLS-1$
+ case TokenNameRestrictedIdentifiersealed:
+ return "sealed"; //$NON-NLS-1$
case TokenNameshort :
return "short"; //$NON-NLS-1$
case TokenNamestatic :
@@ -4868,6 +4920,7 @@ public static boolean isKeyword(int token) {
case TerminalTokens.TokenNameinstanceof:
case TerminalTokens.TokenNamelong:
case TerminalTokens.TokenNamenew:
+ case TerminalTokens.TokenNamenon_sealed:
case TerminalTokens.TokenNamenull:
case TerminalTokens.TokenNamenative:
case TerminalTokens.TokenNamepublic:
@@ -4893,6 +4946,8 @@ public static boolean isKeyword(int token) {
return true;
case TerminalTokens.TokenNameRestrictedIdentifierYield:
case TerminalTokens.TokenNameRestrictedIdentifierrecord:
+ case TerminalTokens.TokenNameRestrictedIdentifiersealed:
+ case TerminalTokens.TokenNameRestrictedIdentifierpermits:
// making explicit - not a (restricted) keyword but restricted identifier.
//$FALL-THROUGH$
default:
@@ -4940,7 +4995,7 @@ private static class Goal {
int first; // steer the parser towards a single minded pursuit.
int [] follow; // the definite terminal symbols that signal the successful reduction to goal.
- int rule;
+ int[] rules;
static int LambdaParameterListRule = 0;
static int IntersectionCastRule = 0;
@@ -4949,6 +5004,8 @@ private static class Goal {
static int BlockStatementoptRule = 0;
static int YieldStatementRule = 0;
static int SwitchLabelCaseLhsRule = 0;
+ static int[] RestrictedIdentifierSealedRule;
+ static int[] RestrictedIdentifierPermitsRule;
static Goal LambdaParameterListGoal;
static Goal IntersectionCastGoal;
@@ -4957,9 +5014,17 @@ private static class Goal {
static Goal BlockStatementoptGoal;
static Goal YieldStatementGoal;
static Goal SwitchLabelCaseLhsGoal;
+ static Goal RestrictedIdentifierSealedGoal;
+ static Goal RestrictedIdentifierPermitsGoal;
+
+ static int[] RestrictedIdentifierSealedFollow = { TokenNameclass, TokenNameinterface,
+ TokenNameenum, TokenNameRestrictedIdentifierrecord };// Note: enum/record allowed as error flagging rules.
+ static int[] RestrictedIdentifierPermitsFollow = { TokenNameLBRACE };
static {
+ List<Integer> ridSealed = new ArrayList<>(2);
+ List<Integer> ridPermits = new ArrayList<>();
for (int i = 1; i <= ParserBasicInformation.NUM_RULES; i++) { // 0 == $acc
if ("ParenthesizedLambdaParameterList".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
LambdaParameterListRule = i;
@@ -4979,10 +5044,18 @@ private static class Goal {
if ("YieldStatement".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
YieldStatementRule = i;
else
+ if ("Modifiersopt".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
+ ridSealed.add(i);
+ else
+ if ("PermittedSubclasses".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
+ ridPermits.add(i);
+ else
if ("SwitchLabelCaseLhs".equals(Parser.name[Parser.non_terminal_index[Parser.lhs[i]]])) //$NON-NLS-1$
SwitchLabelCaseLhsRule = i;
}
+ RestrictedIdentifierSealedRule = ridSealed.stream().mapToInt(Integer :: intValue).toArray(); // overkill but future-proof
+ RestrictedIdentifierPermitsRule = ridPermits.stream().mapToInt(Integer :: intValue).toArray();
LambdaParameterListGoal = new Goal(TokenNameARROW, new int[] { TokenNameARROW }, LambdaParameterListRule);
IntersectionCastGoal = new Goal(TokenNameLPAREN, followSetOfCast(), IntersectionCastRule);
@@ -4991,13 +5064,21 @@ private static class Goal {
BlockStatementoptGoal = new Goal(TokenNameLBRACE, new int [0], BlockStatementoptRule);
YieldStatementGoal = new Goal(TokenNameARROW, new int [0], YieldStatementRule);
SwitchLabelCaseLhsGoal = new Goal(TokenNameARROW, new int [0], SwitchLabelCaseLhsRule);
+ RestrictedIdentifierSealedGoal = new Goal(TokenNameRestrictedIdentifiersealed, RestrictedIdentifierSealedFollow, RestrictedIdentifierSealedRule);
+ RestrictedIdentifierPermitsGoal = new Goal(TokenNameRestrictedIdentifierpermits, RestrictedIdentifierPermitsFollow, RestrictedIdentifierPermitsRule);
}
Goal(int first, int [] follow, int rule) {
this.first = first;
this.follow = follow;
- this.rule = rule;
+ this.rules = new int[] {rule};
+ }
+
+ Goal(int first, int [] follow, int[] rules) {
+ this.first = first;
+ this.follow = follow;
+ this.rules = rules;
}
boolean hasBeenReached(int act, int token) {
@@ -5005,7 +5086,14 @@ private static class Goal {
System.out.println("[Goal = " + Parser.name[Parser.non_terminal_index[Parser.lhs[this.rule]]] + "] " + "Saw: " + Parser.name[Parser.non_terminal_index[Parser.lhs[act]]] + "::" + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Parser.name[Parser.terminal_index[token]]);
*/
- if (act == this.rule) {
+ boolean foundRule = false;
+ for (int i : this.rules) {
+ if (act == i) {
+ foundRule = true;
+ break;
+ }
+ }
+ if (foundRule) {
final int length = this.follow.length;
if (length == 0)
return true;
@@ -5167,6 +5255,18 @@ private VanguardParser getVanguardParser() {
this.vanguardScanner.resetTo(this.startPosition, this.eofPosition - 1, isInModuleDeclaration(), this.scanContext);
return this.vanguardParser;
}
+private VanguardParser getNewVanguardParser() {
+ VanguardScanner vs = getNewVanguardScanner();
+ VanguardParser vp = new VanguardParser(vs);
+ vs.setActiveParser(vp);
+ return vp;
+}
+private VanguardScanner getNewVanguardScanner() {
+ VanguardScanner vs = new VanguardScanner(this.sourceLevel, this.complianceLevel, this.previewEnabled);
+ vs.setSource(this.source);
+ vs.resetTo(this.startPosition, this.eofPosition - 1, isInModuleDeclaration(), this.scanContext);
+ return vs;
+}
protected final boolean mayBeAtBreakPreview() {
return this.breakPreviewAllowed && this.lookBack[1] != TokenNameARROW;
}
@@ -5184,7 +5284,6 @@ protected final boolean maybeAtLambdaOrCast() { // Could the '(' we saw just now
case TokenNamefor:
case TokenNamesynchronized:
case TokenNametry:
- case TokenNamedefault:
return false; // not a viable prefix for cast or lambda.
default:
return this.activeParser.atConflictScenario(TokenNameLPAREN);
@@ -5206,6 +5305,8 @@ protected final boolean maybeAtReferenceExpression() { // Did the '<' we saw jus
case TokenNameGREATER: // public <T> List<T> foo() { /* */ }
case TokenNameRIGHT_SHIFT:// static <T extends SelfType<T>> List<T> makeSingletonList(T t) { /* */ }
case TokenNamenew: // new ArrayList<String>();
+ case TokenNamenon_sealed: // non-sealed X<T>
+ case TokenNameRestrictedIdentifiersealed: // sealed X<T>
case TokenNamepublic: // public List<String> foo() {}
case TokenNameabstract: // abstract List<String> foo() {}
case TokenNameprivate: // private List<String> foo() {}
@@ -5215,9 +5316,11 @@ protected final boolean maybeAtReferenceExpression() { // Did the '<' we saw jus
case TokenNamesuper: // ? super Context<N>
case TokenNameAND: // T extends Object & Comparable<? super T>
case TokenNameimplements: // class A implements I<Z>
+ case TokenNameRestrictedIdentifierpermits: // class A permits I<Z>
case TokenNamethrows: // throws Y<Z>
case TokenNameAT: // @Deprecated <T> void foo() {}
case TokenNameinstanceof: // if (o instanceof List<E>[])
+ case TokenNamedefault:
return false;
default:
break;
@@ -5239,6 +5342,7 @@ private final boolean maybeAtEllipsisAnnotationsStart() { // Did the '@' we saw
case TokenNameextends:
case TokenNamesuper:
case TokenNameimplements:
+ case TokenNameRestrictedIdentifierpermits:
case TokenNameDOT:
case TokenNameLBRACE:
case TokenNameinstanceof:
@@ -5297,11 +5401,20 @@ private boolean mayBeAtAnYieldStatement() {
return false;
}
}
+private boolean mayBeAtARestricedIdentifier(int restrictedIdentifier) {
+ switch (restrictedIdentifier) {
+ case TokenNameRestrictedIdentifiersealed:
+ break;
+ case TokenNameRestrictedIdentifierpermits:
+ break;
+ }
+ return true;
+}
int disambiguatedRestrictedIdentifierrecord(int restrictedIdentifierToken) {
// and here's the kludge
if (restrictedIdentifierToken != TokenNameRestrictedIdentifierrecord)
return restrictedIdentifierToken;
- if (this.sourceLevel < ClassFileConstants.JDK14 || !this.previewEnabled)
+ if (!JavaFeature.RECORDS.isSupported(this.complianceLevel, this.previewEnabled))
return TokenNameIdentifier;
return disambiguaterecordWithLookAhead() ?
@@ -5343,6 +5456,11 @@ private boolean disambiguaterecordWithLookAhead() {
if (lookAhead1 == TokenNameIdentifier) {
int lookAhead2 = this.vanguardScanner.getNextToken();
lookAhead2 = lookAhead2 == TokenNameLESS ? getNextTokenAfterTypeParameterHeader() : lookAhead2;
+ if (lookAhead2 == TokenNameLBRACE) {
+ // record X {} is considered a record (albeit illegal),
+ // This is so that we can issue an appropriate syntax error
+ return true;
+ }
return lookAhead2 == TokenNameLPAREN;
}
} catch (InvalidInputException e) {
@@ -5421,6 +5539,26 @@ private boolean disambiguateYieldWithLookAhead() {
}
return false; // IIE event;
}
+int disambiguatedRestrictedIdentifierpermits(int restrictedIdentifierToken) {
+ // and here's the kludge
+ if (restrictedIdentifierToken != TokenNameRestrictedIdentifierpermits)
+ return restrictedIdentifierToken;
+ if (this.sourceLevel < ClassFileConstants.JDK15 || !this.previewEnabled)
+ return TokenNameIdentifier;
+
+ return disambiguatesRestrictedIdentifierWithLookAhead(this::mayBeAtARestricedIdentifier,
+ restrictedIdentifierToken, Goal.RestrictedIdentifierPermitsGoal);
+}
+int disambiguatedRestrictedIdentifiersealed(int restrictedIdentifierToken) {
+ // and here's the kludge
+ if (restrictedIdentifierToken != TokenNameRestrictedIdentifiersealed)
+ return restrictedIdentifierToken;
+ if (this.sourceLevel < ClassFileConstants.JDK15 || !this.previewEnabled)
+ return TokenNameIdentifier;
+
+ return disambiguatesRestrictedIdentifierWithLookAhead(this::mayBeAtARestricedIdentifier,
+ restrictedIdentifierToken, Goal.RestrictedIdentifierSealedGoal);
+}
int disambiguatedRestrictedIdentifierYield(int restrictedIdentifierToken) {
// and here's the kludge
if (restrictedIdentifierToken != TokenNameRestrictedIdentifierYield)
@@ -5468,6 +5606,17 @@ int disambiguatedRestrictedKeyword(int restrictedKeywordToken) {
}
return token;
}
+int disambiguatesRestrictedIdentifierWithLookAhead(Predicate<Integer> checkPrecondition, int restrictedIdentifierToken, Goal goal) {
+ if (checkPrecondition.test(restrictedIdentifierToken)) {
+ VanguardParser vp = getNewVanguardParser();
+ VanguardScanner vs = (VanguardScanner) vp.scanner;
+ vs.resetTo(this.currentPosition, this.eofPosition - 1);
+ if (vp.parse(goal) == VanguardParser.SUCCESS)
+ return restrictedIdentifierToken;
+ }
+ return TokenNameIdentifier;
+}
+
private VanguardScanner getNewVanguardScanner(char[] src) {
VanguardScanner vs = new VanguardScanner(this.sourceLevel, this.complianceLevel, this.previewEnabled);
vs.setSource(src);
@@ -5523,12 +5672,12 @@ int disambiguatedToken(int token) {
}
return token;
}
-
private boolean mayBeAtCaseLabelExpr() {
if (this.lookBack[1] == TokenNamedefault || this.caseStartPosition <= 0)
return false;
return true;
}
+
protected boolean isAtAssistIdentifier() {
return false;
}
@@ -5575,10 +5724,12 @@ public int fastForward(Statement unused) {
case TokenNamelong:
case TokenNamenative:
case TokenNamenew:
+ case TokenNamenon_sealed:
case TokenNamenull:
case TokenNameprivate:
case TokenNameprotected:
case TokenNamepublic:
+ case TokenNameRestrictedIdentifiersealed:
case TokenNamereturn:
case TokenNameshort:
case TokenNamestatic:
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
index 8f6b5a870c..78cc30c741 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2018 IBM Corporation and others.
+ * Copyright (c) 2005, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -48,6 +48,7 @@ public class ScannerHelper {
private static long[][][] Tables11;
private static long[][][] Tables12;
private static long[][][] Tables13;
+ private static long[][][] Tables15;
public final static int MAX_OBVIOUS = 128;
public final static int[] OBVIOUS_IDENT_CHAR_NATURES = new int[MAX_OBVIOUS];
@@ -158,6 +159,9 @@ static void initializeTableJava12() {
static void initializeTableJava13() {
Tables13 = initializeTables("unicode12_1"); //$NON-NLS-1$
}
+static void initializeTableJava15() {
+ Tables15 = initializeTables13andPlus("unicode13"); //$NON-NLS-1$
+}
static long[][][] initializeTables(String unicode_path) {
long[][][] tempTable = new long[2][][];
tempTable[START_INDEX] = new long[3][];
@@ -227,6 +231,93 @@ static long[][][] initializeTables(String unicode_path) {
}
return tempTable;
}
+static long[][][] initializeTables13andPlus(String unicode_path) {
+ long[][][] tempTable = new long[2][][];
+ tempTable[START_INDEX] = new long[4][];
+ tempTable[PART_INDEX] = new long[5][];
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start0.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[START_INDEX][0] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start1.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[START_INDEX][1] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start2.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[START_INDEX][2] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start3.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[START_INDEX][3] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part0.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[PART_INDEX][0] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part1.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[PART_INDEX][1] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part2.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[PART_INDEX][2] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part3.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[PART_INDEX][3] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part14.rsc")))) { //$NON-NLS-1$
+ long[] readValues = new long[1024];
+ for (int i = 0; i < 1024; i++) {
+ readValues[i] = inputStream.readLong();
+ }
+ tempTable[PART_INDEX][4] = readValues;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return tempTable;
+}
private final static boolean isBitSet(long[] values, int i) {
try {
return (values[i / 64] & Bits[i % 64]) != 0;
@@ -247,6 +338,9 @@ public static boolean isJavaIdentifierPart(long complianceLevel, char c) {
return isJavaIdentifierPart(complianceLevel, (int) c);
}
private static boolean isJavaIdentifierPart0(int codePoint, long[][][] tables) {
+ return isJavaIdentifierPart0(codePoint, tables, false);
+}
+private static boolean isJavaIdentifierPart0(int codePoint, long[][][] tables, boolean isJava15orAbove) {
switch((codePoint & 0x1F0000) >> 16) {
case 0 :
return isBitSet(tables[PART_INDEX][0], codePoint & 0xFFFF);
@@ -254,7 +348,15 @@ private static boolean isJavaIdentifierPart0(int codePoint, long[][][] tables) {
return isBitSet(tables[PART_INDEX][1], codePoint & 0xFFFF);
case 2 :
return isBitSet(tables[PART_INDEX][2], codePoint & 0xFFFF);
+ case 3 :
+ if (isJava15orAbove) {
+ return isBitSet(tables[PART_INDEX][3], codePoint & 0xFFFF);
+ }
+ return false;
case 14 :
+ if (isJava15orAbove) {
+ return isBitSet(tables[PART_INDEX][4], codePoint & 0xFFFF);
+ }
return isBitSet(tables[PART_INDEX][3], codePoint & 0xFFFF);
}
return false;
@@ -295,12 +397,19 @@ public static boolean isJavaIdentifierPart(long complianceLevel, int codePoint)
initializeTableJava12();
}
return isJavaIdentifierPart0(codePoint, Tables12);
- } else {
- // java 13 supports Unicode 12.1
+ } else if (complianceLevel <= ClassFileConstants.JDK14) {
+ // java 13 and 14 support Unicode 12.1
if (Tables13 == null) {
initializeTableJava13();
}
return isJavaIdentifierPart0(codePoint, Tables13);
+
+ } else {
+ // java 15 supports Unicode 13
+ if (Tables15 == null) {
+ initializeTableJava15();
+ }
+ return isJavaIdentifierPart0(codePoint, Tables15, true);
}
}
public static boolean isJavaIdentifierPart(long complianceLevel, char high, char low) {
@@ -322,6 +431,9 @@ public static boolean isJavaIdentifierStart(long complianceLevel, char high, cha
return isJavaIdentifierStart(complianceLevel, toCodePoint(high, low));
}
private static boolean isJavaIdentifierStart0(int codePoint, long[][][] tables) {
+ return isJavaIdentifierStart0(codePoint, tables, false);
+}
+private static boolean isJavaIdentifierStart0(int codePoint, long[][][] tables, boolean isJava15orAbove) {
switch((codePoint & 0x1F0000) >> 16) {
case 0 :
return isBitSet(tables[START_INDEX][0], codePoint & 0xFFFF);
@@ -329,6 +441,10 @@ private static boolean isJavaIdentifierStart0(int codePoint, long[][][] tables)
return isBitSet(tables[START_INDEX][1], codePoint & 0xFFFF);
case 2 :
return isBitSet(tables[START_INDEX][2], codePoint & 0xFFFF);
+ case 3 :
+ if (isJava15orAbove)
+ return isBitSet(tables[START_INDEX][3], codePoint & 0xFFFF);
+ return false;
}
return false;
}
@@ -368,12 +484,18 @@ public static boolean isJavaIdentifierStart(long complianceLevel, int codePoint)
initializeTableJava12();
}
return isJavaIdentifierStart0(codePoint, Tables12);
- } else {
- // java 13 supports Unicode 12.1
+ } else if (complianceLevel <= ClassFileConstants.JDK14) {
+ // java 13 and 14 support Unicode 12.1
if (Tables13 == null) {
initializeTableJava13();
}
return isJavaIdentifierStart0(codePoint, Tables13);
+ } else {
+ // java 15 supports Unicode 13
+ if (Tables15 == null) {
+ initializeTableJava15();
+ }
+ return isJavaIdentifierStart0(codePoint, Tables15, true);
}
}
private static int toCodePoint(char high, char low) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
index aa1ba12797..fdab4c8437 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
@@ -39,76 +39,77 @@ public interface TerminalTokens {
// BEGIN_AUTOGENERATED_REGION
int TokenNameIdentifier = 21,
- TokenNameabstract = 52,
- TokenNameassert = 79,
- TokenNameboolean = 103,
- TokenNamebreak = 80,
- TokenNamebyte = 104,
- TokenNamecase = 89,
- TokenNamecatch = 105,
- TokenNamechar = 106,
- TokenNameclass = 68,
- TokenNamecontinue = 81,
- TokenNameconst = 130,
- TokenNamedefault = 74,
- TokenNamedo = 82,
- TokenNamedouble = 107,
- TokenNameelse = 117,
- TokenNameenum = 72,
- TokenNameextends = 90,
- TokenNamefalse = 41,
- TokenNamefinal = 53,
- TokenNamefinally = 114,
- TokenNamefloat = 108,
- TokenNamefor = 83,
- TokenNamegoto = 131,
- TokenNameif = 84,
- TokenNameimplements = 127,
- TokenNameimport = 109,
+ TokenNameabstract = 42,
+ TokenNameassert = 81,
+ TokenNameboolean = 105,
+ TokenNamebreak = 82,
+ TokenNamebyte = 106,
+ TokenNamecase = 91,
+ TokenNamecatch = 107,
+ TokenNamechar = 108,
+ TokenNameclass = 70,
+ TokenNamecontinue = 83,
+ TokenNameconst = 133,
+ TokenNamedefault = 76,
+ TokenNamedo = 84,
+ TokenNamedouble = 109,
+ TokenNameelse = 119,
+ TokenNameenum = 74,
+ TokenNameextends = 92,
+ TokenNamefalse = 43,
+ TokenNamefinal = 44,
+ TokenNamefinally = 116,
+ TokenNamefloat = 110,
+ TokenNamefor = 85,
+ TokenNamegoto = 134,
+ TokenNameif = 86,
+ TokenNameimplements = 130,
+ TokenNameimport = 111,
TokenNameinstanceof = 17,
- TokenNameint = 110,
- TokenNameinterface = 71,
- TokenNamelong = 111,
- TokenNamenative = 54,
+ TokenNameint = 112,
+ TokenNameinterface = 73,
+ TokenNamelong = 113,
+ TokenNamenative = 45,
TokenNamenew = 36,
- TokenNamenull = 42,
- TokenNamepackage = 88,
- TokenNameprivate = 55,
- TokenNameprotected = 56,
- TokenNamepublic = 57,
- TokenNamereturn = 85,
- TokenNameshort = 112,
+ TokenNamenon_sealed = 46,
+ TokenNamenull = 47,
+ TokenNamepackage = 90,
+ TokenNameprivate = 48,
+ TokenNameprotected = 49,
+ TokenNamepublic = 50,
+ TokenNamereturn = 87,
+ TokenNameshort = 114,
TokenNamestatic = 39,
- TokenNamestrictfp = 58,
+ TokenNamestrictfp = 51,
TokenNamesuper = 34,
- TokenNameswitch = 61,
+ TokenNameswitch = 63,
TokenNamesynchronized = 40,
TokenNamethis = 35,
- TokenNamethrow = 76,
- TokenNamethrows = 115,
- TokenNametransient = 59,
- TokenNametrue = 43,
- TokenNametry = 86,
- TokenNamevoid = 113,
- TokenNamevolatile = 60,
- TokenNamewhile = 77,
- TokenNamemodule = 118,
- TokenNameopen = 119,
- TokenNamerequires = 120,
- TokenNametransitive = 125,
- TokenNameexports = 121,
- TokenNameopens = 122,
- TokenNameto = 128,
- TokenNameuses = 123,
- TokenNameprovides = 124,
- TokenNamewith = 129,
- TokenNameIntegerLiteral = 44,
- TokenNameLongLiteral = 45,
- TokenNameFloatingPointLiteral = 46,
- TokenNameDoubleLiteral = 47,
- TokenNameCharacterLiteral = 48,
- TokenNameStringLiteral = 49,
- TokenNameTextBlock = 50,
+ TokenNamethrow = 78,
+ TokenNamethrows = 117,
+ TokenNametransient = 52,
+ TokenNametrue = 53,
+ TokenNametry = 88,
+ TokenNamevoid = 115,
+ TokenNamevolatile = 54,
+ TokenNamewhile = 79,
+ TokenNamemodule = 120,
+ TokenNameopen = 121,
+ TokenNamerequires = 122,
+ TokenNametransitive = 128,
+ TokenNameexports = 123,
+ TokenNameopens = 124,
+ TokenNameto = 131,
+ TokenNameuses = 125,
+ TokenNameprovides = 126,
+ TokenNamewith = 132,
+ TokenNameIntegerLiteral = 55,
+ TokenNameLongLiteral = 56,
+ TokenNameFloatingPointLiteral = 57,
+ TokenNameDoubleLiteral = 58,
+ TokenNameCharacterLiteral = 59,
+ TokenNameStringLiteral = 60,
+ TokenNameTextBlock = 61,
TokenNamePLUS_PLUS = 2,
TokenNameMINUS_MINUS = 3,
TokenNameEQUAL_EQUAL = 19,
@@ -118,56 +119,58 @@ public interface TerminalTokens {
TokenNameLEFT_SHIFT = 18,
TokenNameRIGHT_SHIFT = 14,
TokenNameUNSIGNED_RIGHT_SHIFT = 16,
- TokenNamePLUS_EQUAL = 91,
- TokenNameMINUS_EQUAL = 92,
- TokenNameMULTIPLY_EQUAL = 93,
- TokenNameDIVIDE_EQUAL = 94,
- TokenNameAND_EQUAL = 95,
- TokenNameOR_EQUAL = 96,
- TokenNameXOR_EQUAL = 97,
- TokenNameREMAINDER_EQUAL = 98,
- TokenNameLEFT_SHIFT_EQUAL = 99,
- TokenNameRIGHT_SHIFT_EQUAL = 100,
- TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 101,
+ TokenNamePLUS_EQUAL = 93,
+ TokenNameMINUS_EQUAL = 94,
+ TokenNameMULTIPLY_EQUAL = 95,
+ TokenNameDIVIDE_EQUAL = 96,
+ TokenNameAND_EQUAL = 97,
+ TokenNameOR_EQUAL = 98,
+ TokenNameXOR_EQUAL = 99,
+ TokenNameREMAINDER_EQUAL = 100,
+ TokenNameLEFT_SHIFT_EQUAL = 101,
+ TokenNameRIGHT_SHIFT_EQUAL = 102,
+ TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 103,
TokenNameOR_OR = 31,
TokenNameAND_AND = 30,
TokenNamePLUS = 4,
TokenNameMINUS = 5,
- TokenNameNOT = 64,
+ TokenNameNOT = 66,
TokenNameREMAINDER = 9,
TokenNameXOR = 24,
TokenNameAND = 22,
TokenNameMULTIPLY = 8,
TokenNameOR = 28,
- TokenNameTWIDDLE = 65,
+ TokenNameTWIDDLE = 67,
TokenNameDIVIDE = 10,
TokenNameGREATER = 15,
TokenNameLESS = 11,
TokenNameLPAREN = 23,
TokenNameRPAREN = 26,
- TokenNameLBRACE = 37,
+ TokenNameLBRACE = 38,
TokenNameRBRACE = 33,
TokenNameLBRACKET = 6,
- TokenNameRBRACKET = 67,
+ TokenNameRBRACKET = 69,
TokenNameSEMICOLON = 25,
TokenNameQUESTION = 29,
- TokenNameCOLON = 63,
+ TokenNameCOLON = 65,
TokenNameCOMMA = 32,
TokenNameDOT = 1,
- TokenNameEQUAL = 75,
- TokenNameAT = 38,
- TokenNameELLIPSIS = 116,
- TokenNameARROW = 102,
+ TokenNameEQUAL = 77,
+ TokenNameAT = 37,
+ TokenNameELLIPSIS = 118,
+ TokenNameARROW = 104,
TokenNameCOLON_COLON = 7,
- TokenNameBeginLambda = 51,
- TokenNameBeginIntersectionCast = 66,
- TokenNameBeginTypeArguments = 87,
- TokenNameElidedSemicolonAndRightBrace = 69,
+ TokenNameBeginLambda = 62,
+ TokenNameBeginIntersectionCast = 68,
+ TokenNameBeginTypeArguments = 89,
+ TokenNameElidedSemicolonAndRightBrace = 71,
TokenNameAT308 = 27,
- TokenNameAT308DOTDOTDOT = 126,
- TokenNameBeginCaseExpr = 70,
- TokenNameRestrictedIdentifierYield = 78,
- TokenNameRestrictedIdentifierrecord = 73,
- TokenNameEOF = 62,
- TokenNameERROR = 132;
+ TokenNameAT308DOTDOTDOT = 129,
+ TokenNameBeginCaseExpr = 72,
+ TokenNameRestrictedIdentifierYield = 80,
+ TokenNameRestrictedIdentifierrecord = 75,
+ TokenNameRestrictedIdentifiersealed = 41,
+ TokenNameRestrictedIdentifierpermits = 127,
+ TokenNameEOF = 64,
+ TokenNameERROR = 135;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index f335d2502c..fc06178f5e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
index f052bd1b8c..8593c4886f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
index cd71650e23..7fc5084986 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
index 07ff827105..c14240ad2b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
index 549601cdea..d95298b244 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
index 640f3280b3..26abf271e4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
index f4fed5c4fe..dc1833df3d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
index e3f564d99c..795d8a4512 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
index 5650dbffde..67d6770513 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index 9fdd139819..1dc9193cb6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
index e5c6ce84ee..ee49ee4d63 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
index b1e0521e1f..8eb1dbfcff 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
index 35cad114ae..7c224e1a5c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
index 30dcc0931a..8fb72f7f67 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
index 1eebf6eeac..77b1ee95c2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index fc05e2baa4..2416f1ff6c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index d3c3d7b5c4..4369869c3b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index 21865a2bdf..f1b1ae5c27 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
index 37154f98d7..4dc12bcb7a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
index a1222f34ca..5a47e821bd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
index d91fcfe4eb..e883c631ec 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
index 151c67a8e1..6c2a04052a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
index de72d8624c..8bcde6f821 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
@@ -67,6 +67,8 @@ ClassHeaderImplements=ClassHeaderImplements
ClassHeaderImplementsopt=ClassHeaderImplements
ClassHeaderName1=ClassHeaderName
ClassHeaderName=ClassHeaderName
+ClassHeaderPermittedSubclasses=ClassHeaderPermittedSubclasses
+ClassHeaderPermittedSubclassesopt=ClassHeaderPermittedSubclasses
ClassInstanceCreationExpression=ClassInstanceCreationExpression
ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName
ClassMemberDeclaration=ClassMemberDeclaration
@@ -180,6 +182,8 @@ InterfaceHeaderExtends=InterfaceHeaderExtends
InterfaceHeaderExtendsopt=InterfaceHeaderExtends
InterfaceHeaderName1=InterfaceHeaderName
InterfaceHeaderName=InterfaceHeaderName
+InterfaceHeaderPermittedSubClassesAndSubInterfaces=InterfaceHeaderPermittedSubClassesAndSubInterfaces
+InterfaceHeaderPermittedSubClassesAndSubInterfacesopt=InterfaceHeaderPermittedSubClassesAndSubInterfaces
InterfaceMemberDeclaration=InterfaceMemberDeclaration
InterfaceMemberDeclarations=InterfaceMemberDeclarations
InterfaceMemberDeclarationsopt=InterfaceMemberDeclarations
@@ -240,6 +244,7 @@ PackageDeclaration=PackageDeclaration
PackageDeclarationName=PackageDeclarationName
ParenthesizedCastNameAndBounds=ParenthesizedCastNameAndBounds
ParenthesizedLambdaParameterList=ParenthesizedLambdaParameterList
+PermittedSubclasses=PermittedSubclasses
PostDecrementExpression=PostDecrementExpression
PostIncrementExpression=PostIncrementExpression
PostfixExpression=Expression
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part0.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part0.rsc
new file mode 100644
index 0000000000..eadab920d7
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part0.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part1.rsc
new file mode 100644
index 0000000000..c1b58e0c42
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part1.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part14.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part14.rsc
new file mode 100644
index 0000000000..226e458f17
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part14.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part2.rsc
new file mode 100644
index 0000000000..0d12943819
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part2.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part3.rsc
new file mode 100644
index 0000000000..02f549dafe
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/part3.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start0.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start0.rsc
new file mode 100644
index 0000000000..18e3c68743
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start0.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start1.rsc
new file mode 100644
index 0000000000..df84cf903e
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start1.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start2.rsc
new file mode 100644
index 0000000000..0d12943819
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start2.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start3.rsc
new file mode 100644
index 0000000000..02f549dafe
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode13/start3.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index 2b5e77eabb..b0acb468cb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -169,6 +169,8 @@ import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.eclipse.jdt.internal.compiler.impl.IrritantSet;
+import org.eclipse.jdt.internal.compiler.impl.JavaFeature;
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.eclipse.jdt.internal.compiler.impl.StringConstant;
import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
@@ -189,6 +191,7 @@ import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBindin
import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
+import org.eclipse.jdt.internal.compiler.lookup.RecordComponentBinding;
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -224,6 +227,10 @@ public class ProblemReporter extends ProblemHandler {
private static String RESTRICTED_IDENTIFIER_RECORD = "RestrictedIdentifierrecord"; //$NON-NLS-1$
private static String RECORD = "record"; //$NON-NLS-1$
+ private static String RESTRICTED_IDENTIFIER_SEALED = "RestrictedIdentifiersealed"; //$NON-NLS-1$
+ private static String SEALED = "sealed"; //$NON-NLS-1$
+ private static String RESTRICTED_IDENTIFIER_PERMITS = "RestrictedIdentifierpermits"; //$NON-NLS-1$
+ private static String PERMITS = "permits"; //$NON-NLS-1$
public ProblemReporter(IErrorHandlingPolicy policy, CompilerOptions options, IProblemFactory problemFactory) {
super(policy, options, problemFactory);
@@ -603,6 +610,7 @@ public static int getIrritant(int problemID) {
case IProblem.JavadocHiddenReference:
case IProblem.JavadocMissingTagDescription:
case IProblem.JavadocInvalidSeeUrlReference:
+ case IProblem.JavadocInvalidModuleQualification:
return CompilerOptions.InvalidJavadoc;
case IProblem.JavadocMissingParamTag:
@@ -2102,20 +2110,12 @@ public void duplicateInitializationOfBlankFinalField(FieldBinding field, Referen
}
public void duplicateInitializationOfFinalLocal(LocalVariableBinding local, ASTNode location) {
String[] arguments = new String[] { new String(local.readableName())};
- if ((local.modifiers & ExtraCompilerModifiers.AccPatternVariable) == 0) {
- this.handle(
+ this.handle(
IProblem.DuplicateFinalLocalInitialization,
arguments,
arguments,
nodeSourceStart(local, location),
nodeSourceEnd(local, location));
- } else {
- this.handle(IProblem.PatternVariableNotInScope,
- arguments,
- arguments,
- nodeSourceStart(local, location),
- nodeSourceEnd(local, location));
- }
}
public void duplicateMethodInType(AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {
MethodBinding method = methodDecl.binding;
@@ -5078,6 +5078,16 @@ public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclar
private boolean isIdentifier(int token) {
return token == TerminalTokens.TokenNameIdentifier;
}
+private boolean isRestrictedIdentifier(int token) {
+ switch(token) {
+ case TerminalTokens.TokenNameRestrictedIdentifierYield:
+ case TerminalTokens.TokenNameRestrictedIdentifierrecord:
+ case TerminalTokens.TokenNameRestrictedIdentifiersealed:
+ case TerminalTokens.TokenNameRestrictedIdentifierpermits:
+ return true;
+ default: return false;
+ }
+}
private boolean isKeyword(int token) {
switch(token) {
case TerminalTokens.TokenNameabstract:
@@ -5108,6 +5118,7 @@ private boolean isKeyword(int token) {
case TerminalTokens.TokenNameinstanceof:
case TerminalTokens.TokenNamelong:
case TerminalTokens.TokenNamenew:
+ case TerminalTokens.TokenNamenon_sealed:
case TerminalTokens.TokenNamenull:
case TerminalTokens.TokenNamenative:
case TerminalTokens.TokenNamepublic:
@@ -5133,6 +5144,8 @@ private boolean isKeyword(int token) {
return true;
case TerminalTokens.TokenNameRestrictedIdentifierYield:
case TerminalTokens.TokenNameRestrictedIdentifierrecord:
+ case TerminalTokens.TokenNameRestrictedIdentifiersealed:
+ case TerminalTokens.TokenNameRestrictedIdentifierpermits:
// making explicit - not a (restricted) keyword but restricted identifier.
//$FALL-THROUGH$
default:
@@ -5525,6 +5538,11 @@ public void javadocInvalidMemberTypeQualification(int sourceStart, int sourceEnd
this.handle(IProblem.JavadocInvalidMemberTypeQualification, NoArgument, NoArgument, sourceStart, sourceEnd);
}
}
+public void javadocInvalidModuleQualification(int sourceStart, int sourceEnd, int modifiers){
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocInvalidModuleQualification, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+}
/*
* Similar implementation than invalidMethod(MessageSend...)
* Note that following problem id cannot occur for Javadoc:
@@ -8237,24 +8255,10 @@ private boolean handleSyntaxErrorOnNewTokens(
char[] errorTokenSource,
String errorTokenName,
String expectedToken) {
- boolean val = false;
if (isIdentifier(currentKind)) {
- String eTokenName = new String(errorTokenSource);
- String origExpectedToken = expectedToken;
- expectedToken = replaceIfSynthetic(expectedToken);
- if (isIdentifier(currentKind)) {
- if (RESTRICTED_IDENTIFIER_RECORD.equals(origExpectedToken) && RECORD.equals(eTokenName)) {
- if (this.options.sourceLevel < ClassFileConstants.JDK14) {
- previewFeatureNotSupported(start, end, RECORD, CompilerOptions.VERSION_14);
- val = true;
- } else if (!this.options.enablePreviewFeatures) {
- previewFeatureNotEnabled(start, end, RECORD);
- val = true;
- }
- }
- }
+ return validateRestrictedKeywords(errorTokenSource, start, end, true);
}
- return val;
+ return false;
}
private void handleSyntaxError(
int id,
@@ -8305,6 +8309,8 @@ private void syntaxError(
} else {
eTokenName = errorTokenName;
}
+ if (isRestrictedIdentifier(currentKind))
+ eTokenName = replaceIfSynthetic(eTokenName);
String[] arguments;
if(expectedToken != null) {
@@ -8335,6 +8341,10 @@ private String replaceIfSynthetic(String token) {
return "yield"; //$NON-NLS-1$
if (token.equals(RESTRICTED_IDENTIFIER_RECORD))
return RECORD;
+ if (token.equals(RESTRICTED_IDENTIFIER_SEALED))
+ return SEALED;
+ if (token.equals(RESTRICTED_IDENTIFIER_PERMITS))
+ return PERMITS;
return token;
}
public void task(String tag, String message, String priority, int start, int end){
@@ -8798,25 +8808,14 @@ public void uninitializedNonNullField(FieldBinding field, ASTNode location) {
nodeSourceEnd(field, location));
}
public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location, Scope scope) {
- if ((binding.modifiers & ExtraCompilerModifiers.AccPatternVariable) == 0) {
- binding.markAsUninitializedIn(scope);
- String[] arguments = new String[] {new String(binding.readableName())};
- this.handle(
- methodHasMissingSwitchDefault() ? IProblem.UninitializedLocalVariableHintMissingDefault : IProblem.UninitializedLocalVariable,
- arguments,
- arguments,
- nodeSourceStart(binding, location),
- nodeSourceEnd(binding, location));
- } else {
- String[] arguments = new String[] {new String(binding.readableName())};
- this.handle(
- IProblem.PatternVariableNotInScope,
- arguments,
- arguments,
- nodeSourceStart(binding, location),
- nodeSourceEnd(binding, location));
-
- }
+ binding.markAsUninitializedIn(scope);
+ String[] arguments = new String[] {new String(binding.readableName())};
+ this.handle(
+ methodHasMissingSwitchDefault() ? IProblem.UninitializedLocalVariableHintMissingDefault : IProblem.UninitializedLocalVariable,
+ arguments,
+ arguments,
+ nodeSourceStart(binding, location),
+ nodeSourceEnd(binding, location));
}
private boolean methodHasMissingSwitchDefault() {
MethodScope methodScope = null;
@@ -9524,15 +9523,8 @@ public void problemNotAnalysed(Expression token, String optionKey) {
token.sourceStart,
token.sourceEnd);
}
-public void previewFeatureNotEnabled(int sourceStart, int sourceEnd, String featureName) {
- String[] args = new String[] {featureName};
- this.handle(
- IProblem.PreviewFeatureDisabled,
- args,
- args,
- sourceStart,
- sourceEnd);
-}
+// Try not to use this. Ideally, this should only be invoked through
+// validateJavaFeatureSupport()
public void previewFeatureUsed(int sourceStart, int sourceEnd) {
this.handle(
IProblem.PreviewFeatureUsed,
@@ -9541,14 +9533,60 @@ public void previewFeatureUsed(int sourceStart, int sourceEnd) {
sourceStart,
sourceEnd);
}
-public void previewFeatureNotSupported(int sourceStart, int sourceEnd, String featureName, String sourceLevel) {
- String[] args = new String[] {featureName, sourceLevel};
- this.handle(
- IProblem.PreviewFeatureNotSupported,
- args,
- args,
- sourceStart,
- sourceEnd);
+//Returns true if the problem is handled and reported (only errors considered and not warnings)
+public boolean validateRestrictedKeywords(char[] name, int start, int end, boolean reportSyntaxError) {
+ boolean isPreviewEnabled = this.options.enablePreviewFeatures;
+ for (JavaFeature feature : JavaFeature.values()) {
+ char[][] restrictedKeywords = feature.getRestrictedKeywords();
+ for (char[] k : restrictedKeywords) {
+ if (CharOperation.equals(name, k)) {
+ if (reportSyntaxError) {
+ return validateJavaFeatureSupport(feature, start, end);
+ } else {
+ if (feature.isPreview()) {
+ int severity = isPreviewEnabled ? ProblemSeverities.Error | ProblemSeverities.Fatal : ProblemSeverities.Warning;
+ restrictedTypeName(name, CompilerOptions.versionFromJdkLevel(feature.getCompliance()), start, end, severity);
+ return isPreviewEnabled;
+ } else {
+ restrictedTypeName(name, CompilerOptions.versionFromJdkLevel(feature.getCompliance()), start, end, ProblemSeverities.Error | ProblemSeverities.Fatal);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+public boolean validateRestrictedKeywords(char[] name, ASTNode node) {
+ return validateRestrictedKeywords(name, node.sourceStart, node.sourceEnd, false);
+}
+//Returns true if the problem is handled and reported (only errors considered and not warnings)
+public boolean validateJavaFeatureSupport(JavaFeature feature, int sourceStart, int sourceEnd) {
+ boolean versionInRange = feature.getCompliance() <= this.options.sourceLevel;
+ String version = CompilerOptions.versionFromJdkLevel(feature.getCompliance());
+ int problemId = -1;
+ if (feature.isPreview()) {
+ if (!versionInRange) {
+ problemId = IProblem.PreviewFeatureNotSupported;
+ } else if (!this.options.enablePreviewFeatures) {
+ problemId = IProblem.PreviewFeatureDisabled;
+ } else if (this.options.isAnyEnabled(IrritantSet.PREVIEW)) {
+ problemId = IProblem.PreviewFeatureUsed;
+ }
+ } else if (!versionInRange) {
+ problemId = IProblem.FeatureNotSupported;
+ }
+ if (problemId > -1) {
+ String[] args = new String[] {feature.getName(), version};
+ this.handle(
+ problemId,
+ args,
+ args,
+ sourceStart,
+ sourceEnd);
+ return true;
+ }
+ return false;
}
public void useAssertAsAnIdentifier(int sourceStart, int sourceEnd) {
this.handle(
@@ -11549,11 +11587,11 @@ public void recordAccessorMethodHasThrowsClause(ASTNode methodDeclaration) {
methodDeclaration.sourceStart,
methodDeclaration.sourceEnd);
}
-public void recordCanonicalConstructorNotPublic(AbstractMethodDeclaration methodDecl) {
+public void recordCanonicalConstructorVisibilityReduced(AbstractMethodDeclaration methodDecl) {
if (!this.options.enablePreviewFeatures)
return;
this.handle(
- IProblem.RecordCanonicalConstructorShouldBePublic,
+ IProblem.RecordCanonicalConstructorVisibilityReduced,
new String[] {
new String(methodDecl.selector)
},
@@ -11617,15 +11655,14 @@ public void recordInstanceInitializerBlockInRecord(Initializer initializer) {
initializer.sourceStart,
initializer.sourceEnd);
}
-public void recordIsAReservedTypeName(ASTNode decl) {
- if (!this.options.enablePreviewFeatures)
- return;
+public void restrictedTypeName(char[] name, String compliance, int start, int end, int severity) {
this.handle(
- IProblem.RecordIsAReservedTypeName,
- NoArgument,
- NoArgument,
- decl.sourceStart,
- decl.sourceEnd);
+ IProblem.RestrictedTypeName,
+ new String[] { new String(name), compliance},
+ new String[] { new String(name), compliance},
+ severity,
+ start,
+ end);
}
public void recordIllegalAccessorReturnType(ASTNode returnType, TypeBinding type) {
if (!this.options.enablePreviewFeatures)
@@ -11667,16 +11704,6 @@ public void recordCanonicalConstructorShouldNotBeGeneric(AbstractMethodDeclarati
methodDecl.sourceStart,
methodDecl.sourceEnd);
}
-public void recordCanonicalConstructorShouldBePublic(MethodDeclaration methodDecl) {
- if (!this.options.enablePreviewFeatures)
- return;
- this.handle(
- IProblem.RecordCanonicalConstructorShouldBePublic,
- new String[] { new String(methodDecl.selector)},
- new String[] { new String(methodDecl.selector)},
- methodDecl.sourceStart,
- methodDecl.sourceEnd);
-}
public void recordCanonicalConstructorHasThrowsClause(AbstractMethodDeclaration methodDecl) {
if (!this.options.enablePreviewFeatures)
return;
@@ -11780,6 +11807,38 @@ public void recordStaticReferenceToOuterLocalVariable(LocalVariableBinding local
node.sourceStart,
node.sourceEnd);
}
+public void recordComponentsCannotHaveModifiers(RecordComponent comp) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String[] arguments = new String[] { new String(comp.name) };
+ this.handle(
+ IProblem.RecordComponentsCannotHaveModifiers,
+ arguments,
+ arguments,
+ comp.sourceStart,
+ comp.sourceEnd);
+}
+public void recordIllegalParameterNameInCanonicalConstructor(RecordComponentBinding comp, Argument arg) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ this.handle(
+ IProblem.RecordIllegalParameterNameInCanonicalConstructor,
+ new String[] {new String(arg.name), new String(comp.name)},
+ new String[] {new String(arg.name), new String(comp.name)},
+ arg.sourceStart,
+ arg.sourceEnd);
+}
+public void recordIllegalExplicitFinalFieldAssignInCompactConstructor(FieldBinding field, FieldReference fieldRef) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String[] arguments = new String[] { new String(field.name) };
+ this.handle(
+ IProblem.RecordIllegalExplicitFinalFieldAssignInCompactConstructor,
+ arguments,
+ arguments,
+ fieldRef.sourceStart,
+ fieldRef.sourceEnd);
+}
public void recordMissingExplicitConstructorCallInNonCanonicalConstructor(ASTNode location) {
this.handle(
IProblem.RecordMissingExplicitConstructorCallInNonCanonicalConstructor,
@@ -11788,4 +11847,220 @@ public void recordMissingExplicitConstructorCallInNonCanonicalConstructor(ASTNod
location.sourceStart,
location.sourceEnd);
}
+public void recordIllegalStaticModifierForLocalClassOrInterface(SourceTypeBinding type) {
+ String[] arguments = new String[] {new String(type.sourceName())};
+ this.handle(
+ IProblem.RecordIllegalStaticModifierForLocalClassOrInterface,
+ arguments,
+ arguments,
+ type.sourceStart(),
+ type.sourceEnd());
+}
+public void localStaticsIllegalVisibilityModifierForInterfaceLocalType(SourceTypeBinding type) {
+ String[] arguments = new String[] {new String(type.sourceName())};
+ this.handle(
+ IProblem.LocalStaticsIllegalVisibilityModifierForInterfaceLocalType,
+ arguments,
+ arguments,
+ type.sourceStart(),
+ type.sourceEnd());
+}
+private void sealedMissingModifier(int problem, SourceTypeBinding type, TypeDeclaration typeDecl, TypeBinding superTypeBinding) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ String superTypeFullName = new String(superTypeBinding.readableName());
+ String superTypeShortName = new String(superTypeBinding.shortReadableName());
+ if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
+ this.handle(
+ problem,
+ new String[] {superTypeFullName, name},
+ new String[] {superTypeShortName, name},
+ typeDecl.sourceStart,
+ typeDecl.sourceEnd);
+}
+
+public void sealedMissingClassModifier(SourceTypeBinding type, TypeDeclaration typeDecl, TypeBinding superTypeBinding) {
+ sealedMissingModifier(IProblem.SealedMissingClassModifier, type, typeDecl, superTypeBinding);
+}
+public void sealedMissingInterfaceModifier(SourceTypeBinding type, TypeDeclaration typeDecl, TypeBinding superTypeBinding) {
+ sealedMissingModifier(IProblem.SealedMissingInterfaceModifier, type, typeDecl, superTypeBinding);
+}
+public void sealedDisAllowedNonSealedModifierInClass(SourceTypeBinding type, TypeDeclaration typeDecl) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(
+ IProblem.SealedDisAllowedNonSealedModifierInClass,
+ new String[] { name },
+ new String[] { name },
+ typeDecl.sourceStart,
+ typeDecl.sourceEnd);
+}
+
+private void sealedSuperTypeDoesNotPermit(int problem, SourceTypeBinding type, TypeReference superType, TypeBinding superTypeBinding) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ String superTypeFullName = new String(superTypeBinding.readableName());
+ String superTypeShortName = new String(superTypeBinding.shortReadableName());
+ if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
+ this.handle(
+ problem,
+ new String[] {name, superTypeFullName},
+ new String[] {name, superTypeShortName},
+ superType.sourceStart,
+ superType.sourceEnd);
+}
+
+public void sealedSuperClassDoesNotPermit(SourceTypeBinding type, TypeReference superType, TypeBinding superTypeBinding) {
+ sealedSuperTypeDoesNotPermit(IProblem.SealedSuperClassDoesNotPermit, type, superType, superTypeBinding);
+}
+public void sealedSuperInterfaceDoesNotPermit(SourceTypeBinding type, TypeReference superType, TypeBinding superTypeBinding) {
+ sealedSuperTypeDoesNotPermit(IProblem.SealedSuperInterfaceDoesNotPermit, type, superType, superTypeBinding);
+}
+
+public void sealedMissingSealedModifier(SourceTypeBinding type, ASTNode node) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(IProblem.SealedMissingSealedModifier, new String[] { name }, new String[] { name }, node.sourceStart,
+ node.sourceEnd);
+}
+
+public void sealedDuplicateTypeInPermits(SourceTypeBinding type, TypeReference reference, ReferenceBinding superType) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ this.handle(
+ IProblem.SealedDuplicateTypeInPermits,
+ new String[] {
+ new String(superType.readableName()),
+ new String(type.sourceName())},
+ new String[] {
+ new String(superType.shortReadableName()),
+ new String(type.sourceName())},
+ reference.sourceStart,
+ reference.sourceEnd);
+}
+
+public void sealedNotDirectSuperClass(ReferenceBinding type, TypeReference reference, SourceTypeBinding superType) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ this.handle(
+ IProblem.SealedNotDirectSuperClass,
+ new String[] {
+ new String(type.sourceName()),
+ new String(superType.readableName())},
+ new String[] {
+ new String(type.sourceName()),
+ new String(superType.readableName())},
+ reference.sourceStart,
+ reference.sourceEnd);
+}
+public void sealedPermittedTypeOutsideOfModule(ReferenceBinding permType, SourceTypeBinding type, ASTNode node, ModuleBinding moduleBinding) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String permTypeName = new String(permType.sourceName);
+ String name = new String(type.sourceName());
+ String moduleName = new String(moduleBinding.name());
+ String[] arguments = new String[] {permTypeName, moduleName, name};
+ this.handle(IProblem.SealedPermittedTypeOutsideOfModule,
+ arguments,
+ arguments,
+ node.sourceStart,
+ node.sourceEnd);
+}
+public void sealedPermittedTypeOutsideOfModule(SourceTypeBinding type, ASTNode node) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(IProblem.SealedPermittedTypeOutsideOfModule, new String[] { name }, new String[] { name },
+ node.sourceStart, node.sourceEnd);
+}
+
+public void sealedPermittedTypeOutsideOfPackage(ReferenceBinding permType, SourceTypeBinding type, ASTNode node, PackageBinding packageBinding) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String permTypeName = new String(permType.sourceName);
+ String name = new String(type.sourceName());
+ String packageName = packageBinding.compoundName == CharOperation.NO_CHAR_CHAR ? "default" : //$NON-NLS-1$
+ CharOperation.toString(packageBinding.compoundName);
+ String[] arguments = new String[] {permTypeName, packageName, name};
+ this.handle(IProblem.SealedPermittedTypeOutsideOfPackage,
+ arguments,
+ arguments,
+ node.sourceStart,
+ node.sourceEnd);
+}
+
+public void sealedSealedTypeMissingPermits(SourceTypeBinding type, ASTNode node) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(IProblem.SealedSealedTypeMissingPermits, new String[] { name }, new String[] { name }, node.sourceStart,
+ node.sourceEnd);
+}
+
+public void sealedInterfaceIsSealedAndNonSealed(SourceTypeBinding type, ASTNode node) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(IProblem.SealedInterfaceIsSealedAndNonSealed,
+ new String[] { name },
+ new String[] { name },
+ node.sourceStart,
+ node.sourceEnd);
+}
+
+public void sealedDisAllowedNonSealedModifierInInterface(SourceTypeBinding type, TypeDeclaration typeDecl) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ this.handle(
+ IProblem.SealedDisAllowedNonSealedModifierInInterface,
+ new String[] { name },
+ new String[] { name },
+ typeDecl.sourceStart,
+ typeDecl.sourceEnd);
+}
+
+public void sealedNotDirectSuperInterface(ReferenceBinding type, TypeReference reference, SourceTypeBinding superType) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ this.handle(
+ IProblem.SealedNotDirectSuperInterface,
+ new String[] {
+ new String(type.sourceName()),
+ new String(superType.readableName())},
+ new String[] {
+ new String(type.sourceName()),
+ new String(superType.readableName())},
+ reference.sourceStart,
+ reference.sourceEnd);
+}
+
+public void sealedLocalDirectSuperTypeSealed(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ String name = new String(type.sourceName());
+ String superTypeFullName = new String(superTypeBinding.readableName());
+ String superTypeShortName = new String(superTypeBinding.shortReadableName());
+ if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
+ this.handle(
+ IProblem.SealedLocalDirectSuperTypeSealed,
+ new String[] {superTypeFullName, name},
+ new String[] {superTypeShortName, name},
+ superclass.sourceStart,
+ superclass.sourceEnd);
+}
+public void sealedAnonymousClassCannotExtendSealedType(TypeReference reference, TypeBinding type) {
+ if (!this.options.enablePreviewFeatures)
+ return;
+ this.handle(
+ IProblem.SealedAnonymousClassCannotExtendSealedType,
+ new String[] {new String(type.readableName())},
+ new String[] {new String(type.shortReadableName())},
+ reference.sourceStart,
+ reference.sourceEnd);
+}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 627705e586..d920b6de59 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -891,7 +891,7 @@
1104 = You are using a preview language feature that may or may not be supported in a future release
1105 = The preview feature {0} is only available with source level {1} and above
1106 = Preview features enabled at an invalid source release level {0}, preview can be enabled only at source level {1}
-
+1107 = The Java feature ''{0}'' is only available with source level {1} and above
# more programming problems:
1200 = Unlikely argument type {0} for {1} on a {2}
1201 = Unlikely argument type for equals(): {0} seems to be unrelated to {2}
@@ -1022,7 +1022,7 @@
1722 = Breaking out of switch expressions not permitted
1723 = Continue out of switch expressions not permitted
1724 = Return within switch expressions not permitted
-# Java 14 Preview - begin
+# Java 15 Preview - begin
# Records
1730 = Illegal modifier for the record {0}; only public, private, protected, static, final and strictfp are permitted
1731 = Illegal modifier for the record {0}; only public, final and strictfp are permitted
@@ -1030,13 +1030,13 @@
1733 = User declared non-static fields {0} are not permitted in a record
1734 = Throws clause not allowed for explicitly declared accessor method
1735 = Throws clause not allowed for canonical constructor {0}
-1736 = The canonical constructor {0} of a record declaration must be declared public.
+1736 = Cannot reduce the visibility of a canonical constructor {0} from that of the record
1737 = Multiple canonical constructors {0} are not allowed
1738 = The body of a compact constructor must not contain a return statement
1739 = Duplicate component {0} in record
1740 = Illegal modifier native for method {0}; native methods are not allowed in record
1741 = Instance Initializer is not allowed in a record declaration
-1742 = Record is a restricted identifier and hence not a valid type name
+1742 = ''{0}'' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java {1}
1743 = Illegal return type of accessor; should be the same as the declared type {0} of the record component
1744 = The accessor method must not be generic
1745 = The accessor method must be declared public
@@ -1049,13 +1049,19 @@
1752 = The type {1} may not subclass {0} explicitly
1753 = void is an invalid type for the component {0} of a record
1754 = The variable argument type {0} of the record {1} must be the last parameter
-1755 = Cannot make a static reference to the non-static variable {0} from a local record
+1755 = Cannot make a static reference to the non-static variable {0}
1756 = A record declaration {0} is not allowed in a local inner class
-1757 = A non-canonical constructor must start with an explicit invocation to a constructor
+1757 = A record component {0} cannot have modifiers
+1758 = Illegal parameter name {0} in canonical constructor, expected {1}, the corresponding component name
+1759 = Illegal explicit assignment of a final field {0} in compact constructor
+1760 = A non-canonical constructor must start with an explicit invocation to a constructor
+1761 = A local interface, enum or record {0} is implicitly static; cannot have explicit static declaration
-1760 = The pattern variable {0} is not in scope in this location
+1765 = Illegal modifier for the local interface {0}; abstract and strictfp are the only modifiers allowed explicitly
+
+1780 = The pattern variable {0} is not in scope in this location
-# Java 14 Preview - end
+# Java 15 Preview - cont.
# Additional doc
1800 = Missing uses tag
@@ -1068,6 +1074,26 @@
1807 = Missing provides class name
1808 = Invalid provides class name
1809 = Invalid provides class
+1810 = Invalid module qualification
+
+
+# Java 15 Preview - cont
+1850 = The class {1} with a sealed direct superclass or a sealed direct superinterface {0} should be declared either final, sealed, or non-sealed
+1851 = A class {0} declared as non-sealed should have either a sealed direct superclass or a sealed direct superinterface
+1852 = The type {0} extending a sealed class {1} should be a permitted subtype of {1}
+1853 = The type {0} extending a sealed interface {1} should be a permitted subtype of {1}
+1854 = A type declaration {0} that has a permits clause should have a sealed modifier
+1855 = The interface {1} with a sealed direct superinterface {0} should be declared either sealed or non-sealed
+1856 = Duplicate type {0} for the type {1} in the permits clause
+1857 = Permitted class {0} does not declare {1} as direct super class
+1858 = Permitted type {0} in a named module {1} should be declared in the same module {1} of declaring type {2}
+1859 = Permitted type {0} in an unnamed module should be declared in the same package {1} of declaring type {2}
+1860 = Sealed class lacks the permits clause and no top level or nested class from the same compilation unit declares {0} as its direct superclass
+1861 = An interface {0} is declared both sealed and non-sealed
+1862 = An interface {0} declared as non-sealed should have a sealed direct superinterface
+1863 = Permitted type {0} does not declare {1} as direct super interface
+1864 = A local class {1} cannot have a sealed direct superclass or a sealed direct superinterface {0}
+1865 = An anonymous class cannot subclass a sealed type {0}
### ELABORATIONS
## Access restrictions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Messages.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Messages.java
index 0f4885d7f2..b25fd95cd1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Messages.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/Messages.java
@@ -116,7 +116,11 @@ public final class Messages {
public static String ast_missingCode;
public static String constant_cannotCastedInto;
public static String constant_cannotConvertedTo;
- public static String abort_againstPreviewNotAllowed;
+
+ public static String text_block;
+ public static String pattern_matching_instanceof;
+ public static String records;
+ public static String sealed_types;
static {
initializeMessages(BUNDLE_NAME, Messages.class);

Back to the top