Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 217786 Details for
Bug 287648
[1.8][compiler] Add support for JSR 308 - Type Annotations Specification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
First batch of files for review & release
patch.txt (text/plain), 413.98 KB, created by
Srikanth Sankaran
on 2012-06-24 09:47:27 EDT
(
hide
)
Description:
First batch of files for review & release
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2012-06-24 09:47:27 EDT
Size:
413.98 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >index f0690ba..a4cd63f 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >@@ -4,6 +4,10 @@ > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -12682,7 +12686,7 @@ > new String[] { > "X1.java", > "public class X1 {\n" + >- " Zork;\n" + >+ " Zork z;\n" + > "}\n", > "org/eclipse/jdt/annotation/NonNull.java", > NONNULL_ANNOTATION_CONTENT, >@@ -12703,9 +12707,9 @@ > "A default nullness annotation has not been specified for the type X1\n" + > "----------\n" + > "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X1.java (at line 2)\n" + >- " Zork;\n" + >+ " Zork z;\n" + > " ^^^^\n" + >- "Syntax error on token \"Zork\", VariableDeclarator expected after this token\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n" + > "2 problems (1 error, 1 warning)", > true); >diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >index 1366784..eedbace 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java >@@ -453,6 +453,7 @@ > expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", DEPRECATED); > expectedProblemAttributes.put("ExceptionTypeNotFound", DEPRECATED); > expectedProblemAttributes.put("ExceptionTypeNotVisible", DEPRECATED); >+ expectedProblemAttributes.put("ExplicitThisParameterNotBelow18", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); > expectedProblemAttributes.put("ExpressionShouldBeAVariable", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); >@@ -484,6 +485,7 @@ > expectedProblemAttributes.put("IllegalAnnotationForBaseType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); > expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); > expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); >+ expectedProblemAttributes.put("IllegalDeclarationOfThisParameter", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); > expectedProblemAttributes.put("IllegalDimension", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); >@@ -526,6 +528,7 @@ > expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("IllegalUnderscorePosition", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); >+ expectedProblemAttributes.put("IllegalUsageOfTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("IllegalVararg", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); >@@ -587,6 +590,7 @@ > expectedProblemAttributes.put("InvalidHighSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidInput", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidLowSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); >+ expectedProblemAttributes.put("InvalidLocationForModifiers", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidNullToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); > expectedProblemAttributes.put("InvalidOctal", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidOperator", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); >@@ -605,7 +609,9 @@ > expectedProblemAttributes.put("InvalidUsageOfAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfForeachStatements", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); >+ expectedProblemAttributes.put("InvalidUsageOfReceiverAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfStaticImports", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); >+ expectedProblemAttributes.put("InvalidUsageOfTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfTypeArguments", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); >@@ -701,6 +707,7 @@ > expectedProblemAttributes.put("MethodRequiresBody", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("MethodReturnsVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); >+ expectedProblemAttributes.put("MisplacedTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); > expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); > expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); > expectedProblemAttributes.put("MissingEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); >@@ -1159,6 +1166,7 @@ > expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", SKIP); > expectedProblemAttributes.put("ExceptionTypeNotFound", SKIP); > expectedProblemAttributes.put("ExceptionTypeNotVisible", SKIP); >+ expectedProblemAttributes.put("ExplicitThisParameterNotBelow18", SKIP); > expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(JavaCore.COMPILER_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE)); > expectedProblemAttributes.put("ExpressionShouldBeAVariable", SKIP); > expectedProblemAttributes.put("ExternalProblemFixable", SKIP); >@@ -1190,6 +1198,7 @@ > expectedProblemAttributes.put("IllegalAnnotationForBaseType", SKIP); > expectedProblemAttributes.put("IllegalCast", SKIP); > expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", SKIP); >+ expectedProblemAttributes.put("IllegalDeclarationOfThisParameter", SKIP); > expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(JavaCore.COMPILER_PB_NULL_SPECIFICATION_VIOLATION)); > expectedProblemAttributes.put("IllegalDimension", SKIP); > expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP); >@@ -1232,6 +1241,7 @@ > expectedProblemAttributes.put("IllegalTypeVariableSuperReference", SKIP); > expectedProblemAttributes.put("IllegalUnderscorePosition", SKIP); > expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", SKIP); >+ expectedProblemAttributes.put("IllegalUsageOfTypeAnnotations", SKIP); > expectedProblemAttributes.put("IllegalVararg", SKIP); > expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", SKIP); > expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", SKIP); >@@ -1293,6 +1303,7 @@ > expectedProblemAttributes.put("InvalidHighSurrogate", SKIP); > expectedProblemAttributes.put("InvalidInput", SKIP); > expectedProblemAttributes.put("InvalidLowSurrogate", SKIP); >+ expectedProblemAttributes.put("InvalidLocationForModifiers", SKIP); > expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP); > expectedProblemAttributes.put("InvalidOctal", SKIP); > expectedProblemAttributes.put("InvalidOperator", SKIP); >@@ -1311,7 +1322,9 @@ > expectedProblemAttributes.put("InvalidUsageOfAnnotations", SKIP); > expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", SKIP); > expectedProblemAttributes.put("InvalidUsageOfForeachStatements", SKIP); >+ expectedProblemAttributes.put("InvalidUsageOfReceiverAnnotations", SKIP); > expectedProblemAttributes.put("InvalidUsageOfStaticImports", SKIP); >+ expectedProblemAttributes.put("InvalidUsageOfTypeAnnotations", SKIP); > expectedProblemAttributes.put("InvalidUsageOfTypeArguments", SKIP); > expectedProblemAttributes.put("InvalidUsageOfTypeParameters", SKIP); > expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", SKIP); >@@ -1407,6 +1420,7 @@ > expectedProblemAttributes.put("MethodRequiresBody", SKIP); > expectedProblemAttributes.put("MethodReturnsVoid", SKIP); > expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST)); >+ expectedProblemAttributes.put("MisplacedTypeAnnotations", SKIP); > expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", SKIP); > expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(JavaCore.COMPILER_PB_SWITCH_MISSING_DEFAULT_CASE)); > expectedProblemAttributes.put("MissingEnclosingInstance", SKIP); >diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java >index f584192..6861b53 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -55,6 +59,12 @@ > public TypeReference copyDims(int dim){ > return this; > } >+/* >+ * No expansion of the completion reference into an array one >+ */ >+public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){ >+ return this; >+} > protected TypeBinding getTypeBinding(Scope scope) { > // it can be a package, type or member type > Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope >diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java >index ad76643..c85bb08 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -55,6 +59,12 @@ > public TypeReference copyDims(int dim){ > return this; > } >+/* >+ * No expansion of the completion reference into an array one >+ */ >+public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){ >+ return this; >+} > protected TypeBinding getTypeBinding(Scope scope) { > if (this.fieldTypeCompletionNode != null) { > throw new CompletionNodeFound(this.fieldTypeCompletionNode, scope); >diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >index 3b6f9e1..476971b 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -1156,9 +1160,12 @@ > if(info == LESS && node instanceof TypeReference) { > if(this.identifierLengthPtr > -1 && this.identifierLengthStack[this.identifierLengthPtr]!= 0) { > if (consumeTypeArguments) consumeTypeArguments(); >- TypeReference ref = this.getTypeReference(0); >+ TypeReference ref; > if(prevKind == K_PARAMETERIZED_CAST) { >+ ref = this.getUnannotatedTypeReference(0); // by design type is not annotated. > ref = computeQualifiedGenericsFromRightSide(ref, 0); >+ } else { >+ ref = this.getTypeReference(0); > } > if(this.currentElement instanceof RecoveredType) { > this.currentElement = this.currentElement.add(new CompletionOnFieldType(ref, false), 0); >@@ -1360,7 +1367,8 @@ > if ((length = this.identifierLengthStack[this.identifierLengthPtr-1]) < 0) { > // build the primitive type node > int dim = isAfterArrayType() ? this.intStack[this.intPtr--] : 0; >- SingleTypeReference typeRef = (SingleTypeReference)TypeReference.baseTypeReference(-length, dim); >+ Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim); >+ SingleTypeReference typeRef = (SingleTypeReference)TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions); > typeRef.sourceStart = this.intStack[this.intPtr--]; > if (dim == 0) { > typeRef.sourceEnd = this.intStack[this.intPtr--]; >@@ -2589,6 +2597,10 @@ > } > } > protected void consumeFormalParameter(boolean isVarArgs) { >+ >+ this.invocationType = NO_RECEIVER; >+ this.qualifier = -1; >+ > if (this.indexOfAssistIdentifier() < 0) { > super.consumeFormalParameter(isVarArgs); > if (this.pendingAnnotation != null) { >@@ -2606,10 +2618,31 @@ > endOfEllipsis = this.intStack[this.intPtr--]; > } > int firstDimensions = this.intStack[this.intPtr--]; >- final int typeDimensions = firstDimensions + extendedDimensions; >- TypeReference type = getTypeReference(typeDimensions); >+ TypeReference type = getUnannotatedTypeReference(extendedDimensions); >+ Annotation [] varArgsAnnotations = null; >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ varArgsAnnotations = new Annotation[length], >+ 0, >+ length); >+ } >+ final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0); >+ if (typeDimensions != extendedDimensions) { >+ // jsr308 type annotations management >+ Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions); >+ Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null); >+ } >+ type = copyDims(type, typeDimensions, annotationsOnAllDimensions); >+ type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition; >+ } > if (isVarArgs) { >- type = copyDims(type, typeDimensions + 1); > if (extendedDimensions == 0) { > type.sourceEnd = endOfEllipsis; > } >@@ -2623,7 +2656,6 @@ > type, > this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers > // consume annotations >- int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { > System.arraycopy( > this.expressionStack, >@@ -2725,6 +2757,24 @@ > } > pushOnElementStack(K_CAST_STATEMENT); > } >+protected void consumeInsideCastExpressionWithAnnotatedQualifiedGenerics() { >+ popElement(K_PARAMETERIZED_CAST); >+ >+ Expression castType; >+ int end = this.intStack[this.intPtr--]; >+ >+ int dim = this.intStack[this.intPtr--]; >+ // TODO is it an annotated type reference? >+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated. >+ >+ castType = computeQualifiedGenericsFromRightSide(rightSide, dim); >+ this.intPtr--; >+ castType.sourceEnd = end - 1; >+ castType.sourceStart = this.intStack[this.intPtr--] + 1; >+ pushOnExpressionStack(castType); >+ >+ pushOnElementStack(K_CAST_STATEMENT); >+} > protected void consumeInsideCastExpressionWithQualifiedGenerics() { > popElement(K_PARAMETERIZED_CAST); > >@@ -2732,7 +2782,7 @@ > int end = this.intStack[this.intPtr--]; > > int dim = this.intStack[this.intPtr--]; >- TypeReference rightSide = getTypeReference(0); >+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated. > > castType = computeQualifiedGenericsFromRightSide(rightSide, dim); > this.intPtr--; >@@ -4384,6 +4434,16 @@ > } > return result; > } >+protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation[][] annotationsOnDimensions) { >+ if (this.assistNode == typeRef) { >+ return typeRef; >+ } >+ TypeReference result = super.copyDims(typeRef, dim, annotationsOnDimensions); >+ if (this.assistNodeParent == typeRef) { >+ this.assistNodeParent = result; >+ } >+ return result; >+} > public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int cursorLoc) { > > this.cursorLocation = cursorLoc; >diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >index 10f68d5..7c52455 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -897,13 +901,13 @@ > /* > * Build specific type reference nodes in case the cursor is located inside the type reference > */ >-protected TypeReference getTypeReference(int dim) { >+protected TypeReference getUnannotatedTypeReference(int dim) { > > int index; > > /* no need to take action if not inside completed identifiers */ > if ((index = indexOfAssistIdentifier(true)) < 0) { >- return super.getTypeReference(dim); >+ return super.getUnannotatedTypeReference(dim); > } > int length = this.identifierLengthStack[this.identifierLengthPtr]; > TypeReference reference; >@@ -1627,6 +1631,9 @@ > this.astLengthPtr = -1; > this.expressionPtr = -1; > this.expressionLengthPtr = -1; >+ this.unattachedAnnotationPtr = -1; >+ this.typeAnnotationLengthPtr = -1; >+ this.typeAnnotationPtr = -1; > this.identifierPtr = -1; > this.identifierLengthPtr = -1; > this.intPtr = -1; >diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java >index 0be1b54..dcc13fc 100644 >--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java >+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -606,10 +610,31 @@ > endOfEllipsis = this.intStack[this.intPtr--]; > } > int firstDimensions = this.intStack[this.intPtr--]; >- final int typeDimensions = firstDimensions + extendedDimensions; >- TypeReference type = getTypeReference(typeDimensions); >+ TypeReference type = getUnannotatedTypeReference(extendedDimensions); >+ Annotation [] varArgsAnnotations = null; >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ varArgsAnnotations = new Annotation[length], >+ 0, >+ length); >+ } >+ final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0); >+ if (typeDimensions != extendedDimensions) { >+ // jsr308 type annotations management >+ Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions); >+ Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null); >+ } >+ type = copyDims(type, typeDimensions, annotationsOnAllDimensions); >+ type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition; >+ } > if (isVarArgs) { >- type = copyDims(type, typeDimensions + 1); > if (extendedDimensions == 0) { > type.sourceEnd = endOfEllipsis; > } >@@ -626,7 +651,6 @@ > arg.declarationSourceStart = modifierPositions; > > // consume annotations >- int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { > System.arraycopy( > this.expressionStack, >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 9f3125f..8ec038b 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 >@@ -1291,6 +1291,20 @@ > int UnusedWarningToken = Internal + 635; > /** @since 3.6 */ > int MissingOverrideAnnotationForInterfaceMethodImplementation = MethodRelated + 636; >+ /** @since 3.9 */ >+ int InvalidUsageOfTypeAnnotations = Syntax + Internal + 637; >+ /** @since 3.9 */ >+ int InvalidUsageOfReceiverAnnotations = Syntax + Internal + 638; >+ /** @since 3.9 */ >+ int MisplacedTypeAnnotations = Syntax + Internal + 639; >+ /** @since 3.9 */ >+ int InvalidLocationForModifiers = Syntax + Internal + 640; >+ /** @since 3.9*/ >+ int IllegalUsageOfTypeAnnotations = Internal + Syntax + 641; >+ /** @since 3.9*/ >+ int IllegalDeclarationOfThisParameter = Internal + Syntax + 642; >+ /** @since 3.9*/ >+ int ExplicitThisParameterNotBelow18 = Internal + Syntax + 643; > > /** > * More problems in generics >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 04c9835..1ce8427 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,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -49,6 +53,9 @@ > // do nothing by default > } > public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) { >+ // do nothing by default >+ } >+ public void endVisit(ArrayInitializer arrayInitializer, ClassScope scope) { > // do nothing by default > } > public void endVisit( >@@ -271,10 +278,24 @@ > // do nothing by default > } > /** >+ * @param annotation >+ * @param scope >+ */ >+ public void endVisit(MarkerAnnotation annotation, ClassScope scope) { >+ // do nothing by default >+ } >+ /** > * @param pair > * @param scope > */ > public void endVisit(MemberValuePair pair, BlockScope scope) { >+ // do nothing by default >+ } >+ /** >+ * @param pair >+ * @param scope >+ */ >+ public void endVisit(MemberValuePair pair, ClassScope scope) { > // do nothing by default > } > public void endVisit(MessageSend messageSend, BlockScope scope) { >@@ -292,6 +313,9 @@ > * @since 3.1 > */ > public void endVisit(NormalAnnotation annotation, BlockScope scope) { >+ // do nothing by default >+ } >+ public void endVisit(NormalAnnotation annotation, ClassScope scope) { > // do nothing by default > } > public void endVisit(NullLiteral nullLiteral, BlockScope scope) { >@@ -372,6 +396,13 @@ > * @since 3.1 > */ > public void endVisit(SingleMemberAnnotation annotation, BlockScope scope) { >+ // do nothing by default >+ } >+ /** >+ * @param annotation >+ * @param scope >+ */ >+ public void endVisit(SingleMemberAnnotation annotation, ClassScope scope) { > // do nothing by default > } > public void endVisit( >@@ -491,6 +522,9 @@ > return true; // do nothing by default, keep traversing > } > public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) { >+ return true; // do nothing by default, keep traversing >+ } >+ public boolean visit(ArrayInitializer arrayInitializer, ClassScope scope) { > return true; // do nothing by default, keep traversing > } > public boolean visit( >@@ -713,11 +747,25 @@ > return true; > } > /** >+ * @param annotation >+ * @param scope >+ */ >+ public boolean visit(MarkerAnnotation annotation, ClassScope scope) { >+ return true; >+ } >+ /** > * @param pair > * @param scope > * @since 3.1 > */ > public boolean visit(MemberValuePair pair, BlockScope scope) { >+ return true; >+ } >+ /** >+ * @param pair >+ * @param scope >+ */ >+ public boolean visit(MemberValuePair pair, ClassScope scope) { > return true; > } > public boolean visit(MessageSend messageSend, BlockScope scope) { >@@ -737,6 +785,13 @@ > * @since 3.1 > */ > public boolean visit(NormalAnnotation annotation, BlockScope scope) { >+ return true; >+ } >+ /** >+ * @param annotation >+ * @param scope >+ */ >+ public boolean visit(NormalAnnotation annotation, ClassScope scope) { > return true; > } > public boolean visit(NullLiteral nullLiteral, BlockScope scope) { >@@ -819,6 +874,13 @@ > public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) { > return true; > } >+ /** >+ * @param annotation >+ * @param scope >+ */ >+ public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) { >+ return true; >+ } > public boolean visit( > SingleNameReference singleNameReference, > BlockScope scope) { >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 fdc9823..071ccdd 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 >@@ -253,6 +253,9 @@ > public static final int INVOCATION_ARGUMENT_UNCHECKED = 1; > public static final int INVOCATION_ARGUMENT_WILDCARD = 2; > >+ // for all declarations that can contain type references that have type annotations >+ public static final int HasTypeAnnotations = Bit21; >+ > // for type reference (diamond case) - Java 7 > public static final int IsUnionType = Bit30; > // Used to tag ParameterizedSingleTypeReference or ParameterizedQualifiedTypeReference when they are >@@ -528,8 +531,15 @@ > public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) { > int length = annotations.length; > for (int i = 0; i < length; i++) { >- annotations[i].print(0, output); >- output.append(" "); //$NON-NLS-1$ >+ if (i > 0) { >+ output.append(" "); //$NON-NLS-1$ >+ } >+ Annotation annotation2 = annotations[i]; >+ if (annotation2 != null) { >+ annotation2.print(0, output); >+ } else { >+ output.append('?'); >+ } > } > return output; > } >@@ -614,6 +624,25 @@ > if (length > 0) { > annotations = new AnnotationBinding[length]; > local.setAnnotations(annotations, scope); >+ } >+ break; >+ case Binding.TYPE_PARAMETER : >+ // jsr308 >+ ReferenceBinding typeVariableBinding = (ReferenceBinding) recipient; >+ if ((typeVariableBinding.tagBits & TagBits.AnnotationResolved) != 0) return; >+ typeVariableBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ typeVariableBinding.setAnnotations(annotations); >+ } >+ break; >+ case Binding.TYPE_USE : >+ ReferenceBinding typeUseBinding = (ReferenceBinding) recipient; >+ if ((typeUseBinding.tagBits & TagBits.AnnotationResolved) != 0) return; >+ typeUseBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ typeUseBinding.setAnnotations(annotations); > } > break; > default : >@@ -712,6 +741,122 @@ > } > } > >+ /** >+ * Resolve annotations, and check duplicates, answers combined tagBits >+ * for recognized standard annotations >+ */ >+ public static void resolveAnnotations(ClassScope scope, Annotation[] sourceAnnotations, Binding recipient) { >+ AnnotationBinding[] annotations = null; >+ int length = sourceAnnotations == null ? 0 : sourceAnnotations.length; >+ if (recipient != null) { >+ switch (recipient.kind()) { >+ case Binding.PACKAGE : >+ PackageBinding packageBinding = (PackageBinding) recipient; >+ if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return; >+ packageBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ break; >+ case Binding.TYPE : >+ case Binding.GENERIC_TYPE : >+ ReferenceBinding type = (ReferenceBinding) recipient; >+ if ((type.tagBits & TagBits.AnnotationResolved) != 0) return; >+ type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ type.setAnnotations(annotations); >+ } >+ break; >+ case Binding.METHOD : >+ MethodBinding method = (MethodBinding) recipient; >+ if ((method.tagBits & TagBits.AnnotationResolved) != 0) return; >+ method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ method.setAnnotations(annotations); >+ } >+ break; >+ case Binding.FIELD : >+ FieldBinding field = (FieldBinding) recipient; >+ if ((field.tagBits & TagBits.AnnotationResolved) != 0) return; >+ field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ field.setAnnotations(annotations); >+ } >+ break; >+ case Binding.LOCAL : >+ LocalVariableBinding local = (LocalVariableBinding) recipient; >+ if ((local.tagBits & TagBits.AnnotationResolved) != 0) return; >+ local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); >+ if (length > 0) { >+ annotations = new AnnotationBinding[length]; >+ local.setAnnotations(annotations, scope); >+ } >+ break; >+ default : >+ return; >+ } >+ } >+ if (sourceAnnotations == null) >+ return; >+ for (int i = 0; i < length; i++) { >+ Annotation annotation = sourceAnnotations[i]; >+ final Binding annotationRecipient = annotation.recipient; >+ if (annotationRecipient != null && recipient != null) { >+ // only local and field can share annnotations >+ switch (recipient.kind()) { >+ case Binding.FIELD : >+ FieldBinding field = (FieldBinding) recipient; >+ field.tagBits = ((FieldBinding) annotationRecipient).tagBits; >+ break; >+ case Binding.LOCAL : >+ LocalVariableBinding local = (LocalVariableBinding) recipient; >+ local.tagBits = ((LocalVariableBinding) annotationRecipient).tagBits; >+ break; >+ } >+ if (annotations != null) { >+ // need to fill the instances array >+ annotations[0] = annotation.getCompilerAnnotation(); >+ for (int j = 1; j < length; j++) { >+ Annotation annot = sourceAnnotations[j]; >+ annotations[j] = annot.getCompilerAnnotation(); >+ } >+ } >+ return; >+ } else { >+ annotation.recipient = recipient; >+ annotation.resolveType(scope); >+ // null if receiver is a package binding >+ if (annotations != null) { >+ annotations[i] = annotation.getCompilerAnnotation(); >+ } >+ } >+ } >+ // check duplicate annotations >+ if (annotations != null) { >+ AnnotationBinding[] distinctAnnotations = annotations; // only copy after 1st duplicate is detected >+ for (int i = 0; i < length; i++) { >+ AnnotationBinding annotation = distinctAnnotations[i]; >+ if (annotation == null) continue; >+ TypeBinding annotationType = annotation.getAnnotationType(); >+ boolean foundDuplicate = false; >+ for (int j = i+1; j < length; j++) { >+ AnnotationBinding otherAnnotation = distinctAnnotations[j]; >+ if (otherAnnotation == null) continue; >+ if (otherAnnotation.getAnnotationType() == annotationType) { >+ foundDuplicate = true; >+ if (distinctAnnotations == annotations) { >+ System.arraycopy(distinctAnnotations, 0, distinctAnnotations = new AnnotationBinding[length], 0, length); >+ } >+ distinctAnnotations[j] = null; // report it only once >+ scope.problemReporter().duplicateAnnotation(sourceAnnotations[j]); >+ } >+ } >+ if (foundDuplicate) { >+ scope.problemReporter().duplicateAnnotation(sourceAnnotations[i]); >+ } >+ } >+ } >+ } > /** > * Figures if @Deprecated annotation is specified, do not resolve entire annotations. > */ >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 d4f065e..28c782f 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contributions for >@@ -14,6 +18,8 @@ > * bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; >+ >+import java.util.List; > > import org.eclipse.jdt.core.compiler.*; > import org.eclipse.jdt.internal.compiler.*; >@@ -39,6 +45,8 @@ > public int modifiers; > public int modifiersSourceStart; > public Annotation[] annotations; >+ // jsr 308 >+ public Annotation[] receiverAnnotations; > public Argument[] arguments; > public TypeReference[] thrownExceptions; > public Statement[] statements; >@@ -301,6 +309,10 @@ > classFile.completeMethodInfo(this.binding, methodAttributeOffset, attributeNumber); > } > >+ public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) { >+ // do nothing >+ } >+ > private void checkArgumentsSize() { > TypeBinding[] parameters = this.binding.parameters; > int size = 1; // an abstract method or a native method cannot be static >@@ -396,7 +408,10 @@ > } > printIndent(tab, output); > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > > TypeParameter[] typeParams = typeParameters(); > if (typeParams != null) { >@@ -418,6 +433,10 @@ > } > } > output.append(')'); >+ if (this.receiverAnnotations != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.receiverAnnotations, output); >+ } > if (this.thrownExceptions != null) { > output.append(" throws "); //$NON-NLS-1$ > for (int i = 0; i < this.thrownExceptions.length; i++) { >@@ -462,6 +481,14 @@ > bindThrownExceptions(); > resolveJavadoc(); > resolveAnnotations(this.scope, this.annotations, this.binding); >+ // jsr308 >+ if (this.receiverAnnotations != null && this.scope.isStatic) { >+ int last = this.receiverAnnotations.length - 1; >+ this.scope.problemReporter().illegalReceiverAnnotations(this.receiverAnnotations[0], >+ this.receiverAnnotations[last]); >+ } >+ // jsr 308 >+ resolveAnnotations(this.scope, this.receiverAnnotations, new Annotation.TypeUseBinding(Binding.TYPE_USE)); > validateNullAnnotations(); > resolveStatements(); > // check @Deprecated annotation presence >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java >index ab66d39..71e11ac 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -87,7 +91,10 @@ > public StringBuffer printAsExpression(int indent, StringBuffer output) { > printIndent(indent, output); > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > > if (this.type != null) { > this.type.print(0, output).append(' '); >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >index 1331b11..132293a 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contributions for >@@ -12,6 +16,8 @@ > * bug 365662 - [compiler][null] warn on contradictory and redundant null annotations > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; >+ >+import java.util.Stack; > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; >@@ -25,6 +31,329 @@ > * Annotation > */ > public abstract class Annotation extends Expression { >+ >+ /** >+ * Return the location for the corresponding annotation inside the type reference, <code>null</code> if none. >+ */ >+ public static int[] getLocations( >+ final TypeReference reference, >+ final Annotation[] primaryAnnotation, >+ final Annotation annotation, >+ final Annotation[][] annotationsOnDimensionsOnExpression) { >+ class LocationCollector extends ASTVisitor { >+ Stack currentIndexes; >+ Annotation currentAnnotation; >+ boolean search = true; >+ >+ public LocationCollector(Annotation currentAnnotation) { >+ this.currentIndexes = new Stack(); >+ this.currentAnnotation = currentAnnotation; >+ } >+ public boolean visit(ArrayTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ // check if the annotation is located on the first dimension >+ Annotation[] annotations = annotationsOnDimensions[0]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) { >+ annotations = annotationsOnDimensions[i]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ } >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations == null) { >+ annotations = primaryAnnotation; >+ } >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.pop(); >+ return true; >+ } >+ public boolean visit(ArrayQualifiedTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ // check if the annotation is located on the first dimension >+ Annotation[] annotations = annotationsOnDimensions[0]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) { >+ annotations = annotationsOnDimensions[i]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ } >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations == null) { >+ annotations = primaryAnnotation; >+ } >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.pop(); >+ return true; >+ } >+ public boolean visit(ParameterizedSingleTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ // check if the annotation is located on the first dimension >+ Annotation[] annotations = annotationsOnDimensions[0]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) { >+ annotations = annotationsOnDimensions[i]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ } >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations == null) { >+ annotations = primaryAnnotation; >+ } >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ TypeReference[] typeReferences = typeReference.typeArguments; >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 0, max = typeReferences.length; i < max; i++) { >+ typeReferences[i].traverse(this, scope); >+ if (!this.search) return false; >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ this.currentIndexes.pop(); >+ return true; >+ } >+ public boolean visit(ParameterizedQualifiedTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ // check if the annotation is located on the first dimension >+ Annotation[] annotations = annotationsOnDimensions[0]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) { >+ annotations = annotationsOnDimensions[i]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ } >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations == null) { >+ annotations = primaryAnnotation; >+ } >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ //TODO it is unclear how to manage annotations located in the first type arguments >+ TypeReference[] typeReferences = typeReference.typeArguments[typeReference.typeArguments.length - 1]; >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 0, max = typeReferences.length; i < max; i++) { >+ typeReferences[i].traverse(this, scope); >+ if (!this.search) return false; >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ this.currentIndexes.pop(); >+ return true; >+ } >+ public boolean visit(SingleTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[][] annotationsOnDimensions = annotationsOnDimensionsOnExpression; >+ if (annotationsOnDimensions != null) { >+ // check if the annotation is located on the first dimension >+ Annotation[] annotations = annotationsOnDimensions[0]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ >+ this.currentIndexes.push(new Integer(0)); >+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) { >+ annotations = annotationsOnDimensions[i]; >+ if (annotations != null) { >+ for (int j = 0, max2 = annotations.length; j < max2; j++) { >+ Annotation current = annotations[j]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1)); >+ } >+ } >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ return false; >+ } >+ public boolean visit(Wildcard typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ TypeReference bound = typeReference.bound; >+ bound.traverse(this, scope); >+ return true; >+ } >+ public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) { >+ if (!this.search) return false; >+ Annotation[] annotations = typeReference.annotations; >+ if (annotations != null) { >+ for (int i = 0; i < annotations.length; i++) { >+ Annotation current = annotations[i]; >+ if (current == this.currentAnnotation) { >+ this.search = false; >+ return false; >+ } >+ } >+ } >+ return true; >+ } >+ public String toString() { >+ StringBuffer buffer = new StringBuffer(); >+ buffer >+ .append("search location for ") //$NON-NLS-1$ >+ .append(this.currentAnnotation) >+ .append("\ncurrent indexes : ") //$NON-NLS-1$ >+ .append(this.currentIndexes); >+ return String.valueOf(buffer); >+ } >+ } >+ if (reference == null) return null; >+ LocationCollector collector = new LocationCollector(annotation); >+ reference.traverse(collector, (BlockScope) null); >+ if (collector.currentIndexes.isEmpty()) { >+ return null; >+ } >+ int size = collector.currentIndexes.size(); >+ int[] result = new int[size]; >+ for (int i = 0; i < size; i++) { >+ result[size - i - 1] = ((Integer) collector.currentIndexes.pop()).intValue(); >+ } >+ return result; >+ } >+ >+ // jsr 308 >+ public static class TypeUseBinding extends ReferenceBinding { >+ private int kind; >+ public TypeUseBinding(int kind) { >+ this.tagBits = 0L; >+ this.kind = kind; >+ } >+ public int kind() { >+ return this.kind; >+ } >+ public boolean hasTypeBit(int bit) { >+ // TODO Auto-generated method stub >+ return false; >+ } >+ } > > final static MemberValuePair[] NoValuePairs = new MemberValuePair[0]; > private static final long TAGBITS_NULLABLE_OR_NONNULL = TagBits.AnnotationNullable|TagBits.AnnotationNonNull; >@@ -91,6 +420,10 @@ > case 'T' : > if (CharOperation.equals(elementName, TypeConstants.TYPE)) > return TagBits.AnnotationForType; >+ if (CharOperation.equals(elementName, TypeConstants.TYPE_USE_TARGET)) >+ return TagBits.AnnotationForTypeUse; >+ if (CharOperation.equals(elementName, TypeConstants.TYPE_PARAMETER_TARGET)) >+ return TagBits.AnnotationForTypeParameter; > break; > } > return 0; // unknown >@@ -202,10 +535,51 @@ > return false; > } > long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference >+ // jsr 308 >+ // we need to filter out type use and type parameter annotations >+ if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) { >+ return false; >+ } >+ > if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) > return true; // by default the retention is CLASS > > return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention; >+ } >+ >+ public boolean isRuntimeTypeInvisible() { >+ final TypeBinding annotationBinding = this.resolvedType; >+ if (annotationBinding == null) { >+ return false; >+ } >+ long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference >+ // jsr 308 >+ // we need to filter out type use and type parameter annotations >+ if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0 >+ && ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) { >+ return false; >+ } >+ >+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >+ return true; // by default the retention is CLASS >+ >+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention; >+ } >+ >+ public boolean isRuntimeTypeVisible() { >+ final TypeBinding annotationBinding = this.resolvedType; >+ if (annotationBinding == null) { >+ return false; >+ } >+ long metaTagBits = annotationBinding.getAnnotationTagBits(); >+ if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0 >+ && ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) { >+ return false; >+ } >+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >+ return false; // by default the retention is CLASS >+ >+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention; > } > > public boolean isRuntimeVisible() { >@@ -214,6 +588,9 @@ > return false; > } > long metaTagBits = annotationBinding.getAnnotationTagBits(); >+ if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) { >+ return false; >+ } > if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) > return false; // by default the retention is CLASS > >@@ -341,16 +718,19 @@ > } > } > } >- if (!foundValue && >- (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0 && >- (this.bits & IsRecovered) == 0) { >+ if (!foundValue >+ && (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0 >+ && (this.bits & IsRecovered) == 0 >+ && annotationType.isValidBinding()) { > scope.problemReporter().missingValueForAnnotationMember(this, selector); > } > } > // check unused pairs > for (int i = 0; i < pairsLength; i++) { > if (pairs[i] != null) { >- scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]); >+ if (annotationType.isValidBinding()) { >+ scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]); >+ } > pairs[i].resolveTypeExpecting(scope, null); // resilient > } > } >@@ -421,19 +801,32 @@ > } > // check (meta)target compatibility > checkTargetCompatibility: { >- long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference >- if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) // does not specify any target restriction >+ if (!annotationType.isValidBinding()) { >+ // no need to check annotation usage if missing > break checkTargetCompatibility; >+ } >+ >+ long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference >+ if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) { >+ // does not specify any target restriction - all locations are possible including type annotations >+ break checkTargetCompatibility; >+ } > > switch (this.recipient.kind()) { > case Binding.PACKAGE : > if ((metaTagBits & TagBits.AnnotationForPackage) != 0) > break checkTargetCompatibility; > break; >+ case Binding.TYPE_USE : >+ if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) { >+ // jsr 308 >+ break checkTargetCompatibility; >+ } >+ break; > case Binding.TYPE : > case Binding.GENERIC_TYPE : > if (((ReferenceBinding)this.recipient).isAnnotationType()) { >- if ((metaTagBits & (TagBits.AnnotationForAnnotationType|TagBits.AnnotationForType)) != 0) >+ if ((metaTagBits & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType)) != 0) > break checkTargetCompatibility; > } else if ((metaTagBits & TagBits.AnnotationForType) != 0) { > break checkTargetCompatibility; >@@ -443,24 +836,48 @@ > } > break; > case Binding.METHOD : >- if (((MethodBinding)this.recipient).isConstructor()) { >+ MethodBinding methodBinding = (MethodBinding) this.recipient; >+ if (methodBinding.isConstructor()) { > if ((metaTagBits & TagBits.AnnotationForConstructor) != 0) > break checkTargetCompatibility; >- } else if ((metaTagBits & TagBits.AnnotationForMethod) != 0) >+ } else if ((metaTagBits & TagBits.AnnotationForMethod) != 0) { > break checkTargetCompatibility; >+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) { >+ // jsr 308 - annotation on method return type >+ if (methodBinding.returnType != null && methodBinding.returnType.id == T_void) { >+ scope.problemReporter().illegalUsageOfTypeAnnotations(this); >+ } >+ break checkTargetCompatibility; >+ } > break; > case Binding.FIELD : >- if ((metaTagBits & TagBits.AnnotationForField) != 0) >+ if ((metaTagBits & TagBits.AnnotationForField) != 0) { > break checkTargetCompatibility; >+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) { >+ // jsr 308 - annotation on field type >+ break checkTargetCompatibility; >+ } > break; > case Binding.LOCAL : > if ((((LocalVariableBinding)this.recipient).tagBits & TagBits.IsArgument) != 0) { >- if ((metaTagBits & TagBits.AnnotationForParameter) != 0) >+ if ((metaTagBits & TagBits.AnnotationForParameter) != 0) { > break checkTargetCompatibility; >- } else if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0) >+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) { >+ // jsr 308 - annotation on method parameter type >+ break checkTargetCompatibility; >+ } >+ } else if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0) { > break checkTargetCompatibility; >+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) { >+ // jsr 308 - annotation on local type >+ break checkTargetCompatibility; >+ } > break; >- } >+ case Binding.TYPE_PARAMETER : // jsr308 >+ if ((metaTagBits & TagBits.AnnotationForTypeParameter) != 0) { >+ break checkTargetCompatibility; >+ } >+ } > scope.problemReporter().disallowedTargetForAnnotation(this); > } > } >@@ -469,4 +886,5 @@ > > public abstract void traverse(ASTVisitor visitor, BlockScope scope); > >+ public abstract void traverse(ASTVisitor visitor, ClassScope scope); > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java >index 8860ec6..69840bb 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -55,7 +59,10 @@ > > printIndent(tab, output); > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > > TypeParameter[] typeParams = typeParameters(); > if (typeParams != null) { >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 0eaad4a..8c96cec 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 >@@ -34,6 +34,9 @@ > this.declarationSourceEnd = (int) posNom; > this.modifiers = modifiers; > this.type = tr; >+ if (tr != null) { >+ this.bits |= (tr.bits & ASTNode.HasTypeAnnotations); >+ } > this.bits |= (IsLocalDeclarationReachable | IsArgument); > } > >@@ -43,6 +46,9 @@ > this.declarationSourceEnd = (int) posNom; > this.modifiers = modifiers; > this.type = tr; >+ if (tr != null) { >+ this.bits |= (tr.bits & ASTNode.HasTypeAnnotations); >+ } > this.bits |= (IsLocalDeclarationReachable | IsArgument | IsTypeElided); > } > >@@ -97,6 +103,10 @@ > return (this.bits & ASTNode.IsArgument) != 0 ? PARAMETER : LOCAL_VARIABLE; > } > >+ public boolean isArgument() { >+ return true; >+ } >+ > public boolean isVarArgs() { > return this.type != null && (this.type.bits & IsVarArgs) != 0; > } >@@ -105,7 +115,10 @@ > > printIndent(indent, output); > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > > if (this.type == null) { > output.append("<no type> "); //$NON-NLS-1$ >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 a7af188..664cbac 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE >@@ -24,6 +28,7 @@ > //dimensions.length gives the number of dimensions, but the > // last ones may be nulled as in new int[4][5][][] > public Expression[] dimensions; >+ public Annotation [][] annotationsOnDimensions; // jsr308 style annotations. > public ArrayInitializer initializer; > > public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { >@@ -83,6 +88,11 @@ > output.append("new "); //$NON-NLS-1$ > this.type.print(0, output); > for (int i = 0; i < this.dimensions.length; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(' '); >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(' '); >+ } > if (this.dimensions[i] == null) > output.append("[]"); //$NON-NLS-1$ > else { >@@ -163,6 +173,12 @@ > return null; > } > } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations = this.annotationsOnDimensions[i]; >+ resolveAnnotations(scope, annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+ } > return this.resolvedType; > } > >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java >index 803966a..cfca327 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -17,16 +21,28 @@ > > public class ArrayQualifiedTypeReference extends QualifiedTypeReference { > int dimensions; >+ Annotation[][] annotationsOnDimensions; // jsr308 style type annotations on dimensions > > public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) { > > super( sources , poss); > this.dimensions = dim ; >+ this.annotationsOnDimensions = null; >+ } >+ >+ public ArrayQualifiedTypeReference(char[][] sources, int dim, Annotation[][] annotationsOnDimensions, long[] poss) { >+ this(sources, dim, poss); >+ this.annotationsOnDimensions = annotationsOnDimensions; >+ this.bits |= ASTNode.HasTypeAnnotations; > } > > public int dimensions() { > > return this.dimensions; >+ } >+ >+ public Annotation[][] getAnnotationsOnDimensions() { >+ return this.annotationsOnDimensions; > } > > /** >@@ -70,16 +86,47 @@ > } > } > >+ protected TypeBinding internalResolveType(Scope scope) { >+ TypeBinding internalResolveType = super.internalResolveType(scope); >+ if (this.annotationsOnDimensions != null) { >+ switch(scope.kind) { >+ case Scope.BLOCK_SCOPE : >+ case Scope.METHOD_SCOPE : >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i]; >+ resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+ break; >+ } >+ } >+ return internalResolveType; >+ } >+ > public StringBuffer printExpression(int indent, StringBuffer output){ > > super.printExpression(indent, output); > if ((this.bits & IsVarArgs) != 0) { > for (int i= 0 ; i < this.dimensions - 1; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(' '); >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(' '); >+ } > output.append("[]"); //$NON-NLS-1$ >+ } >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) { >+ output.append(' '); >+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output); >+ output.append(' '); > } > output.append("..."); //$NON-NLS-1$ > } else { > for (int i= 0 ; i < this.dimensions; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ > } > } >@@ -87,14 +134,52 @@ > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } >+ } > visitor.endVisit(this, scope); > } > > public void traverse(ASTVisitor visitor, ClassScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } >+ } > visitor.endVisit(this, scope); > } >+ >+ protected void resolveAnnotations(BlockScope scope) { >+ super.resolveAnnotations(scope); >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i]; >+ resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+ } >+ } > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java >index fa6c8d5..18f9ce8 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -12,6 +16,7 @@ > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.Scope; >@@ -19,6 +24,7 @@ > > public class ArrayTypeReference extends SingleTypeReference { > public int dimensions; >+ public Annotation[][] annotationsOnDimensions; // jsr308 style type annotations on dimensions. > public int originalSourceEnd; > > /** >@@ -32,11 +38,24 @@ > super(source, pos); > this.originalSourceEnd = this.sourceEnd; > this.dimensions = dimensions ; >+ this.annotationsOnDimensions = null; >+ } >+ >+ public ArrayTypeReference(char[] source, int dimensions, Annotation[][] annotationsOnDimensions, long pos) { >+ this(source, dimensions, pos); >+ if (annotationsOnDimensions != null) { >+ this.bits |= ASTNode.HasTypeAnnotations; >+ } >+ this.annotationsOnDimensions = annotationsOnDimensions; > } > > public int dimensions() { > > return this.dimensions; >+ } >+ >+ public Annotation[][] getAnnotationsOnDimensions() { >+ return this.annotationsOnDimensions; > } > /** > * @return char[][] >@@ -69,11 +88,26 @@ > super.printExpression(indent, output); > if ((this.bits & IsVarArgs) != 0) { > for (int i= 0 ; i < this.dimensions - 1; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(' '); >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(' '); >+ } > output.append("[]"); //$NON-NLS-1$ >+ } >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) { >+ output.append(' '); >+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output); >+ output.append(' '); > } > output.append("..."); //$NON-NLS-1$ > } else { > for (int i= 0 ; i < this.dimensions; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ > } > } >@@ -81,14 +115,71 @@ > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ if (annotations2 != null) { >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } >+ } >+ } > visitor.endVisit(this, scope); > } > > public void traverse(ASTVisitor visitor, ClassScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ if (annotations2 != null) { >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } >+ } >+ } > visitor.endVisit(this, scope); > } >+ >+ protected TypeBinding internalResolveType(Scope scope) { >+ TypeBinding internalResolveType = super.internalResolveType(scope); >+ if (this.annotationsOnDimensions != null) { >+ switch(scope.kind) { >+ case Scope.BLOCK_SCOPE : >+ case Scope.METHOD_SCOPE : >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i]; >+ resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+ break; >+ } >+ } >+ return internalResolveType; >+ } >+ protected void resolveAnnotations(BlockScope scope) { >+ super.resolveAnnotations(scope); >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i]; >+ resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+ } >+ } > } >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 17d5ffa..19dc053 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 >@@ -5,14 +5,21 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.IProblem; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.impl.*; >+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.*; > import org.eclipse.jdt.internal.compiler.flow.*; >@@ -109,7 +116,13 @@ > } > codeStream.recordPositionsFrom(pc, this.sourceStart); > } >- >+public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts); >+ for (int i = 0, max = this.annotations.length; i < max; i++) { >+ Annotation annotation = this.annotations[i]; >+ annotation.traverse(collector, (BlockScope) null); >+ } >+} > /** > * @see org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration#getKind() > */ >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java >index 6cb2c16..8a14ea4 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java >@@ -5,6 +5,9 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -87,7 +90,10 @@ > if (this.modifiers != 0) { > printIndent(indent, output); > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > output.append("{\n"); //$NON-NLS-1$ > if (this.block != null) { > this.block.printBody(indent, output); >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java >index 696a693..7f985aa 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -30,6 +34,10 @@ > public TypeReference copyDims(int dim) { > return null; > } >+ >+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) { >+ return null; >+ } > > /* (non-Javadoc) > * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope) >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 48723a6..692d40e 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for >@@ -19,8 +23,11 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import java.util.List; >+ > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.impl.*; >+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.*; > import org.eclipse.jdt.internal.compiler.flow.*; >@@ -189,11 +196,25 @@ > return LOCAL_VARIABLE; > } > >+ // for local variables >+ public void getAllAnnotationContexts(int targetType, LocalVariableBinding localVariable, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, localVariable, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+ } >+ // for arguments >+ public void getAllAnnotationContexts(int targetType, int parameterIndex, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, parameterIndex, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+ } >+ public boolean isArgument() { >+ return false; >+ } > public void resolve(BlockScope scope) { > > // create a binding and add it to the scope > TypeBinding variableType = this.type.resolveType(scope, true /* check bounds*/); > >+ this.bits |= (this.type.bits & ASTNode.HasTypeAnnotations); > checkModifiers(); > if (variableType != null) { > if (variableType == TypeBinding.VOID) { >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java >index 2a48484..eae5b91 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -42,4 +46,12 @@ > } > visitor.endVisit(this, scope); > } >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ if (visitor.visit(this, scope)) { >+ if (this.type != null) { >+ this.type.traverse(visitor, scope); >+ } >+ } >+ visitor.endVisit(this, scope); >+ } > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java >index e0f7cfb..53c7b16 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contributions for >@@ -17,6 +21,7 @@ > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; >+import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair; > import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; > import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; >@@ -241,4 +246,12 @@ > } > visitor.endVisit(this, scope); > } >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ if (visitor.visit(this, scope)) { >+ if (this.value != null) { >+ this.value.traverse(visitor, scope); >+ } >+ } >+ visitor.endVisit(this, scope); >+ } > } >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 a488177..a231cb7 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contributions for >@@ -15,6 +19,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.CompilationResult; >@@ -24,6 +30,7 @@ > import org.eclipse.jdt.internal.compiler.flow.FlowInfo; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.compiler.lookup.Binding; >+import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; > import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; >@@ -35,6 +42,7 @@ > import org.eclipse.jdt.internal.compiler.parser.Parser; > import org.eclipse.jdt.internal.compiler.problem.AbortMethod; > import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; >+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector; > > public class MethodDeclaration extends AbstractMethodDeclaration { > >@@ -146,6 +154,14 @@ > } > } > >+ public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts); >+ for (int i = 0, max = this.annotations.length; i < max; i++) { >+ Annotation annotation = this.annotations[i]; >+ annotation.traverse(collector, (BlockScope) null); >+ } >+ } >+ > public boolean isMethod() { > return true; > } >@@ -163,6 +179,7 @@ > public void resolveStatements() { > // ========= abort on fatal error ============= > if (this.returnType != null && this.binding != null) { >+ this.bits |= (this.returnType.bits & ASTNode.HasTypeAnnotations); > this.returnType.resolvedType = this.binding.returnType; > // record the return type binding > } >@@ -177,7 +194,10 @@ > } > if (this.typeParameters != null) { > for (int i = 0, length = this.typeParameters.length; i < length; i++) { >- this.typeParameters[i].resolve(this.scope); >+ TypeParameter typeParameter = this.typeParameters[i]; >+ this.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations); >+ typeParameter.resolve(this.scope); >+ typeParameter.resolveAnnotations(this.scope); > if (returnsUndeclTypeVar && this.typeParameters[i].binding == this.returnType.resolvedType) { > returnsUndeclTypeVar = false; > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java >index a1d1bd1..381cc9a 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -71,4 +75,17 @@ > } > visitor.endVisit(this, scope); > } >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ if (visitor.visit(this, scope)) { >+ if (this.type != null) { >+ this.type.traverse(visitor, scope); >+ } >+ if (this.memberValuePairs != null) { >+ int memberValuePairsLength = this.memberValuePairs.length; >+ for (int i = 0; i < memberValuePairsLength; i++) >+ this.memberValuePairs[i].traverse(visitor, scope); >+ } >+ } >+ visitor.endVisit(this, scope); >+ } > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >index e1cd52e..4764694 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -35,6 +39,13 @@ > super(tokens, dim, positions); > this.typeArguments = typeArguments; > } >+ public ParameterizedQualifiedTypeReference(char[][] tokens, TypeReference[][] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long[] positions) { >+ this(tokens, typeArguments, dim, positions); >+ this.annotationsOnDimensions = annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ this.bits |= ASTNode.HasTypeAnnotations; >+ } >+ } > public void checkBounds(Scope scope) { > if (this.resolvedType == null) return; > >@@ -59,6 +70,17 @@ > } > public TypeReference copyDims(int dim){ > return new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, this.sourcePositions); >+ } >+ public TypeReference copyDims(int dim, Annotation[][] dimensionAnnotations){ >+ ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, dimensionAnnotations, this.sourcePositions); >+ parameterizedQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations); >+ if (dimensionAnnotations != null) { >+ parameterizedQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return parameterizedQualifiedTypeReference; >+ } >+ public boolean isParameterizedTypeReference() { >+ return true; > } > > /** >@@ -300,6 +322,11 @@ > } > > public StringBuffer printExpression(int indent, StringBuffer output) { >+ if (this.annotations != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > int length = this.tokens.length; > for (int i = 0; i < length - 1; i++) { > output.append(this.tokens[i]); >@@ -336,11 +363,26 @@ > } > if ((this.bits & IsVarArgs) != 0) { > for (int i= 0 ; i < this.dimensions - 1; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ >+ } >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output); >+ output.append(" "); //$NON-NLS-1$ > } > output.append("..."); //$NON-NLS-1$ > } else { > for (int i= 0 ; i < this.dimensions; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ > } > } >@@ -355,6 +397,20 @@ > } > public void traverse(ASTVisitor visitor, BlockScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } > for (int i = 0, max = this.typeArguments.length; i < max; i++) { > if (this.typeArguments[i] != null) { > for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) { >@@ -368,6 +424,20 @@ > > public void traverse(ASTVisitor visitor, ClassScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } > for (int i = 0, max = this.typeArguments.length; i < max; i++) { > if (this.typeArguments[i] != null) { > for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) { >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >index 40bdc86..6986bbb 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -30,6 +34,13 @@ > this.originalSourceEnd = this.sourceEnd; > this.typeArguments = typeArguments; > } >+ public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long pos) { >+ this(name, typeArguments, dim, pos); >+ this.annotationsOnDimensions = annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ this.bits |= ASTNode.HasTypeAnnotations; >+ } >+ } > public void checkBounds(Scope scope) { > if (this.resolvedType == null) return; > >@@ -48,6 +59,14 @@ > */ > public TypeReference copyDims(int dim) { > return new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, (((long)this.sourceStart)<<32)+this.sourceEnd); >+ } >+ public TypeReference copyDims(int dim, Annotation [][] annotationsOnDims) { >+ ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, annotationsOnDims, (((long)this.sourceStart)<<32)+this.sourceEnd); >+ parameterizedSingleTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations); >+ if (annotationsOnDims != null) { >+ parameterizedSingleTypeReference.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return parameterizedSingleTypeReference; > } > > /** >@@ -81,6 +100,10 @@ > */ > protected TypeBinding getTypeBinding(Scope scope) { > return null; // not supported here - combined with resolveType(...) >+ } >+ >+ public boolean isParameterizedTypeReference() { >+ return true; > } > > /* >@@ -186,11 +209,12 @@ > boolean argHasError = false; > ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original(); > for (int i = 0; i < argLength; i++) { >- TypeReference typeArgument = this.typeArguments[i]; >+ TypeReference typeArgument = this.typeArguments[i]; > TypeBinding argType = isClassScope > ? typeArgument.resolveTypeArgument((ClassScope) scope, currentOriginal, i) > : typeArgument.resolveTypeArgument((BlockScope) scope, currentOriginal, i); >- if (argType == null) { >+ this.bits |= (typeArgument.bits & ASTNode.HasTypeAnnotations); >+ if (argType == null) { > argHasError = true; > } else { > argTypes[i] = argType; >@@ -277,11 +301,26 @@ > output.append(">"); //$NON-NLS-1$ > if ((this.bits & IsVarArgs) != 0) { > for (int i= 0 ; i < this.dimensions - 1; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ >+ } >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output); >+ output.append(" "); //$NON-NLS-1$ > } > output.append("..."); //$NON-NLS-1$ > } else { > for (int i= 0 ; i < this.dimensions; i++) { >+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) { >+ output.append(" "); //$NON-NLS-1$ >+ printAnnotations(this.annotationsOnDimensions[i], output); >+ output.append(" "); //$NON-NLS-1$ >+ } > output.append("[]"); //$NON-NLS-1$ > } > } >@@ -302,6 +341,22 @@ > > public void traverse(ASTVisitor visitor, BlockScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ if (annotations2 != null) { >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } >+ } > for (int i = 0, max = this.typeArguments.length; i < max; i++) { > this.typeArguments[i].traverse(visitor, scope); > } >@@ -311,6 +366,20 @@ > > public void traverse(ASTVisitor visitor, ClassScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ if (this.annotationsOnDimensions != null) { >+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotations2 = this.annotationsOnDimensions[i]; >+ for (int j = 0, max2 = annotations2.length; j < max2; j++) { >+ Annotation annotation = annotations2[j]; >+ annotation.traverse(visitor, scope); >+ } >+ } >+ } > for (int i = 0, max = this.typeArguments.length; i < max; i++) { > this.typeArguments[i].traverse(visitor, scope); > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >index f6d5e3e..1ac39c9 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -32,6 +36,17 @@ > //return a type reference copy of me with some dimensions > //warning : the new type ref has a null binding > return new ArrayQualifiedTypeReference(this.tokens, dim, this.sourcePositions); >+ } >+ >+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) { >+ //return a type reference copy of me with some dimensions >+ //warning : the new type ref has a null binding >+ ArrayQualifiedTypeReference arrayQualifiedTypeReference = new ArrayQualifiedTypeReference(this.tokens, dim, annotationsOnDimensions, this.sourcePositions); >+ arrayQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations); >+ if (annotationsOnDimensions != null) { >+ arrayQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return arrayQualifiedTypeReference; > } > > protected TypeBinding findNextTypeBinding(int tokenIndex, Scope scope, PackageBinding packageBinding) { >@@ -122,7 +137,10 @@ > } > > public StringBuffer printExpression(int indent, StringBuffer output) { >- >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > for (int i = 0; i < this.tokens.length; i++) { > if (i > 0) output.append('.'); > output.append(this.tokens[i]); >@@ -131,14 +149,24 @@ > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ } > visitor.endVisit(this, scope); > } > > public void traverse(ASTVisitor visitor, ClassScope scope) { >- >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ } > visitor.endVisit(this, scope); > } > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java >index e64bf0c..2eff389 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -62,4 +66,16 @@ > } > visitor.endVisit(this, scope); > } >+ >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ if (visitor.visit(this, scope)) { >+ if (this.type != null) { >+ this.type.traverse(visitor, scope); >+ } >+ if (this.memberValue != null) { >+ this.memberValue.traverse(visitor, scope); >+ } >+ } >+ visitor.endVisit(this, scope); >+ } > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java >index 9d3b703..dc1b822 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -33,6 +37,17 @@ > > return new ArrayTypeReference(this.token, dim,(((long)this.sourceStart)<<32)+this.sourceEnd); > } >+ >+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){ >+ //return a type reference copy of me with some dimensions >+ //warning : the new type ref has a null binding >+ ArrayTypeReference arrayTypeReference = new ArrayTypeReference(this.token, dim, annotationsOnDimensions, (((long)this.sourceStart)<<32)+this.sourceEnd); >+ arrayTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations); >+ if (annotationsOnDimensions != null) { >+ arrayTypeReference.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return arrayTypeReference; >+ } > > public char[] getLastToken() { > return this.token; >@@ -54,7 +69,10 @@ > } > > public StringBuffer printExpression(int indent, StringBuffer output){ >- >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > return output.append(this.token); > } > >@@ -85,12 +103,24 @@ > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ } > visitor.endVisit(this, scope); > } > > public void traverse(ASTVisitor visitor, ClassScope scope) { >- visitor.visit(this, scope); >+ if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } >+ } > visitor.endVisit(this, scope); > } > } >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 a694c1a..e8c3207 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contribution for Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop) >@@ -906,7 +910,10 @@ > > public StringBuffer printHeader(int indent, StringBuffer output) { > printModifiers(this.modifiers, output); >- if (this.annotations != null) printAnnotations(this.annotations, output); >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > > switch (kind(this.modifiers)) { > case TypeDeclaration.CLASS_DECL : >@@ -971,6 +978,19 @@ > try { > this.staticInitializerScope.insideTypeAnnotation = true; > resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType); >+ if (this.superclass != null) { >+ this.superclass.resolveAnnotations(this.staticInitializerScope); >+ } >+ if (this.superInterfaces != null) { >+ for (int i = 0, max = this.superInterfaces.length; i < max; i++) { >+ this.superInterfaces[i].resolveAnnotations(this.staticInitializerScope); >+ } >+ } >+ if (this.typeParameters != null) { >+ for (int i = 0, count = this.typeParameters.length; i < count; i++) { >+ this.typeParameters[i].resolveAnnotations(this.staticInitializerScope); >+ } >+ } > } finally { > this.staticInitializerScope.insideTypeAnnotation = old; > } >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 37edacc..63c8941 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,16 +1,24 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import java.util.List; >+ > import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector; >+import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants; > import org.eclipse.jdt.internal.compiler.codegen.CodeStream; > import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; >@@ -42,8 +50,38 @@ > } > } > >+ public void getAllAnnotationContexts(int targetType, int typeParameterIndex, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, typeParameterIndex, allAnnotationContexts); >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(collector, (BlockScope) null); >+ } >+ switch(collector.targetType) { >+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER : >+ collector.targetType = AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND; >+ break; >+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER : >+ collector.targetType = AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND; >+ } >+ if (this.type != null && ((this.type.bits & ASTNode.HasTypeAnnotations) != 0)) { >+ collector.info2 = 0; >+ this.type.traverse(collector, (BlockScope) null); >+ } >+ if (this.bounds != null) { >+ int boundsLength = this.bounds.length; >+ for (int i = 0; i < boundsLength; i++) { >+ TypeReference bound = this.bounds[i]; >+ if ((bound.bits & ASTNode.HasTypeAnnotations) == 0) { >+ continue; >+ } >+ collector.info2 = i + 1; >+ bound.traverse(collector, (BlockScope) null); >+ } >+ } >+ } > private void internalResolve(Scope scope, boolean staticContext) { >- // detect variable/type name collisions >+ // detect variable/type name collisions > if (this.binding != null) { > Binding existingType = scope.parent.getBinding(this.name, Binding.TYPE, this, false/*do not resolve hidden field*/); > if (existingType != null >@@ -63,10 +101,27 @@ > internalResolve(scope, scope.enclosingSourceType().isStatic()); > } > >+ public void resolveAnnotations(BlockScope scope) { >+ if (this.annotations != null) { >+ resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_PARAMETER)); >+ } >+ if (this.type != null) { >+ this.type.resolveAnnotations(scope); >+ } >+ if (this.bounds != null) { >+ for (int i = 0, max = this.bounds.length; i < max; i++) { >+ this.bounds[i].resolveAnnotations(scope); >+ } >+ } >+ } > /* (non-Javadoc) > * @see org.eclipse.jdt.internal.compiler.ast.AstNode#print(int, java.lang.StringBuffer) > */ > public StringBuffer printStatement(int indent, StringBuffer output) { >+ if (this.annotations != null) { >+ printAnnotations(this.annotations, output); >+ output.append(' '); >+ } > output.append(this.name); > if (this.type != null) { > output.append(" extends "); //$NON-NLS-1$ >@@ -82,11 +137,16 @@ > } > > public void generateCode(BlockScope currentScope, CodeStream codeStream) { >- // nothing to do >+ // nothing to do > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } > if (this.type != null) { > this.type.traverse(visitor, scope); > } >@@ -102,6 +162,11 @@ > > public void traverse(ASTVisitor visitor, ClassScope scope) { > if (visitor.visit(this, scope)) { >+ if (this.annotations != null) { >+ int annotationsLength = this.annotations.length; >+ for (int i = 0; i < annotationsLength; i++) >+ this.annotations[i].traverse(visitor, scope); >+ } > if (this.type != null) { > this.type.traverse(visitor, scope); > } >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 7b07cb3..5f150de 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,23 +1,34 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import java.util.ArrayList; >+import java.util.List; >+ > import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.codegen.AnnotationContext; >+import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants; > import org.eclipse.jdt.internal.compiler.flow.FlowContext; > 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.lookup.ArrayBinding; >+import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; >+import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; >@@ -28,12 +39,210 @@ > import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; > > public abstract class TypeReference extends Expression { >- > public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0]; >+static class AnnotationCollector extends ASTVisitor { >+ List annotationContexts; >+ TypeReference typeReference; >+ int targetType; >+ Annotation[] primaryAnnotations; >+ int info = -1; >+ int info2 = -1; >+ LocalVariableBinding localVariable; >+ Annotation[][] annotationsOnDimensions; >+ Wildcard currentWildcard; >+ >+ public AnnotationCollector( >+ TypeParameter typeParameter, >+ int targetType, >+ int typeParameterIndex, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = typeParameter.type; >+ this.targetType = targetType; >+ this.primaryAnnotations = typeParameter.annotations; >+ this.info = typeParameterIndex; >+ } >+ >+ public AnnotationCollector( >+ LocalDeclaration localDeclaration, >+ int targetType, >+ LocalVariableBinding localVariable, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = localDeclaration.type; >+ this.targetType = targetType; >+ this.primaryAnnotations = localDeclaration.annotations; >+ this.localVariable = localVariable; >+ } >+ >+ public AnnotationCollector( >+ LocalDeclaration localDeclaration, >+ int targetType, >+ int parameterIndex, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = localDeclaration.type; >+ this.targetType = targetType; >+ this.primaryAnnotations = localDeclaration.annotations; >+ this.info = parameterIndex; >+ } >+ >+ public AnnotationCollector( >+ MethodDeclaration methodDeclaration, >+ int targetType, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = methodDeclaration.returnType; >+ this.targetType = targetType; >+ this.primaryAnnotations = methodDeclaration.annotations; >+ } >+ >+ public AnnotationCollector( >+ FieldDeclaration fieldDeclaration, >+ int targetType, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = fieldDeclaration.type; >+ this.targetType = targetType; >+ this.primaryAnnotations = fieldDeclaration.annotations; >+ } >+ public AnnotationCollector( >+ TypeReference typeReference, >+ int targetType, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = typeReference; >+ this.targetType = targetType; >+ } >+ public AnnotationCollector( >+ TypeReference typeReference, >+ int targetType, >+ int info, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = typeReference; >+ this.info = info; >+ this.targetType = targetType; >+ } >+ public AnnotationCollector( >+ TypeReference typeReference, >+ int targetType, >+ int info, >+ int typeIndex, >+ List annotationContexts) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = typeReference; >+ this.info = info; >+ this.targetType = targetType; >+ this.info2 = typeIndex; >+ } >+ public AnnotationCollector( >+ TypeReference typeReference, >+ int targetType, >+ int info, >+ List annotationContexts, >+ Annotation[][] annotationsOnDimensions) { >+ this.annotationContexts = annotationContexts; >+ this.typeReference = typeReference; >+ this.info = info; >+ this.targetType = targetType; >+ this.annotationsOnDimensions = annotationsOnDimensions; >+ } >+ private boolean internalVisit(Annotation annotation) { >+ AnnotationContext annotationContext = null; >+ if (annotation.isRuntimeTypeInvisible()) { >+ annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.INVISIBLE, this.annotationsOnDimensions); >+ } else if (annotation.isRuntimeTypeVisible()) { >+ annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.VISIBLE, this.annotationsOnDimensions); >+ } >+ if (annotationContext != null) { >+ annotationContext.wildcard = this.currentWildcard; >+ switch(this.targetType) { >+ case AnnotationTargetTypeConstants.THROWS : >+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER : >+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER : >+ case AnnotationTargetTypeConstants.METHOD_PARAMETER : >+ case AnnotationTargetTypeConstants.TYPE_CAST : >+ case AnnotationTargetTypeConstants.TYPE_INSTANCEOF : >+ case AnnotationTargetTypeConstants.OBJECT_CREATION : >+ case AnnotationTargetTypeConstants.CLASS_LITERAL : >+ case AnnotationTargetTypeConstants.CLASS_EXTENDS_IMPLEMENTS: >+ annotationContext.info = this.info; >+ break; >+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND : >+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND : >+ annotationContext.info2 = this.info2; >+ annotationContext.info = this.info; >+ break; >+ case AnnotationTargetTypeConstants.LOCAL_VARIABLE : >+ annotationContext.variableBinding = this.localVariable; >+ break; >+ case AnnotationTargetTypeConstants.TYPE_ARGUMENT_METHOD_CALL : >+ case AnnotationTargetTypeConstants.TYPE_ARGUMENT_CONSTRUCTOR_CALL : >+ annotationContext.info2 = this.info2; >+ annotationContext.info = this.info; >+ } >+ this.annotationContexts.add(annotationContext); >+ } >+ return true; >+ } >+ public boolean visit(MarkerAnnotation annotation, BlockScope scope) { >+ return internalVisit(annotation); >+ } >+ public boolean visit(NormalAnnotation annotation, BlockScope scope) { >+ return internalVisit(annotation); >+ } >+ public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) { >+ return internalVisit(annotation); >+ } >+ public boolean visit(Wildcard wildcard, BlockScope scope) { >+ this.currentWildcard = wildcard; >+ return true; >+ } >+ public boolean visit(Argument argument, BlockScope scope) { >+ if ((argument.bits & ASTNode.IsUnionType) == 0) { >+ return true; >+ } >+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) { >+ int startPC = this.localVariable.initializationPCs[i << 1]; >+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1]; >+ if (startPC != endPC) { // only entries for non zero length >+ return true; >+ } >+ } >+ return false; >+ } >+ public boolean visit(Argument argument, ClassScope scope) { >+ if ((argument.bits & ASTNode.IsUnionType) == 0) { >+ return true; >+ } >+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) { >+ int startPC = this.localVariable.initializationPCs[i << 1]; >+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1]; >+ if (startPC != endPC) { // only entries for non zero length >+ return true; >+ } >+ } >+ return false; >+ } >+ public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) { >+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) { >+ int startPC = this.localVariable.initializationPCs[i << 1]; >+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1]; >+ if (startPC != endPC) { // only entries for non zero length >+ return true; >+ } >+ } >+ return false; >+ } >+ public void endVisit(Wildcard wildcard, BlockScope scope) { >+ this.currentWildcard = null; >+ } >+} > /* > * Answer a base type reference (can be an array of base type). > */ >-public static final TypeReference baseTypeReference(int baseType, int dim) { >+public static final TypeReference baseTypeReference(int baseType, int dim, Annotation [][] dimAnnotations) { > > if (dim == 0) { > switch (baseType) { >@@ -59,25 +268,28 @@ > } > switch (baseType) { > case (TypeIds.T_void) : >- return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_boolean) : >- return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_char) : >- return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_float) : >- return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_double) : >- return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_byte) : >- return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_short) : >- return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, dimAnnotations, 0); > case (TypeIds.T_int) : >- return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, dimAnnotations, 0); > default : //T_long >- return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, 0); >+ return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, dimAnnotations, 0); > } > } >+ >+// JSR308 type annotations... >+public Annotation[] annotations = null; > > // allows us to trap completion & selection nodes > public void aboutToResolve(Scope scope) { >@@ -90,8 +302,56 @@ > // only parameterized type references have bounds > } > public abstract TypeReference copyDims(int dim); >+public abstract TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions); > public int dimensions() { > return 0; >+} >+public AnnotationContext[] getAllAnnotationContexts(int targetType) { >+ List allAnnotationContexts = new ArrayList(); >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+ return (AnnotationContext[]) allAnnotationContexts.toArray(new AnnotationContext[allAnnotationContexts.size()]); >+} >+/** >+ * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode >+ * @param targetType >+ * @param info >+ * @param allAnnotationContexts >+ */ >+public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+} >+/** >+ * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode >+ * @param targetType >+ * @param info >+ * @param allAnnotationContexts >+ */ >+public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts, Annotation[][] annotationsOnDimensions) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts, annotationsOnDimensions); >+ this.traverse(collector, (BlockScope) null); >+ if (annotationsOnDimensions != null) { >+ for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) { >+ Annotation[] annotationsOnDimension = annotationsOnDimensions[i]; >+ if (annotationsOnDimension != null) { >+ for (int j = 0, max2 = annotationsOnDimension.length; j< max2; j++) { >+ annotationsOnDimension[j].traverse(collector, (BlockScope) null); >+ } >+ } >+ } >+ } >+} >+public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, typeIndex, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+} >+public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) { >+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts); >+ this.traverse(collector, (BlockScope) null); >+} >+public Annotation[][] getAnnotationsOnDimensions() { >+ return null; > } > > public abstract char[] getLastToken(); >@@ -159,6 +419,15 @@ > && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) { > scope.problemReporter().rawTypeReference(this, type); > } >+ if (this.annotations != null) { >+ switch(scope.kind) { >+ case Scope.BLOCK_SCOPE : >+ case Scope.METHOD_SCOPE : >+ resolveAnnotations((BlockScope) scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ break; >+ } >+ } >+ > if (hasError) { > // do not store the computed type, keep the problem type instead > return type; >@@ -169,6 +438,9 @@ > return true; > } > >+public boolean isParameterizedTypeReference() { >+ return false; >+} > protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) { > scope.problemReporter().deprecatedType(type, this, index); > } >@@ -234,4 +506,10 @@ > public abstract void traverse(ASTVisitor visitor, BlockScope scope); > > public abstract void traverse(ASTVisitor visitor, ClassScope scope); >+ >+protected void resolveAnnotations(BlockScope scope) { >+ if (this.annotations != null) { >+ resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE)); >+ } >+} > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java >index f1d7415..bbf7806 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -156,4 +160,9 @@ > return output; > } > >+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) { >+ // TODO Auto-generated method stub >+ return null; >+ } >+ > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java >index 73b985d..b1b1b0a 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -59,7 +63,7 @@ > boundType = scope.kind == Scope.CLASS_SCOPE > ? this.bound.resolveType((ClassScope)scope) > : this.bound.resolveType((BlockScope)scope, true /* check bounds*/); >- >+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations); > if (boundType == null) { > return null; > } >@@ -89,6 +93,7 @@ > public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { > if (this.bound != null) { > this.bound.resolveType(scope, checkBounds); >+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations); > } > return null; > } >@@ -96,6 +101,7 @@ > public TypeBinding resolveType(ClassScope scope) { > if (this.bound != null) { > this.bound.resolveType(scope); >+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations); > } > return null; > } >@@ -104,7 +110,7 @@ > } > > public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) { >- return internalResolveType(classScope, genericType, rank); >+ return internalResolveType(classScope, genericType, rank); > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >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 0a91ea8..a3e7bc6 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 >@@ -132,4 +132,5 @@ > int ATTR_VARS = 0x4; // LocalVariableTableAttribute > int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute > int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc >+ int ATTR_TYPE_ANNOTATION = 0x20; // annotation type annotation (jsr 308) > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java >new file mode 100644 >index 0000000..75de873 >--- /dev/null >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java >@@ -0,0 +1,64 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.compiler.codegen; >+ >+import org.eclipse.jdt.internal.compiler.ast.Annotation; >+import org.eclipse.jdt.internal.compiler.ast.TypeReference; >+import org.eclipse.jdt.internal.compiler.ast.Wildcard; >+import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; >+ >+public class AnnotationContext { >+ public static final int VISIBLE = 0x1; >+ public static final int INVISIBLE = 0x2; >+ public Annotation annotation; >+ public TypeReference typeReference; >+ public int targetType; >+ public int info; >+ public int info2; >+ public int visibility; >+ public Annotation[] primaryAnnotations; >+ public LocalVariableBinding variableBinding; >+ public Annotation[][] annotationsOnDimensions; >+ public Wildcard wildcard; >+ >+ public AnnotationContext( >+ Annotation annotation, >+ TypeReference typeReference, >+ int targetType, >+ Annotation[] primaryAnnotations, >+ int visibility, >+ Annotation[][] annotationsOnDimensions) { >+ this.annotation = annotation; >+ this.typeReference = typeReference; >+ this.targetType = targetType; >+ this.primaryAnnotations = primaryAnnotations; >+ this.visibility = visibility; >+ this.annotationsOnDimensions = annotationsOnDimensions; >+ } >+ >+ public String toString() { >+ return "AnnotationContext [annotation=" //$NON-NLS-1$ >+ + this.annotation >+ + ", typeReference=" //$NON-NLS-1$ >+ + this.typeReference >+ + ", targetType=" //$NON-NLS-1$ >+ + this.targetType >+ + ", info =" //$NON-NLS-1$ >+ + this.info >+ + ", boundIndex=" //$NON-NLS-1$ >+ + this.info2 >+ + "]"; //$NON-NLS-1$ >+ } >+} >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java >new file mode 100644 >index 0000000..ad66617 >--- /dev/null >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java >@@ -0,0 +1,54 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.compiler.codegen; >+ >+public interface AnnotationTargetTypeConstants { >+ int METHOD_RECEIVER = 0x06; >+ int METHOD_RECEIVER_GENERIC_OR_ARRAY = 0x07; >+ int METHOD_RETURN_TYPE = 0x0A; >+ int METHOD_RETURN_TYPE_GENERIC_OR_ARRAY = 0x0B; >+ int METHOD_PARAMETER = 0x0C; >+ int METHOD_PARAMETER_GENERIC_OR_ARRAY = 0x0D; >+ int FIELD = 0x0E; >+ int FIELD_GENERIC_OR_ARRAY = 0x0F; >+ int CLASS_TYPE_PARAMETER_BOUND = 0x10; >+ int CLASS_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x11; >+ int METHOD_TYPE_PARAMETER_BOUND = 0x12; >+ int METHOD_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x13; >+ int CLASS_EXTENDS_IMPLEMENTS = 0x14; >+ int CLASS_EXTENDS_IMPLEMENTS_GENERIC_OR_ARRAY = 0x15; >+ int THROWS = 0x16; >+ int THROWS_GENERIC_OR_ARRAY = 0x17; >+ int WILDCARD_BOUND = 0x1C; >+ int WILDCARD_BOUND_GENERIC_OR_ARRAY = 0x1D; >+ int METHOD_TYPE_PARAMETER = 0x20; >+ int METHOD_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x21; >+ int CLASS_TYPE_PARAMETER = 0x22; >+ int CLASS_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x23; >+ int TYPE_CAST = 0x00; >+ int TYPE_CAST_GENERIC_OR_ARRAY = 0x01; >+ int TYPE_INSTANCEOF = 0x02; >+ int TYPE_INSTANCEOF_GENERIC_OR_ARRAY = 0x03; >+ int OBJECT_CREATION = 0x04; >+ int OBJECT_CREATION_GENERIC_OR_ARRAY = 0x05; >+ int LOCAL_VARIABLE = 0x08; >+ int LOCAL_VARIABLE_GENERIC_OR_ARRAY = 0x09; >+ int TYPE_ARGUMENT_CONSTRUCTOR_CALL = 0x18; >+ int TYPE_ARGUMENT_CONSTRUCTOR_CALL_GENERIC_OR_ARRAY = 0x19; >+ int TYPE_ARGUMENT_METHOD_CALL = 0x1A; >+ int TYPE_ARGUMENT_METHOD_CALL_GENERIC_OR_ARRAY = 0x1B; >+ int CLASS_LITERAL = 0x1E; >+ int CLASS_LITERAL_GENERIC_OR_ARRAY = 0x1F; >+} >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 cd163a2..8d0573d 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contribution for >@@ -32,6 +36,8 @@ > public static final int GENERIC_TYPE = TYPE | ASTNode.Bit12; > public static final int TYPE_PARAMETER = TYPE | ASTNode.Bit13; > public static final int INTERSECTION_TYPE = TYPE | ASTNode.Bit14; >+ // jsr 308 >+ public static final int TYPE_USE = TYPE | ASTNode.Bit15; > > // Shared binding collections > public static final TypeBinding[] NO_TYPES = new TypeBinding[0]; >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 22b5da1..53842d8 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 >@@ -13,9 +13,12 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+ >+import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.*; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.CodeStream; >+import org.eclipse.jdt.internal.compiler.codegen.ConstantPool; > import org.eclipse.jdt.internal.compiler.flow.FlowInfo; > import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo; > import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; >@@ -324,13 +327,35 @@ > this.isStatic = method.binding.isStatic(); > > Argument[] argTypes = method.arguments; >+ > int argLength = argTypes == null ? 0 : argTypes.length; >- if (argLength > 0 && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { >- if (argTypes[--argLength].isVarArgs()) >+ long sourceLevel = compilerOptions().sourceLevel; >+ if (argLength > 0 && sourceLevel >= ClassFileConstants.JDK1_5) { >+ Argument argument = argTypes[--argLength]; >+ if (argument.isVarArgs()) > method.binding.modifiers |= ClassFileConstants.AccVarargs; >+ if (CharOperation.equals(argument.name, ConstantPool.This)) { >+ if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) { >+ problemReporter().illegalThis(argument, method, sourceLevel); >+ } >+ if (argument.annotations != null) { >+ method.receiverAnnotations = argument.annotations; >+ method.bits |= ASTNode.HasTypeAnnotations; >+ } >+ } > while (--argLength >= 0) { >- if (argTypes[argLength].isVarArgs()) >- problemReporter().illegalVararg(argTypes[argLength], method); >+ argument = argTypes[argLength]; >+ if (argument.isVarArgs()) >+ problemReporter().illegalVararg(argument, method); >+ if (CharOperation.equals(argument.name, ConstantPool.This)) { >+ if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) { >+ problemReporter().illegalThis(argument, method, sourceLevel); >+ } >+ if (argument.annotations != null) { >+ method.receiverAnnotations = argument.annotations; >+ method.bits |= ASTNode.HasTypeAnnotations; >+ } >+ } > } > } > >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 25fee09..865ae08 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contribution for bug 186342 [compiler][null] Using annotations for null checking >@@ -783,6 +787,25 @@ > parameterBinding.fPackage = unitPackage; > typeParameter.binding = parameterBinding; > >+ if ((typeParameter.bits & ASTNode.HasTypeAnnotations) != 0) { >+ switch(declaringElement.kind()) { >+ case Binding.METHOD : >+ MethodBinding methodBinding = (MethodBinding) declaringElement; >+ AbstractMethodDeclaration sourceMethod = methodBinding.sourceMethod(); >+ if (sourceMethod != null) { >+ sourceMethod.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations); >+ } >+ break; >+ case Binding.TYPE : >+ if (declaringElement instanceof SourceTypeBinding) { >+ SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) declaringElement; >+ TypeDeclaration typeDeclaration = sourceTypeBinding.scope.referenceContext; >+ if (typeDeclaration != null) { >+ typeDeclaration.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations); >+ } >+ } >+ } >+ } > // detect duplicates, but keep each variable to reduce secondary errors with instantiating this generic type (assume number of variables is correct) > for (int j = 0; j < count; j++) { > TypeVariableBinding knownVar = typeVariableBindings[j]; >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java >index 21b1c11..ccc0064 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contribution for bug 186342 - [compiler][null] Using annotations for null checking >@@ -109,11 +113,14 @@ > long AnnotationForLocalVariable = ASTNode.Bit42L; > long AnnotationForAnnotationType = ASTNode.Bit43L; > long AnnotationForPackage = ASTNode.Bit44L; >+ long AnnotationForTypeUse = ASTNode.Bit54L; >+ long AnnotationForTypeParameter = ASTNode.Bit55L; > long AnnotationTargetMASK = AnnotationTarget > | AnnotationForType | AnnotationForField > | AnnotationForMethod | AnnotationForParameter > | AnnotationForConstructor | AnnotationForLocalVariable >- | AnnotationForAnnotationType | AnnotationForPackage; >+ | AnnotationForAnnotationType | AnnotationForPackage >+ | AnnotationForTypeUse | AnnotationForTypeParameter; > // 2-bits for retention (should check (tagBits & RetentionMask) == RuntimeRetention > long AnnotationSourceRetention = ASTNode.Bit45L; > long AnnotationClassRetention = ASTNode.Bit46L; >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 95ebdc3..67e770e 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 >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Stephan Herrmann - Contributions for >@@ -80,6 +84,10 @@ > char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray(); //$NON-NLS-1$ > char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray(); //$NON-NLS-1$ > char[] UPPER_PACKAGE = "PACKAGE".toCharArray(); //$NON-NLS-1$ >+ >+ // jsr308 >+ char[] TYPE_USE_TARGET = "TYPE_USE".toCharArray(); //$NON-NLS-1$ >+ char[] TYPE_PARAMETER_TARGET = "TYPE_PARAMETER".toCharArray(); //$NON-NLS-1$ > > // Constant compound names > char[][] JAVA_LANG = {JAVA, LANG}; >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 2bbfc3c..0080746 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 >@@ -31,6 +31,7 @@ > import org.eclipse.jdt.internal.compiler.CompilationResult; > import org.eclipse.jdt.internal.compiler.ast.*; > 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.ReferenceContext; >@@ -71,6 +72,9 @@ > //expression stack > protected final static int ExpressionStackIncrement = 100; > >+ // annotation stack >+ protected final static int TypeAnnotationStackIncrement = 100; >+ > protected final static int GenericsStackIncrement = 10; > > private final static String FILEPREFIX = "parser"; //$NON-NLS-1$ >@@ -788,7 +792,25 @@ > protected int[] expressionLengthStack; > protected int expressionPtr; > protected Expression[] expressionStack = new Expression[ExpressionStackIncrement]; >+ protected int unattachedAnnotationPtr; // used for figuring out whether some set of annotations are annotating a dimension or not. > public int firstToken ; // handle for multiple parsing goals >+ >+ /* jsr308 -- Type annotation management, we now maintain type annotations in a separate stack >+ as otherwise they get interspersed with other expressions and some of the code is not prepared >+ to handle such interleaving and will look ugly if changed. >+ >+ See consumeArrayCreationExpressionWithoutInitializer for example. >+ >+ See that annotations gets pushed into expression stack the moment an annotation is discovered and >+ get moved to the new type annotations stack only later when the annotation is recognized to be a >+ type annotation. Where ambiguities exist (i.e 1.7 annotation occurs in a place sanctioned for an >+ 1.5 type annotation, the annotation continues to stay in the expression stack, but in these case >+ interleaving is not an issue. >+ */ >+ protected int typeAnnotationPtr; >+ protected int typeAnnotationLengthPtr; >+ protected Annotation [] typeAnnotationStack = new Annotation[TypeAnnotationStackIncrement]; >+ protected int [] typeAnnotationLengthStack; > // generics management > protected int genericsIdentifiersLengthPtr; > protected int[] genericsIdentifiersLengthStack = new int[GenericsStackIncrement]; >@@ -884,6 +906,7 @@ > this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8; > this.astLengthStack = new int[50]; > this.expressionLengthStack = new int[30]; >+ this.typeAnnotationLengthStack = new int[30]; > this.intStack = new int[50]; > this.identifierStack = new char[30][]; > this.identifierLengthStack = new int[30]; >@@ -1232,6 +1255,7 @@ > } > } > protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) { >+ Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim); > int nameSize = this.identifierLengthStack[this.identifierLengthPtr]; > int tokensSize = nameSize; > if (rightSide instanceof ParameterizedSingleTypeReference) { >@@ -1287,7 +1311,19 @@ > typeArguments[nameSize - 1] = currentTypeArguments; > } > this.identifierLengthPtr--; >- return new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions); >+ ParameterizedQualifiedTypeReference typeRef = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions); >+ int length; >+ if (this.typeAnnotationLengthPtr >= 0 && (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ typeRef.annotations = new Annotation[length], >+ 0, >+ length); >+ typeRef.sourceStart = typeRef.annotations[0].sourceStart; >+ typeRef.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return typeRef; > } > protected void concatExpressionLists() { > this.expressionLengthStack[--this.expressionLengthPtr]++; >@@ -1630,8 +1666,6 @@ > this.expressionLengthPtr -- ; > arrayAllocation.initializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--]; > >- arrayAllocation.type = getTypeReference(0); >- arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage > length = (this.expressionLengthStack[this.expressionLengthPtr--]); > this.expressionPtr -= length ; > System.arraycopy( >@@ -1640,6 +1674,14 @@ > arrayAllocation.dimensions = new Expression[length], > 0, > length); >+ Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length); >+ arrayAllocation.annotationsOnDimensions = annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ arrayAllocation.bits |= ASTNode.HasTypeAnnotations; >+ } >+ arrayAllocation.type = getTypeReference(0); >+ arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage >+ > arrayAllocation.sourceStart = this.intStack[this.intPtr--]; > if (arrayAllocation.initializer == null) { > arrayAllocation.sourceEnd = this.endStatementPosition; >@@ -1654,8 +1696,6 @@ > > int length; > ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression(); >- arrayAllocation.type = getTypeReference(0); >- arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage > length = (this.expressionLengthStack[this.expressionLengthPtr--]); > this.expressionPtr -= length ; > System.arraycopy( >@@ -1664,6 +1704,13 @@ > arrayAllocation.dimensions = new Expression[length], > 0, > length); >+ Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length); >+ arrayAllocation.annotationsOnDimensions = annotationsOnDimensions; >+ if (annotationsOnDimensions != null) { >+ arrayAllocation.bits |= ASTNode.HasTypeAnnotations; >+ } >+ arrayAllocation.type = getTypeReference(0); >+ arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage > arrayAllocation.sourceStart = this.intStack[this.intPtr--]; > if (arrayAllocation.initializer == null) { > arrayAllocation.sourceEnd = this.endStatementPosition; >@@ -2059,7 +2106,7 @@ > pushOnAstStack(caseStatement); > } > protected void consumeCastExpressionLL1() { >- //CastExpression ::= '(' Expression ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus >+ //CastExpression ::= '(' Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus > // Expression is used in order to make the grammar LL1 > > //optimize push/pop >@@ -2074,6 +2121,44 @@ > this.expressionLengthPtr -- ; > updateSourcePosition(cast); > cast.sourceEnd=exp.sourceEnd; >+} >+protected void consumeCastExpressionLL1WithTypeAnnotations() { >+ // CastExpression ::= '(' Modifiers Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus >+ // Expression is used in order to make the grammar LL1 >+ >+ //optimize push/pop >+ >+ // pop the expression >+ Expression expression = this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ // pop the type reference >+ TypeReference typeReference = (TypeReference) this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.sourceStart = typeReferenceSourceStart; >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ } >+ Expression cast; >+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference)); >+ // pop the two positions for left and right parenthesis >+ updateSourcePosition(cast); >+ cast.sourceEnd = expression.sourceEnd; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); > } > protected void consumeCastExpressionWithGenericsArray() { > // CastExpression ::= PushLPAREN Name TypeArguments Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >@@ -2092,6 +2177,44 @@ > castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; > cast.sourceEnd = exp.sourceEnd; > } >+protected void consumeCastExpressionWithGenericsArrayWithTypeAnnotations() { >+ // CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus >+ int end = this.intStack[this.intPtr--]; >+ int dim = this.intStack[this.intPtr--]; >+ >+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); >+ TypeReference typeReference = getTypeReference(dim); >+ >+ // pop expression >+ Expression expression = this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ Expression cast; >+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference)); >+ this.intPtr--; >+ typeReference.sourceEnd = end - 1; >+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; >+ cast.sourceEnd = expression.sourceEnd; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); >+} > protected void consumeCastExpressionWithNameArray() { > // CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus > >@@ -2109,6 +2232,45 @@ > castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; > cast.sourceEnd = exp.sourceEnd; > } >+protected void consumeCastExpressionWithNameArrayWithTypeAnnotations() { >+ // CastExpression ::= PushLPAREN Modifiers Name Dims PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus >+ >+ int end = this.intStack[this.intPtr--]; >+ >+ // handle type arguments >+ pushOnGenericsLengthStack(0); >+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); >+ >+ // pop expression >+ Expression expression = this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]); >+ >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ Expression cast; >+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference)); >+ typeReference.sourceEnd = end - 1; >+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; >+ cast.sourceEnd = expression.sourceEnd; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); >+} > protected void consumeCastExpressionWithPrimitiveType() { > // CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression > >@@ -2125,6 +2287,44 @@ > castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; > cast.sourceEnd = exp.sourceEnd; > } >+protected void consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations() { >+ // CastExpression ::= PushLPAREN Modifiers PrimitiveType Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpression >+ >+ //this.intStack : posOfLeftParen dim posOfRightParen >+ int end = this.intStack[this.intPtr--]; >+ >+ // pop expression >+ Expression expression = this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ >+ TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]); >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ >+ Expression cast; >+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference)); >+ >+ typeReference.sourceEnd = end - 1; >+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; >+ cast.sourceEnd = expression.sourceEnd; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); >+} > protected void consumeCastExpressionWithQualifiedGenericsArray() { > // CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus > Expression exp; >@@ -2133,7 +2333,7 @@ > int end = this.intStack[this.intPtr--]; > > int dim = this.intStack[this.intPtr--]; >- TypeReference rightSide = getTypeReference(0); >+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated. > > ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide(rightSide, dim); > this.intPtr--; >@@ -2141,6 +2341,44 @@ > castType.sourceEnd = end - 1; > castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; > cast.sourceEnd = exp.sourceEnd; >+} >+protected void consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations() { >+ // CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >+ int end = this.intStack[this.intPtr--]; >+ >+ int dim = this.intStack[this.intPtr--]; >+ // pop expression >+ Expression expression = this.expressionStack[this.expressionPtr--]; >+ this.expressionLengthPtr--; >+ >+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated. >+ >+ ParameterizedQualifiedTypeReference typeReference = computeQualifiedGenericsFromRightSide(rightSide, dim); >+ this.intPtr--; >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ Expression cast; >+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference)); >+ typeReference.sourceEnd = end - 1; >+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1; >+ cast.sourceEnd = expression.sourceEnd; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); > } > protected void consumeCatches() { > // Catches ::= Catches CatchClause >@@ -2334,6 +2572,7 @@ > TypeReference superClass = getTypeReference(0); > // There is a class declaration on the top of stack > TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; >+ typeDecl.bits |= (superClass.bits & ASTNode.HasTypeAnnotations); > typeDecl.superclass = superClass; > superClass.bits |= ASTNode.IsSuperType; > typeDecl.bodyStart = typeDecl.superclass.sourceEnd + 1; >@@ -2355,8 +2594,11 @@ > typeDecl.superInterfaces = new TypeReference[length], > 0, > length); >- for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) { >- typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType; >+ TypeReference[] superinterfaces = typeDecl.superInterfaces; >+ for (int i = 0, max = superinterfaces.length; i < max; i++) { >+ TypeReference typeReference = superinterfaces[i]; >+ typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations); >+ typeReference.bits |= ASTNode.IsSuperType; > } > typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1; > this.listLength = 0; // reset after having read super-interfaces >@@ -2690,9 +2932,11 @@ > } > } > >- if (!this.diet || insideFieldInitializer){ >- // add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere. >- constructorCall = SuperReference.implicitSuperConstructorCall(); >+ if (!this.options.ignoreMethodBodies) { >+ if (!this.diet || insideFieldInitializer){ >+ // add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere. >+ constructorCall = SuperReference.implicitSuperConstructorCall(); >+ } > } > } > >@@ -2888,6 +3132,7 @@ > } > protected void consumeDimWithOrWithOutExpr() { > // DimWithOrWithOutExpr ::= '[' ']' >+ // DimWithOrWithOutExpr ::= OneOrMoreAnnotations '[' ']' > pushOnExpressionStack(null); > > if(this.currentElement != null && this.currentToken == TokenNameLBRACE) { >@@ -3097,6 +3342,7 @@ > localDeclaration.annotations = new Annotation[length], > 0, > length); >+ localDeclaration.bits |= ASTNode.HasTypeAnnotations; > } > if (hasModifiers) { > localDeclaration.declarationSourceStart = declarationSourceStart; >@@ -3105,6 +3351,7 @@ > localDeclaration.declarationSourceStart = type.sourceStart; > } > localDeclaration.type = type; >+ localDeclaration.bits |= (type.bits & ASTNode.HasTypeAnnotations); > > ForeachStatement iteratorForStatement = > new ForeachStatement( >@@ -3195,6 +3442,8 @@ > char[] identifierName = this.identifierStack[this.identifierPtr]; > long namePosition = this.identifierPositionStack[this.identifierPtr]; > int extendedDimension = this.intStack[this.intPtr--]; >+ // pop any annotations on extended dimensions now, so they don't pollute the base dimensions. >+ Annotation [][] annotationsOnExtendedDimensions = extendedDimension == 0 ? null : getAnnotationsOnDimensions(extendedDimension); > AbstractVariableDeclaration declaration; > // create the ast node > boolean isLocalDeclaration = this.nestedMethod[this.nestedType] != 0; >@@ -3227,6 +3476,7 @@ > declaration.annotations = new Annotation[length], > 0, > length); >+ declaration.bits |= ASTNode.HasTypeAnnotations; > } > type = getTypeReference(typeDim = this.intStack[this.intPtr--]); // type dimension > if (declaration.declarationSourceStart == -1) { >@@ -3248,6 +3498,7 @@ > declaration.annotations = new Annotation[length], > 0, > length); >+ declaration.bits |= ASTNode.HasTypeAnnotations; > } > // Store javadoc only on first declaration as it is the same for all ones > FieldDeclaration fieldDeclaration = (FieldDeclaration) declaration; >@@ -3265,14 +3516,22 @@ > if (annotations != null) { > final int annotationsLength = annotations.length; > System.arraycopy(annotations, 0, declaration.annotations = new Annotation[annotationsLength], 0, annotationsLength); >+ declaration.bits |= ASTNode.HasTypeAnnotations; > } > } > > if (extendedDimension == 0) { > declaration.type = type; >+ declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations); > } else { > int dimension = typeDim + extendedDimension; >- declaration.type = copyDims(type, dimension); >+ Annotation [][] annotationsOnAllDimensions = null; >+ Annotation[][] annotationsOnDimensions = type.getAnnotationsOnDimensions(); >+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(typeDim, annotationsOnDimensions, extendedDimension, annotationsOnExtendedDimensions); >+ declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations); >+ } >+ declaration.type = copyDims(type, dimension, annotationsOnAllDimensions); > } > this.variablesCounter[this.nestedType]++; > pushOnAstStack(declaration); >@@ -3298,6 +3557,30 @@ > } > this.lastIgnoredToken = -1; > } >+} >+protected Annotation[][] getMergedAnnotationsOnDimensions(int dims, Annotation[][] annotationsOnDimensions, >+ int extendedDims, Annotation[][] annotationsOnExtendedDimensions) { >+ >+if (annotationsOnDimensions == null && annotationsOnExtendedDimensions == null) >+return null; >+ >+Annotation [][] mergedAnnotations = new Annotation[dims + extendedDims][]; >+for (int i = 0; i < dims; i++) { >+if (annotationsOnDimensions != null) { >+mergedAnnotations[i] = annotationsOnDimensions[i]; >+} else { >+mergedAnnotations[i] = null; >+} >+} >+for (int i = dims, j = 0; i < dims + extendedDims; i++, j++) { >+if (annotationsOnExtendedDimensions != null) { >+mergedAnnotations[i] = annotationsOnExtendedDimensions[j]; >+} else { >+mergedAnnotations[i] = null; >+} >+} >+ >+return mergedAnnotations; > } > protected void consumeEnumBodyNoConstants() { > // nothing to do >@@ -3409,6 +3692,7 @@ > enumConstant.annotations = new Annotation[length], > 0, > length); >+ enumConstant.bits |= ASTNode.HasTypeAnnotations; > } > pushOnAstStack(enumConstant); > if (this.currentElement != null){ >@@ -3918,8 +4202,7 @@ > this.identifierStack : > this.intStack : > */ >- >- this.identifierLengthPtr--; >+ this.identifierLengthPtr--; > char[] identifierName = this.identifierStack[this.identifierPtr]; > long namePositions = this.identifierPositionStack[this.identifierPtr--]; > int extendedDimensions = this.intStack[this.intPtr--]; >@@ -3928,10 +4211,32 @@ > endOfEllipsis = this.intStack[this.intPtr--]; > } > int firstDimensions = this.intStack[this.intPtr--]; >- final int typeDimensions = firstDimensions + extendedDimensions; >- TypeReference type = getTypeReference(typeDimensions); >+ TypeReference type = getUnannotatedTypeReference(extendedDimensions); >+ Annotation [] varArgsAnnotations = null; >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ varArgsAnnotations = new Annotation[length], >+ 0, >+ length); >+ } >+ final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0); >+ >+ if (typeDimensions != extendedDimensions) { >+ // jsr308 type annotations management >+ Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions); >+ Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null); >+ } >+ type = copyDims(type, typeDimensions, annotationsOnAllDimensions); >+ type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition; >+ } > if (isVarArgs) { >- type = copyDims(type, typeDimensions + 1); > if (extendedDimensions == 0) { > type.sourceEnd = endOfEllipsis; > } >@@ -3946,8 +4251,8 @@ > type, > this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers > arg.declarationSourceStart = modifierPositions; >+ arg.bits |= (type.bits & ASTNode.HasTypeAnnotations); > // consume annotations >- int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { > System.arraycopy( > this.expressionStack, >@@ -3955,6 +4260,7 @@ > arg.annotations = new Annotation[length], > 0, > length); >+ arg.bits |= ASTNode.HasTypeAnnotations; > RecoveredType currentRecoveryType = this.currentRecoveryType(); > if (currentRecoveryType != null) > currentRecoveryType.annotationsConsumed(arg.annotations); >@@ -3974,7 +4280,37 @@ > extendedDimensions > 0) { > problemReporter().illegalExtendedDimensions(arg); > } >+ } else { >+ // The grammar allows trailing annotations in FormalParameter as in >+ // "int @NonNull[] @Misplaced parameter" in order to allow for constructs such as >+ // "Object @NonNull[] @Correct ... objects" -- we prune these here. >+ if (varArgsAnnotations != null) { >+ problemReporter().misplacedTypeAnnotations(varArgsAnnotations[0], >+ varArgsAnnotations[varArgsAnnotations.length-1]); >+ } > } >+} >+protected Annotation[][] getAnnotationsOnDimensions(int dimensionsCount) { >+ Annotation [][] dimensionsAnnotations = null; >+ if (dimensionsCount > 0) { >+ for (int i = 0; i < dimensionsCount; i++) { >+ Annotation [] annotations = null; >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ annotations = new Annotation[length], >+ 0, >+ length); >+ if (dimensionsAnnotations == null) { >+ dimensionsAnnotations = new Annotation[dimensionsCount][]; >+ } >+ dimensionsAnnotations[dimensionsCount - i - 1] = annotations; >+ } >+ } >+ } >+ return dimensionsAnnotations; > } > protected void consumeFormalParameterList() { > // FormalParameterList ::= FormalParameterList ',' FormalParameter >@@ -4036,6 +4372,9 @@ > } > protected void consumeInsideCastExpressionWithQualifiedGenerics() { > // InsideCastExpressionWithQualifiedGenerics ::= $empty >+} >+protected void consumeInsideCastExpressionWithAnnotatedQualifiedGenerics() { >+ // InsideCastExpressionWithAnnotatedQualifiedGenerics ::= $empty > } > protected void consumeInstanceOfExpression() { > // RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType >@@ -4133,8 +4472,11 @@ > typeDecl.superInterfaces = new TypeReference[length], > 0, > length); >- for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) { >- typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType; >+ TypeReference[] superinterfaces = typeDecl.superInterfaces; >+ for (int i = 0, max = superinterfaces.length; i < max; i++) { >+ TypeReference typeReference = superinterfaces[i]; >+ typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations); >+ typeReference.bits |= ASTNode.IsSuperType; > } > typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1; > this.listLength = 0; // reset after having read super-interfaces >@@ -4494,8 +4836,10 @@ > if (isNotAbstract) { > //statements > explicitDeclarations = this.realBlockStack[this.realBlockPtr--]; >- if (!this.options.ignoreMethodBodies) { >- if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { >+ if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { >+ if (this.options.ignoreMethodBodies) { >+ this.astPtr -= length; >+ } else { > System.arraycopy( > this.astStack, > (this.astPtr -= length) + 1, >@@ -4503,9 +4847,6 @@ > 0, > length); > } >- } else { >- length = this.astLengthStack[this.astLengthPtr--]; >- this.astPtr -= length; > } > } > >@@ -4598,7 +4939,13 @@ > TypeReference returnType = md.returnType; > md.sourceEnd = this.endPosition; > int dims = returnType.dimensions() + extendedDims; >- md.returnType = copyDims(returnType, dims); >+ Annotation [][] annotationsOnDimensions = returnType.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnExtendedDimensions = getAnnotationsOnDimensions(extendedDims); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(returnType.dimensions(), annotationsOnDimensions, extendedDims, annotationsOnExtendedDimensions); >+ } >+ md.returnType = copyDims(returnType, dims, annotationsOnAllDimensions); > if (this.currentToken == TokenNameLBRACE){ > md.bodyStart = this.endPosition + 1; > } >@@ -4682,7 +5029,9 @@ > long selectorSource = this.identifierPositionStack[this.identifierPtr--]; > this.identifierLengthPtr--; > //type >- md.returnType = getTypeReference(this.intStack[this.intPtr--]); >+ TypeReference returnType = getTypeReference(this.intStack[this.intPtr--]); >+ md.returnType = returnType; >+ md.bits |= (returnType.bits & ASTNode.HasTypeAnnotations); > > // consume type parameters > int length = this.genericsLengthStack[this.genericsLengthPtr--]; >@@ -4908,6 +5257,28 @@ > // Resources ::= Resources ';' Resource > concatNodeLists(); > } >+protected void consumeOneMoreTypeAnnotation() { >+ // OneOrMoreAnnotations ::= OneOrMoreAnnotations Annotation >+ this.expressionLengthPtr --; >+ Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--]; >+ pushOnTypeAnnotationStack(annotation); >+ this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++; >+ if(!this.statementRecoveryActivated && >+ this.options.sourceLevel < ClassFileConstants.JDK1_7 && >+ this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { >+ problemReporter().invalidUsageOfTypeAnnotations(annotation); >+} >+} >+protected void consumePotentialNameArrayType () { >+ >+ // FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray VariableDeclaratorId >+ // FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray '...' VariableDeclaratorId >+ // PotentialNameArray -> $empty >+ // Dimensions including lack of have been pushed appropriately by action attached to DimsoptAnnotsopt >+ pushOnGenericsLengthStack(0); // handle type arguments >+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); >+} >+ > protected void consumeNameArrayType() { > pushOnGenericsLengthStack(0); // handle type arguments > pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); >@@ -4971,9 +5342,21 @@ > } > this.recordStringLiterals = true; > } >-protected void consumeOneDimLoop() { >+protected void consumeOneDimLoop(boolean expressionStackMayHaveAnnotations) { > // OneDimLoop ::= '[' ']' >+ // OneDimOrAnnot -> '[' ']' > this.dimensions++; >+ if (!expressionStackMayHaveAnnotations || this.unattachedAnnotationPtr == -1 ) { >+ pushOnTypeAnnotationLengthStack(0); // no annotations for the current dimension. >+ } else { >+ this.unattachedAnnotationPtr = -1; // Leave type annotation stacks they are. >+ } >+} >+protected void consumeOneDimLoopWithAnnotations() { >+ // OneDimLoop ::= OneOrMoreAnnotations '[' ']' >+ this.dimensions++; >+ // Top of expression stack contains annotations of length specified >+ // by top of expression length stack that apply to this dimension. > } > protected void consumeOnlySynchronized() { > // OnlySynchronized ::= 'synchronized' >@@ -5143,7 +5526,7 @@ > pushOnGenericsLengthStack(0); > > pushOnExpressionStack( >- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--]))); >+ new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--]))); > } > protected void consumePrimaryNoNewArrayName() { > // PrimaryNoNewArray ::= Name '.' 'class' >@@ -5152,7 +5535,7 @@ > // handle type arguments > pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); > pushOnGenericsLengthStack(0); >- TypeReference typeReference = getTypeReference(0); >+ TypeReference typeReference = getUnannotatedTypeReference(0); // TODO (Srikanth) needs fix > > pushOnExpressionStack( > new ClassLiteralAccess(this.intStack[this.intPtr--], typeReference)); >@@ -5162,6 +5545,7 @@ > // handle type arguments > pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); > pushOnGenericsLengthStack(0); >+ pushOnTypeAnnotationLengthStack(0); // javac complains on annotations here. > TypeReference typeReference = getTypeReference(0); > > pushOnExpressionStack( >@@ -5175,7 +5559,7 @@ > // handle type arguments > pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]); > pushOnGenericsLengthStack(0); // handle type arguments >- >+ pushOnTypeAnnotationLengthStack(0); // javac complains on annotations here. > TypeReference typeReference = getTypeReference(0); > > pushOnExpressionStack( >@@ -5188,13 +5572,13 @@ > // PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class' > this.intPtr--; // remove the class start position > pushOnExpressionStack( >- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--]))); >+ new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--]))); > } > protected void consumePrimaryNoNewArrayPrimitiveType() { > // PrimaryNoNewArray ::= PrimitiveType '.' 'class' > this.intPtr--; // remove the class start position > pushOnExpressionStack( >- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(0))); >+ new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(0))); > } > protected void consumePrimaryNoNewArrayThis() { > // PrimaryNoNewArray ::= 'this' >@@ -5325,1820 +5709,2144 @@ > // PushRPAREN ::= ')' > pushOnIntStack(this.rParenPos); > } >+protected void consumeUnannotatedType() { >+ /* We go through some song & dance here to get the type annotations stacks >+ to reflect the fact that this type was unannotated. Using a dummy non-terminal >+ with an empty rhs leads to conflicts in many places :-( >+ */ >+ pushOnTypeAnnotationLengthStack(0); // either done or else made room. >+ int dims = this.intStack[this.intPtr]; >+ if (dims != 0) { >+ System.arraycopy( >+ this.typeAnnotationLengthStack, >+ this.typeAnnotationLengthPtr - dims, >+ this.typeAnnotationLengthStack, >+ this.typeAnnotationLengthPtr - dims + 1, >+ dims); >+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims] = 0; // tag type as unannotated >+ } >+} >+protected void consumeAnnotatedType() { >+ /* We go through some song & dance here to get the type annotations stacks >+ to reflect the fact that this type was unannotated. Using a dummy non-terminal >+ with an empty rhs leads to conflicts in many places :-( >+ */ >+ int dims = this.intStack[this.intPtr]; >+ if (dims != 0) { >+ int counter = 0; >+ for (int i = 0; i < dims; i++) { >+ // we count existing dimensions with annotations >+ counter += this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1 + i]; >+ } >+ System.arraycopy( >+ this.typeAnnotationLengthStack, >+ this.typeAnnotationLengthPtr - dims + 1, >+ this.typeAnnotationLengthStack, >+ this.typeAnnotationLengthPtr - dims + 2, >+ dims); >+ int length = this.expressionLengthStack[this.expressionLengthPtr--]; >+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1] = length; >+ int typeAnnotationStackLength = this.typeAnnotationStack.length; >+ if (this.typeAnnotationPtr + counter + length >= typeAnnotationStackLength) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ 0, >+ this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement], >+ 0, >+ typeAnnotationStackLength); >+ } >+ System.arraycopy( >+ this.typeAnnotationStack, >+ this.typeAnnotationPtr - counter + 1, >+ this.typeAnnotationStack, >+ this.typeAnnotationPtr - counter + 1 + length, >+ counter); >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ this.typeAnnotationStack, >+ this.typeAnnotationPtr - counter + 1, >+ length); >+ this.typeAnnotationPtr += length; >+ this.typeAnnotationLengthPtr++; >+ } else { >+ int length = this.expressionLengthStack[this.expressionLengthPtr--]; >+ int typeAnnotationStackLength = this.typeAnnotationStack.length; >+ if (this.typeAnnotationPtr + length >= typeAnnotationStackLength) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ 0, >+ this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement], >+ 0, >+ typeAnnotationStackLength); >+ } >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ this.typeAnnotationStack, >+ this.typeAnnotationPtr + 1, >+ length); >+ this.typeAnnotationPtr += length; >+ pushOnTypeAnnotationLengthStack(length); >+ } >+// if (this.modifiers != ClassFileConstants.AccDefault) { >+// problemReporter().invalidLocationForModifiers(typeReference); >+// } >+// resetModifiers(); >+} >+protected void consumeTypeAnnotation (boolean markAsUnattached) { >+ if(!this.statementRecoveryActivated && >+ this.options.sourceLevel < ClassFileConstants.JDK1_7 && >+ this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { >+ problemReporter().invalidUsageOfTypeAnnotations((Annotation) this.expressionStack[this.expressionPtr]); >+ } >+ this.expressionLengthPtr --; >+ Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--]; >+ pushOnTypeAnnotationStack(annotation); >+ if (markAsUnattached) { >+ if (this.unattachedAnnotationPtr == -1) { >+ this.unattachedAnnotationPtr = this.typeAnnotationPtr; >+ } else { >+ this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++; >+ } >+ } >+} >+protected void consumeDimsWithTrailingAnnotsopt() { >+ // DimsoptAnnotsopt -> DimsAnnotLoop >+ pushOnIntStack(this.dimensions); >+ this.dimensions = 0; >+ if (this.unattachedAnnotationPtr == -1) { >+ pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg) >+ } else { >+ this.unattachedAnnotationPtr = -1; // reset this and leave the annotation stacks as they are. >+ } >+} >+protected void consumeZeroTypeAnnotations(boolean shouldPush) { >+ if (shouldPush) { >+ pushOnTypeAnnotationLengthStack(0); >+ } else { >+ this.typeAnnotationLengthPtr --; // pop the 0 from the length stack >+ } >+} >+protected void consumeEmptyDimsoptAnnotsopt() { >+ // DimsoptAnnotsopt ::= $empty >+ pushOnIntStack(0); // signal a non array >+ pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg) >+} >+protected void consumeRightParenForUnannotatedTypeCast() { >+ consumeUnannotatedType(); >+ // PushRPAREN ::= ')' >+ pushOnIntStack(this.rParenPos); >+} >+protected void consumeRightParenForNameUnannotatedTypeCast() { >+ pushOnIntStack(0); // signal a non array >+ consumeUnannotatedType(); >+ // remove the fake dimension >+ this.intPtr--; >+ // PushRPAREN ::= ')' >+ pushOnIntStack(this.rParenPos); >+} >+protected void consumeRightParenForAnnotatedTypeCast() { >+ consumeUnannotatedType(); >+ // PushRPAREN ::= ')' >+ pushOnIntStack(this.rParenPos); >+} >+protected void consumeRightParenForNameAndAnnotatedTypeCast() { >+ // push a zero for dimensions >+ pushOnIntStack(0); >+ consumeUnannotatedType(); >+ // remove the fake dimension >+ this.intPtr--; >+ // PushRPAREN ::= ')' >+ pushOnIntStack(this.rParenPos); >+} > // This method is part of an automatic generation : do NOT edit-modify > protected void consumeRule(int act) { > switch ( act ) { >- case 30 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$ >+ case 32 : if (DEBUG) { System.out.println("Type ::= TypeInternal"); } //$NON-NLS-1$ >+ consumeUnannotatedType(); >+ break; >+ >+ case 34 : if (DEBUG) { System.out.println("Type0 ::= TypeInternal"); } //$NON-NLS-1$ >+ consumeUnannotatedType(); >+ break; >+ >+ case 35 : if (DEBUG) { System.out.println("TypeInternal ::= PrimitiveType"); } //$NON-NLS-1$ > consumePrimitiveType(); > break; > >- case 44 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$ >- consumeReferenceType(); >+ case 49 : if (DEBUG) { System.out.println("ReferenceType ::= ReferenceType0"); } //$NON-NLS-1$ >+ consumeUnannotatedType(); > break; > >- case 48 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$ >- consumeClassOrInterfaceName(); >+ case 50 : if (DEBUG) { System.out.println("ReferenceType ::= Modifiers ReferenceType0"); } //$NON-NLS-1$ >+ consumeAnnotatedType(); > break; > >- case 49 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$ >- consumeClassOrInterface(); >+ case 51 : if (DEBUG) { System.out.println("ReferenceType0 ::= ClassOrInterfaceType0"); } //$NON-NLS-1$ >+ consumeReferenceType(); > break; > >- case 50 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$ >- consumeGenericType(); >+ case 53 : if (DEBUG) { System.out.println("Annotationsopt ::="); } //$NON-NLS-1$ >+ consumeZeroTypeAnnotations(true); > break; > >- case 51 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$ >+ case 58 : if (DEBUG) { System.out.println("ClassOrInterface ::= ClassOrInterface0"); } //$NON-NLS-1$ >+ consumeZeroTypeAnnotations(true); >+ break; >+ >+ case 59 : if (DEBUG) { System.out.println("ClassOrInterface0 ::= Name"); } //$NON-NLS-1$ >+ consumeClassOrInterfaceName(); >+ break; >+ >+ case 61 : if (DEBUG) { System.out.println("PopZeroTypeAnnotations ::="); } //$NON-NLS-1$ >+ consumeZeroTypeAnnotations(false); >+ break; >+ >+ case 62 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments..."); } //$NON-NLS-1$ >+ consumeGenericType(); >+ break; >+ >+ case 63 : if (DEBUG) { System.out.println("GenericTypeDotName ::= GenericType DOT Name"); } //$NON-NLS-1$ >+ consumeClassOrInterface(); >+ break; >+ >+ case 64 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$ > consumeGenericTypeWithDiamond(); > break; > >- case 52 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$ >- consumeArrayTypeWithTypeArgumentsName(); >- break; >- >- case 53 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$ >+ case 66 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$ > consumePrimitiveArrayType(); > break; > >- case 54 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$ >+ case 67 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$ > consumeNameArrayType(); > break; > >- case 55 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$ >+ case 68 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$ > consumeGenericTypeNameArrayType(); > break; > >- case 56 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$ >+ case 69 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$ > consumeGenericTypeArrayType(); > break; > >- case 61 : 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(); > break; > >- case 62 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$ >+ case 75 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$ > consumeCompilationUnit(); > break; > >- case 63 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$ >+ case 76 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$ > consumeInternalCompilationUnit(); > break; > >- case 64 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ >+ case 77 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ > consumeInternalCompilationUnit(); > break; > >- case 65 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ >+ case 78 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ > consumeInternalCompilationUnitWithTypes(); > break; > >- case 66 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ >+ case 79 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$ > consumeInternalCompilationUnitWithTypes(); > break; > >- case 67 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ >+ case 80 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ > consumeInternalCompilationUnit(); > break; > >- case 68 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$ >+ case 81 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$ > consumeInternalCompilationUnitWithTypes(); > break; > >- case 69 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ >+ case 82 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ > consumeInternalCompilationUnitWithTypes(); > break; > >- case 70 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$ >+ case 83 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$ > consumeEmptyInternalCompilationUnit(); > break; > >- case 71 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$ >+ case 84 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$ > consumeReduceImports(); > break; > >- case 72 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$ >+ case 85 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$ > consumeEnterCompilationUnit(); > break; > >- case 88 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ >+ case 104 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ > consumeCatchHeader(); > break; > >- case 90 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$ >+ case 106 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$ > consumeImportDeclarations(); > break; > >- case 92 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$ >+ case 108 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$ > consumeTypeDeclarations(); > break; > >- case 93 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$ >+ case 109 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$ > consumePackageDeclaration(); > break; > >- case 94 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$ >+ case 110 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$ > consumePackageDeclarationNameWithModifiers(); > break; > >- case 95 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$ >- consumePackageDeclarationName(); >+ case 111 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$ >+ consumePackageDeclarationName(); > break; > >- case 96 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$ >+ case 112 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$ > consumePackageComment(); > break; > >- case 101 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$ >+ case 117 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$ > consumeImportDeclaration(); > break; > >- case 102 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name"); } //$NON-NLS-1$ >+ case 118 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name"); } //$NON-NLS-1$ > consumeSingleTypeImportDeclarationName(); > break; > >- case 103 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ >+ case 119 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ > consumeImportDeclaration(); > break; > >- case 104 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$ >+ case 120 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$ > consumeTypeImportOnDemandDeclarationName(); > break; > >- case 107 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 123 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ > consumeEmptyTypeDeclaration(); > break; > >- case 111 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$ >+ case 127 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$ > consumeModifiers2(); > break; > >- case 123 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$ >+ case 139 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$ > consumeAnnotationAsModifier(); > break; > >- case 124 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$ >+ case 140 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$ > consumeClassDeclaration(); > break; > >- case 125 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$ >+ case 141 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$ > consumeClassHeader(); > break; > >- case 126 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$ >+ case 142 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$ > consumeTypeHeaderNameWithTypeParameters(); > break; > >- case 128 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$ >+ case 144 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$ > consumeClassHeaderName1(); > break; > >- case 129 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$ >+ case 145 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$ > consumeClassHeaderExtends(); > break; > >- case 130 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$ >+ case 146 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$ > consumeClassHeaderImplements(); > break; > >- case 132 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$ >+ case 148 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$ > consumeInterfaceTypeList(); > break; > >- case 133 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$ >+ case 149 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$ > consumeInterfaceType(); > break; > >- case 136 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$ >+ case 152 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$ > consumeClassBodyDeclarations(); > break; > >- case 140 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$ >+ case 156 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$ > consumeClassBodyDeclaration(); > break; > >- case 141 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$ >+ case 157 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$ > consumeDiet(); > break; > >- case 142 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$ >+ case 158 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$ > consumeClassBodyDeclaration(); > break; > >- case 143 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$ >+ case 159 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$ > consumeCreateInitializer(); > break; > >- case 150 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 166 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ > consumeEmptyTypeDeclaration(); > break; > >- case 153 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$ >+ case 169 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type0..."); } //$NON-NLS-1$ > consumeFieldDeclaration(); > break; > >- case 155 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$ >+ case 171 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$ > consumeVariableDeclarators(); > break; > >- case 158 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$ >+ case 174 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$ > consumeEnterVariable(); > break; > >- case 159 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$ >+ case 175 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$ > consumeExitVariableWithInitialization(); > break; > >- case 160 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$ >+ case 176 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$ > consumeExitVariableWithoutInitialization(); > break; > >- case 161 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$ >+ case 177 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$ > consumeForceNoDiet(); > break; > >- case 162 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$ >+ case 178 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$ > consumeRestoreDiet(); > break; > >- case 167 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ >+ case 179 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$ >+ consumeExplicitThisParameter(); >+ break; >+ >+ case 185 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ > // set to true to consume a method with a body > consumeMethodDeclaration(true); > break; > >- case 168 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$ >+ case 186 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$ > // set to false to consume a method without body > consumeMethodDeclaration(false); > break; > >- case 169 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$ >+ case 187 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$ > consumeMethodHeader(); > break; > >- case 170 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$ >+ case 188 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$ > consumeMethodHeaderNameWithTypeParameters(false); > break; > >- case 171 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$ >+ case 189 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type0 Identifier..."); } //$NON-NLS-1$ > consumeMethodHeaderName(false); > break; > >- case 172 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ >+ case 190 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ > consumeMethodHeaderRightParen(); > break; > >- case 173 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$ >+ case 191 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$ > consumeMethodHeaderExtendedDims(); > break; > >- case 174 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$ >+ case 192 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$ > consumeMethodHeaderThrowsClause(); > break; > >- case 175 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$ >+ case 193 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$ > consumeConstructorHeader(); > break; > >- case 176 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$ >+ case 194 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$ > consumeConstructorHeaderNameWithTypeParameters(); > break; > >- case 177 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$ >+ case 195 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$ > consumeConstructorHeaderName(); > break; > >- case 179 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$ >+ case 197 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$ > consumeFormalParameterList(); > break; > >- case 180 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$ >+ case 198 : if (DEBUG) { System.out.println("PotentialNameArray ::="); } //$NON-NLS-1$ >+ consumePotentialNameArrayType(); >+ break; >+ >+ case 199 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); } //$NON-NLS-1$ > consumeFormalParameter(false); > break; > >- case 181 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type ELLIPSIS..."); } //$NON-NLS-1$ >+ case 200 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); } //$NON-NLS-1$ > consumeFormalParameter(true); > break; > >- case 182 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$ >+ case 201 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); } //$NON-NLS-1$ >+ consumeFormalParameter(false); >+ break; >+ >+ case 202 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); } //$NON-NLS-1$ >+ consumeFormalParameter(true); >+ break; >+ >+ case 203 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); } //$NON-NLS-1$ >+ consumeFormalParameter(false); >+ break; >+ >+ case 204 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); } //$NON-NLS-1$ >+ consumeFormalParameter(true); >+ break; >+ >+ case 205 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); } //$NON-NLS-1$ >+ consumeFormalParameter(false); >+ break; >+ >+ case 206 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); } //$NON-NLS-1$ >+ consumeFormalParameter(true); >+ break; >+ >+ case 207 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$ > consumeCatchFormalParameter(); > break; > >- case 183 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$ >+ case 208 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$ > consumeCatchType(); > break; > >- case 184 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$ >+ case 209 : if (DEBUG) { System.out.println("UnionType ::= TypeInternal"); } //$NON-NLS-1$ > consumeUnionTypeAsClassType(); > break; > >- case 185 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$ >+ case 210 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$ > consumeUnionType(); > break; > >- case 187 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$ >+ case 212 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$ > consumeClassTypeList(); > break; > >- case 188 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$ >+ case 213 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$ > consumeClassTypeElt(); > break; > >- case 189 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$ >+ case 214 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$ > consumeMethodBody(); > break; > >- case 190 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$ >+ case 215 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$ > consumeNestedMethod(); > break; > >- case 191 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$ >+ case 216 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$ > consumeStaticInitializer(); > break; > >- case 192 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$ >+ case 217 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$ > consumeStaticOnly(); > break; > >- case 193 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$ >+ case 218 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$ > consumeConstructorDeclaration() ; > break; > >- case 194 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$ >+ case 219 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$ > consumeInvalidConstructorDeclaration() ; > break; > >- case 195 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$ >+ case 220 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(0, THIS_CALL); > break; > >- case 196 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$ >+ case 221 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL); > break; > >- case 197 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$ >+ case 222 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(0,SUPER_CALL); > break; > >- case 198 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$ >+ case 223 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL); > break; > >- case 199 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$ >+ case 224 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(1, SUPER_CALL); > break; > >- case 200 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ >+ case 225 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL); > break; > >- case 201 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$ >+ case 226 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(2, SUPER_CALL); > break; > >- case 202 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ >+ case 227 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL); > break; > >- case 203 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$ >+ case 228 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(1, THIS_CALL); > break; > >- case 204 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ >+ case 229 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL); > break; > >- case 205 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$ >+ case 230 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$ > consumeExplicitConstructorInvocation(2, THIS_CALL); > break; > >- case 206 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ >+ case 231 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ > consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL); > break; > >- case 207 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$ >+ case 232 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$ > consumeInterfaceDeclaration(); > break; > >- case 208 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$ >+ case 233 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$ > consumeInterfaceHeader(); > break; > >- case 209 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$ >+ case 234 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$ > consumeTypeHeaderNameWithTypeParameters(); > break; > >- case 211 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$ >+ case 236 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$ > consumeInterfaceHeaderName1(); > break; > >- case 212 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$ >+ case 237 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$ > consumeInterfaceHeaderExtends(); > break; > >- case 215 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$ >+ case 240 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$ > consumeInterfaceMemberDeclarations(); > break; > >- case 216 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 241 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ > consumeEmptyTypeDeclaration(); > break; > >- case 217 : if (DEBUG) { System.out.println("PushDefault ::="); } //$NON-NLS-1$ >+ case 242 : if (DEBUG) { System.out.println("PushDefault ::="); } //$NON-NLS-1$ > consumeInterfaceMethodDefault(); > break; > >- case 219 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader default..."); } //$NON-NLS-1$ >+ case 244 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader default..."); } //$NON-NLS-1$ > consumeInterfaceMethodDeclaration(true); > break; > >- case 220 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ >+ case 245 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ > consumeInterfaceMethodDeclaration(false); > break; > >- case 221 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ >+ case 246 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ > consumeInvalidConstructorDeclaration(true); > break; > >- case 222 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ >+ case 247 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ > consumeInvalidConstructorDeclaration(false); > break; > >- case 233 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ >+ case 258 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ > consumePushLeftBrace(); > break; > >- case 234 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ >+ case 259 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ > consumeEmptyArrayInitializer(); > break; > >- case 235 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ >+ case 260 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ > consumeArrayInitializer(); > break; > >- case 236 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ >+ case 261 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ > consumeArrayInitializer(); > break; > >- case 238 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ >+ case 263 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ > consumeVariableInitializers(); > break; > >- case 239 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ >+ case 264 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ > consumeBlock(); > break; > >- case 240 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ >+ case 265 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ > consumeOpenBlock() ; > break; > >- case 242 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ >+ case 267 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ > consumeBlockStatements() ; > break; > >- case 246 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ >+ case 271 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ > consumeInvalidInterfaceDeclaration(); > break; > >- case 247 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ >+ case 272 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ > consumeInvalidAnnotationTypeDeclaration(); > break; > >- case 248 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ >+ case 273 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ > consumeInvalidEnumDeclaration(); > break; > >- case 249 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ >+ case 274 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ > consumeLocalVariableDeclarationStatement(); > break; > >- case 250 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$ >+ case 275 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type0 PushModifiers..."); } //$NON-NLS-1$ > consumeLocalVariableDeclaration(); > break; > >- case 251 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$ >+ case 276 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type0..."); } //$NON-NLS-1$ > consumeLocalVariableDeclaration(); > break; > >- case 252 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ >+ case 277 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ > consumePushModifiers(); > break; > >- case 253 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ >+ case 278 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ > consumePushModifiersForHeader(); > break; > >- case 254 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ >+ case 279 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ > consumePushRealModifiers(); > break; > >- case 281 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 306 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ > consumeEmptyStatement(); > break; > >- case 282 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ >+ case 307 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ > consumeStatementLabel() ; > break; > >- case 283 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ >+ case 308 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ > consumeStatementLabel() ; > break; > >- case 284 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ >- consumeLabel() ; >+ case 309 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ >+ consumeLabel(); > break; > >- case 285 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ >+ case 310 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ > consumeExpressionStatement(); > break; > >- case 294 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ >+ case 319 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ > consumeStatementIfNoElse(); > break; > >- case 295 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ >+ case 320 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ > consumeStatementIfWithElse(); > break; > >- case 296 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ >+ case 321 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ > consumeStatementIfWithElse(); > break; > >- case 297 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ >+ case 322 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ > consumeStatementSwitch() ; > break; > >- case 298 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ >+ case 323 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ > consumeEmptySwitchBlock() ; > break; > >- case 301 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ >+ case 326 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ > consumeSwitchBlock() ; > break; > >- case 303 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ >+ case 328 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ > consumeSwitchBlockStatements() ; > break; > >- case 304 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ >+ case 329 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ > consumeSwitchBlockStatement() ; > break; > >- case 306 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ >+ case 331 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ > consumeSwitchLabels() ; > break; > >- case 307 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$ >+ case 332 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$ > consumeCaseLabel(); > break; > >- case 308 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ >+ case 333 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ > consumeDefaultLabel(); > break; > >- case 309 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ >+ case 334 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ > consumeStatementWhile() ; > break; > >- case 310 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ >+ case 335 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ > consumeStatementWhile() ; > break; > >- case 311 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ >+ case 336 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ > consumeStatementDo() ; > break; > >- case 312 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ >+ case 337 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ > consumeStatementFor() ; > break; > >- case 313 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ >+ case 338 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ > consumeStatementFor() ; > break; > >- case 314 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ >+ case 339 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ > consumeForInit() ; > break; > >- case 318 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ >+ case 343 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ > consumeStatementExpressionList() ; > break; > >- case 319 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ >+ case 344 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ > consumeSimpleAssertStatement() ; > break; > >- case 320 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ >+ case 345 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ > consumeAssertStatement() ; > break; > >- case 321 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ >+ case 346 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ > consumeStatementBreak() ; > break; > >- case 322 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ >+ case 347 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ > consumeStatementBreakWithLabel() ; > break; > >- case 323 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ >+ case 348 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ > consumeStatementContinue() ; > break; > >- case 324 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ >+ case 349 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ > consumeStatementContinueWithLabel() ; > break; > >- case 325 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ >+ case 350 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ > consumeStatementReturn() ; > break; > >- case 326 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ >+ case 351 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ > consumeStatementThrow(); > break; > >- case 327 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ >+ case 352 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ > consumeStatementSynchronized(); > break; > >- case 328 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ >+ case 353 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ > consumeOnlySynchronized(); > break; > >- case 329 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ >+ case 354 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ > consumeStatementTry(false, false); > break; > >- case 330 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ >+ case 355 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ > consumeStatementTry(true, false); > break; > >- case 331 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ >+ case 356 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ > consumeStatementTry(false, true); > break; > >- case 332 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ >+ case 357 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ > consumeStatementTry(true, true); > break; > >- case 333 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ >+ case 358 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ > consumeResourceSpecification(); > break; > >- case 334 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ >+ case 359 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ > consumeResourceOptionalTrailingSemiColon(false); > break; > >- case 335 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 360 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ > consumeResourceOptionalTrailingSemiColon(true); > break; > >- case 336 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ >+ case 361 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ > consumeSingleResource(); > break; > >- case 337 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ >+ case 362 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ > consumeMultipleResources(); > break; > >- case 338 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ >+ case 363 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ > consumeResourceOptionalTrailingSemiColon(true); > break; > >- case 339 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$ >+ case 364 : if (DEBUG) { System.out.println("Resource ::= TypeInternal PushModifiers..."); } //$NON-NLS-1$ > consumeResourceAsLocalVariableDeclaration(); > break; > >- case 340 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$ >+ case 365 : if (DEBUG) { System.out.println("Resource ::= Modifiers TypeInternal PushRealModifiers..."); } //$NON-NLS-1$ > consumeResourceAsLocalVariableDeclaration(); > break; > >- case 342 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ >+ case 367 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ > consumeExitTryBlock(); > break; > >- case 344 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ >+ case 369 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ > consumeCatches(); > break; > >- case 345 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ >+ case 370 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ > consumeStatementCatch() ; > break; > >- case 347 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ >+ case 372 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ > consumeLeftParen(); > break; > >- case 348 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ >+ case 373 : if (DEBUG) { System.out.println("PushRPARENForUnannotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$ >+ consumeRightParenForUnannotatedTypeCast(); >+ break; >+ >+ case 374 : if (DEBUG) { System.out.println("PushRPARENForNameUnannotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$ >+ consumeRightParenForNameUnannotatedTypeCast(); >+ break; >+ >+ case 375 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ > consumeRightParen(); > break; > >- case 353 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ >+ case 376 : if (DEBUG) { System.out.println("PushRPARENForAnnotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$ >+ consumeRightParenForAnnotatedTypeCast(); >+ break; >+ >+ case 377 : if (DEBUG) { System.out.println("PushRPARENForNameAndAnnotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$ >+ consumeRightParenForNameAndAnnotatedTypeCast(); >+ break; >+ >+ case 382 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayThis(); > break; > >- case 354 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ >+ case 383 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ > consumePrimaryNoNewArray(); > break; > >- case 355 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ >+ case 384 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayWithName(); > break; > >- case 358 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ >+ case 387 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayNameThis(); > break; > >- case 359 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$ >+ case 388 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayNameSuper(); > break; > >- case 360 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ >+ case 389 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayName(); > break; > >- case 361 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ >+ case 390 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayArrayType(); > break; > >- case 362 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ >+ case 391 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayPrimitiveArrayType(); > break; > >- case 363 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ >+ case 392 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ > consumePrimaryNoNewArrayPrimitiveType(); > break; > >- case 369 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name COLON_COLON..."); } //$NON-NLS-1$ >+ case 398 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name COLON_COLON..."); } //$NON-NLS-1$ > consumeReferenceExpressionNameForm(); > break; > >- case 370 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$ >+ case 399 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$ > consumeReferenceExpressionTypeForm(false); > break; > >- case 371 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$ >+ case 400 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$ > consumeReferenceExpressionTypeForm(true); > break; > >- case 372 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ >+ case 401 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ > consumeReferenceExpressionPrimaryForm(); > break; > >- case 373 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ >+ case 402 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ > consumeReferenceExpressionSuperForm(); > break; > >- case 374 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ >+ case 403 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ > consumeEmptyTypeArguments(); > break; > >- case 376 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ >+ case 405 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ > consumeIdentifierOrNew(false); > break; > >- case 377 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ >+ case 406 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ > consumeIdentifierOrNew(true); > break; > >- case 378 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ >+ case 407 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ > consumeLambdaExpression(); > break; > >- case 379 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier"); } //$NON-NLS-1$ >+ case 408 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier"); } //$NON-NLS-1$ > consumeTypeElidedLambdaParameter(false); > break; > >- case 383 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ >+ case 412 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ > consumeFormalParameterList(); > break; > >- case 384 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ >+ case 413 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ > consumeTypeElidedLambdaParameter(true); > break; > >- case 386 : if (DEBUG) { System.out.println("LambdaBody ::= NestedType NestedMethod LBRACE..."); } //$NON-NLS-1$ >+ case 415 : if (DEBUG) { System.out.println("LambdaBody ::= NestedType NestedMethod LBRACE..."); } //$NON-NLS-1$ > consumeBlock(); > break; > >- case 387 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ >+ case 416 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ > consumeElidedLeftBraceAndReturn(); > break; > >- case 388 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ >+ case 417 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ > consumeAllocationHeader(); > break; > >- case 389 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ >+ case 418 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionWithTypeArguments(); > break; > >- case 390 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ >+ case 419 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpression(); > break; > >- case 391 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ >+ case 420 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; > break; > >- case 392 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ >+ case 421 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionQualified() ; > break; > >- case 393 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ >+ case 422 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionQualified() ; > break; > >- case 394 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ >+ case 423 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; > break; > >- case 395 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ >+ case 424 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ > consumeEnterInstanceCreationArgumentList(); > break; > >- case 396 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); } //$NON-NLS-1$ >+ case 425 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); } //$NON-NLS-1$ > consumeClassInstanceCreationExpressionName() ; > break; > >- case 397 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ >+ case 426 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ > consumeClassBodyopt(); > break; > >- case 399 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ >+ case 428 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ > consumeEnterAnonymousClassBody(false); > break; > >- case 400 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ >+ case 429 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ > consumeClassBodyopt(); > break; > >- case 402 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ >+ case 431 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ > consumeEnterAnonymousClassBody(true); > break; > >- case 404 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ >+ case 433 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ > consumeArgumentList(); > break; > >- case 405 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$ >+ case 434 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new Annotationsopt PrimitiveType"); } //$NON-NLS-1$ > consumeArrayCreationHeader(); > break; > >- case 406 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ >+ case 435 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ > consumeArrayCreationHeader(); > break; > >- case 407 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ >+ case 436 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ > consumeArrayCreationExpressionWithoutInitializer(); > break; > >- case 408 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$ >+ case 437 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new Annotationsopt"); } //$NON-NLS-1$ > consumeArrayCreationExpressionWithInitializer(); > break; > >- case 409 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ >+ case 438 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ > consumeArrayCreationExpressionWithoutInitializer(); > break; > >- case 410 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ >+ case 439 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ > consumeArrayCreationExpressionWithInitializer(); > break; > >- case 412 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ >+ case 441 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ > consumeDimWithOrWithOutExprs(); > break; > >- case 414 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ >+ case 444 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET..."); } //$NON-NLS-1$ > consumeDimWithOrWithOutExpr(); > break; > >- case 415 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ >+ case 445 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotations LBRACKET..."); } //$NON-NLS-1$ >+ consumeDimWithOrWithOutExpr(); >+ break; >+ >+ case 446 : if (DEBUG) { System.out.println("DimsoptAnnotsopt ::="); } //$NON-NLS-1$ >+ consumeEmptyDimsoptAnnotsopt(); >+ break; >+ >+ case 447 : if (DEBUG) { System.out.println("DimsoptAnnotsopt -> DimsAnnotLoop"); } //$NON-NLS-1$ >+ consumeDimsWithTrailingAnnotsopt(); >+ break; >+ >+ case 450 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= Annotation"); } //$NON-NLS-1$ >+ consumeTypeAnnotation(true); >+ break; >+ >+ case 451 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ >+ consumeOneDimLoop(true); >+ break; >+ >+ case 452 : if (DEBUG) { System.out.println("TypeAnnotations ::= Annotation"); } //$NON-NLS-1$ >+ consumeTypeAnnotation(false); >+ break; >+ >+ case 453 : if (DEBUG) { System.out.println("TypeAnnotations ::= TypeAnnotations Annotation"); } //$NON-NLS-1$ >+ consumeOneMoreTypeAnnotation(); >+ break; >+ >+ case 454 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ > consumeDims(); > break; > >- case 418 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ >- consumeOneDimLoop(); >+ case 457 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ >+ consumeOneDimLoop(false); > break; > >- case 419 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ >+ case 458 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$ >+ consumeOneDimLoopWithAnnotations(); >+ break; >+ >+ case 459 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ > consumeFieldAccess(false); > break; > >- case 420 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ >+ case 460 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ > consumeFieldAccess(true); > break; > >- case 421 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ >+ case 461 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ > consumeMethodInvocationName(); > break; > >- case 422 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ >+ case 462 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ > consumeMethodInvocationNameWithTypeArguments(); > break; > >- case 423 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ >+ case 463 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ > consumeMethodInvocationPrimaryWithTypeArguments(); > break; > >- case 424 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ >+ case 464 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ > consumeMethodInvocationPrimary(); > break; > >- case 425 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ >+ case 465 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ > consumeMethodInvocationSuperWithTypeArguments(); > break; > >- case 426 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ >+ case 466 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ > consumeMethodInvocationSuper(); > break; > >- case 427 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ >+ case 467 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ > consumeArrayAccess(true); > break; > >- case 428 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ >+ case 468 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ > consumeArrayAccess(false); > break; > >- case 429 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ >+ case 469 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ > consumeArrayAccess(false); > break; > >- case 431 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ >+ case 471 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ > consumePostfixExpression(); > break; > >- case 434 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ >+ case 474 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.PLUS,true); > break; > >- case 435 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ >+ case 475 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.MINUS,true); > break; > >- case 436 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ >+ case 476 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ > consumePushPosition(); > break; > >- case 439 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ >+ case 479 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.PLUS); > break; > >- case 440 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ >+ case 480 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.MINUS); > break; > >- case 442 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ >+ case 482 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.PLUS,false); > break; > >- case 443 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ >+ case 483 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.MINUS,false); > break; > >- case 445 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ >+ case 485 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.TWIDDLE); > break; > >- case 446 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ >+ case 486 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.NOT); > break; > >- case 448 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ >+ case 488 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ > consumeCastExpressionWithPrimitiveType(); > break; > >- case 449 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ >+ case 489 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers PrimitiveType..."); } //$NON-NLS-1$ >+ consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations(); >+ break; >+ >+ case 490 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ > consumeCastExpressionWithGenericsArray(); > break; > >- case 450 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ >+ case 491 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$ >+ consumeCastExpressionWithGenericsArrayWithTypeAnnotations(); >+ break; >+ >+ case 492 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ > consumeCastExpressionWithQualifiedGenericsArray(); > break; > >- case 451 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$ >+ case 493 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$ >+ consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations(); >+ break; >+ >+ case 494 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ > consumeCastExpressionLL1(); > break; > >- case 452 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN..."); } //$NON-NLS-1$ >+ case 495 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$ >+ consumeCastExpressionLL1WithTypeAnnotations(); >+ break; >+ >+ case 496 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$ > consumeCastExpressionWithNameArray(); > break; > >- case 453 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ >+ case 497 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name Dims..."); } //$NON-NLS-1$ >+ consumeCastExpressionWithNameArrayWithTypeAnnotations(); >+ break; >+ >+ case 498 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ > consumeOnlyTypeArgumentsForCastExpression(); > break; > >- case 454 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ >+ case 499 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ > consumeInsideCastExpression(); > break; > >- case 455 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ >+ case 500 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ > consumeInsideCastExpressionLL1(); > break; > >- case 456 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ >+ case 501 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ > consumeInsideCastExpressionWithQualifiedGenerics(); > break; > >- case 458 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ >+ case 502 : if (DEBUG) { System.out.println("InsideCastExpressionWithAnnotatedQualifiedGenerics ::="); } //$NON-NLS-1$ >+ consumeInsideCastExpressionWithAnnotatedQualifiedGenerics(); >+ break; >+ >+ case 504 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.MULTIPLY); > break; > >- case 459 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ >+ case 505 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.DIVIDE); > break; > >- case 460 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ >+ case 506 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.REMAINDER); > break; > >- case 462 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ >+ case 508 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.PLUS); > break; > >- case 463 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ >+ case 509 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.MINUS); > break; > >- case 465 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ >+ case 511 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LEFT_SHIFT); > break; > >- case 466 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ >+ case 512 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); > break; > >- case 467 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ >+ case 513 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); > break; > >- case 469 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ >+ case 515 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LESS); > break; > >- case 470 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ >+ case 516 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.GREATER); > break; > >- case 471 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ >+ case 517 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LESS_EQUAL); > break; > >- case 472 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ >+ case 518 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.GREATER_EQUAL); > break; > >- case 474 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$ >+ case 520 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$ > consumeInstanceOfExpression(); > break; > >- case 476 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ >+ case 522 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ > consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); > break; > >- case 477 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ >+ case 523 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ > consumeEqualityExpression(OperatorIds.NOT_EQUAL); > break; > >- case 479 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ >+ case 525 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.AND); > break; > >- case 481 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ >+ case 527 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.XOR); > break; > >- case 483 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ >+ case 529 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.OR); > break; > >- case 485 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ >+ case 531 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.AND_AND); > break; > >- case 487 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ >+ case 533 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.OR_OR); > break; > >- case 489 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ >+ case 535 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ > consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; > break; > >- case 492 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ >+ case 538 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ > consumeAssignment(); > break; > >- case 494 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ >+ case 540 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ > ignoreExpressionAssignment(); > break; > >- case 495 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ >+ case 541 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(EQUAL); > break; > >- case 496 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ >+ case 542 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(MULTIPLY); > break; > >- case 497 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ >+ case 543 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(DIVIDE); > break; > >- case 498 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ >+ case 544 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(REMAINDER); > break; > >- case 499 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ >+ case 545 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(PLUS); > break; > >- case 500 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ >+ case 546 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(MINUS); > break; > >- case 501 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ >+ case 547 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(LEFT_SHIFT); > break; > >- case 502 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ >+ case 548 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(RIGHT_SHIFT); > break; > >- case 503 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ >+ case 549 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); > break; > >- case 504 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ >+ case 550 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(AND); > break; > >- case 505 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ >+ case 551 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(XOR); > break; > >- case 506 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ >+ case 552 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ > consumeAssignmentOperator(OR); > break; > >- case 507 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ >+ case 553 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ > consumeExpression(); > break; > >- case 510 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ >+ case 556 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ > consumeEmptyExpression(); > break; > >- case 515 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ >+ case 561 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ > consumeEmptyClassBodyDeclarationsopt(); > break; > >- case 516 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ >+ case 562 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ > consumeClassBodyDeclarationsopt(); > break; > >- case 517 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ >+ case 563 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ > consumeDefaultModifiers(); > break; > >- case 518 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ >+ case 564 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ > consumeModifiers(); > break; > >- case 519 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ >+ case 565 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ > consumeEmptyBlockStatementsopt(); > break; > >- case 521 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ >+ case 567 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ > consumeEmptyDimsopt(); > break; > >- case 523 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ >+ case 569 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ > consumeEmptyArgumentListopt(); > break; > >- case 527 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ >+ case 573 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ > consumeFormalParameterListopt(); > break; > >- case 531 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ >+ case 577 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ > consumeEmptyInterfaceMemberDeclarationsopt(); > break; > >- case 532 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ >+ case 578 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ > consumeInterfaceMemberDeclarationsopt(); > break; > >- case 533 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ >+ case 579 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ > consumeNestedType(); > break; > >- case 534 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ >+ case 580 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ > consumeEmptyForInitopt(); > break; > >- case 536 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ >+ case 582 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ > consumeEmptyForUpdateopt(); > break; > >- case 540 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ >+ case 586 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ > consumeEmptyCatchesopt(); > break; > >- case 542 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ >+ case 588 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ > consumeEnumDeclaration(); > break; > >- case 543 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ >+ case 589 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ > consumeEnumHeader(); > break; > >- case 544 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ >+ case 590 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ > consumeEnumHeaderName(); > break; > >- case 545 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ >+ case 591 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ > consumeEnumHeaderNameWithTypeParameters(); > break; > >- case 546 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ >+ case 592 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ > consumeEnumBodyNoConstants(); > break; > >- case 547 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ >+ case 593 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ > consumeEnumBodyNoConstants(); > break; > >- case 548 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ >+ case 594 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ > consumeEnumBodyWithConstants(); > break; > >- case 549 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ >+ case 595 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ > consumeEnumBodyWithConstants(); > break; > >- case 551 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ >+ case 597 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ > consumeEnumConstants(); > break; > >- case 552 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ >+ case 598 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ > consumeEnumConstantHeaderName(); > break; > >- case 553 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ >+ case 599 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ > consumeEnumConstantHeader(); > break; > >- case 554 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ >+ case 600 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ > consumeEnumConstantWithClassBody(); > break; > >- case 555 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ >+ case 601 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ > consumeEnumConstantNoClassBody(); > break; > >- case 556 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ >+ case 602 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ > consumeArguments(); > break; > >- case 557 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ >+ case 603 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ > consumeEmptyArguments(); > break; > >- case 559 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ >+ case 605 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ > consumeEnumDeclarations(); > break; > >- case 560 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ >+ case 606 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ > consumeEmptyEnumDeclarations(); > break; > >- case 562 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ >+ case 608 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ > consumeEnhancedForStatement(); > break; > >- case 563 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ >+ case 609 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ > consumeEnhancedForStatement(); > break; > >- case 564 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$ >+ case 610 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type0..."); } //$NON-NLS-1$ > consumeEnhancedForStatementHeaderInit(false); > break; > >- case 565 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ >+ case 611 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ > consumeEnhancedForStatementHeaderInit(true); > break; > >- case 566 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ >+ case 612 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ > consumeEnhancedForStatementHeader(); > break; > >- case 567 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ >+ case 613 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ > consumeImportDeclaration(); > break; > >- case 568 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ >+ case 614 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ > consumeSingleStaticImportDeclarationName(); > break; > >- case 569 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ >+ case 615 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ > consumeImportDeclaration(); > break; > >- case 570 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ >+ case 616 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ > consumeStaticImportOnDemandDeclarationName(); > break; > >- case 571 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ >+ case 617 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ > consumeTypeArguments(); > break; > >- case 572 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ >+ case 618 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ > consumeOnlyTypeArguments(); > break; > >- case 574 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ >+ case 620 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ > consumeTypeArgumentList1(); > break; > >- case 576 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ >+ case 622 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ > consumeTypeArgumentList(); > break; > >- case 577 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ >+ case 623 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ > consumeTypeArgument(); > break; > >- case 581 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ >+ case 627 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ > consumeReferenceType1(); > break; > >- case 582 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ >+ case 628 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ > consumeTypeArgumentReferenceType1(); > break; > >- case 584 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ >+ case 629 : if (DEBUG) { System.out.println("ReferenceType1 ::= Modifiers ClassOrInterface LESS..."); } //$NON-NLS-1$ >+ consumeTypeArgumentReferenceType1WithTypeAnnotations(); >+ break; >+ >+ case 631 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ > consumeTypeArgumentList2(); > break; > >- case 587 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ >+ case 634 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ > consumeReferenceType2(); > break; > >- case 588 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ >+ case 635 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ > consumeTypeArgumentReferenceType2(); > break; > >- case 590 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ >+ case 636 : if (DEBUG) { System.out.println("ReferenceType2 ::= Modifiers ClassOrInterface LESS..."); } //$NON-NLS-1$ >+ consumeTypeArgumentReferenceType2WithTypeAnnotations(); >+ break; >+ >+ case 638 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ > consumeTypeArgumentList3(); > break; > >- case 593 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ >+ case 641 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ > consumeReferenceType3(); > break; > >- case 594 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); } //$NON-NLS-1$ >+ case 642 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); } //$NON-NLS-1$ > consumeWildcard(); > break; > >- case 595 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); } //$NON-NLS-1$ >+ case 643 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); } //$NON-NLS-1$ > consumeWildcardWithBounds(); > break; > >- case 596 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ >+ case 644 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ > consumeWildcardBoundsExtends(); > break; > >- case 597 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ >+ case 645 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ > consumeWildcardBoundsSuper(); > break; > >- case 598 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); } //$NON-NLS-1$ >+ case 646 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); } //$NON-NLS-1$ > consumeWildcard1(); > break; > >- case 599 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); } //$NON-NLS-1$ >+ case 647 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); } //$NON-NLS-1$ > consumeWildcard1WithBounds(); > break; > >- case 600 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ >+ case 648 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ > consumeWildcardBounds1Extends(); > break; > >- case 601 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ >+ case 649 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ > consumeWildcardBounds1Super(); > break; > >- case 602 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ >+ case 650 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ > consumeWildcard2(); > break; > >- case 603 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); } //$NON-NLS-1$ >+ case 651 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); } //$NON-NLS-1$ > consumeWildcard2WithBounds(); > break; > >- case 604 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ >+ case 652 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ > consumeWildcardBounds2Extends(); > break; > >- case 605 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ >+ case 653 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ > consumeWildcardBounds2Super(); > break; > >- case 606 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ >+ case 654 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ > consumeWildcard3(); > break; > >- case 607 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); } //$NON-NLS-1$ >+ case 655 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); } //$NON-NLS-1$ > consumeWildcard3WithBounds(); > break; > >- case 608 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ >+ case 656 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ > consumeWildcardBounds3Extends(); > break; > >- case 609 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ >+ case 657 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ > consumeWildcardBounds3Super(); > break; > >- case 610 : if (DEBUG) { System.out.println("TypeParameterHeader ::= Identifier"); } //$NON-NLS-1$ >+ case 658 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$ >+ consumeZeroTypeAnnotations(true); >+ break; >+ >+ case 659 : if (DEBUG) { System.out.println("TypeParameterHeader ::= PushZeroTypeAnnotations..."); } //$NON-NLS-1$ > consumeTypeParameterHeader(); > break; > >- case 611 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$ >+ case 660 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotations Identifier"); } //$NON-NLS-1$ >+ consumeTypeParameterHeader(); >+ break; >+ >+ case 661 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$ > consumeTypeParameters(); > break; > >- case 613 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ >+ case 663 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ > consumeTypeParameterList(); > break; > >- case 615 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ >+ case 665 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ > consumeTypeParameterWithExtends(); > break; > >- case 616 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ >+ case 666 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ > consumeTypeParameterWithExtendsAndBounds(); > break; > >- case 618 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ >+ case 668 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ > consumeAdditionalBoundList(); > break; > >- case 619 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ >+ case 669 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ > consumeAdditionalBound(); > break; > >- case 621 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ >+ case 671 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ > consumeTypeParameterList1(); > break; > >- case 622 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ >+ case 672 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ > consumeTypeParameter1(); > break; > >- case 623 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ >+ case 673 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ > consumeTypeParameter1WithExtends(); > break; > >- case 624 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ >+ case 674 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ > consumeTypeParameter1WithExtendsAndBounds(); > break; > >- case 626 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ >+ case 676 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ > consumeAdditionalBoundList1(); > break; > >- case 627 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ >+ case 677 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ > consumeAdditionalBound1(); > break; > >- case 633 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ >+ case 683 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.PLUS); > break; > >- case 634 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ >+ case 684 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.MINUS); > break; > >- case 637 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ >+ case 687 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.TWIDDLE); > break; > >- case 638 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ >+ case 688 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ > consumeUnaryExpression(OperatorIds.NOT); > break; > >- case 641 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 691 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.MULTIPLY); > break; > >- case 642 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ >+ case 692 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); > break; > >- case 643 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 693 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.DIVIDE); > break; > >- case 644 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ >+ case 694 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.DIVIDE); > break; > >- case 645 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 695 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.REMAINDER); > break; > >- case 646 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ >+ case 696 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.REMAINDER); > break; > >- case 648 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 698 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.PLUS); > break; > >- case 649 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ >+ case 699 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.PLUS); > break; > >- case 650 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 700 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.MINUS); > break; > >- case 651 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ >+ case 701 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.MINUS); > break; > >- case 653 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ >+ case 703 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LEFT_SHIFT); > break; > >- case 654 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ >+ case 704 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); > break; > >- case 655 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ >+ case 705 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); > break; > >- case 656 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ >+ case 706 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); > break; > >- case 657 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ >+ case 707 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); > break; > >- case 658 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ >+ case 708 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); > break; > >- case 660 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ >+ case 710 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LESS); > break; > >- case 661 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ >+ case 711 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.LESS); > break; > >- case 662 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ >+ case 712 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.GREATER); > break; > >- case 663 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ >+ case 713 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.GREATER); > break; > >- case 664 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 714 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.LESS_EQUAL); > break; > >- case 665 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ >+ case 715 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); > break; > >- case 666 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 716 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.GREATER_EQUAL); > break; > >- case 667 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ >+ case 717 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); > break; > >- case 669 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$ >+ case 719 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$ > consumeInstanceOfExpressionWithName(); > break; > >- case 670 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 720 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeInstanceOfExpression(); > break; > >- case 672 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 722 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); > break; > >- case 673 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ >+ case 723 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ > consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); > break; > >- case 674 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 724 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeEqualityExpression(OperatorIds.NOT_EQUAL); > break; > >- case 675 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ >+ case 725 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ > consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); > break; > >- case 677 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ >+ case 727 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.AND); > break; > >- case 678 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ >+ case 728 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.AND); > break; > >- case 680 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 730 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.XOR); > break; > >- case 681 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ >+ case 731 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.XOR); > break; > >- case 683 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 733 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.OR); > break; > >- case 684 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ >+ case 734 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.OR); > break; > >- case 686 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 736 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.AND_AND); > break; > >- case 687 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ >+ case 737 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.AND_AND); > break; > >- case 689 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 739 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeBinaryExpression(OperatorIds.OR_OR); > break; > >- case 690 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ >+ case 740 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ > consumeBinaryExpressionWithName(OperatorIds.OR_OR); > break; > >- case 692 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ >+ case 742 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ > consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; > break; > >- case 693 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ >+ case 743 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ > consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; > break; > >- case 697 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ >+ case 747 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclarationHeaderName() ; > break; > >- case 698 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ >+ case 748 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; > break; > >- case 699 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ >+ case 749 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; > break; > >- case 700 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ >+ case 750 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclarationHeaderName() ; > break; > >- case 701 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ >+ case 751 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclarationHeader() ; > break; > >- case 702 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ >+ case 752 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ > consumeAnnotationTypeDeclaration() ; > break; > >- case 704 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ >+ case 754 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ > consumeEmptyAnnotationTypeMemberDeclarationsopt() ; > break; > >- case 705 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ >+ case 755 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ > consumeAnnotationTypeMemberDeclarationsopt() ; > break; > >- case 707 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ >+ case 757 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ > consumeAnnotationTypeMemberDeclarations() ; > break; > >- case 708 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ >+ case 758 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ > consumeMethodHeaderNameWithTypeParameters(true); > break; > >- case 709 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ >+ case 759 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type0..."); } //$NON-NLS-1$ > consumeMethodHeaderName(true); > break; > >- case 710 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ >+ case 760 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ > consumeEmptyMethodHeaderDefaultValue() ; > break; > >- case 711 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ >+ case 761 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ > consumeMethodHeaderDefaultValue(); > break; > >- case 712 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ >+ case 762 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ > consumeMethodHeader(); > break; > >- case 713 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ >+ case 763 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ > consumeAnnotationTypeMemberDeclaration() ; > break; > >- case 721 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$ >+ case 771 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$ > consumeAnnotationName() ; > break; > >- case 722 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ >+ case 772 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ > consumeNormalAnnotation() ; > break; > >- case 723 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ >+ case 773 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ > consumeEmptyMemberValuePairsopt() ; > break; > >- case 726 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ >+ case 776 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ > consumeMemberValuePairs() ; > break; > >- case 727 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ >+ case 777 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ > consumeMemberValuePair() ; > break; > >- case 728 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ >+ case 778 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ > consumeEnterMemberValue() ; > break; > >- case 729 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ >+ case 779 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ > consumeExitMemberValue() ; > break; > >- case 731 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ >+ case 781 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ > consumeMemberValueAsName() ; > break; > >- case 734 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ >+ case 784 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ > consumeMemberValueArrayInitializer() ; > break; > >- case 735 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ >+ case 785 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ > consumeMemberValueArrayInitializer() ; > break; > >- case 736 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ >+ case 786 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ > consumeEmptyMemberValueArrayInitializer() ; > break; > >- case 737 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ >+ case 787 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ > consumeEmptyMemberValueArrayInitializer() ; > break; > >- case 738 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ >+ case 788 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ > consumeEnterMemberValueArrayInitializer() ; > break; > >- case 740 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ >+ case 790 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ > consumeMemberValues() ; > break; > >- case 741 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ >+ case 791 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ > consumeMarkerAnnotation() ; > break; > >- case 742 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ >+ case 792 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ > consumeSingleMemberAnnotationMemberValue() ; > break; > >- case 743 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ >+ case 793 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ > consumeSingleMemberAnnotation() ; > break; > >- case 744 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ >+ case 794 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ > consumeRecoveryMethodHeaderNameWithTypeParameters(); > break; > >- case 745 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ >+ case 795 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type0..."); } //$NON-NLS-1$ > consumeRecoveryMethodHeaderName(); > break; > >- case 746 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ >+ case 796 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ > consumeMethodHeader(); > break; > >- case 747 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ >+ case 797 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ > consumeMethodHeader(); > break; > > } >+} >+protected void consumeExplicitThisParameter() { >+ // VariableDeclaratorIdOrThis ::= 'this' >+ >+ int stackLength = this.identifierStack.length; >+ if (++this.identifierPtr >= stackLength) { >+ System.arraycopy( >+ this.identifierStack, 0, >+ this.identifierStack = new char[stackLength + 20][], 0, >+ stackLength); >+ System.arraycopy( >+ this.identifierPositionStack, 0, >+ this.identifierPositionStack = new long[stackLength + 20], 0, >+ stackLength); >+ } >+ this.identifierStack[this.identifierPtr] = ConstantPool.This; >+ int thisStart = this.intStack[this.intPtr--]; >+ this.identifierPositionStack[this.identifierPtr] = >+ (((long) thisStart << 32)) + (thisStart + 3); >+ >+ stackLength = this.identifierLengthStack.length; >+ if (++this.identifierLengthPtr >= stackLength) { >+ System.arraycopy( >+ this.identifierLengthStack, 0, >+ this.identifierLengthStack = new int[stackLength + 10], 0, >+ stackLength); >+ } >+ this.identifierLengthStack[this.identifierLengthPtr] = 1; >+ pushOnIntStack(0); // extended dimensions.. > } > protected void consumeLambdaExpression() { > >@@ -8287,10 +8995,64 @@ > pushOnGenericsStack(getTypeReference(0)); > this.intPtr--; > } >+protected void consumeTypeArgumentReferenceType1WithTypeAnnotations() { >+ concatGenericsLists(); >+ TypeReference typeReference = getUnannotatedTypeReference(0); >+ // copy from expression stack to type annotation stack >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ pushOnGenericsStack(typeReference); >+ // remove the 0 pushed by ZeroTypeAnnotation >+ this.typeAnnotationLengthPtr--; >+ this.intPtr--; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); >+} > protected void consumeTypeArgumentReferenceType2() { > concatGenericsLists(); > pushOnGenericsStack(getTypeReference(0)); > this.intPtr--; >+} >+protected void consumeTypeArgumentReferenceType2WithTypeAnnotations() { >+ concatGenericsLists(); >+ TypeReference typeReference = getUnannotatedTypeReference(0); >+ // copy from expression stack to type annotation stack >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ typeReference.annotations = new Annotation[length], >+ 0, >+ length); >+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart; >+ if (this.modifiersSourceStart < typeReferenceSourceStart) { >+ typeReferenceSourceStart = this.modifiersSourceStart; >+ } >+ typeReference.bits |= ASTNode.HasTypeAnnotations; >+ typeReference.sourceStart = typeReferenceSourceStart; >+ } >+ pushOnGenericsStack(typeReference); >+ this.intPtr--; >+ if (this.modifiers != ClassFileConstants.AccDefault) { >+ problemReporter().invalidLocationForModifiers(typeReference); >+ } >+ resetModifiers(); > } > protected void consumeTypeArguments() { > concatGenericsLists(); >@@ -8380,6 +9142,7 @@ > typeParameter.declarationSourceEnd = superType.sourceEnd; > typeParameter.type = superType; > superType.bits |= ASTNode.IsSuperType; >+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations); > this.genericsStack[this.genericsPtr] = typeParameter; > } > protected void consumeTypeParameter1WithExtendsAndBounds() { >@@ -8392,15 +9155,28 @@ > TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr]; > typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd; > typeParameter.type = superType; >+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations); > superType.bits |= ASTNode.IsSuperType; > typeParameter.bounds = bounds; > for (int i = 0, max = bounds.length; i < max; i++) { >- bounds[i].bits |= ASTNode.IsSuperType; >+ TypeReference bound = bounds[i]; >+ bound.bits |= ASTNode.IsSuperType; >+ typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations); > } > } > protected void consumeTypeParameterHeader() { > //TypeParameterHeader ::= Identifier > TypeParameter typeParameter = new TypeParameter(); >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ typeParameter.annotations = new Annotation[length], >+ 0, >+ length); >+ typeParameter.bits |= ASTNode.HasTypeAnnotations; >+ } > long pos = this.identifierPositionStack[this.identifierPtr]; > final int end = (int) pos; > typeParameter.declarationSourceEnd = end; >@@ -8452,6 +9228,7 @@ > TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr]; > typeParameter.declarationSourceEnd = superType.sourceEnd; > typeParameter.type = superType; >+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations); > superType.bits |= ASTNode.IsSuperType; > } > protected void consumeTypeParameterWithExtendsAndBounds() { >@@ -8463,11 +9240,14 @@ > TypeReference superType = getTypeReference(this.intStack[this.intPtr--]); > TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr]; > typeParameter.type = superType; >+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations); > superType.bits |= ASTNode.IsSuperType; > typeParameter.bounds = bounds; > typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd; > for (int i = 0, max = bounds.length; i < max; i++) { >- bounds[i].bits |= ASTNode.IsSuperType; >+ TypeReference bound = bounds[i]; >+ bound.bits |= ASTNode.IsSuperType; >+ typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations); > } > } > protected void consumeUnaryExpression(int op) { >@@ -8666,6 +9446,7 @@ > // Nothing to do > // The wildcard is created by the consumeWildcardBoundsExtends or by consumeWildcardBoundsSuper > } >+ > /** > * Given the current comment stack, answer whether some comment is available in a certain exclusive range > * >@@ -8705,12 +9486,18 @@ > m.explicitDeclarations = c.explicitDeclarations; > m.returnType = null; > m.javadoc = c.javadoc; >+ m.bits = c.bits; > return m; > } > > protected TypeReference copyDims(TypeReference typeRef, int dim) { > return typeRef.copyDims(dim); > } >+ >+protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation[][]annotationsOnDimensions) { >+ return typeRef.copyDims(dim, annotationsOnDimensions); >+} >+ > protected FieldDeclaration createFieldDeclaration(char[] fieldDeclarationName, int sourceStart, int sourceEnd) { > return new FieldDeclaration(fieldDeclarationName, sourceStart, sourceEnd); > } >@@ -9192,13 +9979,35 @@ > return exp; > } > protected TypeReference getTypeReference(int dim) { >+ TypeReference ref = getUnannotatedTypeReference(dim); >+ int length; >+ if (this.typeAnnotationLengthPtr >= 0 >+ && (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ // if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ ref.annotations = new Annotation[length], >+ 0, >+ length); >+ ref.sourceStart = ref.annotations[0].sourceStart; >+ ref.bits |= ASTNode.HasTypeAnnotations; >+ } >+ return ref; >+ } >+protected TypeReference getUnannotatedTypeReference(int dim) { > /* build a Reference on a variable that may be qualified or not > This variable is a type reference and dim will be its dimensions*/ > > TypeReference ref; >+ Annotation [][] annotationsOnDimensions = null; > int length = this.identifierLengthStack[this.identifierLengthPtr--]; > if (length < 0) { //flag for precompiled type reference on base types >- ref = TypeReference.baseTypeReference(-length, dim); >+ if (dim > 0) { >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); >+ } >+ ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions); > ref.sourceStart = this.intStack[this.intPtr--]; > if (dim == 0) { > ref.sourceEnd = this.intStack[this.intPtr--]; >@@ -9220,12 +10029,17 @@ > this.identifierStack[this.identifierPtr], > this.identifierPositionStack[this.identifierPtr--]); > } else { >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); > ref = > new ArrayTypeReference( > this.identifierStack[this.identifierPtr], > dim, >+ annotationsOnDimensions, > this.identifierPositionStack[this.identifierPtr--]); > ref.sourceEnd = this.endPosition; >+ if (annotationsOnDimensions != null) { >+ ref.bits |= ASTNode.HasTypeAnnotations; >+ } > } > } else { > this.genericsLengthPtr--; >@@ -9243,14 +10057,17 @@ > if (dim == 0) { > ref = new QualifiedTypeReference(tokens, positions); > } else { >- ref = new ArrayQualifiedTypeReference(tokens, dim, positions); >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); >+ ref = new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions); > ref.sourceEnd = this.endPosition; >+ ref.bits |= ASTNode.HasTypeAnnotations; > } > } > } > return ref; > } > protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLength, int numberOfIdentifiers) { >+ Annotation[][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim); > if (identifierLength == 1 && numberOfIdentifiers == 1) { > int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--]; > TypeReference[] typeArguments = null; >@@ -9261,7 +10078,7 @@ > this.genericsPtr -= currentTypeArgumentsLength; > System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments, 0, currentTypeArgumentsLength); > } >- ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, this.identifierPositionStack[this.identifierPtr--]); >+ ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, annotationsOnDimensions, this.identifierPositionStack[this.identifierPtr--]); > if (dim != 0) { > parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition; > } >@@ -9303,7 +10120,7 @@ > currentIdentifiersLength = this.identifierLengthStack[this.identifierLengthPtr--]; > } > } >- ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions); >+ ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions); > if (dim != 0) { > parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition; > } >@@ -9535,6 +10352,9 @@ > this.astLengthPtr = -1; > this.expressionPtr = -1; > this.expressionLengthPtr = -1; >+ this.unattachedAnnotationPtr = -1; >+ this.typeAnnotationLengthPtr = -1; >+ this.typeAnnotationPtr = -1; > this.identifierPtr = -1; > this.identifierLengthPtr = -1; > this.intPtr = -1; >@@ -10706,6 +11526,7 @@ > } > this.identifierLengthStack[this.identifierLengthPtr] = 1; > } >+ > protected void pushIdentifier(int flag) { > /*push a special flag on the stack : > -zero stands for optional Name >@@ -10754,6 +11575,37 @@ > stackLength); > } > this.astLengthStack[this.astLengthPtr] = 1; >+} >+protected void pushOnTypeAnnotationStack(Annotation annotation) { >+ >+ int stackLength = this.typeAnnotationStack.length; >+ if (++this.typeAnnotationPtr >= stackLength) { >+ System.arraycopy( >+ this.typeAnnotationStack, 0, >+ this.typeAnnotationStack = new Annotation[stackLength + TypeAnnotationStackIncrement], 0, >+ stackLength); >+ } >+ this.typeAnnotationStack[this.typeAnnotationPtr] = annotation; >+ >+ stackLength = this.typeAnnotationLengthStack.length; >+ if (++this.typeAnnotationLengthPtr >= stackLength) { >+ System.arraycopy( >+ this.typeAnnotationLengthStack, 0, >+ this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0, >+ stackLength); >+ } >+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = 1; >+} >+protected void pushOnTypeAnnotationLengthStack(int pos) { >+ >+ int stackLength = this.typeAnnotationLengthStack.length; >+ if (++this.typeAnnotationLengthPtr >= stackLength) { >+ System.arraycopy( >+ this.typeAnnotationLengthStack, 0, >+ this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0, >+ stackLength); >+ } >+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = pos; > } > protected void pushOnExpressionStack(Expression expr) { > >@@ -11178,6 +12030,9 @@ > this.astLengthPtr = -1; > this.expressionPtr = -1; > this.expressionLengthPtr = -1; >+ this.unattachedAnnotationPtr = -1; >+ this.typeAnnotationLengthPtr = -1; >+ this.typeAnnotationPtr = -1; > this.identifierPtr = -1; > this.identifierLengthPtr = -1; > this.intPtr = -1; >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 cbd1e2a..9620442 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 >@@ -9,6 +9,10 @@ > * Community Process (JCP) and is made available for testing and evaluation purposes > * only. The code is not compatible with any specification of the JCP. > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -19,21 +23,21 @@ > public interface ParserBasicInformation { > > int ERROR_SYMBOL = 115, >- MAX_NAME_LENGTH = 41, >- NUM_STATES = 1033, >+ MAX_NAME_LENGTH = 50, >+ NUM_STATES = 1095, > > NT_OFFSET = 115, >- SCOPE_UBOUND = 144, >- SCOPE_SIZE = 145, >- LA_STATE_OFFSET = 13788, >+ SCOPE_UBOUND = 240, >+ SCOPE_SIZE = 241, >+ LA_STATE_OFFSET = 16594, > MAX_LA = 1, >- NUM_RULES = 747, >+ NUM_RULES = 797, > NUM_TERMINALS = 115, >- NUM_NON_TERMINALS = 335, >- NUM_SYMBOLS = 450, >- START_STATE = 939, >+ NUM_NON_TERMINALS = 357, >+ NUM_SYMBOLS = 472, >+ START_STATE = 864, > EOFT_SYMBOL = 67, > EOLT_SYMBOL = 67, >- ACCEPT_ACTION = 13787, >- ERROR_ACTION = 13788; >+ ACCEPT_ACTION = 16593, >+ ERROR_ACTION = 16594; > } >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 cc25135..597b28e 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 >@@ -10,6 +10,10 @@ > * only. The code is not compatible with any specification of the JCP. > * > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -39,118 +43,118 @@ > TokenNameCOMMENT_BLOCK = 1002, > TokenNameCOMMENT_JAVADOC = 1003; > >- int TokenNameIdentifier = 22, >- TokenNameabstract = 58, >- TokenNameassert = 89, >- TokenNameboolean = 33, >- TokenNamebreak = 90, >- TokenNamebyte = 34, >- TokenNamecase = 106, >- TokenNamecatch = 104, >- TokenNamechar = 35, >- TokenNameclass = 76, >- TokenNamecontinue = 91, >+ int TokenNameIdentifier = 19, >+ TokenNameabstract = 46, >+ TokenNameassert = 79, >+ TokenNameboolean = 32, >+ TokenNamebreak = 80, >+ TokenNamebyte = 33, >+ TokenNamecase = 107, >+ TokenNamecatch = 105, >+ TokenNamechar = 34, >+ TokenNameclass = 77, >+ TokenNamecontinue = 81, > TokenNameconst = 113, >- TokenNamedefault = 100, >- TokenNamedo = 92, >- TokenNamedouble = 36, >- TokenNameelse = 108, >- TokenNameenum = 102, >- TokenNameextends = 103, >- TokenNamefalse = 46, >- TokenNamefinal = 59, >- TokenNamefinally = 107, >- TokenNamefloat = 37, >- TokenNamefor = 93, >+ TokenNamedefault = 90, >+ TokenNamedo = 82, >+ TokenNamedouble = 35, >+ TokenNameelse = 109, >+ TokenNameenum = 103, >+ TokenNameextends = 104, >+ TokenNamefalse = 57, >+ TokenNamefinal = 47, >+ TokenNamefinally = 108, >+ TokenNamefloat = 36, >+ TokenNamefor = 83, > TokenNamegoto = 114, >- TokenNameif = 94, >- TokenNameimplements = 111, >- TokenNameimport = 105, >+ TokenNameif = 84, >+ TokenNameimplements = 112, >+ TokenNameimport = 106, > TokenNameinstanceof = 17, >- TokenNameint = 38, >- TokenNameinterface = 99, >- TokenNamelong = 39, >- TokenNamenative = 60, >- TokenNamenew = 44, >- TokenNamenull = 47, >- TokenNamepackage = 101, >- TokenNameprivate = 61, >- TokenNameprotected = 62, >- TokenNamepublic = 63, >- TokenNamereturn = 95, >- TokenNameshort = 40, >- TokenNamestatic = 56, >- TokenNamestrictfp = 64, >- TokenNamesuper = 42, >- TokenNameswitch = 96, >- TokenNamesynchronized = 57, >+ TokenNameint = 37, >+ TokenNameinterface = 89, >+ TokenNamelong = 38, >+ TokenNamenative = 48, >+ TokenNamenew = 56, >+ TokenNamenull = 58, >+ TokenNamepackage = 91, >+ TokenNameprivate = 49, >+ TokenNameprotected = 50, >+ TokenNamepublic = 51, >+ TokenNamereturn = 85, >+ TokenNameshort = 39, >+ TokenNamestatic = 44, >+ TokenNamestrictfp = 52, >+ TokenNamesuper = 53, >+ TokenNameswitch = 86, >+ TokenNamesynchronized = 45, > TokenNamethis = 43, >- TokenNamethrow = 97, >- TokenNamethrows = 110, >- TokenNametransient = 65, >- TokenNametrue = 48, >- TokenNametry = 98, >- TokenNamevoid = 41, >- TokenNamevolatile = 66, >- TokenNamewhile = 77, >- TokenNameIntegerLiteral = 49, >- TokenNameLongLiteral = 50, >- TokenNameFloatingPointLiteral = 51, >- TokenNameDoubleLiteral = 52, >- TokenNameCharacterLiteral = 53, >- TokenNameStringLiteral = 54, >+ TokenNamethrow = 87, >+ TokenNamethrows = 111, >+ TokenNametransient = 54, >+ TokenNametrue = 59, >+ TokenNametry = 88, >+ TokenNamevoid = 40, >+ TokenNamevolatile = 55, >+ TokenNamewhile = 78, >+ TokenNameIntegerLiteral = 60, >+ TokenNameLongLiteral = 61, >+ TokenNameFloatingPointLiteral = 62, >+ TokenNameDoubleLiteral = 63, >+ TokenNameCharacterLiteral = 64, >+ TokenNameStringLiteral = 65, > TokenNamePLUS_PLUS = 2, > TokenNameMINUS_MINUS = 3, >- TokenNameEQUAL_EQUAL = 19, >+ TokenNameEQUAL_EQUAL = 20, > TokenNameLESS_EQUAL = 13, > TokenNameGREATER_EQUAL = 14, >- TokenNameNOT_EQUAL = 20, >+ TokenNameNOT_EQUAL = 21, > TokenNameLEFT_SHIFT = 18, > TokenNameRIGHT_SHIFT = 15, > TokenNameUNSIGNED_RIGHT_SHIFT = 16, >- TokenNamePLUS_EQUAL = 78, >- TokenNameMINUS_EQUAL = 79, >- TokenNameMULTIPLY_EQUAL = 80, >- TokenNameDIVIDE_EQUAL = 81, >- TokenNameAND_EQUAL = 82, >- TokenNameOR_EQUAL = 83, >- TokenNameXOR_EQUAL = 84, >- TokenNameREMAINDER_EQUAL = 85, >- TokenNameLEFT_SHIFT_EQUAL = 86, >- TokenNameRIGHT_SHIFT_EQUAL = 87, >- TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 88, >- TokenNameOR_OR = 30, >- TokenNameAND_AND = 29, >+ TokenNamePLUS_EQUAL = 92, >+ TokenNameMINUS_EQUAL = 93, >+ TokenNameMULTIPLY_EQUAL = 94, >+ TokenNameDIVIDE_EQUAL = 95, >+ TokenNameAND_EQUAL = 96, >+ TokenNameOR_EQUAL = 97, >+ TokenNameXOR_EQUAL = 98, >+ TokenNameREMAINDER_EQUAL = 99, >+ TokenNameLEFT_SHIFT_EQUAL = 100, >+ TokenNameRIGHT_SHIFT_EQUAL = 101, >+ TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 102, >+ TokenNameOR_OR = 31, >+ TokenNameAND_AND = 30, > TokenNamePLUS = 4, > TokenNameMINUS = 5, >- TokenNameNOT = 70, >+ TokenNameNOT = 69, > TokenNameREMAINDER = 8, >- TokenNameXOR = 23, >- TokenNameAND = 21, >+ TokenNameXOR = 24, >+ TokenNameAND = 22, > TokenNameMULTIPLY = 7, > TokenNameOR = 25, >- TokenNameTWIDDLE = 71, >+ TokenNameTWIDDLE = 70, > TokenNameDIVIDE = 9, > TokenNameGREATER = 12, >- TokenNameLESS = 11, >- TokenNameLPAREN = 24, >- TokenNameRPAREN = 26, >+ TokenNameLESS = 10, >+ TokenNameLPAREN = 26, >+ TokenNameRPAREN = 27, > TokenNameLBRACE = 68, >- TokenNameRBRACE = 32, >+ TokenNameRBRACE = 42, > TokenNameLBRACKET = 6, > TokenNameRBRACKET = 72, > TokenNameSEMICOLON = 28, >- TokenNameQUESTION = 27, >- TokenNameCOLON = 69, >- TokenNameCOMMA = 31, >+ TokenNameQUESTION = 29, >+ TokenNameCOLON = 71, >+ TokenNameCOMMA = 41, > TokenNameDOT = 1, > TokenNameEQUAL = 74, >- TokenNameAT = 45, >- TokenNameELLIPSIS = 112, >- TokenNameARROW = 109, >- TokenNameCOLON_COLON = 10, >- TokenNameBeginLambda = 55, >- TokenNameBeginTypeArguments = 75, >+ TokenNameAT = 23, >+ TokenNameELLIPSIS = 75, >+ TokenNameARROW = 110, >+ TokenNameCOLON_COLON = 11, >+ TokenNameBeginLambda = 66, >+ TokenNameBeginTypeArguments = 76, > TokenNameElidedSemicolonAndRightBrace = 73, > TokenNameEOF = 67, > TokenNameERROR = 115; >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 b2721bd..9fa1cee 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/parser10.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc >index 9f5fc24..3f1a7b5 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc >Binary files differ >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc >index 1a994f4..5de4d12 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.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 43d5e27..6ab8ca3 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 2ebc772..d763fed 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 c4fc780..75f3e06 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 a1e78b9..3d76c4e 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 2a567fd..ca4cfca 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 71db35c..17e81bb 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 3e3af72..cabd42c 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 66cd08d..f475c1d 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 >@@ -1 +1,8 @@ >-ll k HHHDDk EEE" HIhE jEMDYYD"DDfJJmc""L"Ef"d"""--" >\ No newline at end of file >+mmJ**D*l+)KJ**HHHHHDl****+++GGG)KKK!++55**IiG**** >+ >+!k!)!G!!NDOOD!DD!h)) >+) >+)gJJnY!M!hGg!Z! >+!! >+! >+5+! >\ No newline at end of file >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 18f4599..11b17ab 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 ca4ffc6..3de489c 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 fcc8c55..ccfe323 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 297828e..4592b12 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 7378156..3843dae 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 0d5b79d..5a6823f 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 48e1a25..d8e8e62 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 c548b4b..b304e67 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 b09a72b..d9694d2 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 ba1b8f1..3ec273d 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 9590181..b01c32d 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 070db1f..0469444 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 3526827..e8c5a71 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 814820d..a0bc195 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 >@@ -1,17 +1,3 @@ >-############################################################################### >-# Copyright (c) 2012 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 >-# http://www.eclipse.org/legal/epl-v10.html >-# >-# This is an implementation of an early-draft specification developed under the Java >-# Community Process (JCP) and is made available for testing and evaluation purposes >-# only. The code is not compatible with any specification of the JCP. >-# >-# Contributors: >-# IBM Corporation - initial API and implementation >-############################################################################### > ,opt=, > ;opt=; > AbstractMethodDeclaration=MethodDeclaration >@@ -36,6 +22,7 @@ > AnnotationTypeMemberDeclaration=AnnotationTypeMemberDeclaration > AnnotationTypeMemberDeclarations=AnnotationTypeMemberDeclarations > AnnotationTypeMemberDeclarationsopt=AnnotationTypeMemberDeclarations >+Annotationsopt=Annotationsopt > ArgumentList=ArgumentList > ArgumentListopt=ArgumentList > Arguments=Arguments >@@ -80,7 +67,9 @@ > ClassInstanceCreationExpression=ClassInstanceCreationExpression > ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName > ClassMemberDeclaration=ClassMemberDeclaration >+ClassOrInterface0=Type > ClassOrInterface=Type >+ClassOrInterfaceType0=Type > ClassOrInterfaceType=Type > ClassType=ClassType > ClassTypeElt=ClassType >@@ -104,8 +93,10 @@ > DimWithOrWithOutExpr=Dimension > DimWithOrWithOutExprs=Dimensions > Dims=Dimensions >+DimsAnnotLoop=DimsAnnotLoop > DimsLoop=Dimensions > Dimsopt=Dimensions >+DimsoptAnnotsopt=AnnotationsDimensionsSequence > DoStatement=DoStatement > ElidedLeftBraceAndReturn=ElidedLeftBraceAndReturn > EmptyStatement=EmptyStatement >@@ -157,6 +148,7 @@ > FormalParameterListopt=FormalParameterList > GenericMethodDeclaration=GenericMethodDeclaration > GenericType=GenericType >+GenericTypeDotName=GenericTypeDotName > Goal=Goal > Header1=Header1 > Header2=Header2 >@@ -172,6 +164,7 @@ > Initializer=Initializer > InsideCastExpression=InsideCastExpression > InsideCastExpressionLL1=InsideCastExpression >+InsideCastExpressionWithAnnotatedQualifiedGenerics=InsideCastExpression > InsideCastExpressionWithQualifiedGenerics=InsideCastExpression > InstanceofExpression=Expression > InstanceofExpression_NotName=Expression >@@ -229,6 +222,7 @@ > NormalAnnotation=NormalAnnotation > NumericType=NumericType > OneDimLoop=Dimension >+OneDimOrAnnot=OneDimensionOrAnnotation > OnlySynchronized=OnlySynchronized > OnlyTypeArguments=TypeArguments > OnlyTypeArgumentsForCastExpression=TypeArguments >@@ -237,10 +231,12 @@ > PackageComment=PackageComment > PackageDeclaration=PackageDeclaration > PackageDeclarationName=PackageDeclarationName >+PopZeroTypeAnnotations=PopZeroTypeAnnotations > PostDecrementExpression=PostDecrementExpression > PostIncrementExpression=PostIncrementExpression > PostfixExpression=Expression > PostfixExpression_NotName=Expression >+PotentialNameArray=PotentialNameArray > PreDecrementExpression=PreDecrementExpression > PreIncrementExpression=PreIncrementExpression > Primary=Expression >@@ -253,7 +249,12 @@ > PushModifiersForHeader=PushModifiersForHeader > PushPosition=PushPosition > PushRPAREN=) >+PushRPARENForAnnotatedTypeCast=) >+PushRPARENForNameAndAnnotatedTypeCast=) >+PushRPARENForNameUnannotatedTypeCast=) >+PushRPARENForUnannotatedTypeCast=) > PushRealModifiers=PushRealModifiers >+PushZeroTypeAnnotations=ZeroTypeAnnotations > QualifiedClassBodyopt=ClassBody > QualifiedEnterAnonymousClassBody=EnterAnonymousClassBody > QualifiedName=QualifiedName >@@ -261,6 +262,7 @@ > RecoveryMethodHeaderName=MethodHeaderName > ReduceImports=ReduceImports > ReferenceExpression=ReferenceExpression >+ReferenceType0=ReferenceType > ReferenceType1=ReferenceType1 > ReferenceType2=ReferenceType2 > ReferenceType3=ReferenceType3 >@@ -302,7 +304,9 @@ > TryBlock=Block > TryStatement=TryStatement > TryStatementWithResources=TryStatementWithResources >+Type0=Type > Type=Type >+TypeAnnotations=TypeAnnotations > TypeArgument1=TypeArgument1 > TypeArgument2=TypeArgument2 > TypeArgument3=TypeArgument3 >@@ -318,6 +322,7 @@ > TypeElidedFormalParameterList=TypeElidedFormalParameterList > TypeImportOnDemandDeclaration=TypeImportOnDemandDeclaration > TypeImportOnDemandDeclarationName=TypeImportOnDemandDeclarationName >+TypeInternal=Type > TypeParameter1=TypeParameter1 > TypeParameter=TypeParameter > TypeParameterHeader=TypeParameter >@@ -333,6 +338,7 @@ > UnqualifiedEnterAnonymousClassBody=EnterAnonymousClassBody > VariableDeclarator=VariableDeclarator > VariableDeclaratorId=VariableDeclaratorId >+VariableDeclaratorIdOrThis=VariableDeclaratorIdOrThis > VariableDeclarators=VariableDeclarators > VariableInitializer=VariableInitializer > VariableInitializers=VariableInitializers >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 9ebf5e7..086ba92 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 >@@ -9,6 +9,10 @@ > * Community Process (JCP) and is made available for testing and evaluation purposes > * only. The code is not compatible with any specification of the JCP. > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Benjamin Muskalla - Contribution for bug 239066 >@@ -2573,6 +2577,14 @@ > methodDecl.sourceStart, > methodDecl.sourceEnd); > } >+public void invalidLocationForModifiers(ASTNode location) { >+ this.handle( >+ IProblem.InvalidLocationForModifiers, >+ NoArgument, >+ NoArgument, >+ location.sourceStart, >+ location.sourceEnd); >+} > public void illegalModifierForVariable(LocalDeclaration localDecl, boolean complainAsArgument) { > String[] arguments = new String[] {new String(localDecl.name)}; > this.handle( >@@ -2640,6 +2652,15 @@ > arguments, > argType.sourceStart, > argType.sourceEnd); >+} >+public void illegalThis(Argument argument, AbstractMethodDeclaration method, long sourceLevel) { >+ String[] arguments = NoArgument; >+ this.handle( >+ sourceLevel <= ClassFileConstants.JDK1_7 ? IProblem.ExplicitThisParameterNotBelow18 : IProblem.IllegalDeclarationOfThisParameter, >+ arguments, >+ arguments, >+ argument.sourceStart, >+ argument.sourceEnd); > } > public void illegalVisibilityModifierCombinationForField(ReferenceBinding type, FieldDeclaration fieldDecl) { > String[] arguments = new String[] {new String(fieldDecl.name)}; >@@ -4148,6 +4169,41 @@ > argument.type.sourceStart, > argument.sourceEnd); > } >+ >+public void invalidUsageOfTypeAnnotations(Annotation annotation) { >+ this.handle( >+ IProblem.InvalidUsageOfTypeAnnotations, >+ NoArgument, >+ NoArgument, >+ annotation.sourceStart, >+ annotation.sourceEnd); >+} >+ >+public void illegalReceiverAnnotations(Annotation first, Annotation last) { >+ this.handle( >+ IProblem.InvalidUsageOfReceiverAnnotations, >+ NoArgument, >+ NoArgument, >+ first.sourceStart, >+ last.sourceEnd); >+} >+ >+public void misplacedTypeAnnotations(Annotation first, Annotation last) { >+ this.handle( >+ IProblem.MisplacedTypeAnnotations, >+ NoArgument, >+ NoArgument, >+ first.sourceStart, >+ last.sourceEnd); >+} >+public void illegalUsageOfTypeAnnotations(Annotation annotation) { >+ this.handle( >+ IProblem.IllegalUsageOfTypeAnnotations, >+ NoArgument, >+ NoArgument, >+ annotation.sourceStart, >+ annotation.sourceEnd); >+} > public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) { > this.referenceContext = compUnitDecl; > String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)}; >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 62774eb..f1576dd 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 >@@ -586,7 +586,13 @@ > 634 = The method {0}({1}) of type {2} must override or implement a supertype method > 635 = Unnecessary @SuppressWarnings("{0}") > 636 = The method {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superinterface method >- >+637 = Syntax error, type annotations are available only when source level is at least 1.8 >+638 = Receiver annotations are illegal in a static method context >+639 = Syntax error, type annotations are illegal here >+640 = Syntax error, modifiers are illegal here >+641 = Type annotation is illegal for a method that returns void >+642 = Only the first formal parameter of an instance method may be declared explicitly as "this" >+643 = Explicit declaration of "this" parameter is allowed only at source level 1.8 or above > ### MORE GENERICS > 660 = Unused type arguments for the non generic constructor {0}({1}) of type {2}; it should not be parameterized with arguments <{3}> > >diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java >index 0b4e059..efe4aff 100644 >--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java >+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -792,6 +796,9 @@ > > // reset stacks in consistent state > this.expressionPtr = -1; >+ this.unattachedAnnotationPtr = -1; >+ this.typeAnnotationLengthPtr = -1; >+ this.typeAnnotationPtr = -1; > this.identifierPtr = -1; > this.identifierLengthPtr = -1; > >diff --git a/org.eclipse.jdt.core/grammar/java.g b/org.eclipse.jdt.core/grammar/java.g >index 6739000..0ad3ec1 100644 >--- a/org.eclipse.jdt.core/grammar/java.g >+++ b/org.eclipse.jdt.core/grammar/java.g >@@ -182,9 +182,8 @@ > Goal ::= '>>' StaticInitializer > Goal ::= '>>' Initializer > -- error recovery >--- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method >-Goal ::= '>>>' Header1 Modifiersopt >-Goal ::= '!' Header2 Modifiersopt >+Goal ::= '>>>' Header1 RecoveryExitHeader >+Goal ::= '!' Header2 RecoveryExitHeader > Goal ::= '*' BlockStatements > Goal ::= '*' CatchHeader > -- JDOM >@@ -205,6 +204,9 @@ > Goal ::= '?' AnnotationTypeMemberDeclaration > /:$readableName Goal:/ > >+RecoveryExitHeader ::= $empty >+RecoveryExitHeader ::= '...' >+ > Literal -> IntegerLiteral > Literal -> LongLiteral > Literal -> FloatingPointLiteral >@@ -218,9 +220,37 @@ > BooleanLiteral -> false > /:$readableName BooleanLiteral:/ > >-Type ::= PrimitiveType >+-- Type is a wrapper that automatically allows for jsr308 style >+-- annotations to prefix a (Java5/6) Type. If type annotations >+-- are illegal in a certain place, use TypeInternal instead. >+-- If type annotations are legal, but so are java5/6 style >+-- declaration annotations, use Type0 instead. >+ >+Type ::= TypeInternal >+-- consumeUnannotatedType inserts 0 at the suitable place in the type >+-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right >+-- length of the type annotations 0 or otherwise. >+/.$putCase consumeUnannotatedType(); $break ./ >+Type ::= TypeAnnotations TypeInternal >+/:$compliance 1.7:/ >+/:$readableName Type:/ >+ >+-- Type0 is to be used in places where type annotations are legal >+-- but are not consumed as TypeAnnotations, but as modifiers. This >+-- is because from the parser's point of view there are places where >+-- java5/6 style declarations annotations can occur in the same place >+-- and it is too early to tell which is which. >+Type0 ::= TypeInternal >+-- consumeUnannotatedType inserts 0 at the suitable place in the type >+-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right >+-- length of the type annotations 0 or otherwise. >+/.$putCase consumeUnannotatedType(); $break ./ >+/:$readableName Type:/ >+ >+-- TypeInternal is the Java5/6 Type >+TypeInternal ::= PrimitiveType > /.$putCase consumePrimitiveType(); $break ./ >-Type -> ReferenceType >+TypeInternal -> ReferenceType0 > /:$readableName Type:/ > > PrimitiveType -> NumericType >@@ -241,27 +271,72 @@ > FloatingPointType -> 'double' > /:$readableName FloatingPointType:/ > >-ReferenceType ::= ClassOrInterfaceType >-/.$putCase consumeReferenceType(); $break ./ >-ReferenceType -> ArrayType >+---------------------------- JSR308------------------------------------------- >+-- ReferenceType has been wrapped now, so that it can be used by itself without >+-- having to spell out the rule once with Modifiers & once without. >+-- If type annotations are not legal prefixes to ReferenceType at some point, use >+-- ReferenceType0 instead. Otherwise reject the annotations in the parser. >+ >+ReferenceType ::= ReferenceType0 >+-- consumeUnannotatedType inserts 0 at the suitable place in the type >+-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right >+-- length of the type annotations 0 or otherwise. >+/.$putCase consumeUnannotatedType(); $break ./ >+ReferenceType ::= Modifiers ReferenceType0 >+/.$putCase consumeAnnotatedType(); $break ./ >+/:$compliance 1.7:/ > /:$readableName ReferenceType:/ > >---------------------------------------------------------------- >--- 1.5 feature >---------------------------------------------------------------- >-ClassOrInterfaceType -> ClassOrInterface >-ClassOrInterfaceType -> GenericType >+ReferenceType0 ::= ClassOrInterfaceType0 >+/.$putCase consumeReferenceType(); $break ./ >+ReferenceType0 -> ArrayType >+/:$readableName ReferenceType:/ >+ >+Annotationsopt ::= $empty >+/.$putCase consumeZeroTypeAnnotations(true); $break ./ >+Annotationsopt -> TypeAnnotations >+/:$compliance 1.7:/ >+/:$readableName Annotationsopt:/ >+ >+-- ClassOrInterfaceType has now been wrapped so that it automatically includes >+-- JSR308 style optional annotations. Use ClassOrInterfaceType0 if annotations >+-- are illegal in some place - otherwise reject the annotations in the parser. >+ClassOrInterfaceType ::= Annotationsopt ClassOrInterfaceType0 > /:$readableName Type:/ > >-ClassOrInterface ::= Name >-/.$putCase consumeClassOrInterfaceName(); $break ./ >-ClassOrInterface ::= GenericType '.' Name >-/.$putCase consumeClassOrInterface(); $break ./ >+ClassOrInterfaceType0 -> ClassOrInterface0 >+ClassOrInterfaceType0 -> GenericType >+/:$readableName Type:/ >+---------------------------- JSR308------------------------------------------- >+ >+-- ClassOrInterface has been wrapped now so that it ALWAYS PUSHES >+-- A 0 IN THE TYPE ANNOTATIONS LENGTH STACK. If this behavior is >+-- not desirable, then (a) use ClassOrInterface0 if possible or (b) >+-- if that is not possible due to conflicts, then this 0 will have >+-- to be popped suitably when erroneous/extraneous. See the use of >+-- the production PopZeroTypeAnnotations for examples. >+ >+ClassOrInterface ::= ClassOrInterface0 >+/.$putCase consumeZeroTypeAnnotations(true); $break ./ > /:$readableName Type:/ > >-GenericType ::= ClassOrInterface TypeArguments >-/.$putCase consumeGenericType(); $break ./ >+ClassOrInterface0 ::= Name >+/.$putCase consumeClassOrInterfaceName(); $break ./ >+ClassOrInterface0 ::= GenericTypeDotName >+/:$readableName Type:/ >+ >+PopZeroTypeAnnotations ::= $empty >+/.$putCase consumeZeroTypeAnnotations(false); $break ./ >+/:$readableName PopZeroTypeAnnotations:/ >+ >+GenericType ::= ClassOrInterface TypeArguments PopZeroTypeAnnotations >+/.$putCase consumeGenericType(); $break ./ >+/:$compliance 1.5:/ > /:$readableName GenericType:/ >+ >+GenericTypeDotName ::= GenericType '.' Name >+/.$putCase consumeClassOrInterface(); $break ./ >+/:$readableName GenericTypeDotName:/ > > GenericType ::= ClassOrInterface '<' '>' > /.$putCase consumeGenericTypeWithDiamond(); $break ./ >@@ -277,8 +352,7 @@ > -- ArrayType ::= ArrayType '[' ']' > -- > >-ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name >-/.$putCase consumeArrayTypeWithTypeArgumentsName(); $break ./ >+ArrayTypeWithTypeArgumentsName ::= GenericTypeDotName > /:$readableName ArrayTypeWithTypeArgumentsName:/ > > ArrayType ::= PrimitiveType Dims >@@ -357,8 +431,12 @@ > /:$readableName Header1:/ > > Header2 -> Header >-Header2 -> EnumConstantHeader >+Header2 -> EnumConstantHeader RecoveryEnumConstantSeparatoropt > /:$readableName Header2:/ >+ >+RecoveryEnumConstantSeparatoropt ::= $empty >+RecoveryEnumConstantSeparatoropt ::= ',' >+RecoveryEnumConstantSeparatoropt ::= ';' > > CatchHeader ::= 'catch' '(' CatchFormalParameter ')' '{' > /.$putCase consumeCatchHeader(); $break ./ >@@ -384,7 +462,7 @@ > /:$compliance 1.5:/ > > PackageDeclarationName ::= PackageComment 'package' Name >-/.$putCase consumePackageDeclarationName(); $break ./ >+/.$putCase consumePackageDeclarationName(); $break ./ > /:$readableName PackageDeclarationName:/ > > PackageComment ::= $empty >@@ -558,7 +636,7 @@ > -- | 'transient' > -- | 'volatile' > >-FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';' >+FieldDeclaration ::= Modifiersopt Type0 VariableDeclarators ';' > /.$putCase consumeFieldDeclaration(); $break ./ > /:$readableName FieldDeclaration:/ > >@@ -566,6 +644,7 @@ > VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator > /.$putCase consumeVariableDeclarators(); $break ./ > /:$readableName VariableDeclarators:/ >+/:$recovery_template Identifier:/ > > VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization > VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization >@@ -590,6 +669,12 @@ > RestoreDiet ::= $empty > /.$putCase consumeRestoreDiet(); $break ./ > /:$readableName RestoreDiet:/ >+ >+VariableDeclaratorIdOrThis ::= 'this' >+/.$putCase consumeExplicitThisParameter(); $break ./ >+VariableDeclaratorIdOrThis -> VariableDeclaratorId >+/:$readableName VariableDeclaratorIdOrThis:/ >+/:$compliance 1.8:/ > > VariableDeclaratorId ::= 'Identifier' Dimsopt > /:$readableName VariableDeclaratorId:/ >@@ -629,7 +714,7 @@ > > MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./ >-MethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+MethodHeaderName ::= Modifiersopt Type0 'Identifier' '(' > /.$putCase consumeMethodHeaderName(false); $break ./ > /:$readableName MethodHeaderName:/ > >@@ -661,10 +746,33 @@ > /.$putCase consumeFormalParameterList(); $break ./ > /:$readableName FormalParameterList:/ > >+PotentialNameArray -> $empty >+/.$putCase consumePotentialNameArrayType(); $break ./ >+/:$readableName PotentialNameArray:/ >+ > --1.1 feature >-FormalParameter ::= Modifiersopt Type VariableDeclaratorId >+--FormalParameter ::= Modifiersopt Type VariableDeclaratorId >+--FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId >+--The above rules have been rewritten by inlinng the type subgrammar >+--to avoid the conflicts resulting from jsr308 changes. >+FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt VariableDeclaratorIdOrThis > /.$putCase consumeFormalParameter(false); $break ./ >-FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId >+FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(true); $break ./ >+/:$compliance 1.5:/ >+FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray '...' VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(true); $break ./ >+/:$compliance 1.5:/ >+FormalParameter ::= Modifiersopt GenericType DimsoptAnnotsopt VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt GenericType DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(true); $break ./ >+/:$compliance 1.5:/ >+FormalParameter ::= Modifiersopt GenericTypeDotName DimsoptAnnotsopt VariableDeclaratorIdOrThis >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt GenericTypeDotName DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis > /.$putCase consumeFormalParameter(true); $break ./ > /:$readableName FormalParameter:/ > /:$compliance 1.5:/ >@@ -679,7 +787,7 @@ > /.$putCase consumeCatchType(); $break ./ > /:$readableName CatchType:/ > >-UnionType ::= Type >+UnionType ::= TypeInternal > /.$putCase consumeUnionTypeAsClassType(); $break ./ > UnionType ::= UnionType '|' Type > /.$putCase consumeUnionType(); $break ./ >@@ -706,7 +814,7 @@ > > --18.8.4 Productions from 8.5: Static Initializers > >-StaticInitializer ::= StaticOnly Block >+StaticInitializer ::= StaticOnly Block > /.$putCase consumeStaticInitializer(); $break./ > /:$readableName StaticInitializer:/ > >@@ -842,7 +950,6 @@ > InvalidInitializer -> Initializer > /:$readableName InvalidInitializer:/ > >- > InterfaceMemberDeclaration -> AbstractMethodDeclaration > InterfaceMemberDeclaration -> InvalidConstructorDeclaration > InterfaceMemberDeclaration -> InvalidInitializer >@@ -906,13 +1013,13 @@ > /.$putCase consumeLocalVariableDeclarationStatement(); $break ./ > /:$readableName LocalVariableDeclarationStatement:/ > >-LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators >+LocalVariableDeclaration ::= Type0 PushModifiers VariableDeclarators > /.$putCase consumeLocalVariableDeclaration(); $break ./ > -- 1.1 feature > -- The modifiers part of this rule makes the grammar more permissive. > -- The only modifier here is final. We put Modifiers to allow multiple modifiers > -- This will require to check the validity of the modifier >-LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators >+LocalVariableDeclaration ::= Modifiers Type0 PushRealModifiers VariableDeclarators > /.$putCase consumeLocalVariableDeclaration(); $break ./ > /:$readableName LocalVariableDeclaration:/ > >@@ -980,7 +1087,7 @@ > /:$readableName LabeledStatement:/ > > Label ::= 'Identifier' >-/.$putCase consumeLabel() ; $break ./ >+/.$putCase consumeLabel(); $break ./ > /:$readableName Label:/ > > ExpressionStatement ::= StatementExpression ';' >@@ -1154,12 +1261,12 @@ > /:$readableName ;:/ > /:$compliance 1.7:/ > >-Resource ::= Type PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization >+Resource ::= TypeInternal PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization > /.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./ > /:$readableName Resource:/ > /:$compliance 1.7:/ > >-Resource ::= Modifiers Type PushRealModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization >+Resource ::= Modifiers TypeInternal PushRealModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization > /.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./ > /:$readableName Resource:/ > /:$compliance 1.7:/ >@@ -1180,7 +1287,7 @@ > /.$putCase consumeStatementCatch() ; $break ./ > /:$readableName CatchClause:/ > >-Finally ::= 'finally' Block >+Finally ::= 'finally' Block > /:$readableName Finally:/ > /:$recovery_template finally { }:/ > >@@ -1191,8 +1298,25 @@ > /.$putCase consumeLeftParen(); $break ./ > /:$readableName (:/ > /:$recovery_template (:/ >+PushRPARENForUnannotatedTypeCast ::= ')' >+/.$putCase consumeRightParenForUnannotatedTypeCast(); $break ./ >+/:$readableName ):/ >+/:$recovery_template ):/ >+PushRPARENForNameUnannotatedTypeCast ::= ')' >+/.$putCase consumeRightParenForNameUnannotatedTypeCast(); $break ./ >+/:$readableName ):/ >+/:$recovery_template ):/ > PushRPAREN ::= ')' > /.$putCase consumeRightParen(); $break ./ >+/:$readableName ):/ >+/:$recovery_template ):/ >+PushRPARENForAnnotatedTypeCast ::= ')' >+/.$putCase consumeRightParenForAnnotatedTypeCast(); $break ./ >+/:$readableName ):/ >+/:$recovery_template ):/ >+ >+PushRPARENForNameAndAnnotatedTypeCast ::= ')' >+/.$putCase consumeRightParenForNameAndAnnotatedTypeCast(); $break ./ > /:$readableName ):/ > /:$recovery_template ):/ > >@@ -1214,6 +1338,7 @@ > PrimaryNoNewArray -> ClassInstanceCreationExpression > PrimaryNoNewArray -> FieldAccess > --1.1 feature >+-- javac doesn't permit type annotations here. > PrimaryNoNewArray ::= Name '.' 'this' > /.$putCase consumePrimaryNoNewArrayNameThis(); $break ./ > PrimaryNoNewArray ::= Name '.' 'super' >@@ -1390,18 +1515,18 @@ > /.$putCase consumeArgumentList(); $break ./ > /:$readableName ArgumentList:/ > >-ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs >+-- ArrayCreationHeader is used only in recovery and the consume* method is a NOP. >+ArrayCreationHeader ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationHeader(); $break ./ >- > ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationHeader(); $break ./ > /:$readableName ArrayCreationHeader:/ > >-ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs >+ArrayCreationWithoutArrayInitializer ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ > /:$readableName ArrayCreationWithoutArrayInitializer:/ > >-ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer >+ArrayCreationWithArrayInitializer ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs ArrayInitializer > /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ > /:$readableName ArrayCreationWithArrayInitializer:/ > >@@ -1416,11 +1541,45 @@ > /.$putCase consumeDimWithOrWithOutExprs(); $break ./ > /:$readableName Dimensions:/ > >-DimWithOrWithOutExpr ::= '[' Expression ']' >-DimWithOrWithOutExpr ::= '[' ']' >+DimWithOrWithOutExpr ::= '[' PushZeroTypeAnnotations Expression ']' >+DimWithOrWithOutExpr ::= TypeAnnotations '[' Expression ']' >+/:$compliance 1.7:/ >+DimWithOrWithOutExpr ::= '[' PushZeroTypeAnnotations ']' > /. $putCase consumeDimWithOrWithOutExpr(); $break ./ >+DimWithOrWithOutExpr ::= TypeAnnotations '[' ']' >+/. $putCase consumeDimWithOrWithOutExpr(); $break ./ >+/:$compliance 1.7:/ > /:$readableName Dimension:/ > -- ----------------------------------------------- >+ >+-- jsr 308 >+ >+DimsoptAnnotsopt -> $empty >+/. $putCase consumeEmptyDimsoptAnnotsopt(); $break ./ >+/:$readableName AnnotationsDimensionsSequence:/ >+DimsoptAnnotsopt -> DimsAnnotLoop >+/. $putCase consumeDimsWithTrailingAnnotsopt(); $break ./ >+/:$readableName Dimensionsoptannotsopt:/ >+DimsAnnotLoop ::= OneDimOrAnnot >+DimsAnnotLoop ::= DimsAnnotLoop OneDimOrAnnot >+/:$readableName DimsAnnotLoop:/ >+ >+OneDimOrAnnot ::= Annotation >+/. $putCase consumeTypeAnnotation(true); $break ./ >+-- Complain if source level < 1.7 >+/:$compliance 1.7:/ >+OneDimOrAnnot -> '[' ']' >+/. $putCase consumeOneDimLoop(true); $break ./ >+-- Bump up dimensions && mark zero annotations. >+/:$readableName OneDimensionOrAnnotation:/ >+ >+TypeAnnotations ::= Annotation >+/. $putCase consumeTypeAnnotation(false); $break ./ >+/:$compliance 1.7:/ >+TypeAnnotations ::= TypeAnnotations Annotation >+/. $putCase consumeOneMoreTypeAnnotation(); $break ./ >+/:$compliance 1.7:/ >+/:$readableName TypeAnnotations:/ > > Dims ::= DimsLoop > /. $putCase consumeDims(); $break ./ >@@ -1429,8 +1588,14 @@ > DimsLoop ::= DimsLoop OneDimLoop > /:$readableName Dimensions:/ > OneDimLoop ::= '[' ']' >-/. $putCase consumeOneDimLoop(); $break ./ >+/. $putCase consumeOneDimLoop(false); $break ./ >+-- Bump up dimensions && mark zero annotations. > /:$readableName Dimension:/ >+OneDimLoop ::= TypeAnnotations '[' ']' >+/:$compliance 1.7:/ >+/. $putCase consumeOneDimLoopWithAnnotations(); $break ./ >+-- Bump up dimensions >+/:$readableName DimensionWithAnnotations:/ > > FieldAccess ::= Primary '.' 'Identifier' > /.$putCase consumeFieldAccess(false); $break ./ >@@ -1511,16 +1676,31 @@ > UnaryExpressionNotPlusMinus -> CastExpression > /:$readableName Expression:/ > >-CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression >+CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpression > /.$putCase consumeCastExpressionWithPrimitiveType(); $break ./ >-CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >+CastExpression ::= PushLPAREN Modifiers PrimitiveType Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpression >+/:$compliance 1.7:/ >+/.$putCase consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations(); $break ./ >+CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithGenericsArray(); $break ./ >-CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus >+CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus >+/:$compliance 1.7:/ >+/.$putCase consumeCastExpressionWithGenericsArrayWithTypeAnnotations(); $break ./ >+CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType0 Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./ >-CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus >+CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType0 Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpressionWithAnnotatedQualifiedGenerics UnaryExpressionNotPlusMinus >+/:$compliance 1.7:/ >+/.$putCase consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations(); $break ./ >+CastExpression ::= PushLPAREN Name PushRPARENForNameUnannotatedTypeCast InsideCastExpressionLL1 UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionLL1(); $break ./ >-CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >+CastExpression ::= PushLPAREN Modifiers Name PushRPARENForNameAndAnnotatedTypeCast InsideCastExpressionLL1 UnaryExpressionNotPlusMinus >+/:$compliance 1.7:/ >+/.$putCase consumeCastExpressionLL1WithTypeAnnotations(); $break ./ >+CastExpression ::= PushLPAREN Name Dims PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithNameArray(); $break ./ >+CastExpression ::= PushLPAREN Modifiers Name Dims PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus >+/:$compliance 1.7:/ >+/.$putCase consumeCastExpressionWithNameArrayWithTypeAnnotations(); $break ./ > /:$readableName CastExpression:/ > > OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments >@@ -1535,6 +1715,10 @@ > /:$readableName InsideCastExpression:/ > InsideCastExpressionWithQualifiedGenerics ::= $empty > /.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./ >+/:$readableName InsideCastExpression:/ >+ >+InsideCastExpressionWithAnnotatedQualifiedGenerics ::= $empty >+/.$putCase consumeInsideCastExpressionWithAnnotatedQualifiedGenerics(); $break ./ > /:$readableName InsideCastExpression:/ > > MultiplicativeExpression -> UnaryExpression >@@ -1842,11 +2026,11 @@ > /.$putCase consumeEnhancedForStatement(); $break ./ > /:$readableName EnhancedForStatementNoShortIf:/ > >-EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt >+EnhancedForStatementHeaderInit ::= 'for' '(' Type0 PushModifiers Identifier Dimsopt > /.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./ > /:$readableName EnhancedForStatementHeaderInit:/ > >-EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt >+EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type0 PushRealModifiers Identifier Dimsopt > /.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./ > /:$readableName EnhancedForStatementHeaderInit:/ > >@@ -1921,8 +2105,11 @@ > /:$compliance 1.5:/ > ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2 > /.$putCase consumeTypeArgumentReferenceType1(); $break ./ >-/:$readableName ReferenceType1:/ > /:$compliance 1.5:/ >+ReferenceType1 ::= Modifiers ClassOrInterface '<' TypeArgumentList2 >+/:$compliance 1.7:/ >+/.$putCase consumeTypeArgumentReferenceType1WithTypeAnnotations(); $break ./ >+/:$readableName ReferenceType1:/ > > TypeArgumentList2 -> TypeArgument2 > /:$compliance 1.5:/ >@@ -1942,8 +2129,11 @@ > /:$compliance 1.5:/ > ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3 > /.$putCase consumeTypeArgumentReferenceType2(); $break ./ >-/:$readableName ReferenceType2:/ > /:$compliance 1.5:/ >+ReferenceType2 ::= Modifiers ClassOrInterface '<' TypeArgumentList3 >+/:$compliance 1.7:/ >+/.$putCase consumeTypeArgumentReferenceType2WithTypeAnnotations(); $break ./ >+/:$readableName ReferenceType2:/ > > TypeArgumentList3 -> TypeArgument3 > TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3 >@@ -2025,10 +2215,17 @@ > /:$readableName WildcardBound3:/ > /:$compliance 1.5:/ > >-TypeParameterHeader ::= Identifier >+PushZeroTypeAnnotations ::= $empty >+/.$putCase consumeZeroTypeAnnotations(true); $break ./ >+/:$readableName ZeroTypeAnnotations:/ >+ >+TypeParameterHeader ::= PushZeroTypeAnnotations Identifier >+/.$putCase consumeTypeParameterHeader(); $break ./ >+/:$compliance 1.5:/ >+TypeParameterHeader ::= TypeAnnotations Identifier >+/:$compliance 1.7:/ > /.$putCase consumeTypeParameterHeader(); $break ./ > /:$readableName TypeParameter:/ >-/:$compliance 1.5:/ > > TypeParameters ::= '<' TypeParameterList1 > /.$putCase consumeTypeParameters(); $break ./ >@@ -2295,7 +2492,7 @@ > > AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./ >-AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+AnnotationMethodHeaderName ::= Modifiersopt Type0 'Identifier' '(' > /.$putCase consumeMethodHeaderName(true); $break ./ > /:$readableName MethodHeaderName:/ > /:$compliance 1.5:/ >@@ -2341,6 +2538,7 @@ > /.$putCase consumeAnnotationName() ; $break ./ > /:$readableName AnnotationName:/ > /:$compliance 1.5:/ >+/:$recovery_template @ Identifier:/ > > NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')' > /.$putCase consumeNormalAnnotation() ; $break ./ >@@ -2438,7 +2636,7 @@ > RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeRecoveryMethodHeaderNameWithTypeParameters(); $break ./ > /:$compliance 1.5:/ >-RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+RecoveryMethodHeaderName ::= Modifiersopt Type0 'Identifier' '(' > /.$putCase consumeRecoveryMethodHeaderName(); $break ./ > /:$readableName MethodHeaderName:/ > >diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java >index 597b56c..5b7e66e 100644 >--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java >+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 > * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -18,6 +22,7 @@ > import org.eclipse.jdt.internal.compiler.ast.*; > import org.eclipse.jdt.internal.compiler.parser.*; > import org.eclipse.jdt.internal.compiler.problem.*; >+import org.eclipse.jdt.internal.compiler.util.Util; > > public class DocumentElementParser extends Parser { > IDocumentElementRequestor requestor; >@@ -450,6 +455,9 @@ > char[] varName = this.identifierStack[this.identifierPtr]; > long namePosition = this.identifierPositionStack[this.identifierPtr--]; > int extendedTypeDimension = this.intStack[this.intPtr--]; >+ // pop any annotations on extended dimensions now, so they don't pollute the base dimensions. >+ Annotation [][] annotationsOnExtendedDimensions = extendedTypeDimension == 0 ? null : getAnnotationsOnDimensions(extendedTypeDimension); >+ > > AbstractVariableDeclaration declaration; > if (this.nestedMethod[this.nestedType] != 0) { >@@ -513,7 +521,12 @@ > declaration.type = type; > } else { > int dimension = typeDim + extendedTypeDimension; >- declaration.type = copyDims(type, dimension); >+ Annotation [][] annotationsOnAllDimensions = null; >+ Annotation[][] annotationsOnDimensions = type.getAnnotationsOnDimensions(); >+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(typeDim, annotationsOnDimensions, extendedTypeDimension, annotationsOnExtendedDimensions); >+ } >+ declaration.type = copyDims(type, dimension, annotationsOnAllDimensions); > } > this.variablesCounter[this.nestedType]++; > this.nestedMethod[this.nestedType]++; >@@ -536,6 +549,126 @@ > (int) namePosition, > extendedTypeDimension, > extendedTypeDimension == 0 ? -1 : this.endPosition); >+ } >+} >+protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { >+ TypeReference type; >+ >+ char[] identifierName = this.identifierStack[this.identifierPtr]; >+ long namePosition = this.identifierPositionStack[this.identifierPtr]; >+ >+ LocalDeclaration localDeclaration = createLocalDeclaration(identifierName, (int) (namePosition >>> 32), (int) namePosition); >+ localDeclaration.declarationSourceEnd = localDeclaration.declarationEnd; >+ >+ int extraDims = this.intStack[this.intPtr--]; >+ this.identifierPtr--; >+ this.identifierLengthPtr--; >+ // remove fake modifiers/modifiers start >+ int declarationSourceStart1 = 0; >+ int modifiersSourceStart1 = 0; >+ int modifiersValue = 0; >+ if (hasModifiers) { >+ declarationSourceStart1 = this.intStack[this.intPtr--]; >+ modifiersSourceStart1 = this.intStack[this.intPtr--]; >+ modifiersValue = this.intStack[this.intPtr--]; >+ } else { >+ this.intPtr-=3; >+ } >+ >+ type = getTypeReference(this.intStack[this.intPtr--] + extraDims); // type dimension >+ >+ // consume annotations >+ int length; >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--])!= 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ localDeclaration.annotations = new Annotation[length], >+ 0, >+ length); >+ } >+ if (hasModifiers) { >+ localDeclaration.declarationSourceStart = declarationSourceStart1; >+ localDeclaration.modifiersSourceStart = modifiersSourceStart1; >+ localDeclaration.modifiers = modifiersValue; >+ } else { >+ localDeclaration.declarationSourceStart = type.sourceStart; >+ } >+ localDeclaration.type = type; >+ >+ ForeachStatement iteratorForStatement = >+ new ForeachStatement( >+ localDeclaration, >+ this.intStack[this.intPtr--]); >+ pushOnAstStack(iteratorForStatement); >+ >+ iteratorForStatement.sourceEnd = localDeclaration.declarationSourceEnd; >+} >+protected void consumeMethodHeaderNameWithTypeParameters(boolean isAnnotationMethod) { >+ // MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' >+ // AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' >+ // RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' >+ MethodDeclaration md = null; >+ if(isAnnotationMethod) { >+ md = new AnnotationMethodDeclaration(this.compilationUnit.compilationResult); >+ this.recordStringLiterals = false; >+ } else { >+ md = new MethodDeclaration(this.compilationUnit.compilationResult); >+ } >+ >+ //name >+ md.selector = this.identifierStack[this.identifierPtr]; >+ long selectorSource = this.identifierPositionStack[this.identifierPtr--]; >+ this.identifierLengthPtr--; >+ //type >+ md.returnType = getTypeReference(this.intStack[this.intPtr--]); >+ >+ // consume type parameters >+ int length = this.genericsLengthStack[this.genericsLengthPtr--]; >+ this.genericsPtr -= length; >+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, md.typeParameters = new TypeParameter[length], 0, length); >+ >+ //modifiers >+ md.declarationSourceStart = this.intStack[this.intPtr--]; >+ md.modifiersSourceStart = this.intStack[this.intPtr--]; >+ md.modifiers = this.intStack[this.intPtr--]; >+ // consume annotations >+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.expressionStack, >+ (this.expressionPtr -= length) + 1, >+ md.annotations = new Annotation[length], >+ 0, >+ length); >+ } >+ // javadoc >+ md.javadoc = this.javadoc; >+ this.javadoc = null; >+ >+ //highlight starts at selector start >+ md.sourceStart = (int) (selectorSource >>> 32); >+ pushOnAstStack(md); >+ md.sourceEnd = this.lParenPos; >+ md.bodyStart = this.lParenPos+1; >+ this.listLength = 0; // initialize this.listLength before reading parameters/throws >+ >+ // recovery >+ if (this.currentElement != null){ >+ boolean isType; >+ if ((isType = this.currentElement instanceof RecoveredType) >+ //|| md.modifiers != 0 >+ || (Util.getLineNumber(md.returnType.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr) >+ == Util.getLineNumber(md.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr))){ >+ if(isType) { >+ ((RecoveredType) this.currentElement).pendingTypeParameters = null; >+ } >+ this.lastCheckPoint = md.bodyStart; >+ this.currentElement = this.currentElement.add(md, 0); >+ this.lastIgnoredToken = -1; >+ } else { >+ this.lastCheckPoint = md.sourceStart; >+ this.restartRecovery = true; >+ } > } > } > /* >@@ -598,10 +731,31 @@ > endOfEllipsis = this.intStack[this.intPtr--]; > } > int firstDimensions = this.intStack[this.intPtr--]; >- final int typeDimensions = firstDimensions + extendedDimensions; >- TypeReference type = getTypeReference(typeDimensions); >+ TypeReference type = getUnannotatedTypeReference(extendedDimensions); >+ Annotation [] varArgsAnnotations = null; >+ int length; >+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) { >+ System.arraycopy( >+ this.typeAnnotationStack, >+ (this.typeAnnotationPtr -= length) + 1, >+ varArgsAnnotations = new Annotation[length], >+ 0, >+ length); >+ } >+ final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0); >+ if (typeDimensions != extendedDimensions) { >+ // jsr308 type annotations management >+ Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions); >+ Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null); >+ } >+ type = copyDims(type, typeDimensions, annotationsOnAllDimensions); >+ type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition; >+ } > if (isVarArgs) { >- type = copyDims(type, typeDimensions + 1); > if (extendedDimensions == 0) { > type.sourceEnd = endOfEllipsis; > } >@@ -615,7 +769,6 @@ > type, > this.intStack[this.intPtr + 1]);// modifiers > // consume annotations >- int length; > if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { > System.arraycopy( > this.expressionStack, >@@ -878,7 +1031,14 @@ > TypeReference returnType = md.returnType; > md.sourceEnd = this.endPosition; > int dims = returnType.dimensions() + extendedDims; >- md.returnType = copyDims(returnType, dims); >+ Annotation [][] annotationsOnDimensions = returnType.getAnnotationsOnDimensions(); >+ Annotation [][] annotationsOnExtendedDimensions = getAnnotationsOnDimensions(extendedDims); >+ Annotation [][] annotationsOnAllDimensions = null; >+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) { >+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(returnType.dimensions(), annotationsOnDimensions, extendedDims, annotationsOnExtendedDimensions); >+ } >+ md.returnType = copyDims(returnType, dims, annotationsOnAllDimensions); >+ > if (this.currentToken == TokenNameLBRACE) { > md.bodyStart = this.endPosition + 1; > } >@@ -1399,7 +1559,7 @@ > * This variable is a type reference and dim will be its dimensions. > * We don't have any side effect on the stacks' pointers. > */ >- >+ Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim); > int length; > TypeReference ref; > if ((length = this.identifierLengthStack[localIdentifierLengthPtr]) == 1) { >@@ -1414,12 +1574,13 @@ > new ArrayTypeReference( > this.identifierStack[localIdentifierPtr], > dim, >+ annotationsOnDimensions, > this.identifierPositionStack[localIdentifierPtr--]); > ref.sourceEnd = this.endPosition; > } > } else { > if (length < 0) { //flag for precompiled type reference on base types >- ref = TypeReference.baseTypeReference(-length, dim); >+ ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions); > ref.sourceStart = this.intStack[this.localIntPtr--]; > if (dim == 0) { > ref.sourceEnd = this.intStack[this.localIntPtr--]; >@@ -1441,7 +1602,7 @@ > if (dim == 0) > ref = new QualifiedTypeReference(tokens, positions); > else >- ref = new ArrayQualifiedTypeReference(tokens, dim, positions); >+ ref = new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions); > } > } > return ref; >diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >index 58e476b..097a37a 100644 >--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -730,13 +734,16 @@ > return null; > } > } >-public TypeReference getTypeReference(int dim) { >+public TypeReference getUnannotatedTypeReference(int dim) { > /* build a Reference on a variable that may be qualified or not > * This variable is a type reference and dim will be its dimensions > */ >+ Annotation [][] annotationsOnDimensions = null; >+ TypeReference ref; > int length = this.identifierLengthStack[this.identifierLengthPtr--]; > if (length < 0) { //flag for precompiled type reference on base types >- TypeReference ref = TypeReference.baseTypeReference(-length, dim); >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); >+ ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions); > ref.sourceStart = this.intStack[this.intPtr--]; > if (dim == 0) { > ref.sourceEnd = this.intStack[this.intPtr--]; >@@ -747,12 +754,11 @@ > if (this.reportReferenceInfo){ > this.requestor.acceptTypeReference(ref.getParameterizedTypeName(), ref.sourceStart, ref.sourceEnd); > } >- return ref; > } else { > int numberOfIdentifiers = this.genericsIdentifiersLengthStack[this.genericsIdentifiersLengthPtr--]; > if (length != numberOfIdentifiers || this.genericsLengthStack[this.genericsLengthPtr] != 0) { > // generic type >- TypeReference ref = getTypeReferenceForGenericType(dim, length, numberOfIdentifiers); >+ ref = getTypeReferenceForGenericType(dim, length, numberOfIdentifiers); > if (this.reportReferenceInfo) { > if (length == 1 && numberOfIdentifiers == 1) { > ParameterizedSingleTypeReference parameterizedSingleTypeReference = (ParameterizedSingleTypeReference) ref; >@@ -762,30 +768,29 @@ > this.requestor.acceptTypeReference(parameterizedQualifiedTypeReference.tokens, parameterizedQualifiedTypeReference.sourceStart, parameterizedQualifiedTypeReference.sourceEnd); > } > } >- return ref; > } else if (length == 1) { > // single variable reference > this.genericsLengthPtr--; // pop the 0 > if (dim == 0) { >- SingleTypeReference ref = >+ ref = > new SingleTypeReference( > this.identifierStack[this.identifierPtr], > this.identifierPositionStack[this.identifierPtr--]); > if (this.reportReferenceInfo) { >- this.requestor.acceptTypeReference(ref.token, ref.sourceStart); >+ this.requestor.acceptTypeReference(((SingleTypeReference)ref).token, ref.sourceStart); > } >- return ref; > } else { >- ArrayTypeReference ref = >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); >+ ref = > new ArrayTypeReference( > this.identifierStack[this.identifierPtr], > dim, >+ annotationsOnDimensions, > this.identifierPositionStack[this.identifierPtr--]); > ref.sourceEnd = this.endPosition; > if (this.reportReferenceInfo) { >- this.requestor.acceptTypeReference(ref.token, ref.sourceStart); >+ this.requestor.acceptTypeReference(((ArrayTypeReference)ref).token, ref.sourceStart); > } >- return ref; > } > } else {//Qualified variable reference > this.genericsLengthPtr--; >@@ -800,22 +805,22 @@ > 0, > length); > if (dim == 0) { >- QualifiedTypeReference ref = new QualifiedTypeReference(tokens, positions); >+ ref = new QualifiedTypeReference(tokens, positions); > if (this.reportReferenceInfo) { >- this.requestor.acceptTypeReference(ref.tokens, ref.sourceStart, ref.sourceEnd); >+ this.requestor.acceptTypeReference(((QualifiedTypeReference)ref).tokens, ref.sourceStart, ref.sourceEnd); > } >- return ref; > } else { >- ArrayQualifiedTypeReference ref = >- new ArrayQualifiedTypeReference(tokens, dim, positions); >+ annotationsOnDimensions = getAnnotationsOnDimensions(dim); >+ ref = >+ new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions); > ref.sourceEnd = this.endPosition; > if (this.reportReferenceInfo) { >- this.requestor.acceptTypeReference(ref.tokens, ref.sourceStart, ref.sourceEnd); >+ this.requestor.acceptTypeReference(((ArrayQualifiedTypeReference)ref).tokens, ref.sourceStart, ref.sourceEnd); > } >- return ref; > } > } > } >+ return ref; > } > public NameReference getUnspecifiedReference() { > /* build a (unspecified) NameReference which may be qualified*/ >diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >index e627215..60e683c 100644 >--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -740,8 +744,16 @@ > this.nodeSet.addTrustedMatch(result, true); > return result; > } >-protected TypeReference getTypeReference(int dim) { >- TypeReference typeRef = super.getTypeReference(dim); >+protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation [][] annotationsOnDimensions) { >+ TypeReference result = super.copyDims(typeRef, dim, annotationsOnDimensions); >+ if (this.nodeSet.removePossibleMatch(typeRef) != null) >+ this.nodeSet.addPossibleMatch(result); >+ else if (this.nodeSet.removeTrustedMatch(typeRef) != null) >+ this.nodeSet.addTrustedMatch(result, true); >+ return result; >+} >+protected TypeReference getUnannotatedTypeReference(int dim) { >+ TypeReference typeRef = super.getUnannotatedTypeReference(dim); > if (this.patternFineGrain == 0) { > this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 287648
:
145655
|
145779
|
145880
|
146186
|
146401
|
146602
|
148041
|
148087
|
149501
|
149970
|
150486
|
187248
|
217341
|
217581
|
217668
|
217685
|
217786