Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 287648 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-3 / +7 lines)
Lines 4-9 Link Here
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 *
11
 *
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 12682-12688 Link Here
12682
		new String[] {
12686
		new String[] {
12683
				"X1.java",
12687
				"X1.java",
12684
				"public class X1 {\n" +
12688
				"public class X1 {\n" +
12685
				"	Zork;\n" +
12689
				"	Zork z;\n" +
12686
				"}\n",
12690
				"}\n",
12687
				"org/eclipse/jdt/annotation/NonNull.java",
12691
				"org/eclipse/jdt/annotation/NonNull.java",
12688
				NONNULL_ANNOTATION_CONTENT,
12692
				NONNULL_ANNOTATION_CONTENT,
Lines 12703-12711 Link Here
12703
		"A default nullness annotation has not been specified for the type X1\n" + 
12707
		"A default nullness annotation has not been specified for the type X1\n" + 
12704
		"----------\n" + 
12708
		"----------\n" + 
12705
		"2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X1.java (at line 2)\n" + 
12709
		"2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X1.java (at line 2)\n" + 
12706
		"	Zork;\n" + 
12710
		"	Zork z;\n" + 
12707
		"	^^^^\n" + 
12711
		"	^^^^\n" + 
12708
		"Syntax error on token \"Zork\", VariableDeclarator expected after this token\n" + 
12712
		"Zork cannot be resolved to a type\n" + 
12709
		"----------\n" + 
12713
		"----------\n" + 
12710
		"2 problems (1 error, 1 warning)", 
12714
		"2 problems (1 error, 1 warning)", 
12711
		true);
12715
		true);
(-)a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java (+14 lines)
Lines 453-458 Link Here
453
		expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", DEPRECATED);
453
		expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", DEPRECATED);
454
		expectedProblemAttributes.put("ExceptionTypeNotFound", DEPRECATED);
454
		expectedProblemAttributes.put("ExceptionTypeNotFound", DEPRECATED);
455
		expectedProblemAttributes.put("ExceptionTypeNotVisible", DEPRECATED);
455
		expectedProblemAttributes.put("ExceptionTypeNotVisible", DEPRECATED);
456
		expectedProblemAttributes.put("ExplicitThisParameterNotBelow18", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
456
		expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE));
457
		expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE));
457
		expectedProblemAttributes.put("ExpressionShouldBeAVariable", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
458
		expectedProblemAttributes.put("ExpressionShouldBeAVariable", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
458
		expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
459
		expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
Lines 484-489 Link Here
484
		expectedProblemAttributes.put("IllegalAnnotationForBaseType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
485
		expectedProblemAttributes.put("IllegalAnnotationForBaseType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
485
		expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
486
		expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
486
		expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
487
		expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
488
		expectedProblemAttributes.put("IllegalDeclarationOfThisParameter", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
487
		expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
489
		expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
488
		expectedProblemAttributes.put("IllegalDimension", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
490
		expectedProblemAttributes.put("IllegalDimension", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
489
		expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
491
		expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
Lines 526-531 Link Here
526
		expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
528
		expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
527
		expectedProblemAttributes.put("IllegalUnderscorePosition", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
529
		expectedProblemAttributes.put("IllegalUnderscorePosition", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
528
		expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
530
		expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
531
		expectedProblemAttributes.put("IllegalUsageOfTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
529
		expectedProblemAttributes.put("IllegalVararg", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
532
		expectedProblemAttributes.put("IllegalVararg", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
530
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
533
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
531
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
534
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
Lines 587-592 Link Here
587
		expectedProblemAttributes.put("InvalidHighSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
590
		expectedProblemAttributes.put("InvalidHighSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
588
		expectedProblemAttributes.put("InvalidInput", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
591
		expectedProblemAttributes.put("InvalidInput", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
589
		expectedProblemAttributes.put("InvalidLowSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
592
		expectedProblemAttributes.put("InvalidLowSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
593
		expectedProblemAttributes.put("InvalidLocationForModifiers", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
590
		expectedProblemAttributes.put("InvalidNullToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
594
		expectedProblemAttributes.put("InvalidNullToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
591
		expectedProblemAttributes.put("InvalidOctal", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
595
		expectedProblemAttributes.put("InvalidOctal", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
592
		expectedProblemAttributes.put("InvalidOperator", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
596
		expectedProblemAttributes.put("InvalidOperator", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
Lines 605-611 Link Here
605
		expectedProblemAttributes.put("InvalidUsageOfAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
609
		expectedProblemAttributes.put("InvalidUsageOfAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
606
		expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
610
		expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
607
		expectedProblemAttributes.put("InvalidUsageOfForeachStatements", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
611
		expectedProblemAttributes.put("InvalidUsageOfForeachStatements", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
612
		expectedProblemAttributes.put("InvalidUsageOfReceiverAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
608
		expectedProblemAttributes.put("InvalidUsageOfStaticImports", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
613
		expectedProblemAttributes.put("InvalidUsageOfStaticImports", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
614
		expectedProblemAttributes.put("InvalidUsageOfTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
609
		expectedProblemAttributes.put("InvalidUsageOfTypeArguments", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
615
		expectedProblemAttributes.put("InvalidUsageOfTypeArguments", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
610
		expectedProblemAttributes.put("InvalidUsageOfTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
616
		expectedProblemAttributes.put("InvalidUsageOfTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
611
		expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
617
		expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
Lines 701-706 Link Here
701
		expectedProblemAttributes.put("MethodRequiresBody", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
707
		expectedProblemAttributes.put("MethodRequiresBody", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
702
		expectedProblemAttributes.put("MethodReturnsVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
708
		expectedProblemAttributes.put("MethodReturnsVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
703
		expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
709
		expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
710
		expectedProblemAttributes.put("MisplacedTypeAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
704
		expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
711
		expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
705
		expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
712
		expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
706
		expectedProblemAttributes.put("MissingEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
713
		expectedProblemAttributes.put("MissingEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
Lines 1159-1164 Link Here
1159
		expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", SKIP);
1166
		expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", SKIP);
1160
		expectedProblemAttributes.put("ExceptionTypeNotFound", SKIP);
1167
		expectedProblemAttributes.put("ExceptionTypeNotFound", SKIP);
1161
		expectedProblemAttributes.put("ExceptionTypeNotVisible", SKIP);
1168
		expectedProblemAttributes.put("ExceptionTypeNotVisible", SKIP);
1169
		expectedProblemAttributes.put("ExplicitThisParameterNotBelow18", SKIP);
1162
		expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(JavaCore.COMPILER_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE));
1170
		expectedProblemAttributes.put("ExplicitlyClosedAutoCloseable", new ProblemAttributes(JavaCore.COMPILER_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE));
1163
		expectedProblemAttributes.put("ExpressionShouldBeAVariable", SKIP);
1171
		expectedProblemAttributes.put("ExpressionShouldBeAVariable", SKIP);
1164
		expectedProblemAttributes.put("ExternalProblemFixable", SKIP);
1172
		expectedProblemAttributes.put("ExternalProblemFixable", SKIP);
Lines 1190-1195 Link Here
1190
		expectedProblemAttributes.put("IllegalAnnotationForBaseType", SKIP);
1198
		expectedProblemAttributes.put("IllegalAnnotationForBaseType", SKIP);
1191
		expectedProblemAttributes.put("IllegalCast", SKIP);
1199
		expectedProblemAttributes.put("IllegalCast", SKIP);
1192
		expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", SKIP);
1200
		expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", SKIP);
1201
		expectedProblemAttributes.put("IllegalDeclarationOfThisParameter", SKIP);
1193
		expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(JavaCore.COMPILER_PB_NULL_SPECIFICATION_VIOLATION));
1202
		expectedProblemAttributes.put("IllegalDefinitionToNonNullParameter", new ProblemAttributes(JavaCore.COMPILER_PB_NULL_SPECIFICATION_VIOLATION));
1194
		expectedProblemAttributes.put("IllegalDimension", SKIP);
1203
		expectedProblemAttributes.put("IllegalDimension", SKIP);
1195
		expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP);
1204
		expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP);
Lines 1232-1237 Link Here
1232
		expectedProblemAttributes.put("IllegalTypeVariableSuperReference", SKIP);
1241
		expectedProblemAttributes.put("IllegalTypeVariableSuperReference", SKIP);
1233
		expectedProblemAttributes.put("IllegalUnderscorePosition", SKIP);
1242
		expectedProblemAttributes.put("IllegalUnderscorePosition", SKIP);
1234
		expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", SKIP);
1243
		expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", SKIP);
1244
		expectedProblemAttributes.put("IllegalUsageOfTypeAnnotations", SKIP);
1235
		expectedProblemAttributes.put("IllegalVararg", SKIP);
1245
		expectedProblemAttributes.put("IllegalVararg", SKIP);
1236
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", SKIP);
1246
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", SKIP);
1237
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", SKIP);
1247
		expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", SKIP);
Lines 1293-1298 Link Here
1293
		expectedProblemAttributes.put("InvalidHighSurrogate", SKIP);
1303
		expectedProblemAttributes.put("InvalidHighSurrogate", SKIP);
1294
		expectedProblemAttributes.put("InvalidInput", SKIP);
1304
		expectedProblemAttributes.put("InvalidInput", SKIP);
1295
		expectedProblemAttributes.put("InvalidLowSurrogate", SKIP);
1305
		expectedProblemAttributes.put("InvalidLowSurrogate", SKIP);
1306
		expectedProblemAttributes.put("InvalidLocationForModifiers", SKIP);
1296
		expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP);
1307
		expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP);
1297
		expectedProblemAttributes.put("InvalidOctal", SKIP);
1308
		expectedProblemAttributes.put("InvalidOctal", SKIP);
1298
		expectedProblemAttributes.put("InvalidOperator", SKIP);
1309
		expectedProblemAttributes.put("InvalidOperator", SKIP);
Lines 1311-1317 Link Here
1311
		expectedProblemAttributes.put("InvalidUsageOfAnnotations", SKIP);
1322
		expectedProblemAttributes.put("InvalidUsageOfAnnotations", SKIP);
1312
		expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", SKIP);
1323
		expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", SKIP);
1313
		expectedProblemAttributes.put("InvalidUsageOfForeachStatements", SKIP);
1324
		expectedProblemAttributes.put("InvalidUsageOfForeachStatements", SKIP);
1325
		expectedProblemAttributes.put("InvalidUsageOfReceiverAnnotations", SKIP);
1314
		expectedProblemAttributes.put("InvalidUsageOfStaticImports", SKIP);
1326
		expectedProblemAttributes.put("InvalidUsageOfStaticImports", SKIP);
1327
		expectedProblemAttributes.put("InvalidUsageOfTypeAnnotations", SKIP);
1315
		expectedProblemAttributes.put("InvalidUsageOfTypeArguments", SKIP);
1328
		expectedProblemAttributes.put("InvalidUsageOfTypeArguments", SKIP);
1316
		expectedProblemAttributes.put("InvalidUsageOfTypeParameters", SKIP);
1329
		expectedProblemAttributes.put("InvalidUsageOfTypeParameters", SKIP);
1317
		expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", SKIP);
1330
		expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", SKIP);
Lines 1407-1412 Link Here
1407
		expectedProblemAttributes.put("MethodRequiresBody", SKIP);
1420
		expectedProblemAttributes.put("MethodRequiresBody", SKIP);
1408
		expectedProblemAttributes.put("MethodReturnsVoid", SKIP);
1421
		expectedProblemAttributes.put("MethodReturnsVoid", SKIP);
1409
		expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST));
1422
		expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST));
1423
		expectedProblemAttributes.put("MisplacedTypeAnnotations", SKIP);
1410
		expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", SKIP);
1424
		expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", SKIP);
1411
		expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(JavaCore.COMPILER_PB_SWITCH_MISSING_DEFAULT_CASE));
1425
		expectedProblemAttributes.put("MissingDefaultCase", new ProblemAttributes(JavaCore.COMPILER_PB_SWITCH_MISSING_DEFAULT_CASE));
1412
		expectedProblemAttributes.put("MissingEnclosingInstance", SKIP);
1426
		expectedProblemAttributes.put("MissingEnclosingInstance", SKIP);
(-)a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java (-1 / +11 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 55-60 Link Here
55
public TypeReference copyDims(int dim){
59
public TypeReference copyDims(int dim){
56
	return this;
60
	return this;
57
}
61
}
62
/*
63
 * No expansion of the completion reference into an array one
64
 */
65
public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){
66
	return this;
67
}
58
protected TypeBinding getTypeBinding(Scope scope) {
68
protected TypeBinding getTypeBinding(Scope scope) {
59
	// it can be a package, type or member type
69
	// it can be a package, type or member type
60
	Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope
70
	Binding binding = scope.parent.getTypeOrPackage(this.tokens); // step up from the ClassScope
(-)a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java (-1 / +11 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 55-60 Link Here
55
public TypeReference copyDims(int dim){
59
public TypeReference copyDims(int dim){
56
	return this;
60
	return this;
57
}
61
}
62
/*
63
 * No expansion of the completion reference into an array one
64
 */
65
public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){
66
	return this;
67
}
58
protected TypeBinding getTypeBinding(Scope scope) {
68
protected TypeBinding getTypeBinding(Scope scope) {
59
    if (this.fieldTypeCompletionNode != null) {
69
    if (this.fieldTypeCompletionNode != null) {
60
		throw new CompletionNodeFound(this.fieldTypeCompletionNode, scope);
70
		throw new CompletionNodeFound(this.fieldTypeCompletionNode, scope);
(-)a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-7 / +67 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 1156-1164 Link Here
1156
				if(info == LESS && node instanceof TypeReference) {
1160
				if(info == LESS && node instanceof TypeReference) {
1157
					if(this.identifierLengthPtr > -1 && this.identifierLengthStack[this.identifierLengthPtr]!= 0) {
1161
					if(this.identifierLengthPtr > -1 && this.identifierLengthStack[this.identifierLengthPtr]!= 0) {
1158
						if (consumeTypeArguments) consumeTypeArguments();
1162
						if (consumeTypeArguments) consumeTypeArguments();
1159
						TypeReference ref = this.getTypeReference(0);
1163
						TypeReference ref;
1160
						if(prevKind == K_PARAMETERIZED_CAST) {
1164
						if(prevKind == K_PARAMETERIZED_CAST) {
1165
							ref = this.getUnannotatedTypeReference(0);  // by design type is not annotated.
1161
							ref = computeQualifiedGenericsFromRightSide(ref, 0);
1166
							ref = computeQualifiedGenericsFromRightSide(ref, 0);
1167
						} else {
1168
							ref = this.getTypeReference(0);
1162
						}
1169
						}
1163
						if(this.currentElement instanceof RecoveredType) {
1170
						if(this.currentElement instanceof RecoveredType) {
1164
							this.currentElement = this.currentElement.add(new CompletionOnFieldType(ref, false), 0);
1171
							this.currentElement = this.currentElement.add(new CompletionOnFieldType(ref, false), 0);
Lines 1360-1366 Link Here
1360
		if ((length = this.identifierLengthStack[this.identifierLengthPtr-1]) < 0) {
1367
		if ((length = this.identifierLengthStack[this.identifierLengthPtr-1]) < 0) {
1361
			// build the primitive type node
1368
			// build the primitive type node
1362
			int dim = isAfterArrayType() ? this.intStack[this.intPtr--] : 0;
1369
			int dim = isAfterArrayType() ? this.intStack[this.intPtr--] : 0;
1363
			SingleTypeReference typeRef = (SingleTypeReference)TypeReference.baseTypeReference(-length, dim);
1370
			Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
1371
			SingleTypeReference typeRef = (SingleTypeReference)TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions);
1364
			typeRef.sourceStart = this.intStack[this.intPtr--];
1372
			typeRef.sourceStart = this.intStack[this.intPtr--];
1365
			if (dim == 0) {
1373
			if (dim == 0) {
1366
				typeRef.sourceEnd = this.intStack[this.intPtr--];
1374
				typeRef.sourceEnd = this.intStack[this.intPtr--];
Lines 2589-2594 Link Here
2589
	}
2597
	}
2590
}
2598
}
2591
protected void consumeFormalParameter(boolean isVarArgs) {
2599
protected void consumeFormalParameter(boolean isVarArgs) {
2600
	
2601
	this.invocationType = NO_RECEIVER;
2602
	this.qualifier = -1;
2603
	
2592
	if (this.indexOfAssistIdentifier() < 0) {
2604
	if (this.indexOfAssistIdentifier() < 0) {
2593
		super.consumeFormalParameter(isVarArgs);
2605
		super.consumeFormalParameter(isVarArgs);
2594
		if (this.pendingAnnotation != null) {
2606
		if (this.pendingAnnotation != null) {
Lines 2606-2615 Link Here
2606
			endOfEllipsis = this.intStack[this.intPtr--];
2618
			endOfEllipsis = this.intStack[this.intPtr--];
2607
		}
2619
		}
2608
		int firstDimensions = this.intStack[this.intPtr--];
2620
		int firstDimensions = this.intStack[this.intPtr--];
2609
		final int typeDimensions = firstDimensions + extendedDimensions;
2621
		TypeReference type = getUnannotatedTypeReference(extendedDimensions);
2610
		TypeReference type = getTypeReference(typeDimensions);
2622
		Annotation [] varArgsAnnotations = null;
2623
		int length;
2624
		if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
2625
			System.arraycopy(
2626
				this.typeAnnotationStack,
2627
				(this.typeAnnotationPtr -= length) + 1,
2628
				varArgsAnnotations = new Annotation[length],
2629
				0,
2630
				length);
2631
		} 
2632
		final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0);
2633
		if (typeDimensions != extendedDimensions) {
2634
			// jsr308 type annotations management
2635
			Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions);
2636
			Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions();
2637
			Annotation [][] annotationsOnAllDimensions = null;
2638
			if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) {
2639
				annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); 
2640
				annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null);
2641
			}
2642
			type = copyDims(type, typeDimensions, annotationsOnAllDimensions);
2643
			type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition;
2644
		}
2611
		if (isVarArgs) {
2645
		if (isVarArgs) {
2612
			type = copyDims(type, typeDimensions + 1);
2613
			if (extendedDimensions == 0) {
2646
			if (extendedDimensions == 0) {
2614
				type.sourceEnd = endOfEllipsis;
2647
				type.sourceEnd = endOfEllipsis;
2615
			}
2648
			}
Lines 2623-2629 Link Here
2623
				type,
2656
				type,
2624
				this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
2657
				this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
2625
		// consume annotations
2658
		// consume annotations
2626
		int length;
2627
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2659
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2628
			System.arraycopy(
2660
			System.arraycopy(
2629
				this.expressionStack,
2661
				this.expressionStack,
Lines 2725-2730 Link Here
2725
	}
2757
	}
2726
	pushOnElementStack(K_CAST_STATEMENT);
2758
	pushOnElementStack(K_CAST_STATEMENT);
2727
}
2759
}
2760
protected void consumeInsideCastExpressionWithAnnotatedQualifiedGenerics() {
2761
	popElement(K_PARAMETERIZED_CAST);
2762
2763
	Expression castType;
2764
	int end = this.intStack[this.intPtr--];
2765
2766
	int dim = this.intStack[this.intPtr--];
2767
	// TODO is it an annotated type reference?
2768
	TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
2769
2770
	castType = computeQualifiedGenericsFromRightSide(rightSide, dim);
2771
	this.intPtr--;
2772
	castType.sourceEnd = end - 1;
2773
	castType.sourceStart = this.intStack[this.intPtr--] + 1;
2774
	pushOnExpressionStack(castType);
2775
2776
	pushOnElementStack(K_CAST_STATEMENT);
2777
}
2728
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
2778
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
2729
	popElement(K_PARAMETERIZED_CAST);
2779
	popElement(K_PARAMETERIZED_CAST);
2730
2780
Lines 2732-2738 Link Here
2732
	int end = this.intStack[this.intPtr--];
2782
	int end = this.intStack[this.intPtr--];
2733
2783
2734
	int dim = this.intStack[this.intPtr--];
2784
	int dim = this.intStack[this.intPtr--];
2735
	TypeReference rightSide = getTypeReference(0);
2785
	TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
2736
2786
2737
	castType = computeQualifiedGenericsFromRightSide(rightSide, dim);
2787
	castType = computeQualifiedGenericsFromRightSide(rightSide, dim);
2738
	this.intPtr--;
2788
	this.intPtr--;
Lines 4384-4389 Link Here
4384
	}
4434
	}
4385
	return result;
4435
	return result;
4386
}
4436
}
4437
protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation[][] annotationsOnDimensions) {
4438
	if (this.assistNode == typeRef) {
4439
		return typeRef;
4440
	}
4441
	TypeReference result = super.copyDims(typeRef, dim, annotationsOnDimensions);
4442
	if (this.assistNodeParent == typeRef) {
4443
		this.assistNodeParent = result;
4444
	}
4445
	return result;
4446
}
4387
public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int cursorLoc) {
4447
public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int cursorLoc) {
4388
4448
4389
	this.cursorLocation = cursorLoc;
4449
	this.cursorLocation = cursorLoc;
(-)a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java (-3 / +10 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 897-909 Link Here
897
/*
901
/*
898
 * Build specific type reference nodes in case the cursor is located inside the type reference
902
 * Build specific type reference nodes in case the cursor is located inside the type reference
899
 */
903
 */
900
protected TypeReference getTypeReference(int dim) {
904
protected TypeReference getUnannotatedTypeReference(int dim) {
901
905
902
	int index;
906
	int index;
903
907
904
	/* no need to take action if not inside completed identifiers */
908
	/* no need to take action if not inside completed identifiers */
905
	if ((index = indexOfAssistIdentifier(true)) < 0) {
909
	if ((index = indexOfAssistIdentifier(true)) < 0) {
906
		return super.getTypeReference(dim);
910
		return super.getUnannotatedTypeReference(dim);
907
	}
911
	}
908
	int length = this.identifierLengthStack[this.identifierLengthPtr];
912
	int length = this.identifierLengthStack[this.identifierLengthPtr];
909
	TypeReference reference;
913
	TypeReference reference;
Lines 1627-1632 Link Here
1627
	this.astLengthPtr = -1;
1631
	this.astLengthPtr = -1;
1628
	this.expressionPtr = -1;
1632
	this.expressionPtr = -1;
1629
	this.expressionLengthPtr = -1;
1633
	this.expressionLengthPtr = -1;
1634
	this.unattachedAnnotationPtr = -1;
1635
	this.typeAnnotationLengthPtr = -1;
1636
	this.typeAnnotationPtr = -1;
1630
	this.identifierPtr = -1;
1637
	this.identifierPtr = -1;
1631
	this.identifierLengthPtr	= -1;
1638
	this.identifierLengthPtr	= -1;
1632
	this.intPtr = -1;
1639
	this.intPtr = -1;
(-)a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java (-5 / +29 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 606-615 Link Here
606
			endOfEllipsis = this.intStack[this.intPtr--];
610
			endOfEllipsis = this.intStack[this.intPtr--];
607
		}
611
		}
608
		int firstDimensions = this.intStack[this.intPtr--];
612
		int firstDimensions = this.intStack[this.intPtr--];
609
		final int typeDimensions = firstDimensions + extendedDimensions;
613
		TypeReference type = getUnannotatedTypeReference(extendedDimensions);
610
		TypeReference type = getTypeReference(typeDimensions);
614
		Annotation [] varArgsAnnotations = null;
615
		int length;
616
		if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
617
			System.arraycopy(
618
				this.typeAnnotationStack,
619
				(this.typeAnnotationPtr -= length) + 1,
620
				varArgsAnnotations = new Annotation[length],
621
				0,
622
				length);
623
		} 
624
		final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0);
625
		if (typeDimensions != extendedDimensions) {
626
			// jsr308 type annotations management
627
			Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions);
628
			Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions();
629
			Annotation [][] annotationsOnAllDimensions = null;
630
			if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) {
631
				annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); 
632
				annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null);
633
			}
634
			type = copyDims(type, typeDimensions, annotationsOnAllDimensions);
635
			type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition;
636
		}
611
		if (isVarArgs) {
637
		if (isVarArgs) {
612
			type = copyDims(type, typeDimensions + 1);
613
			if (extendedDimensions == 0) {
638
			if (extendedDimensions == 0) {
614
				type.sourceEnd = endOfEllipsis;
639
				type.sourceEnd = endOfEllipsis;
615
			}
640
			}
Lines 626-632 Link Here
626
		arg.declarationSourceStart = modifierPositions;
651
		arg.declarationSourceStart = modifierPositions;
627
652
628
		// consume annotations
653
		// consume annotations
629
		int length;
630
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
654
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
631
			System.arraycopy(
655
			System.arraycopy(
632
				this.expressionStack,
656
				this.expressionStack,
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java (+14 lines)
Lines 1291-1296 Link Here
1291
	int UnusedWarningToken = Internal + 635;
1291
	int UnusedWarningToken = Internal + 635;
1292
	/** @since 3.6 */
1292
	/** @since 3.6 */
1293
	int MissingOverrideAnnotationForInterfaceMethodImplementation = MethodRelated + 636;
1293
	int MissingOverrideAnnotationForInterfaceMethodImplementation = MethodRelated + 636;
1294
	/** @since 3.9 */
1295
    int InvalidUsageOfTypeAnnotations = Syntax + Internal + 637;
1296
    /** @since 3.9 */
1297
    int InvalidUsageOfReceiverAnnotations = Syntax + Internal + 638;
1298
    /** @since 3.9 */
1299
    int MisplacedTypeAnnotations = Syntax + Internal + 639;
1300
    /** @since 3.9 */
1301
    int InvalidLocationForModifiers = Syntax + Internal + 640;
1302
    /** @since 3.9*/
1303
    int IllegalUsageOfTypeAnnotations = Internal + Syntax + 641;
1304
    /** @since 3.9*/
1305
    int IllegalDeclarationOfThisParameter = Internal + Syntax + 642;
1306
    /** @since 3.9*/
1307
    int ExplicitThisParameterNotBelow18 = Internal + Syntax + 643;
1294
1308
1295
	/**
1309
	/**
1296
	 * More problems in generics
1310
	 * More problems in generics
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java (-1 / +63 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 49-54 Link Here
49
		// do nothing by default
53
		// do nothing by default
50
	}
54
	}
51
	public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
55
	public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
56
		// do nothing by default
57
	}
58
	public void endVisit(ArrayInitializer arrayInitializer, ClassScope scope) {
52
		// do nothing by default
59
		// do nothing by default
53
	}
60
	}
54
	public void endVisit(
61
	public void endVisit(
Lines 271-280 Link Here
271
		// do nothing by default
278
		// do nothing by default
272
	}
279
	}
273
	/**
280
	/**
281
	 * @param annotation
282
	 * @param scope
283
	 */
284
	public void endVisit(MarkerAnnotation annotation, ClassScope scope) {
285
		// do nothing by default
286
	}
287
	/**
274
	 * @param pair
288
	 * @param pair
275
	 * @param scope
289
	 * @param scope
276
	 */
290
	 */
277
	public void endVisit(MemberValuePair pair, BlockScope scope) {
291
	public void endVisit(MemberValuePair pair, BlockScope scope) {
292
		// do nothing by default
293
	}
294
	/**
295
	 * @param pair
296
	 * @param scope
297
	 */
298
	public void endVisit(MemberValuePair pair, ClassScope scope) {
278
		// do nothing by default
299
		// do nothing by default
279
	}
300
	}
280
	public void endVisit(MessageSend messageSend, BlockScope scope) {
301
	public void endVisit(MessageSend messageSend, BlockScope scope) {
Lines 292-297 Link Here
292
	 * @since 3.1
313
	 * @since 3.1
293
	 */
314
	 */
294
	public void endVisit(NormalAnnotation annotation, BlockScope scope) {
315
	public void endVisit(NormalAnnotation annotation, BlockScope scope) {
316
		// do nothing by default
317
	}
318
	public void endVisit(NormalAnnotation annotation, ClassScope scope) {
295
		// do nothing by default
319
		// do nothing by default
296
	}
320
	}
297
	public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
321
	public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
Lines 372-377 Link Here
372
	 * @since 3.1
396
	 * @since 3.1
373
	 */
397
	 */
374
	public void endVisit(SingleMemberAnnotation annotation, BlockScope scope) {
398
	public void endVisit(SingleMemberAnnotation annotation, BlockScope scope) {
399
		// do nothing by default
400
	}
401
	/**
402
	 * @param annotation
403
	 * @param scope
404
	 */
405
	public void endVisit(SingleMemberAnnotation annotation, ClassScope scope) {
375
		// do nothing by default
406
		// do nothing by default
376
	}
407
	}
377
	public void endVisit(
408
	public void endVisit(
Lines 491-496 Link Here
491
		return true; // do nothing by default, keep traversing
522
		return true; // do nothing by default, keep traversing
492
	}
523
	}
493
	public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
524
	public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
525
		return true; // do nothing by default, keep traversing
526
	}
527
	public boolean visit(ArrayInitializer arrayInitializer, ClassScope scope) {
494
		return true; // do nothing by default, keep traversing
528
		return true; // do nothing by default, keep traversing
495
	}
529
	}
496
	public boolean visit(
530
	public boolean visit(
Lines 713-723 Link Here
713
		return true;
747
		return true;
714
	}
748
	}
715
	/**
749
	/**
750
	 * @param annotation
751
	 * @param scope
752
	 */
753
	public boolean visit(MarkerAnnotation annotation, ClassScope scope) {
754
		return true;
755
	}
756
	/**
716
	 * @param pair
757
	 * @param pair
717
	 * @param scope
758
	 * @param scope
718
	 * @since 3.1
759
	 * @since 3.1
719
	 */
760
	 */
720
	public boolean visit(MemberValuePair pair, BlockScope scope) {
761
	public boolean visit(MemberValuePair pair, BlockScope scope) {
762
		return true;
763
	}
764
	/**
765
	 * @param pair
766
	 * @param scope
767
	 */
768
	public boolean visit(MemberValuePair pair, ClassScope scope) {
721
		return true;
769
		return true;
722
	}
770
	}
723
	public boolean visit(MessageSend messageSend, BlockScope scope) {
771
	public boolean visit(MessageSend messageSend, BlockScope scope) {
Lines 737-742 Link Here
737
	 * @since 3.1
785
	 * @since 3.1
738
	 */
786
	 */
739
	public boolean visit(NormalAnnotation annotation, BlockScope scope) {
787
	public boolean visit(NormalAnnotation annotation, BlockScope scope) {
788
		return true;
789
	}
790
	/**
791
	 * @param annotation
792
	 * @param scope
793
	 */
794
	public boolean visit(NormalAnnotation annotation, ClassScope scope) {
740
		return true;
795
		return true;
741
	}
796
	}
742
	public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
797
	public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
Lines 819-824 Link Here
819
	public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
874
	public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
820
		return true;
875
		return true;
821
	}
876
	}
877
	/**
878
	 * @param annotation
879
	 * @param scope
880
	 */
881
	public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) {
882
		return true;
883
	}
822
	public boolean visit(
884
	public boolean visit(
823
		SingleNameReference singleNameReference,
885
		SingleNameReference singleNameReference,
824
		BlockScope scope) {
886
		BlockScope scope) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java (-2 / +147 lines)
Lines 253-258 Link Here
253
	public static final int INVOCATION_ARGUMENT_UNCHECKED = 1;
253
	public static final int INVOCATION_ARGUMENT_UNCHECKED = 1;
254
	public static final int INVOCATION_ARGUMENT_WILDCARD = 2;
254
	public static final int INVOCATION_ARGUMENT_WILDCARD = 2;
255
255
256
	// for all declarations that can contain type references that have type annotations
257
	public static final int HasTypeAnnotations = Bit21;
258
	
256
	// for type reference (diamond case) - Java 7
259
	// for type reference (diamond case) - Java 7
257
	public static final int IsUnionType = Bit30;
260
	public static final int IsUnionType = Bit30;
258
	// Used to tag ParameterizedSingleTypeReference or ParameterizedQualifiedTypeReference when they are
261
	// Used to tag ParameterizedSingleTypeReference or ParameterizedQualifiedTypeReference when they are
Lines 528-535 Link Here
528
	public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) {
531
	public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) {
529
		int length = annotations.length;
532
		int length = annotations.length;
530
		for (int i = 0; i < length; i++) {
533
		for (int i = 0; i < length; i++) {
531
			annotations[i].print(0, output);
534
			if (i > 0) {
532
			output.append(" "); //$NON-NLS-1$
535
				output.append(" "); //$NON-NLS-1$
536
			}
537
			Annotation annotation2 = annotations[i];
538
			if (annotation2 != null) {
539
				annotation2.print(0, output);
540
			} else {
541
				output.append('?');
542
			}
533
		}
543
		}
534
		return output;
544
		return output;
535
	}
545
	}
Lines 614-619 Link Here
614
					if (length > 0) {
624
					if (length > 0) {
615
						annotations = new AnnotationBinding[length];
625
						annotations = new AnnotationBinding[length];
616
						local.setAnnotations(annotations, scope);
626
						local.setAnnotations(annotations, scope);
627
					}
628
					break;
629
				case Binding.TYPE_PARAMETER :
630
					// jsr308
631
					ReferenceBinding typeVariableBinding = (ReferenceBinding) recipient;
632
					if ((typeVariableBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
633
					typeVariableBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
634
					if (length > 0) {
635
						annotations = new AnnotationBinding[length];
636
						typeVariableBinding.setAnnotations(annotations);
637
					}
638
					break;
639
				case Binding.TYPE_USE :
640
					ReferenceBinding typeUseBinding = (ReferenceBinding) recipient;
641
					if ((typeUseBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
642
					typeUseBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
643
					if (length > 0) {
644
						annotations = new AnnotationBinding[length];
645
						typeUseBinding.setAnnotations(annotations);
617
					}
646
					}
618
					break;
647
					break;
619
				default :
648
				default :
Lines 712-717 Link Here
712
		}
741
		}
713
	}
742
	}
714
743
744
	/**
745
	 * Resolve annotations, and check duplicates, answers combined tagBits
746
	 * for recognized standard annotations
747
	 */
748
	public static void resolveAnnotations(ClassScope scope, Annotation[] sourceAnnotations, Binding recipient) {
749
		AnnotationBinding[] annotations = null;
750
		int length = sourceAnnotations == null ? 0 : sourceAnnotations.length;
751
		if (recipient != null) {
752
			switch (recipient.kind()) {
753
				case Binding.PACKAGE :
754
					PackageBinding packageBinding = (PackageBinding) recipient;
755
					if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
756
					packageBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
757
					break;
758
				case Binding.TYPE :
759
				case Binding.GENERIC_TYPE :
760
					ReferenceBinding type = (ReferenceBinding) recipient;
761
					if ((type.tagBits & TagBits.AnnotationResolved) != 0) return;
762
					type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
763
					if (length > 0) {
764
						annotations = new AnnotationBinding[length];
765
						type.setAnnotations(annotations);
766
					}
767
					break;
768
				case Binding.METHOD :
769
					MethodBinding method = (MethodBinding) recipient;
770
					if ((method.tagBits & TagBits.AnnotationResolved) != 0) return;
771
					method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
772
					if (length > 0) {
773
						annotations = new AnnotationBinding[length];
774
						method.setAnnotations(annotations);
775
					}
776
					break;
777
				case Binding.FIELD :
778
					FieldBinding field = (FieldBinding) recipient;
779
					if ((field.tagBits & TagBits.AnnotationResolved) != 0) return;
780
					field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
781
					if (length > 0) {
782
						annotations = new AnnotationBinding[length];
783
						field.setAnnotations(annotations);
784
					}
785
					break;
786
				case Binding.LOCAL :
787
					LocalVariableBinding local = (LocalVariableBinding) recipient;
788
					if ((local.tagBits & TagBits.AnnotationResolved) != 0) return;
789
					local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
790
					if (length > 0) {
791
						annotations = new AnnotationBinding[length];
792
						local.setAnnotations(annotations, scope);
793
					}
794
					break;
795
				default :
796
					return;
797
			}
798
		}
799
		if (sourceAnnotations == null)
800
			return;
801
		for (int i = 0; i < length; i++) {
802
			Annotation annotation = sourceAnnotations[i];
803
			final Binding annotationRecipient = annotation.recipient;
804
			if (annotationRecipient != null && recipient != null) {
805
				// only local and field can share annnotations
806
				switch (recipient.kind()) {
807
					case Binding.FIELD :
808
						FieldBinding field = (FieldBinding) recipient;
809
						field.tagBits = ((FieldBinding) annotationRecipient).tagBits;
810
						break;
811
					case Binding.LOCAL :
812
						LocalVariableBinding local = (LocalVariableBinding) recipient;
813
						local.tagBits = ((LocalVariableBinding) annotationRecipient).tagBits;
814
						break;
815
				}
816
				if (annotations != null) {
817
					// need to fill the instances array
818
					annotations[0] = annotation.getCompilerAnnotation();
819
					for (int j = 1; j < length; j++) {
820
						Annotation annot = sourceAnnotations[j];
821
						annotations[j] = annot.getCompilerAnnotation();
822
					}
823
				}
824
				return;
825
			} else {
826
				annotation.recipient = recipient;
827
				annotation.resolveType(scope);
828
				// null if receiver is a package binding
829
				if (annotations != null) {
830
					annotations[i] = annotation.getCompilerAnnotation();
831
				}
832
			}
833
		}
834
		// check duplicate annotations
835
		if (annotations != null) {
836
			AnnotationBinding[] distinctAnnotations = annotations; // only copy after 1st duplicate is detected
837
			for (int i = 0; i < length; i++) {
838
				AnnotationBinding annotation = distinctAnnotations[i];
839
				if (annotation == null) continue;
840
				TypeBinding annotationType = annotation.getAnnotationType();
841
				boolean foundDuplicate = false;
842
				for (int j = i+1; j < length; j++) {
843
					AnnotationBinding otherAnnotation = distinctAnnotations[j];
844
					if (otherAnnotation == null) continue;
845
					if (otherAnnotation.getAnnotationType() == annotationType) {
846
						foundDuplicate = true;
847
						if (distinctAnnotations == annotations) {
848
							System.arraycopy(distinctAnnotations, 0, distinctAnnotations = new AnnotationBinding[length], 0, length);
849
						}
850
						distinctAnnotations[j] = null; // report it only once
851
						scope.problemReporter().duplicateAnnotation(sourceAnnotations[j]);
852
					}
853
				}
854
				if (foundDuplicate) {
855
					scope.problemReporter().duplicateAnnotation(sourceAnnotations[i]);
856
				}
857
			}
858
		}
859
	}
715
/**
860
/**
716
 * Figures if @Deprecated annotation is specified, do not resolve entire annotations.
861
 * Figures if @Deprecated annotation is specified, do not resolve entire annotations.
717
 */
862
 */
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java (-1 / +28 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contributions for
14
 *     Stephan Herrmann - Contributions for
Lines 14-19 Link Here
14
 *								bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults
18
 *								bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults
15
 *******************************************************************************/
19
 *******************************************************************************/
16
package org.eclipse.jdt.internal.compiler.ast;
20
package org.eclipse.jdt.internal.compiler.ast;
21
22
import java.util.List;
17
23
18
import org.eclipse.jdt.core.compiler.*;
24
import org.eclipse.jdt.core.compiler.*;
19
import org.eclipse.jdt.internal.compiler.*;
25
import org.eclipse.jdt.internal.compiler.*;
Lines 39-44 Link Here
39
	public int modifiers;
45
	public int modifiers;
40
	public int modifiersSourceStart;
46
	public int modifiersSourceStart;
41
	public Annotation[] annotations;
47
	public Annotation[] annotations;
48
	// jsr 308
49
	public Annotation[] receiverAnnotations;
42
	public Argument[] arguments;
50
	public Argument[] arguments;
43
	public TypeReference[] thrownExceptions;
51
	public TypeReference[] thrownExceptions;
44
	public Statement[] statements;
52
	public Statement[] statements;
Lines 301-306 Link Here
301
		classFile.completeMethodInfo(this.binding, methodAttributeOffset, attributeNumber);
309
		classFile.completeMethodInfo(this.binding, methodAttributeOffset, attributeNumber);
302
	}
310
	}
303
311
312
	public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
313
		// do nothing
314
	}
315
304
	private void checkArgumentsSize() {
316
	private void checkArgumentsSize() {
305
		TypeBinding[] parameters = this.binding.parameters;
317
		TypeBinding[] parameters = this.binding.parameters;
306
		int size = 1; // an abstract method or a native method cannot be static
318
		int size = 1; // an abstract method or a native method cannot be static
Lines 396-402 Link Here
396
		}
408
		}
397
		printIndent(tab, output);
409
		printIndent(tab, output);
398
		printModifiers(this.modifiers, output);
410
		printModifiers(this.modifiers, output);
399
		if (this.annotations != null) printAnnotations(this.annotations, output);
411
		if (this.annotations != null) {
412
			printAnnotations(this.annotations, output);
413
			output.append(' ');
414
		}
400
415
401
		TypeParameter[] typeParams = typeParameters();
416
		TypeParameter[] typeParams = typeParameters();
402
		if (typeParams != null) {
417
		if (typeParams != null) {
Lines 418-423 Link Here
418
			}
433
			}
419
		}
434
		}
420
		output.append(')');
435
		output.append(')');
436
		if (this.receiverAnnotations != null) {
437
			output.append(" "); //$NON-NLS-1$
438
			printAnnotations(this.receiverAnnotations, output);
439
		}
421
		if (this.thrownExceptions != null) {
440
		if (this.thrownExceptions != null) {
422
			output.append(" throws "); //$NON-NLS-1$
441
			output.append(" throws "); //$NON-NLS-1$
423
			for (int i = 0; i < this.thrownExceptions.length; i++) {
442
			for (int i = 0; i < this.thrownExceptions.length; i++) {
Lines 462-467 Link Here
462
			bindThrownExceptions();
481
			bindThrownExceptions();
463
			resolveJavadoc();
482
			resolveJavadoc();
464
			resolveAnnotations(this.scope, this.annotations, this.binding);
483
			resolveAnnotations(this.scope, this.annotations, this.binding);
484
			// jsr308
485
			if (this.receiverAnnotations != null && this.scope.isStatic) {
486
				int last = this.receiverAnnotations.length - 1;
487
				this.scope.problemReporter().illegalReceiverAnnotations(this.receiverAnnotations[0],
488
						                                                this.receiverAnnotations[last]);
489
			}
490
			// jsr 308
491
			resolveAnnotations(this.scope, this.receiverAnnotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
465
			validateNullAnnotations();
492
			validateNullAnnotations();
466
			resolveStatements();
493
			resolveStatements();
467
			// check @Deprecated annotation presence
494
			// check @Deprecated annotation presence
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java (-2 / +9 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 87-93 Link Here
87
	public StringBuffer printAsExpression(int indent, StringBuffer output) {
91
	public StringBuffer printAsExpression(int indent, StringBuffer output) {
88
		printIndent(indent, output);
92
		printIndent(indent, output);
89
		printModifiers(this.modifiers, output);
93
		printModifiers(this.modifiers, output);
90
		if (this.annotations != null) printAnnotations(this.annotations, output);
94
		if (this.annotations != null) {
95
			printAnnotations(this.annotations, output);
96
			output.append(' ');
97
		}
91
98
92
		if (this.type != null) {
99
		if (this.type != null) {
93
			this.type.print(0, output).append(' ');
100
			this.type.print(0, output).append(' ');
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java (-13 / +431 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contributions for
14
 *     Stephan Herrmann - Contributions for
Lines 12-17 Link Here
12
 *								bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
16
 *								bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
13
 *******************************************************************************/
17
 *******************************************************************************/
14
package org.eclipse.jdt.internal.compiler.ast;
18
package org.eclipse.jdt.internal.compiler.ast;
19
20
import java.util.Stack;
15
21
16
import org.eclipse.jdt.core.compiler.CharOperation;
22
import org.eclipse.jdt.core.compiler.CharOperation;
17
import org.eclipse.jdt.internal.compiler.ASTVisitor;
23
import org.eclipse.jdt.internal.compiler.ASTVisitor;
Lines 25-30 Link Here
25
 * Annotation
31
 * Annotation
26
 */
32
 */
27
public abstract class Annotation extends Expression {
33
public abstract class Annotation extends Expression {
34
	
35
	/**
36
	 * Return the location for the corresponding annotation inside the type reference, <code>null</code> if none.
37
	 */
38
	public static int[] getLocations(
39
			final TypeReference reference,
40
			final Annotation[] primaryAnnotation,
41
			final Annotation annotation,
42
			final Annotation[][] annotationsOnDimensionsOnExpression) {
43
		class LocationCollector extends ASTVisitor {
44
			Stack currentIndexes;
45
			Annotation currentAnnotation;
46
			boolean search = true;
47
			
48
			public LocationCollector(Annotation currentAnnotation) {
49
				this.currentIndexes = new Stack();
50
				this.currentAnnotation = currentAnnotation;
51
			}
52
			public boolean visit(ArrayTypeReference typeReference, BlockScope scope) {
53
				if (!this.search) return false;
54
				Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
55
				if (annotationsOnDimensions != null) {
56
					// check if the annotation is located on the first dimension
57
					Annotation[] annotations = annotationsOnDimensions[0];
58
					if (annotations != null) {
59
						for (int j = 0, max2 = annotations.length; j < max2; j++) {
60
							Annotation current = annotations[j];
61
							if (current == this.currentAnnotation) {
62
								this.search = false;
63
								return false;
64
							}
65
						}
66
					}
67
68
					this.currentIndexes.push(new Integer(0));
69
					for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
70
						annotations = annotationsOnDimensions[i];
71
						if (annotations != null) {
72
							for (int j = 0, max2 = annotations.length; j < max2; j++) {
73
								Annotation current = annotations[j];
74
								if (current == this.currentAnnotation) {
75
									this.search = false;
76
									return false;
77
								}
78
							}
79
						}
80
						this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
81
					}
82
				}
83
				Annotation[] annotations = typeReference.annotations;
84
				if (annotations == null) {
85
					annotations = primaryAnnotation;
86
				}
87
				if (annotations != null) {
88
					for (int i = 0; i < annotations.length; i++) {
89
						Annotation current = annotations[i];
90
						if (current == this.currentAnnotation) {
91
							this.search = false;
92
							return false;
93
						}
94
					}
95
				}
96
				this.currentIndexes.pop();
97
				return true;
98
			}
99
			public boolean visit(ArrayQualifiedTypeReference typeReference, BlockScope scope) {
100
				if (!this.search) return false;
101
				Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
102
				if (annotationsOnDimensions != null) {
103
					// check if the annotation is located on the first dimension
104
					Annotation[] annotations = annotationsOnDimensions[0];
105
					if (annotations != null) {
106
						for (int j = 0, max2 = annotations.length; j < max2; j++) {
107
							Annotation current = annotations[j];
108
							if (current == this.currentAnnotation) {
109
								this.search = false;
110
								return false;
111
							}
112
						}
113
					}
114
115
					this.currentIndexes.push(new Integer(0));
116
					for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
117
						annotations = annotationsOnDimensions[i];
118
						if (annotations != null) {
119
							for (int j = 0, max2 = annotations.length; j < max2; j++) {
120
								Annotation current = annotations[j];
121
								if (current == this.currentAnnotation) {
122
									this.search = false;
123
									return false;
124
								}
125
							}
126
						}
127
						this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
128
					}
129
				}
130
				Annotation[] annotations = typeReference.annotations;
131
				if (annotations == null) {
132
					annotations = primaryAnnotation;
133
				}
134
				if (annotations != null) {
135
					for (int i = 0; i < annotations.length; i++) {
136
						Annotation current = annotations[i];
137
						if (current == this.currentAnnotation) {
138
							this.search = false;
139
							return false;
140
						}
141
					}
142
				}
143
				this.currentIndexes.pop();
144
				return true;
145
			}
146
			public boolean visit(ParameterizedSingleTypeReference typeReference, BlockScope scope) {
147
				if (!this.search) return false;
148
				Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
149
				if (annotationsOnDimensions != null) {
150
					// check if the annotation is located on the first dimension
151
					Annotation[] annotations = annotationsOnDimensions[0];
152
					if (annotations != null) {
153
						for (int j = 0, max2 = annotations.length; j < max2; j++) {
154
							Annotation current = annotations[j];
155
							if (current == this.currentAnnotation) {
156
								this.search = false;
157
								return false;
158
							}
159
						}
160
					}
161
162
					this.currentIndexes.push(new Integer(0));
163
					for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
164
						annotations = annotationsOnDimensions[i];
165
						if (annotations != null) {
166
							for (int j = 0, max2 = annotations.length; j < max2; j++) {
167
								Annotation current = annotations[j];
168
								if (current == this.currentAnnotation) {
169
									this.search = false;
170
									return false;
171
								}
172
							}
173
						}
174
						this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
175
					}
176
				}
177
				Annotation[] annotations = typeReference.annotations;
178
				if (annotations == null) {
179
					annotations = primaryAnnotation;
180
				}
181
				if (annotations != null) {
182
					for (int i = 0; i < annotations.length; i++) {
183
						Annotation current = annotations[i];
184
						if (current == this.currentAnnotation) {
185
							this.search = false;
186
							return false;
187
						}
188
					}
189
				}
190
				TypeReference[] typeReferences = typeReference.typeArguments;
191
				this.currentIndexes.push(new Integer(0));
192
				for (int i = 0, max = typeReferences.length; i < max; i++) {
193
					typeReferences[i].traverse(this, scope);
194
					if (!this.search) return false;
195
					this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
196
				}
197
				this.currentIndexes.pop();
198
				return true;
199
			}
200
			public boolean visit(ParameterizedQualifiedTypeReference typeReference, BlockScope scope) {
201
				if (!this.search) return false;
202
				Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
203
				if (annotationsOnDimensions != null) {
204
					// check if the annotation is located on the first dimension
205
					Annotation[] annotations = annotationsOnDimensions[0];
206
					if (annotations != null) {
207
						for (int j = 0, max2 = annotations.length; j < max2; j++) {
208
							Annotation current = annotations[j];
209
							if (current == this.currentAnnotation) {
210
								this.search = false;
211
								return false;
212
							}
213
						}
214
					}
215
216
					this.currentIndexes.push(new Integer(0));
217
					for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
218
						annotations = annotationsOnDimensions[i];
219
						if (annotations != null) {
220
							for (int j = 0, max2 = annotations.length; j < max2; j++) {
221
								Annotation current = annotations[j];
222
								if (current == this.currentAnnotation) {
223
									this.search = false;
224
									return false;
225
								}
226
							}
227
						}
228
						this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
229
					}
230
				}
231
				Annotation[] annotations = typeReference.annotations;
232
				if (annotations == null) {
233
					annotations = primaryAnnotation;
234
				}
235
				if (annotations != null) {
236
					for (int i = 0; i < annotations.length; i++) {
237
						Annotation current = annotations[i];
238
						if (current == this.currentAnnotation) {
239
							this.search = false;
240
							return false;
241
						}
242
					}
243
				}
244
				//TODO it is unclear how to manage annotations located in the first type arguments
245
				TypeReference[] typeReferences = typeReference.typeArguments[typeReference.typeArguments.length - 1];
246
				this.currentIndexes.push(new Integer(0));
247
				for (int i = 0, max = typeReferences.length; i < max; i++) {
248
					typeReferences[i].traverse(this, scope);
249
					if (!this.search) return false;
250
					this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
251
				}
252
				this.currentIndexes.pop();
253
				return true;
254
			}
255
			public boolean visit(SingleTypeReference typeReference, BlockScope scope) {
256
				if (!this.search) return false;
257
				Annotation[][] annotationsOnDimensions = annotationsOnDimensionsOnExpression;
258
				if (annotationsOnDimensions != null) {
259
					// check if the annotation is located on the first dimension
260
					Annotation[] annotations = annotationsOnDimensions[0];
261
					if (annotations != null) {
262
						for (int j = 0, max2 = annotations.length; j < max2; j++) {
263
							Annotation current = annotations[j];
264
							if (current == this.currentAnnotation) {
265
								this.search = false;
266
								return false;
267
							}
268
						}
269
					}
270
271
					this.currentIndexes.push(new Integer(0));
272
					for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
273
						annotations = annotationsOnDimensions[i];
274
						if (annotations != null) {
275
							for (int j = 0, max2 = annotations.length; j < max2; j++) {
276
								Annotation current = annotations[j];
277
								if (current == this.currentAnnotation) {
278
									this.search = false;
279
									return false;
280
								}
281
							}
282
						}
283
						this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
284
					}
285
				}
286
				Annotation[] annotations = typeReference.annotations;
287
				if (annotations != null) {
288
					for (int i = 0; i < annotations.length; i++) {
289
						Annotation current = annotations[i];
290
						if (current == this.currentAnnotation) {
291
							this.search = false;
292
							return false;
293
						}
294
					}
295
				}
296
				return false;
297
			}
298
			public boolean visit(Wildcard typeReference, BlockScope scope) {
299
				if (!this.search) return false;
300
				TypeReference bound = typeReference.bound;
301
				bound.traverse(this, scope);
302
				return true;
303
			}
304
			public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) {
305
				if (!this.search) return false;
306
				Annotation[] annotations = typeReference.annotations;
307
				if (annotations != null) {
308
					for (int i = 0; i < annotations.length; i++) {
309
						Annotation current = annotations[i];
310
						if (current == this.currentAnnotation) {
311
							this.search = false;
312
							return false;
313
						}
314
					}
315
				}
316
				return true;
317
			}
318
			public String toString() {
319
				StringBuffer buffer = new StringBuffer();
320
				buffer
321
					.append("search location for ") //$NON-NLS-1$
322
					.append(this.currentAnnotation)
323
					.append("\ncurrent indexes : ") //$NON-NLS-1$
324
					.append(this.currentIndexes);
325
				return String.valueOf(buffer);
326
			}
327
		}
328
		if (reference == null) return null;
329
		LocationCollector collector = new LocationCollector(annotation);
330
		reference.traverse(collector, (BlockScope) null);
331
		if (collector.currentIndexes.isEmpty()) {
332
			return null;
333
		}
334
		int size = collector.currentIndexes.size();
335
		int[] result = new int[size];
336
		for (int i = 0; i < size; i++) {
337
			result[size - i - 1] = ((Integer) collector.currentIndexes.pop()).intValue();
338
		}
339
		return result;
340
	}
341
	
342
	// jsr 308
343
		public static class TypeUseBinding extends ReferenceBinding {
344
			private int kind;
345
			public TypeUseBinding(int kind) {
346
				this.tagBits = 0L;
347
				this.kind = kind;
348
			}
349
			public int kind() {
350
				return this.kind;
351
			}
352
			public boolean hasTypeBit(int bit) {
353
				// TODO Auto-generated method stub
354
				return false;
355
			}
356
		}
28
357
29
	final static MemberValuePair[] NoValuePairs = new MemberValuePair[0];
358
	final static MemberValuePair[] NoValuePairs = new MemberValuePair[0];
30
	private static final long TAGBITS_NULLABLE_OR_NONNULL = TagBits.AnnotationNullable|TagBits.AnnotationNonNull;
359
	private static final long TAGBITS_NULLABLE_OR_NONNULL = TagBits.AnnotationNullable|TagBits.AnnotationNonNull;
Lines 91-96 Link Here
91
			case 'T' :
420
			case 'T' :
92
				if (CharOperation.equals(elementName, TypeConstants.TYPE))
421
				if (CharOperation.equals(elementName, TypeConstants.TYPE))
93
					return TagBits.AnnotationForType;
422
					return TagBits.AnnotationForType;
423
				if (CharOperation.equals(elementName, TypeConstants.TYPE_USE_TARGET))
424
					return TagBits.AnnotationForTypeUse;
425
				if (CharOperation.equals(elementName, TypeConstants.TYPE_PARAMETER_TARGET))
426
					return TagBits.AnnotationForTypeParameter;
94
				break;
427
				break;
95
		}
428
		}
96
		return 0; // unknown
429
		return 0; // unknown
Lines 202-211 Link Here
202
			return false;
535
			return false;
203
		}
536
		}
204
		long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
537
		long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
538
		// jsr 308
539
		// we need to filter out type use and type parameter annotations
540
		if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
541
			return false;
542
		}
543
205
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
544
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
206
			return true; // by default the retention is CLASS
545
			return true; // by default the retention is CLASS
207
546
208
		return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
547
		return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
548
	}
549
550
	public boolean isRuntimeTypeInvisible() {
551
		final TypeBinding annotationBinding = this.resolvedType;
552
		if (annotationBinding == null) {
553
			return false;
554
		}
555
		long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
556
		// jsr 308
557
		// we need to filter out type use and type parameter annotations
558
		if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0
559
				&& ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) {
560
			return false;
561
		}
562
563
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
564
			return true; // by default the retention is CLASS
565
566
		return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
567
	}
568
569
	public boolean isRuntimeTypeVisible() {
570
		final TypeBinding annotationBinding = this.resolvedType;
571
		if (annotationBinding == null) {
572
			return false;
573
		}
574
		long metaTagBits = annotationBinding.getAnnotationTagBits();
575
		if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0
576
				&& ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) {
577
			return false;
578
		}
579
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
580
			return false; // by default the retention is CLASS
581
582
		return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
209
	}
583
	}
210
584
211
	public boolean isRuntimeVisible() {
585
	public boolean isRuntimeVisible() {
Lines 214-219 Link Here
214
			return false;
588
			return false;
215
		}
589
		}
216
		long metaTagBits = annotationBinding.getAnnotationTagBits();
590
		long metaTagBits = annotationBinding.getAnnotationTagBits();
591
		if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
592
			return false;
593
		}
217
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
594
		if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
218
			return false; // by default the retention is CLASS
595
			return false; // by default the retention is CLASS
219
596
Lines 341-356 Link Here
341
					}
718
					}
342
				}
719
				}
343
			}
720
			}
344
			if (!foundValue &&
721
			if (!foundValue
345
					(method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0 &&
722
					&& (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0
346
					(this.bits & IsRecovered) == 0) {
723
					&& (this.bits & IsRecovered) == 0
724
					&& annotationType.isValidBinding()) {
347
				scope.problemReporter().missingValueForAnnotationMember(this, selector);
725
				scope.problemReporter().missingValueForAnnotationMember(this, selector);
348
			}
726
			}
349
		}
727
		}
350
		// check unused pairs
728
		// check unused pairs
351
		for (int i = 0; i < pairsLength; i++) {
729
		for (int i = 0; i < pairsLength; i++) {
352
			if (pairs[i] != null) {
730
			if (pairs[i] != null) {
353
				scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]);
731
				if (annotationType.isValidBinding()) {
732
					scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]);
733
				}
354
				pairs[i].resolveTypeExpecting(scope, null); // resilient
734
				pairs[i].resolveTypeExpecting(scope, null); // resilient
355
			}
735
			}
356
		}
736
		}
Lines 421-439 Link Here
421
			}
801
			}
422
			// check (meta)target compatibility
802
			// check (meta)target compatibility
423
			checkTargetCompatibility: {
803
			checkTargetCompatibility: {
424
				long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
804
				if (!annotationType.isValidBinding()) {
425
				if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) // does not specify any target restriction
805
					// no need to check annotation usage if missing
426
					break checkTargetCompatibility;
806
					break checkTargetCompatibility;
807
				}
808
809
				long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
810
				if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
811
					// does not specify any target restriction - all locations are possible including type annotations
812
					break checkTargetCompatibility;
813
				}
427
814
428
				switch (this.recipient.kind()) {
815
				switch (this.recipient.kind()) {
429
					case Binding.PACKAGE :
816
					case Binding.PACKAGE :
430
						if ((metaTagBits & TagBits.AnnotationForPackage) != 0)
817
						if ((metaTagBits & TagBits.AnnotationForPackage) != 0)
431
							break checkTargetCompatibility;
818
							break checkTargetCompatibility;
432
						break;
819
						break;
820
					case Binding.TYPE_USE :
821
						if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
822
							// jsr 308
823
							break checkTargetCompatibility;
824
						}
825
						break;
433
					case Binding.TYPE :
826
					case Binding.TYPE :
434
					case Binding.GENERIC_TYPE :
827
					case Binding.GENERIC_TYPE :
435
						if (((ReferenceBinding)this.recipient).isAnnotationType()) {
828
						if (((ReferenceBinding)this.recipient).isAnnotationType()) {
436
							if ((metaTagBits & (TagBits.AnnotationForAnnotationType|TagBits.AnnotationForType)) != 0)
829
							if ((metaTagBits & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType)) != 0)
437
							break checkTargetCompatibility;
830
							break checkTargetCompatibility;
438
						} else if ((metaTagBits & TagBits.AnnotationForType) != 0) {
831
						} else if ((metaTagBits & TagBits.AnnotationForType) != 0) {
439
							break checkTargetCompatibility;
832
							break checkTargetCompatibility;
Lines 443-466 Link Here
443
						}
836
						}
444
						break;
837
						break;
445
					case Binding.METHOD :
838
					case Binding.METHOD :
446
						if (((MethodBinding)this.recipient).isConstructor()) {
839
						MethodBinding methodBinding = (MethodBinding) this.recipient;
840
						if (methodBinding.isConstructor()) {
447
							if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
841
							if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
448
								break checkTargetCompatibility;
842
								break checkTargetCompatibility;
449
						} else 	if ((metaTagBits & TagBits.AnnotationForMethod) != 0)
843
						} else if ((metaTagBits & TagBits.AnnotationForMethod) != 0) {
450
							break checkTargetCompatibility;
844
							break checkTargetCompatibility;
845
						} else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
846
							// jsr 308 - annotation on method return type
847
							if (methodBinding.returnType != null && methodBinding.returnType.id == T_void) {
848
								scope.problemReporter().illegalUsageOfTypeAnnotations(this);
849
							}
850
							break checkTargetCompatibility;
851
						}
451
						break;
852
						break;
452
					case Binding.FIELD :
853
					case Binding.FIELD :
453
						if ((metaTagBits & TagBits.AnnotationForField) != 0)
854
						if ((metaTagBits & TagBits.AnnotationForField) != 0) {
454
							break checkTargetCompatibility;
855
							break checkTargetCompatibility;
856
						} else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
857
							// jsr 308 - annotation on field type
858
							break checkTargetCompatibility;
859
						}
455
						break;
860
						break;
456
					case Binding.LOCAL :
861
					case Binding.LOCAL :
457
						if ((((LocalVariableBinding)this.recipient).tagBits & TagBits.IsArgument) != 0) {
862
						if ((((LocalVariableBinding)this.recipient).tagBits & TagBits.IsArgument) != 0) {
458
							if ((metaTagBits & TagBits.AnnotationForParameter) != 0)
863
							if ((metaTagBits & TagBits.AnnotationForParameter) != 0) {
459
								break checkTargetCompatibility;
864
								break checkTargetCompatibility;
460
						} else 	if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0)
865
							} else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
866
								// jsr 308 - annotation on method parameter type
867
								break checkTargetCompatibility;
868
							}
869
						} else if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0) {
461
							break checkTargetCompatibility;
870
							break checkTargetCompatibility;
871
						} else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
872
							// jsr 308 - annotation on local type
873
							break checkTargetCompatibility;
874
						}
462
						break;
875
						break;
463
				}
876
					case Binding.TYPE_PARAMETER : // jsr308
877
						if ((metaTagBits & TagBits.AnnotationForTypeParameter) != 0) {
878
							break checkTargetCompatibility;
879
						}
880
					}
464
				scope.problemReporter().disallowedTargetForAnnotation(this);
881
				scope.problemReporter().disallowedTargetForAnnotation(this);
465
			}
882
			}
466
		}
883
		}
Lines 469-472 Link Here
469
886
470
	public abstract void traverse(ASTVisitor visitor, BlockScope scope);
887
	public abstract void traverse(ASTVisitor visitor, BlockScope scope);
471
888
889
	public abstract void traverse(ASTVisitor visitor, ClassScope scope);
472
}
890
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java (-2 / +9 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 55-61 Link Here
55
59
56
		printIndent(tab, output);
60
		printIndent(tab, output);
57
		printModifiers(this.modifiers, output);
61
		printModifiers(this.modifiers, output);
58
		if (this.annotations != null) printAnnotations(this.annotations, output);
62
		if (this.annotations != null) {
63
			printAnnotations(this.annotations, output);
64
			output.append(' ');
65
		}
59
66
60
		TypeParameter[] typeParams = typeParameters();
67
		TypeParameter[] typeParams = typeParameters();
61
		if (typeParams != null) {
68
		if (typeParams != null) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java (-1 / +14 lines)
Lines 34-39 Link Here
34
		this.declarationSourceEnd = (int) posNom;
34
		this.declarationSourceEnd = (int) posNom;
35
		this.modifiers = modifiers;
35
		this.modifiers = modifiers;
36
		this.type = tr;
36
		this.type = tr;
37
		if (tr != null) {
38
			this.bits |= (tr.bits & ASTNode.HasTypeAnnotations);
39
		}
37
		this.bits |= (IsLocalDeclarationReachable | IsArgument);
40
		this.bits |= (IsLocalDeclarationReachable | IsArgument);
38
	}
41
	}
39
42
Lines 43-48 Link Here
43
		this.declarationSourceEnd = (int) posNom;
46
		this.declarationSourceEnd = (int) posNom;
44
		this.modifiers = modifiers;
47
		this.modifiers = modifiers;
45
		this.type = tr;
48
		this.type = tr;
49
		if (tr != null) {
50
			this.bits |= (tr.bits & ASTNode.HasTypeAnnotations);
51
		}
46
		this.bits |= (IsLocalDeclarationReachable | IsArgument | IsTypeElided);
52
		this.bits |= (IsLocalDeclarationReachable | IsArgument | IsTypeElided);
47
	}
53
	}
48
54
Lines 97-102 Link Here
97
		return (this.bits & ASTNode.IsArgument) != 0 ? PARAMETER : LOCAL_VARIABLE;
103
		return (this.bits & ASTNode.IsArgument) != 0 ? PARAMETER : LOCAL_VARIABLE;
98
	}
104
	}
99
105
106
	public boolean isArgument() {
107
		return true;
108
	}
109
100
	public boolean isVarArgs() {
110
	public boolean isVarArgs() {
101
		return this.type != null &&  (this.type.bits & IsVarArgs) != 0;
111
		return this.type != null &&  (this.type.bits & IsVarArgs) != 0;
102
	}
112
	}
Lines 105-111 Link Here
105
115
106
		printIndent(indent, output);
116
		printIndent(indent, output);
107
		printModifiers(this.modifiers, output);
117
		printModifiers(this.modifiers, output);
108
		if (this.annotations != null) printAnnotations(this.annotations, output);
118
		if (this.annotations != null) {
119
			printAnnotations(this.annotations, output);
120
			output.append(' ');
121
		}
109
122
110
		if (this.type == null) {
123
		if (this.type == null) {
111
			output.append("<no type> "); //$NON-NLS-1$
124
			output.append("<no type> "); //$NON-NLS-1$
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java (+16 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
14
 *     Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
Lines 24-29 Link Here
24
	//dimensions.length gives the number of dimensions, but the
28
	//dimensions.length gives the number of dimensions, but the
25
	// last ones may be nulled as in new int[4][5][][]
29
	// last ones may be nulled as in new int[4][5][][]
26
	public Expression[] dimensions;
30
	public Expression[] dimensions;
31
	public Annotation [][] annotationsOnDimensions; // jsr308 style annotations.
27
	public ArrayInitializer initializer;
32
	public ArrayInitializer initializer;
28
33
29
	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
34
	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
Lines 83-88 Link Here
83
		output.append("new "); //$NON-NLS-1$
88
		output.append("new "); //$NON-NLS-1$
84
		this.type.print(0, output);
89
		this.type.print(0, output);
85
		for (int i = 0; i < this.dimensions.length; i++) {
90
		for (int i = 0; i < this.dimensions.length; i++) {
91
			if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
92
				output.append(' ');
93
				printAnnotations(this.annotationsOnDimensions[i], output);
94
				output.append(' ');
95
			}
86
			if (this.dimensions[i] == null)
96
			if (this.dimensions[i] == null)
87
				output.append("[]"); //$NON-NLS-1$
97
				output.append("[]"); //$NON-NLS-1$
88
			else {
98
			else {
Lines 163-168 Link Here
163
				return null;
173
				return null;
164
			}
174
			}
165
		}
175
		}
176
		if (this.annotationsOnDimensions != null) {
177
			for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
178
				Annotation[] annotations = this.annotationsOnDimensions[i];
179
				resolveAnnotations(scope, annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
180
			}
181
		}
166
		return this.resolvedType;
182
		return this.resolvedType;
167
	}
183
	}
168
184
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java (-5 / +90 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 17-32 Link Here
17
21
18
public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
22
public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
19
	int dimensions;
23
	int dimensions;
24
	Annotation[][] annotationsOnDimensions;  // jsr308 style type annotations on dimensions
20
25
21
	public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) {
26
	public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss) {
22
27
23
		super( sources , poss);
28
		super( sources , poss);
24
		this.dimensions = dim ;
29
		this.dimensions = dim ;
30
		this.annotationsOnDimensions = null; 
31
	}
32
33
	public ArrayQualifiedTypeReference(char[][] sources, int dim, Annotation[][] annotationsOnDimensions, long[] poss) {
34
		this(sources, dim, poss);
35
		this.annotationsOnDimensions = annotationsOnDimensions;
36
		this.bits |= ASTNode.HasTypeAnnotations;
25
	}
37
	}
26
38
27
	public int dimensions() {
39
	public int dimensions() {
28
40
29
		return this.dimensions;
41
		return this.dimensions;
42
	}
43
	
44
	public Annotation[][] getAnnotationsOnDimensions() {
45
		return this.annotationsOnDimensions;
30
	}
46
	}
31
47
32
	/**
48
	/**
Lines 70-85 Link Here
70
		}
86
		}
71
	}
87
	}
72
88
89
	protected TypeBinding internalResolveType(Scope scope) {
90
		TypeBinding internalResolveType = super.internalResolveType(scope);
91
		if (this.annotationsOnDimensions != null) {
92
			switch(scope.kind) {
93
				case Scope.BLOCK_SCOPE :
94
				case Scope.METHOD_SCOPE :
95
					for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
96
						Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
97
						resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
98
					}
99
					break;
100
			}
101
		}
102
		return internalResolveType;
103
	}
104
73
	public StringBuffer printExpression(int indent, StringBuffer output){
105
	public StringBuffer printExpression(int indent, StringBuffer output){
74
106
75
		super.printExpression(indent, output);
107
		super.printExpression(indent, output);
76
		if ((this.bits & IsVarArgs) != 0) {
108
		if ((this.bits & IsVarArgs) != 0) {
77
			for (int i= 0 ; i < this.dimensions - 1; i++) {
109
			for (int i= 0 ; i < this.dimensions - 1; i++) {
110
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
111
					output.append(' ');
112
					printAnnotations(this.annotationsOnDimensions[i], output);
113
					output.append(' ');
114
				}
78
				output.append("[]"); //$NON-NLS-1$
115
				output.append("[]"); //$NON-NLS-1$
116
			}
117
			if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
118
				output.append(' ');
119
				printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
120
				output.append(' ');
79
			}
121
			}
80
			output.append("..."); //$NON-NLS-1$
122
			output.append("..."); //$NON-NLS-1$
81
		} else {
123
		} else {
82
			for (int i= 0 ; i < this.dimensions; i++) {
124
			for (int i= 0 ; i < this.dimensions; i++) {
125
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
126
					output.append(" "); //$NON-NLS-1$
127
					printAnnotations(this.annotationsOnDimensions[i], output);
128
					output.append(" "); //$NON-NLS-1$
129
				}
83
				output.append("[]"); //$NON-NLS-1$
130
				output.append("[]"); //$NON-NLS-1$
84
			}
131
			}
85
		}
132
		}
Lines 87-100 Link Here
87
	}
134
	}
88
135
89
	public void traverse(ASTVisitor visitor, BlockScope scope) {
136
	public void traverse(ASTVisitor visitor, BlockScope scope) {
90
137
		if (visitor.visit(this, scope)) {
91
		visitor.visit(this, scope);
138
			if (this.annotations != null) {
139
				int annotationsLength = this.annotations.length;
140
				for (int i = 0; i < annotationsLength; i++)
141
					this.annotations[i].traverse(visitor, scope);
142
			}
143
			if (this.annotationsOnDimensions != null) {
144
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
145
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
146
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
147
						Annotation annotation = annotations2[j];
148
						annotation.traverse(visitor, scope);
149
					}
150
				}
151
			}
152
		}
92
		visitor.endVisit(this, scope);
153
		visitor.endVisit(this, scope);
93
	}
154
	}
94
155
95
	public void traverse(ASTVisitor visitor, ClassScope scope) {
156
	public void traverse(ASTVisitor visitor, ClassScope scope) {
96
157
		if (visitor.visit(this, scope)) {
97
		visitor.visit(this, scope);
158
			if (this.annotations != null) {
159
				int annotationsLength = this.annotations.length;
160
				for (int i = 0; i < annotationsLength; i++)
161
					this.annotations[i].traverse(visitor, scope);
162
			}
163
			if (this.annotationsOnDimensions != null) {
164
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
165
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
166
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
167
						Annotation annotation = annotations2[j];
168
						annotation.traverse(visitor, scope);
169
					}
170
				}
171
			}
172
		}
98
		visitor.endVisit(this, scope);
173
		visitor.endVisit(this, scope);
99
	}
174
	}
175
176
	protected void resolveAnnotations(BlockScope scope) {
177
		super.resolveAnnotations(scope);
178
		if (this.annotationsOnDimensions != null) {
179
			for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
180
				Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
181
				resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
182
			}
183
		}
184
	}
100
}
185
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java (-5 / +96 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 12-17 Link Here
12
16
13
import org.eclipse.jdt.core.compiler.CharOperation;
17
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.internal.compiler.ASTVisitor;
18
import org.eclipse.jdt.internal.compiler.ASTVisitor;
19
import org.eclipse.jdt.internal.compiler.lookup.Binding;
15
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
20
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
16
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
21
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
17
import org.eclipse.jdt.internal.compiler.lookup.Scope;
22
import org.eclipse.jdt.internal.compiler.lookup.Scope;
Lines 19-24 Link Here
19
24
20
public class ArrayTypeReference extends SingleTypeReference {
25
public class ArrayTypeReference extends SingleTypeReference {
21
	public int dimensions;
26
	public int dimensions;
27
	public Annotation[][] annotationsOnDimensions; // jsr308 style type annotations on dimensions.
22
	public int originalSourceEnd;
28
	public int originalSourceEnd;
23
29
24
	/**
30
	/**
Lines 32-42 Link Here
32
		super(source, pos);
38
		super(source, pos);
33
		this.originalSourceEnd = this.sourceEnd;
39
		this.originalSourceEnd = this.sourceEnd;
34
		this.dimensions = dimensions ;
40
		this.dimensions = dimensions ;
41
		this.annotationsOnDimensions = null;
42
	}
43
44
	public ArrayTypeReference(char[] source, int dimensions, Annotation[][] annotationsOnDimensions, long pos) {
45
		this(source, dimensions, pos);
46
		if (annotationsOnDimensions != null) {
47
			this.bits |= ASTNode.HasTypeAnnotations;
48
		}
49
		this.annotationsOnDimensions = annotationsOnDimensions;
35
	}
50
	}
36
51
37
	public int dimensions() {
52
	public int dimensions() {
38
53
39
		return this.dimensions;
54
		return this.dimensions;
55
	}
56
	
57
	public Annotation[][] getAnnotationsOnDimensions() {
58
		return this.annotationsOnDimensions;
40
	}
59
	}
41
	/**
60
	/**
42
	 * @return char[][]
61
	 * @return char[][]
Lines 69-79 Link Here
69
		super.printExpression(indent, output);
88
		super.printExpression(indent, output);
70
		if ((this.bits & IsVarArgs) != 0) {
89
		if ((this.bits & IsVarArgs) != 0) {
71
			for (int i= 0 ; i < this.dimensions - 1; i++) {
90
			for (int i= 0 ; i < this.dimensions - 1; i++) {
91
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
92
					output.append(' ');
93
					printAnnotations(this.annotationsOnDimensions[i], output);
94
					output.append(' ');
95
				}
72
				output.append("[]"); //$NON-NLS-1$
96
				output.append("[]"); //$NON-NLS-1$
97
			}
98
			if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
99
				output.append(' ');
100
				printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
101
				output.append(' ');
73
			}
102
			}
74
			output.append("..."); //$NON-NLS-1$
103
			output.append("..."); //$NON-NLS-1$
75
		} else {
104
		} else {
76
			for (int i= 0 ; i < this.dimensions; i++) {
105
			for (int i= 0 ; i < this.dimensions; i++) {
106
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
107
					output.append(" "); //$NON-NLS-1$
108
					printAnnotations(this.annotationsOnDimensions[i], output);
109
					output.append(" "); //$NON-NLS-1$
110
				}
77
				output.append("[]"); //$NON-NLS-1$
111
				output.append("[]"); //$NON-NLS-1$
78
			}
112
			}
79
		}
113
		}
Lines 81-94 Link Here
81
	}
115
	}
82
116
83
	public void traverse(ASTVisitor visitor, BlockScope scope) {
117
	public void traverse(ASTVisitor visitor, BlockScope scope) {
84
118
		if (visitor.visit(this, scope)) {
85
		visitor.visit(this, scope);
119
			if (this.annotations != null) {
120
				int annotationsLength = this.annotations.length;
121
				for (int i = 0; i < annotationsLength; i++)
122
					this.annotations[i].traverse(visitor, scope);
123
			}
124
			if (this.annotationsOnDimensions != null) {
125
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
126
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
127
					if (annotations2 != null) {
128
						for (int j = 0, max2 = annotations2.length; j < max2; j++) {
129
							Annotation annotation = annotations2[j];
130
							annotation.traverse(visitor, scope);
131
						}
132
					}
133
				}
134
			}
135
		}
86
		visitor.endVisit(this, scope);
136
		visitor.endVisit(this, scope);
87
	}
137
	}
88
138
89
	public void traverse(ASTVisitor visitor, ClassScope scope) {
139
	public void traverse(ASTVisitor visitor, ClassScope scope) {
90
140
		if (visitor.visit(this, scope)) {
91
		visitor.visit(this, scope);
141
			if (this.annotations != null) {
142
				int annotationsLength = this.annotations.length;
143
				for (int i = 0; i < annotationsLength; i++)
144
					this.annotations[i].traverse(visitor, scope);
145
			}
146
			if (this.annotationsOnDimensions != null) {
147
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
148
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
149
					if (annotations2 != null) {
150
						for (int j = 0, max2 = annotations2.length; j < max2; j++) {
151
							Annotation annotation = annotations2[j];
152
							annotation.traverse(visitor, scope);
153
						}
154
					}
155
				}
156
			}
157
		}
92
		visitor.endVisit(this, scope);
158
		visitor.endVisit(this, scope);
93
	}
159
	}
160
161
	protected TypeBinding internalResolveType(Scope scope) {
162
		TypeBinding internalResolveType = super.internalResolveType(scope);
163
		if (this.annotationsOnDimensions != null) {
164
			switch(scope.kind) {
165
				case Scope.BLOCK_SCOPE :
166
				case Scope.METHOD_SCOPE :
167
					for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
168
						Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
169
						resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
170
					}
171
					break;
172
			}
173
		}
174
		return internalResolveType;
175
	}
176
	protected void resolveAnnotations(BlockScope scope) {
177
		super.resolveAnnotations(scope);
178
		if (this.annotationsOnDimensions != null) {
179
			for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
180
				Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
181
				resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
182
			}
183
		}
184
	}
94
}
185
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java (-1 / +14 lines)
Lines 5-18 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
15
package org.eclipse.jdt.internal.compiler.ast;
12
16
17
import java.util.List;
18
13
import org.eclipse.jdt.core.compiler.IProblem;
19
import org.eclipse.jdt.core.compiler.IProblem;
14
import org.eclipse.jdt.internal.compiler.ASTVisitor;
20
import org.eclipse.jdt.internal.compiler.ASTVisitor;
15
import org.eclipse.jdt.internal.compiler.impl.*;
21
import org.eclipse.jdt.internal.compiler.impl.*;
22
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
16
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
23
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
17
import org.eclipse.jdt.internal.compiler.codegen.*;
24
import org.eclipse.jdt.internal.compiler.codegen.*;
18
import org.eclipse.jdt.internal.compiler.flow.*;
25
import org.eclipse.jdt.internal.compiler.flow.*;
Lines 109-115 Link Here
109
	}
116
	}
110
	codeStream.recordPositionsFrom(pc, this.sourceStart);
117
	codeStream.recordPositionsFrom(pc, this.sourceStart);
111
}
118
}
112
119
public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
120
	AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
121
	for (int i = 0, max = this.annotations.length; i < max; i++) {
122
		Annotation annotation = this.annotations[i];
123
		annotation.traverse(collector, (BlockScope) null);
124
	}
125
}
113
/**
126
/**
114
 * @see org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration#getKind()
127
 * @see org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration#getKind()
115
 */
128
 */
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java (-1 / +7 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
8
 * Contributors:
11
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
12
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
13
 *******************************************************************************/
Lines 87-93 Link Here
87
		if (this.modifiers != 0) {
90
		if (this.modifiers != 0) {
88
			printIndent(indent, output);
91
			printIndent(indent, output);
89
			printModifiers(this.modifiers, output);
92
			printModifiers(this.modifiers, output);
90
			if (this.annotations != null) printAnnotations(this.annotations, output);
93
			if (this.annotations != null) {
94
				printAnnotations(this.annotations, output);
95
				output.append(' ');
96
			}
91
			output.append("{\n"); //$NON-NLS-1$
97
			output.append("{\n"); //$NON-NLS-1$
92
			if (this.block != null) {
98
			if (this.block != null) {
93
				this.block.printBody(indent, output);
99
				this.block.printBody(indent, output);
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java (-1 / +9 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 30-35 Link Here
30
	public TypeReference copyDims(int dim) {
34
	public TypeReference copyDims(int dim) {
31
		return null;
35
		return null;
32
	}
36
	}
37
	
38
	public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
39
		return null;
40
	}
33
41
34
	/* (non-Javadoc)
42
	/* (non-Javadoc)
35
	 * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
43
	 * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java (+21 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
14
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
Lines 19-26 Link Here
19
 *******************************************************************************/
23
 *******************************************************************************/
20
package org.eclipse.jdt.internal.compiler.ast;
24
package org.eclipse.jdt.internal.compiler.ast;
21
25
26
import java.util.List;
27
22
import org.eclipse.jdt.internal.compiler.ASTVisitor;
28
import org.eclipse.jdt.internal.compiler.ASTVisitor;
23
import org.eclipse.jdt.internal.compiler.impl.*;
29
import org.eclipse.jdt.internal.compiler.impl.*;
30
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
24
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
31
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
25
import org.eclipse.jdt.internal.compiler.codegen.*;
32
import org.eclipse.jdt.internal.compiler.codegen.*;
26
import org.eclipse.jdt.internal.compiler.flow.*;
33
import org.eclipse.jdt.internal.compiler.flow.*;
Lines 189-199 Link Here
189
		return LOCAL_VARIABLE;
196
		return LOCAL_VARIABLE;
190
	}
197
	}
191
198
199
	// for local variables
200
	public void getAllAnnotationContexts(int targetType, LocalVariableBinding localVariable, List allAnnotationContexts) {
201
		AnnotationCollector collector = new AnnotationCollector(this, targetType, localVariable, allAnnotationContexts);
202
		this.traverse(collector, (BlockScope) null);
203
	}
204
	// for arguments
205
	public void getAllAnnotationContexts(int targetType, int parameterIndex, List allAnnotationContexts) {
206
		AnnotationCollector collector = new AnnotationCollector(this, targetType, parameterIndex, allAnnotationContexts);
207
		this.traverse(collector, (BlockScope) null);
208
	}
209
	public boolean isArgument() {
210
		return false;
211
	}
192
	public void resolve(BlockScope scope) {
212
	public void resolve(BlockScope scope) {
193
213
194
		// create a binding and add it to the scope
214
		// create a binding and add it to the scope
195
		TypeBinding variableType = this.type.resolveType(scope, true /* check bounds*/);
215
		TypeBinding variableType = this.type.resolveType(scope, true /* check bounds*/);
196
216
217
		this.bits |= (this.type.bits & ASTNode.HasTypeAnnotations);
197
		checkModifiers();
218
		checkModifiers();
198
		if (variableType != null) {
219
		if (variableType != null) {
199
			if (variableType == TypeBinding.VOID) {
220
			if (variableType == TypeBinding.VOID) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java (-1 / +13 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 42-45 Link Here
42
		}
46
		}
43
		visitor.endVisit(this, scope);
47
		visitor.endVisit(this, scope);
44
	}
48
	}
49
	public void traverse(ASTVisitor visitor, ClassScope scope) {
50
		if (visitor.visit(this, scope)) {
51
			if (this.type != null) {
52
				this.type.traverse(visitor, scope);
53
			}
54
		}
55
		visitor.endVisit(this, scope);
56
	}
45
}
57
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java (+13 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contributions for
14
 *     Stephan Herrmann - Contributions for
Lines 17-22 Link Here
17
import org.eclipse.jdt.internal.compiler.impl.Constant;
21
import org.eclipse.jdt.internal.compiler.impl.Constant;
18
import org.eclipse.jdt.internal.compiler.lookup.Binding;
22
import org.eclipse.jdt.internal.compiler.lookup.Binding;
19
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
23
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
24
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
20
import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair;
25
import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair;
21
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
26
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
22
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
27
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
Lines 241-244 Link Here
241
		}
246
		}
242
		visitor.endVisit(this, scope);
247
		visitor.endVisit(this, scope);
243
	}
248
	}
249
	public void traverse(ASTVisitor visitor, ClassScope scope) {
250
		if (visitor.visit(this, scope)) {
251
			if (this.value != null) {
252
				this.value.traverse(visitor, scope);
253
			}
254
		}
255
		visitor.endVisit(this, scope);
256
	}
244
}
257
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java (-1 / +21 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contributions for
14
 *     Stephan Herrmann - Contributions for
Lines 15-20 Link Here
15
 *******************************************************************************/
19
 *******************************************************************************/
16
package org.eclipse.jdt.internal.compiler.ast;
20
package org.eclipse.jdt.internal.compiler.ast;
17
21
22
import java.util.List;
23
18
import org.eclipse.jdt.core.compiler.CharOperation;
24
import org.eclipse.jdt.core.compiler.CharOperation;
19
import org.eclipse.jdt.internal.compiler.ASTVisitor;
25
import org.eclipse.jdt.internal.compiler.ASTVisitor;
20
import org.eclipse.jdt.internal.compiler.CompilationResult;
26
import org.eclipse.jdt.internal.compiler.CompilationResult;
Lines 24-29 Link Here
24
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
30
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
25
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
31
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
26
import org.eclipse.jdt.internal.compiler.lookup.Binding;
32
import org.eclipse.jdt.internal.compiler.lookup.Binding;
33
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
27
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
34
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
28
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
35
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
29
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
36
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
Lines 35-40 Link Here
35
import org.eclipse.jdt.internal.compiler.parser.Parser;
42
import org.eclipse.jdt.internal.compiler.parser.Parser;
36
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
43
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
37
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
44
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
45
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
38
46
39
public class MethodDeclaration extends AbstractMethodDeclaration {
47
public class MethodDeclaration extends AbstractMethodDeclaration {
40
48
Lines 146-151 Link Here
146
		}
154
		}
147
	}
155
	}
148
156
157
	public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
158
		AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
159
		for (int i = 0, max = this.annotations.length; i < max; i++) {
160
			Annotation annotation = this.annotations[i];
161
			annotation.traverse(collector, (BlockScope) null);
162
		}
163
	}
164
149
	public boolean isMethod() {
165
	public boolean isMethod() {
150
		return true;
166
		return true;
151
	}
167
	}
Lines 163-168 Link Here
163
	public void resolveStatements() {
179
	public void resolveStatements() {
164
		// ========= abort on fatal error =============
180
		// ========= abort on fatal error =============
165
		if (this.returnType != null && this.binding != null) {
181
		if (this.returnType != null && this.binding != null) {
182
			this.bits |= (this.returnType.bits & ASTNode.HasTypeAnnotations);
166
			this.returnType.resolvedType = this.binding.returnType;
183
			this.returnType.resolvedType = this.binding.returnType;
167
			// record the return type binding
184
			// record the return type binding
168
		}
185
		}
Lines 177-183 Link Here
177
		}
194
		}
178
		if (this.typeParameters != null) {
195
		if (this.typeParameters != null) {
179
			for (int i = 0, length = this.typeParameters.length; i < length; i++) {
196
			for (int i = 0, length = this.typeParameters.length; i < length; i++) {
180
				this.typeParameters[i].resolve(this.scope);
197
				TypeParameter typeParameter = this.typeParameters[i];
198
				this.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations);
199
				typeParameter.resolve(this.scope);
200
				typeParameter.resolveAnnotations(this.scope);
181
				if (returnsUndeclTypeVar && this.typeParameters[i].binding == this.returnType.resolvedType) {
201
				if (returnsUndeclTypeVar && this.typeParameters[i].binding == this.returnType.resolvedType) {
182
					returnsUndeclTypeVar = false;
202
					returnsUndeclTypeVar = false;
183
				}
203
				}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java (-1 / +18 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 71-74 Link Here
71
		}
75
		}
72
		visitor.endVisit(this, scope);
76
		visitor.endVisit(this, scope);
73
	}
77
	}
78
	public void traverse(ASTVisitor visitor, ClassScope scope) {
79
		if (visitor.visit(this, scope)) {
80
			if (this.type != null) {
81
				this.type.traverse(visitor, scope);
82
			}
83
			if (this.memberValuePairs != null) {
84
				int memberValuePairsLength = this.memberValuePairs.length;
85
				for (int i = 0; i < memberValuePairsLength; i++)
86
					this.memberValuePairs[i].traverse(visitor, scope);
87
			}
88
		}
89
		visitor.endVisit(this, scope);
90
	}
74
}
91
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (-1 / +71 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 35-40 Link Here
35
		super(tokens, dim, positions);
39
		super(tokens, dim, positions);
36
		this.typeArguments = typeArguments;
40
		this.typeArguments = typeArguments;
37
	}
41
	}
42
	public ParameterizedQualifiedTypeReference(char[][] tokens, TypeReference[][] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long[] positions) {
43
		this(tokens, typeArguments, dim, positions);
44
		this.annotationsOnDimensions = annotationsOnDimensions;
45
		if (annotationsOnDimensions != null) {
46
			this.bits |= ASTNode.HasTypeAnnotations;
47
		}
48
	}
38
	public void checkBounds(Scope scope) {
49
	public void checkBounds(Scope scope) {
39
		if (this.resolvedType == null) return;
50
		if (this.resolvedType == null) return;
40
51
Lines 59-64 Link Here
59
	}
70
	}
60
	public TypeReference copyDims(int dim){
71
	public TypeReference copyDims(int dim){
61
		return new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, this.sourcePositions);
72
		return new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, this.sourcePositions);
73
	}
74
	public TypeReference copyDims(int dim, Annotation[][] dimensionAnnotations){
75
		ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, dimensionAnnotations, this.sourcePositions);
76
		parameterizedQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
77
		if (dimensionAnnotations != null) {
78
			parameterizedQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations;
79
		}
80
		return parameterizedQualifiedTypeReference;
81
	}
82
	public boolean isParameterizedTypeReference() {
83
		return true;
62
	}
84
	}
63
85
64
	/**
86
	/**
Lines 300-305 Link Here
300
	}
322
	}
301
323
302
	public StringBuffer printExpression(int indent, StringBuffer output) {
324
	public StringBuffer printExpression(int indent, StringBuffer output) {
325
		if (this.annotations != null) {
326
			output.append(" "); //$NON-NLS-1$
327
			printAnnotations(this.annotations, output);
328
			output.append(' ');
329
		}
303
		int length = this.tokens.length;
330
		int length = this.tokens.length;
304
		for (int i = 0; i < length - 1; i++) {
331
		for (int i = 0; i < length - 1; i++) {
305
			output.append(this.tokens[i]);
332
			output.append(this.tokens[i]);
Lines 336-346 Link Here
336
		}
363
		}
337
		if ((this.bits & IsVarArgs) != 0) {
364
		if ((this.bits & IsVarArgs) != 0) {
338
			for (int i= 0 ; i < this.dimensions - 1; i++) {
365
			for (int i= 0 ; i < this.dimensions - 1; i++) {
366
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
367
					output.append(" "); //$NON-NLS-1$
368
					printAnnotations(this.annotationsOnDimensions[i], output);
369
					output.append(" "); //$NON-NLS-1$
370
				}
339
				output.append("[]"); //$NON-NLS-1$
371
				output.append("[]"); //$NON-NLS-1$
372
			}
373
			if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
374
				output.append(" "); //$NON-NLS-1$
375
				printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
376
				output.append(" "); //$NON-NLS-1$
340
			}
377
			}
341
			output.append("..."); //$NON-NLS-1$
378
			output.append("..."); //$NON-NLS-1$
342
		} else {
379
		} else {
343
			for (int i= 0 ; i < this.dimensions; i++) {
380
			for (int i= 0 ; i < this.dimensions; i++) {
381
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
382
					output.append(" "); //$NON-NLS-1$
383
					printAnnotations(this.annotationsOnDimensions[i], output);
384
					output.append(" "); //$NON-NLS-1$
385
				}
344
				output.append("[]"); //$NON-NLS-1$
386
				output.append("[]"); //$NON-NLS-1$
345
			}
387
			}
346
		}
388
		}
Lines 355-360 Link Here
355
	}
397
	}
356
	public void traverse(ASTVisitor visitor, BlockScope scope) {
398
	public void traverse(ASTVisitor visitor, BlockScope scope) {
357
		if (visitor.visit(this, scope)) {
399
		if (visitor.visit(this, scope)) {
400
			if (this.annotations != null) {
401
				int annotationsLength = this.annotations.length;
402
				for (int i = 0; i < annotationsLength; i++)
403
					this.annotations[i].traverse(visitor, scope);
404
			}
405
			if (this.annotationsOnDimensions != null) {
406
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
407
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
408
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
409
						Annotation annotation = annotations2[j];
410
						annotation.traverse(visitor, scope);
411
					}
412
				}
413
			}
358
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
414
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
359
				if (this.typeArguments[i] != null) {
415
				if (this.typeArguments[i] != null) {
360
					for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
416
					for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
Lines 368-373 Link Here
368
424
369
	public void traverse(ASTVisitor visitor, ClassScope scope) {
425
	public void traverse(ASTVisitor visitor, ClassScope scope) {
370
		if (visitor.visit(this, scope)) {
426
		if (visitor.visit(this, scope)) {
427
			if (this.annotations != null) {
428
				int annotationsLength = this.annotations.length;
429
				for (int i = 0; i < annotationsLength; i++)
430
					this.annotations[i].traverse(visitor, scope);
431
			}
432
			if (this.annotationsOnDimensions != null) {
433
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
434
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
435
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
436
						Annotation annotation = annotations2[j];
437
						annotation.traverse(visitor, scope);
438
					}
439
				}
440
			}
371
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
441
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
372
				if (this.typeArguments[i] != null) {
442
				if (this.typeArguments[i] != null) {
373
					for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
443
					for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-3 / +72 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 30-35 Link Here
30
		this.originalSourceEnd = this.sourceEnd;
34
		this.originalSourceEnd = this.sourceEnd;
31
		this.typeArguments = typeArguments;
35
		this.typeArguments = typeArguments;
32
	}
36
	}
37
	public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long pos) {
38
		this(name, typeArguments, dim, pos);
39
		this.annotationsOnDimensions = annotationsOnDimensions;
40
		if (annotationsOnDimensions != null) {
41
			this.bits |= ASTNode.HasTypeAnnotations;
42
		}
43
	}
33
	public void checkBounds(Scope scope) {
44
	public void checkBounds(Scope scope) {
34
		if (this.resolvedType == null) return;
45
		if (this.resolvedType == null) return;
35
46
Lines 48-53 Link Here
48
	 */
59
	 */
49
	public TypeReference copyDims(int dim) {
60
	public TypeReference copyDims(int dim) {
50
		return new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, (((long)this.sourceStart)<<32)+this.sourceEnd);
61
		return new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, (((long)this.sourceStart)<<32)+this.sourceEnd);
62
	}
63
	public TypeReference copyDims(int dim, Annotation [][] annotationsOnDims) {
64
		ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, annotationsOnDims, (((long)this.sourceStart)<<32)+this.sourceEnd);
65
		parameterizedSingleTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
66
		if (annotationsOnDims != null) {
67
			parameterizedSingleTypeReference.bits |= ASTNode.HasTypeAnnotations;
68
		}
69
		return parameterizedSingleTypeReference;
51
	}
70
	}
52
71
53
	/**
72
	/**
Lines 81-86 Link Here
81
     */
100
     */
82
    protected TypeBinding getTypeBinding(Scope scope) {
101
    protected TypeBinding getTypeBinding(Scope scope) {
83
        return null; // not supported here - combined with resolveType(...)
102
        return null; // not supported here - combined with resolveType(...)
103
    }
104
    
105
    public boolean isParameterizedTypeReference() {
106
    	return true;
84
    }
107
    }
85
108
86
    /*
109
    /*
Lines 186-196 Link Here
186
		boolean argHasError = false;
209
		boolean argHasError = false;
187
		ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
210
		ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original();
188
		for (int i = 0; i < argLength; i++) {
211
		for (int i = 0; i < argLength; i++) {
189
		    TypeReference typeArgument = this.typeArguments[i];
212
			TypeReference typeArgument = this.typeArguments[i];
190
		    TypeBinding argType = isClassScope
213
		    TypeBinding argType = isClassScope
191
				? typeArgument.resolveTypeArgument((ClassScope) scope, currentOriginal, i)
214
				? typeArgument.resolveTypeArgument((ClassScope) scope, currentOriginal, i)
192
				: typeArgument.resolveTypeArgument((BlockScope) scope, currentOriginal, i);
215
				: typeArgument.resolveTypeArgument((BlockScope) scope, currentOriginal, i);
193
		     if (argType == null) {
216
			this.bits |= (typeArgument.bits & ASTNode.HasTypeAnnotations);
217
			if (argType == null) {
194
		         argHasError = true;
218
		         argHasError = true;
195
		     } else {
219
		     } else {
196
			    argTypes[i] = argType;
220
			    argTypes[i] = argType;
Lines 277-287 Link Here
277
		output.append(">"); //$NON-NLS-1$
301
		output.append(">"); //$NON-NLS-1$
278
		if ((this.bits & IsVarArgs) != 0) {
302
		if ((this.bits & IsVarArgs) != 0) {
279
			for (int i= 0 ; i < this.dimensions - 1; i++) {
303
			for (int i= 0 ; i < this.dimensions - 1; i++) {
304
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
305
					output.append(" "); //$NON-NLS-1$
306
					printAnnotations(this.annotationsOnDimensions[i], output);
307
					output.append(" "); //$NON-NLS-1$
308
				}
280
				output.append("[]"); //$NON-NLS-1$
309
				output.append("[]"); //$NON-NLS-1$
310
			}
311
			if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
312
				output.append(" "); //$NON-NLS-1$
313
				printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
314
				output.append(" "); //$NON-NLS-1$
281
			}
315
			}
282
			output.append("..."); //$NON-NLS-1$
316
			output.append("..."); //$NON-NLS-1$
283
		} else {
317
		} else {
284
			for (int i= 0 ; i < this.dimensions; i++) {
318
			for (int i= 0 ; i < this.dimensions; i++) {
319
				if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
320
					output.append(" "); //$NON-NLS-1$
321
					printAnnotations(this.annotationsOnDimensions[i], output);
322
					output.append(" "); //$NON-NLS-1$
323
				}
285
				output.append("[]"); //$NON-NLS-1$
324
				output.append("[]"); //$NON-NLS-1$
286
			}
325
			}
287
		}
326
		}
Lines 302-307 Link Here
302
341
303
	public void traverse(ASTVisitor visitor, BlockScope scope) {
342
	public void traverse(ASTVisitor visitor, BlockScope scope) {
304
		if (visitor.visit(this, scope)) {
343
		if (visitor.visit(this, scope)) {
344
			if (this.annotations != null) {
345
				int annotationsLength = this.annotations.length;
346
				for (int i = 0; i < annotationsLength; i++)
347
					this.annotations[i].traverse(visitor, scope);
348
			}
349
			if (this.annotationsOnDimensions != null) {
350
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
351
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
352
					if (annotations2 != null) {
353
						for (int j = 0, max2 = annotations2.length; j < max2; j++) {
354
							Annotation annotation = annotations2[j];
355
							annotation.traverse(visitor, scope);
356
						}
357
					}
358
				}
359
			}
305
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
360
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
306
				this.typeArguments[i].traverse(visitor, scope);
361
				this.typeArguments[i].traverse(visitor, scope);
307
			}
362
			}
Lines 311-316 Link Here
311
366
312
	public void traverse(ASTVisitor visitor, ClassScope scope) {
367
	public void traverse(ASTVisitor visitor, ClassScope scope) {
313
		if (visitor.visit(this, scope)) {
368
		if (visitor.visit(this, scope)) {
369
			if (this.annotations != null) {
370
				int annotationsLength = this.annotations.length;
371
				for (int i = 0; i < annotationsLength; i++)
372
					this.annotations[i].traverse(visitor, scope);
373
			}
374
			if (this.annotationsOnDimensions != null) {
375
				for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
376
					Annotation[] annotations2 = this.annotationsOnDimensions[i];
377
					for (int j = 0, max2 = annotations2.length; j < max2; j++) {
378
						Annotation annotation = annotations2[j];
379
						annotation.traverse(visitor, scope);
380
					}
381
				}
382
			}
314
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
383
			for (int i = 0, max = this.typeArguments.length; i < max; i++) {
315
				this.typeArguments[i].traverse(visitor, scope);
384
				this.typeArguments[i].traverse(visitor, scope);
316
			}
385
			}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java (-6 / +34 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 32-37 Link Here
32
		//return a type reference copy of me with some dimensions
36
		//return a type reference copy of me with some dimensions
33
		//warning : the new type ref has a null binding
37
		//warning : the new type ref has a null binding
34
		return new ArrayQualifiedTypeReference(this.tokens, dim, this.sourcePositions);
38
		return new ArrayQualifiedTypeReference(this.tokens, dim, this.sourcePositions);
39
	}
40
	
41
	public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
42
		//return a type reference copy of me with some dimensions
43
		//warning : the new type ref has a null binding
44
		ArrayQualifiedTypeReference arrayQualifiedTypeReference = new ArrayQualifiedTypeReference(this.tokens, dim, annotationsOnDimensions, this.sourcePositions);
45
		arrayQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
46
		if (annotationsOnDimensions != null) {
47
			arrayQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations;
48
		}
49
		return arrayQualifiedTypeReference;
35
	}
50
	}
36
51
37
	protected TypeBinding findNextTypeBinding(int tokenIndex, Scope scope, PackageBinding packageBinding) {
52
	protected TypeBinding findNextTypeBinding(int tokenIndex, Scope scope, PackageBinding packageBinding) {
Lines 122-128 Link Here
122
	}
137
	}
123
138
124
	public StringBuffer printExpression(int indent, StringBuffer output) {
139
	public StringBuffer printExpression(int indent, StringBuffer output) {
125
140
		if (this.annotations != null) {
141
			printAnnotations(this.annotations, output);
142
			output.append(' ');
143
		}
126
		for (int i = 0; i < this.tokens.length; i++) {
144
		for (int i = 0; i < this.tokens.length; i++) {
127
			if (i > 0) output.append('.');
145
			if (i > 0) output.append('.');
128
			output.append(this.tokens[i]);
146
			output.append(this.tokens[i]);
Lines 131-144 Link Here
131
	}
149
	}
132
150
133
	public void traverse(ASTVisitor visitor, BlockScope scope) {
151
	public void traverse(ASTVisitor visitor, BlockScope scope) {
134
152
		if (visitor.visit(this, scope)) {
135
		visitor.visit(this, scope);
153
			if (this.annotations != null) {
154
				int annotationsLength = this.annotations.length;
155
				for (int i = 0; i < annotationsLength; i++)
156
					this.annotations[i].traverse(visitor, scope);
157
			}
158
		}
136
		visitor.endVisit(this, scope);
159
		visitor.endVisit(this, scope);
137
	}
160
	}
138
161
139
	public void traverse(ASTVisitor visitor, ClassScope scope) {
162
	public void traverse(ASTVisitor visitor, ClassScope scope) {
140
163
		if (visitor.visit(this, scope)) {
141
		visitor.visit(this, scope);
164
			if (this.annotations != null) {
165
				int annotationsLength = this.annotations.length;
166
				for (int i = 0; i < annotationsLength; i++)
167
					this.annotations[i].traverse(visitor, scope);
168
			}
169
		}
142
		visitor.endVisit(this, scope);
170
		visitor.endVisit(this, scope);
143
	}
171
	}
144
}
172
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java (-1 / +17 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 62-65 Link Here
62
		}
66
		}
63
		visitor.endVisit(this, scope);
67
		visitor.endVisit(this, scope);
64
	}
68
	}
69
70
	public void traverse(ASTVisitor visitor, ClassScope scope) {
71
		if (visitor.visit(this, scope)) {
72
			if (this.type != null) {
73
				this.type.traverse(visitor, scope);
74
			}
75
			if (this.memberValue != null) {
76
				this.memberValue.traverse(visitor, scope);
77
			}
78
		}
79
		visitor.endVisit(this, scope);
80
	}
65
}
81
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java (-4 / +34 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 33-38 Link Here
33
37
34
		return new ArrayTypeReference(this.token, dim,(((long)this.sourceStart)<<32)+this.sourceEnd);
38
		return new ArrayTypeReference(this.token, dim,(((long)this.sourceStart)<<32)+this.sourceEnd);
35
	}
39
	}
40
	
41
	public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){
42
		//return a type reference copy of me with some dimensions
43
		//warning : the new type ref has a null binding
44
		ArrayTypeReference arrayTypeReference = new ArrayTypeReference(this.token, dim, annotationsOnDimensions, (((long)this.sourceStart)<<32)+this.sourceEnd);
45
		arrayTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
46
		if (annotationsOnDimensions != null) {
47
			arrayTypeReference.bits |= ASTNode.HasTypeAnnotations;
48
		}
49
		return arrayTypeReference;
50
	}
36
51
37
	public char[] getLastToken() {
52
	public char[] getLastToken() {
38
		return this.token;
53
		return this.token;
Lines 54-60 Link Here
54
	}
69
	}
55
70
56
	public StringBuffer printExpression(int indent, StringBuffer output){
71
	public StringBuffer printExpression(int indent, StringBuffer output){
57
72
		if (this.annotations != null) {
73
			printAnnotations(this.annotations, output);
74
			output.append(' ');
75
		}
58
		return output.append(this.token);
76
		return output.append(this.token);
59
	}
77
	}
60
78
Lines 85-96 Link Here
85
	}
103
	}
86
104
87
	public void traverse(ASTVisitor visitor, BlockScope scope) {
105
	public void traverse(ASTVisitor visitor, BlockScope scope) {
88
		visitor.visit(this, scope);
106
		if (visitor.visit(this, scope)) {
107
			if (this.annotations != null) {
108
				int annotationsLength = this.annotations.length;
109
				for (int i = 0; i < annotationsLength; i++)
110
					this.annotations[i].traverse(visitor, scope);
111
			}
112
		}
89
		visitor.endVisit(this, scope);
113
		visitor.endVisit(this, scope);
90
	}
114
	}
91
115
92
	public void traverse(ASTVisitor visitor, ClassScope scope) {
116
	public void traverse(ASTVisitor visitor, ClassScope scope) {
93
		visitor.visit(this, scope);
117
		if (visitor.visit(this, scope)) {
118
			if (this.annotations != null) {
119
				int annotationsLength = this.annotations.length;
120
				for (int i = 0; i < annotationsLength; i++)
121
					this.annotations[i].traverse(visitor, scope);
122
			}
123
		}
94
		visitor.endVisit(this, scope);
124
		visitor.endVisit(this, scope);
95
	}
125
	}
96
}
126
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java (-1 / +21 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contribution for Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop)
14
 *     Stephan Herrmann - Contribution for Bug 360328 - [compiler][null] detect null problems in nested code (local class inside a loop)
Lines 906-912 Link Here
906
910
907
public StringBuffer printHeader(int indent, StringBuffer output) {
911
public StringBuffer printHeader(int indent, StringBuffer output) {
908
	printModifiers(this.modifiers, output);
912
	printModifiers(this.modifiers, output);
909
	if (this.annotations != null) printAnnotations(this.annotations, output);
913
	if (this.annotations != null) {
914
		printAnnotations(this.annotations, output);
915
		output.append(' ');
916
	}
910
917
911
	switch (kind(this.modifiers)) {
918
	switch (kind(this.modifiers)) {
912
		case TypeDeclaration.CLASS_DECL :
919
		case TypeDeclaration.CLASS_DECL :
Lines 971-976 Link Here
971
		try {
978
		try {
972
			this.staticInitializerScope.insideTypeAnnotation = true;
979
			this.staticInitializerScope.insideTypeAnnotation = true;
973
			resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
980
			resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
981
			if (this.superclass != null) {
982
				this.superclass.resolveAnnotations(this.staticInitializerScope);
983
			}
984
			if (this.superInterfaces != null) {
985
				for (int i = 0, max = this.superInterfaces.length; i < max; i++) {
986
					this.superInterfaces[i].resolveAnnotations(this.staticInitializerScope);
987
				}
988
			}
989
			if (this.typeParameters != null) {
990
				for (int i = 0, count = this.typeParameters.length; i < count; i++) {
991
					this.typeParameters[i].resolveAnnotations(this.staticInitializerScope);
992
				}
993
			}
974
		} finally {
994
		} finally {
975
			this.staticInitializerScope.insideTypeAnnotation = old;
995
			this.staticInitializerScope.insideTypeAnnotation = old;
976
		}
996
		}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java (-3 / +68 lines)
Lines 1-16 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
15
package org.eclipse.jdt.internal.compiler.ast;
12
16
17
import java.util.List;
18
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
19
import org.eclipse.jdt.internal.compiler.ASTVisitor;
20
import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
21
import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
14
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
22
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
15
import org.eclipse.jdt.internal.compiler.lookup.Binding;
23
import org.eclipse.jdt.internal.compiler.lookup.Binding;
16
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
24
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
Lines 42-49 Link Here
42
		}
50
		}
43
	}
51
	}
44
52
53
	public void getAllAnnotationContexts(int targetType, int typeParameterIndex, List allAnnotationContexts) {
54
		AnnotationCollector collector = new AnnotationCollector(this, targetType, typeParameterIndex, allAnnotationContexts);
55
		if (this.annotations != null) {
56
			int annotationsLength = this.annotations.length;
57
			for (int i = 0; i < annotationsLength; i++)
58
				this.annotations[i].traverse(collector, (BlockScope) null);
59
		}
60
		switch(collector.targetType) {
61
			case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER :
62
				collector.targetType = AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND;
63
				break;
64
			case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER :
65
				collector.targetType = AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND;
66
		}
67
		if (this.type != null && ((this.type.bits & ASTNode.HasTypeAnnotations) != 0)) {
68
			collector.info2 = 0;
69
			this.type.traverse(collector, (BlockScope) null);
70
		}
71
		if (this.bounds != null) {
72
			int boundsLength = this.bounds.length;
73
			for (int i = 0; i < boundsLength; i++) {
74
				TypeReference bound = this.bounds[i];
75
				if ((bound.bits & ASTNode.HasTypeAnnotations) == 0) {
76
					continue;
77
				}
78
				collector.info2 = i + 1;
79
				bound.traverse(collector, (BlockScope) null);
80
			}
81
		}
82
	}
45
	private void internalResolve(Scope scope, boolean staticContext) {
83
	private void internalResolve(Scope scope, boolean staticContext) {
46
	    // detect variable/type name collisions
84
		// detect variable/type name collisions
47
		if (this.binding != null) {
85
		if (this.binding != null) {
48
			Binding existingType = scope.parent.getBinding(this.name, Binding.TYPE, this, false/*do not resolve hidden field*/);
86
			Binding existingType = scope.parent.getBinding(this.name, Binding.TYPE, this, false/*do not resolve hidden field*/);
49
			if (existingType != null
87
			if (existingType != null
Lines 63-72 Link Here
63
		internalResolve(scope, scope.enclosingSourceType().isStatic());
101
		internalResolve(scope, scope.enclosingSourceType().isStatic());
64
	}
102
	}
65
103
104
	public void resolveAnnotations(BlockScope scope) {
105
		if (this.annotations != null) {
106
			resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_PARAMETER));
107
		}
108
		if (this.type != null) {
109
			this.type.resolveAnnotations(scope);
110
		}
111
		if (this.bounds != null) {
112
			for (int i = 0, max = this.bounds.length; i < max; i++) {
113
				this.bounds[i].resolveAnnotations(scope);
114
			}
115
		}
116
	}
66
	/* (non-Javadoc)
117
	/* (non-Javadoc)
67
	 * @see org.eclipse.jdt.internal.compiler.ast.AstNode#print(int, java.lang.StringBuffer)
118
	 * @see org.eclipse.jdt.internal.compiler.ast.AstNode#print(int, java.lang.StringBuffer)
68
	 */
119
	 */
69
	public StringBuffer printStatement(int indent, StringBuffer output) {
120
	public StringBuffer printStatement(int indent, StringBuffer output) {
121
		if (this.annotations != null) {
122
			printAnnotations(this.annotations, output);
123
			output.append(' ');
124
		}
70
		output.append(this.name);
125
		output.append(this.name);
71
		if (this.type != null) {
126
		if (this.type != null) {
72
			output.append(" extends "); //$NON-NLS-1$
127
			output.append(" extends "); //$NON-NLS-1$
Lines 82-92 Link Here
82
	}
137
	}
83
138
84
	public void generateCode(BlockScope currentScope, CodeStream codeStream) {
139
	public void generateCode(BlockScope currentScope, CodeStream codeStream) {
85
	    // nothing to do
140
		// nothing to do
86
	}
141
	}
87
142
88
	public void traverse(ASTVisitor visitor, BlockScope scope) {
143
	public void traverse(ASTVisitor visitor, BlockScope scope) {
89
		if (visitor.visit(this, scope)) {
144
		if (visitor.visit(this, scope)) {
145
			if (this.annotations != null) {
146
				int annotationsLength = this.annotations.length;
147
				for (int i = 0; i < annotationsLength; i++)
148
					this.annotations[i].traverse(visitor, scope);
149
			}
90
			if (this.type != null) {
150
			if (this.type != null) {
91
				this.type.traverse(visitor, scope);
151
				this.type.traverse(visitor, scope);
92
			}
152
			}
Lines 102-107 Link Here
102
162
103
	public void traverse(ASTVisitor visitor, ClassScope scope) {
163
	public void traverse(ASTVisitor visitor, ClassScope scope) {
104
		if (visitor.visit(this, scope)) {
164
		if (visitor.visit(this, scope)) {
165
			if (this.annotations != null) {
166
				int annotationsLength = this.annotations.length;
167
				for (int i = 0; i < annotationsLength; i++)
168
					this.annotations[i].traverse(visitor, scope);
169
			}
105
			if (this.type != null) {
170
			if (this.type != null) {
106
				this.type.traverse(visitor, scope);
171
				this.type.traverse(visitor, scope);
107
			}
172
			}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java (-12 / +290 lines)
Lines 1-23 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
15
package org.eclipse.jdt.internal.compiler.ast;
12
16
17
import java.util.ArrayList;
18
import java.util.List;
19
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
20
import org.eclipse.jdt.internal.compiler.ASTVisitor;
21
import org.eclipse.jdt.internal.compiler.codegen.AnnotationContext;
22
import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
14
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
23
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
15
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
24
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
16
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
25
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
17
import org.eclipse.jdt.internal.compiler.impl.Constant;
26
import org.eclipse.jdt.internal.compiler.impl.Constant;
18
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
27
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
28
import org.eclipse.jdt.internal.compiler.lookup.Binding;
19
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
29
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
20
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
30
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
31
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
21
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
32
import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
22
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
33
import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
23
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
34
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
Lines 28-39 Link Here
28
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
39
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
29
40
30
public abstract class TypeReference extends Expression {
41
public abstract class TypeReference extends Expression {
31
32
	public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0];
42
	public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0];
43
static class AnnotationCollector extends ASTVisitor {
44
	List annotationContexts;
45
	TypeReference typeReference;
46
	int targetType;
47
	Annotation[] primaryAnnotations;
48
	int info = -1;
49
	int info2 = -1;
50
	LocalVariableBinding localVariable;
51
	Annotation[][] annotationsOnDimensions;
52
	Wildcard currentWildcard;
53
54
	public AnnotationCollector(
55
			TypeParameter typeParameter,
56
			int targetType,
57
			int typeParameterIndex,
58
			List annotationContexts) {
59
		this.annotationContexts = annotationContexts;
60
		this.typeReference = typeParameter.type;
61
		this.targetType = targetType;
62
		this.primaryAnnotations = typeParameter.annotations;
63
		this.info = typeParameterIndex;
64
	}
65
66
	public AnnotationCollector(
67
			LocalDeclaration localDeclaration,
68
			int targetType,
69
			LocalVariableBinding localVariable,
70
			List annotationContexts) {
71
		this.annotationContexts = annotationContexts;
72
		this.typeReference = localDeclaration.type;
73
		this.targetType = targetType;
74
		this.primaryAnnotations = localDeclaration.annotations;
75
		this.localVariable = localVariable;
76
	}
77
78
	public AnnotationCollector(
79
			LocalDeclaration localDeclaration,
80
			int targetType,
81
			int parameterIndex,
82
			List annotationContexts) {
83
		this.annotationContexts = annotationContexts;
84
		this.typeReference = localDeclaration.type;
85
		this.targetType = targetType;
86
		this.primaryAnnotations = localDeclaration.annotations;
87
		this.info = parameterIndex;
88
	}
89
90
	public AnnotationCollector(
91
			MethodDeclaration methodDeclaration,
92
			int targetType,
93
			List annotationContexts) {
94
		this.annotationContexts = annotationContexts;
95
		this.typeReference = methodDeclaration.returnType;
96
		this.targetType = targetType;
97
		this.primaryAnnotations = methodDeclaration.annotations;
98
	}
99
100
	public AnnotationCollector(
101
			FieldDeclaration fieldDeclaration,
102
			int targetType,
103
			List annotationContexts) {
104
		this.annotationContexts = annotationContexts;
105
		this.typeReference = fieldDeclaration.type;
106
		this.targetType = targetType;
107
		this.primaryAnnotations = fieldDeclaration.annotations;
108
	}
109
	public AnnotationCollector(
110
			TypeReference typeReference,
111
			int targetType,
112
			List annotationContexts) {
113
		this.annotationContexts = annotationContexts;
114
		this.typeReference = typeReference;
115
		this.targetType = targetType;
116
	}
117
	public AnnotationCollector(
118
			TypeReference typeReference,
119
			int targetType,
120
			int info,
121
			List annotationContexts) {
122
		this.annotationContexts = annotationContexts;
123
		this.typeReference = typeReference;
124
		this.info = info;
125
		this.targetType = targetType;
126
	}
127
	public AnnotationCollector(
128
			TypeReference typeReference,
129
			int targetType,
130
			int info,
131
			int typeIndex,
132
			List annotationContexts) {
133
		this.annotationContexts = annotationContexts;
134
		this.typeReference = typeReference;
135
		this.info = info;
136
		this.targetType = targetType;
137
		this.info2 = typeIndex;
138
	}
139
	public AnnotationCollector(
140
			TypeReference typeReference,
141
			int targetType,
142
			int info,
143
			List annotationContexts,
144
			Annotation[][] annotationsOnDimensions) {
145
		this.annotationContexts = annotationContexts;
146
		this.typeReference = typeReference;
147
		this.info = info;
148
		this.targetType = targetType;
149
		this.annotationsOnDimensions = annotationsOnDimensions;
150
	}
151
	private boolean internalVisit(Annotation annotation) {
152
		AnnotationContext annotationContext = null;
153
		if (annotation.isRuntimeTypeInvisible()) {
154
			annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.INVISIBLE, this.annotationsOnDimensions);
155
		} else if (annotation.isRuntimeTypeVisible()) {
156
			annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.VISIBLE, this.annotationsOnDimensions);
157
		}
158
		if (annotationContext != null) {
159
			annotationContext.wildcard = this.currentWildcard;
160
			switch(this.targetType) {
161
				case AnnotationTargetTypeConstants.THROWS :
162
				case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER :
163
				case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER :
164
				case AnnotationTargetTypeConstants.METHOD_PARAMETER :
165
				case AnnotationTargetTypeConstants.TYPE_CAST :
166
				case AnnotationTargetTypeConstants.TYPE_INSTANCEOF :
167
				case AnnotationTargetTypeConstants.OBJECT_CREATION :
168
				case AnnotationTargetTypeConstants.CLASS_LITERAL :
169
				case AnnotationTargetTypeConstants.CLASS_EXTENDS_IMPLEMENTS:
170
					annotationContext.info = this.info;
171
					break;
172
				case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND :
173
				case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND :
174
					annotationContext.info2 = this.info2;
175
					annotationContext.info = this.info;
176
					break;
177
				case AnnotationTargetTypeConstants.LOCAL_VARIABLE :
178
					annotationContext.variableBinding = this.localVariable;
179
					break;
180
				case AnnotationTargetTypeConstants.TYPE_ARGUMENT_METHOD_CALL :
181
				case AnnotationTargetTypeConstants.TYPE_ARGUMENT_CONSTRUCTOR_CALL :
182
					annotationContext.info2 = this.info2;
183
					annotationContext.info = this.info;
184
			}
185
			this.annotationContexts.add(annotationContext);
186
		}
187
		return true;
188
	}
189
	public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
190
		return internalVisit(annotation);
191
	}
192
	public boolean visit(NormalAnnotation annotation, BlockScope scope) {
193
		return internalVisit(annotation);
194
	}
195
	public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
196
		return internalVisit(annotation);
197
	}
198
	public boolean visit(Wildcard wildcard, BlockScope scope) {
199
		this.currentWildcard = wildcard;
200
		return true;
201
	}
202
	public boolean visit(Argument argument, BlockScope scope) {
203
		if ((argument.bits & ASTNode.IsUnionType) == 0) {
204
			return true;
205
		}
206
		for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
207
			int startPC = this.localVariable.initializationPCs[i << 1];
208
			int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
209
			if (startPC != endPC) { // only entries for non zero length
210
				return true;
211
			}
212
		}
213
		return false;
214
	}
215
	public boolean visit(Argument argument, ClassScope scope) {
216
		if ((argument.bits & ASTNode.IsUnionType) == 0) {
217
			return true;
218
		}
219
		for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
220
			int startPC = this.localVariable.initializationPCs[i << 1];
221
			int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
222
			if (startPC != endPC) { // only entries for non zero length
223
				return true;
224
			}
225
		}
226
		return false;
227
	}
228
	public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
229
		for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
230
			int startPC = this.localVariable.initializationPCs[i << 1];
231
			int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
232
			if (startPC != endPC) { // only entries for non zero length
233
				return true;
234
			}
235
		}
236
		return false;
237
	}
238
	public void endVisit(Wildcard wildcard, BlockScope scope) {
239
		this.currentWildcard = null;
240
	}
241
}
33
/*
242
/*
34
 * Answer a base type reference (can be an array of base type).
243
 * Answer a base type reference (can be an array of base type).
35
 */
244
 */
36
public static final TypeReference baseTypeReference(int baseType, int dim) {
245
public static final TypeReference baseTypeReference(int baseType, int dim, Annotation [][] dimAnnotations) {
37
246
38
	if (dim == 0) {
247
	if (dim == 0) {
39
		switch (baseType) {
248
		switch (baseType) {
Lines 59-83 Link Here
59
	}
268
	}
60
	switch (baseType) {
269
	switch (baseType) {
61
		case (TypeIds.T_void) :
270
		case (TypeIds.T_void) :
62
			return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, 0);
271
			return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, dimAnnotations, 0);
63
		case (TypeIds.T_boolean) :
272
		case (TypeIds.T_boolean) :
64
			return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, 0);
273
			return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, dimAnnotations, 0);
65
		case (TypeIds.T_char) :
274
		case (TypeIds.T_char) :
66
			return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, 0);
275
			return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, dimAnnotations, 0);
67
		case (TypeIds.T_float) :
276
		case (TypeIds.T_float) :
68
			return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, 0);
277
			return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, dimAnnotations, 0);
69
		case (TypeIds.T_double) :
278
		case (TypeIds.T_double) :
70
			return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, 0);
279
			return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, dimAnnotations, 0);
71
		case (TypeIds.T_byte) :
280
		case (TypeIds.T_byte) :
72
			return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, 0);
281
			return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, dimAnnotations, 0);
73
		case (TypeIds.T_short) :
282
		case (TypeIds.T_short) :
74
			return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, 0);
283
			return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, dimAnnotations, 0);
75
		case (TypeIds.T_int) :
284
		case (TypeIds.T_int) :
76
			return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, 0);
285
			return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, dimAnnotations, 0);
77
		default : //T_long
286
		default : //T_long
78
			return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, 0);
287
			return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, dimAnnotations, 0);
79
	}
288
	}
80
}
289
}
290
291
// JSR308 type annotations...
292
public Annotation[] annotations = null;
81
293
82
// allows us to trap completion & selection nodes
294
// allows us to trap completion & selection nodes
83
public void aboutToResolve(Scope scope) {
295
public void aboutToResolve(Scope scope) {
Lines 90-97 Link Here
90
	// only parameterized type references have bounds
302
	// only parameterized type references have bounds
91
}
303
}
92
public abstract TypeReference copyDims(int dim);
304
public abstract TypeReference copyDims(int dim);
305
public abstract TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions);
93
public int dimensions() {
306
public int dimensions() {
94
	return 0;
307
	return 0;
308
}
309
public AnnotationContext[] getAllAnnotationContexts(int targetType) {
310
	List allAnnotationContexts = new ArrayList();
311
	AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
312
	this.traverse(collector, (BlockScope) null);
313
	return (AnnotationContext[]) allAnnotationContexts.toArray(new AnnotationContext[allAnnotationContexts.size()]);
314
}
315
/**
316
 * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
317
 * @param targetType
318
 * @param info
319
 * @param allAnnotationContexts
320
 */
321
public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts) {
322
	AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts);
323
	this.traverse(collector, (BlockScope) null);
324
}
325
/**
326
 * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
327
 * @param targetType
328
 * @param info
329
 * @param allAnnotationContexts
330
 */
331
public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts, Annotation[][] annotationsOnDimensions) {
332
	AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts, annotationsOnDimensions);
333
	this.traverse(collector, (BlockScope) null);
334
	if (annotationsOnDimensions != null) {
335
		for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) {
336
			Annotation[] annotationsOnDimension = annotationsOnDimensions[i];
337
			if (annotationsOnDimension != null) {
338
				for (int j = 0, max2 = annotationsOnDimension.length; j< max2; j++) {
339
					annotationsOnDimension[j].traverse(collector, (BlockScope) null);
340
				}
341
			}
342
		}
343
	}
344
}
345
public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List allAnnotationContexts) {
346
	AnnotationCollector collector = new AnnotationCollector(this, targetType, info, typeIndex, allAnnotationContexts);
347
	this.traverse(collector, (BlockScope) null);
348
}
349
public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
350
	AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
351
	this.traverse(collector, (BlockScope) null);
352
}
353
public Annotation[][] getAnnotationsOnDimensions() {
354
	return null;
95
}
355
}
96
356
97
public abstract char[] getLastToken();
357
public abstract char[] getLastToken();
Lines 159-164 Link Here
159
			&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) {
419
			&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) {
160
		scope.problemReporter().rawTypeReference(this, type);
420
		scope.problemReporter().rawTypeReference(this, type);
161
	}
421
	}
422
	if (this.annotations != null) {
423
		switch(scope.kind) {
424
			case Scope.BLOCK_SCOPE :
425
			case Scope.METHOD_SCOPE :
426
				resolveAnnotations((BlockScope) scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
427
				break;
428
		}
429
	}
430
162
	if (hasError) {
431
	if (hasError) {
163
		// do not store the computed type, keep the problem type instead
432
		// do not store the computed type, keep the problem type instead
164
		return type;
433
		return type;
Lines 169-174 Link Here
169
	return true;
438
	return true;
170
}
439
}
171
440
441
public boolean isParameterizedTypeReference() {
442
	return false;
443
}
172
protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
444
protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
173
	scope.problemReporter().deprecatedType(type, this, index);
445
	scope.problemReporter().deprecatedType(type, this, index);
174
}
446
}
Lines 234-237 Link Here
234
public abstract void traverse(ASTVisitor visitor, BlockScope scope);
506
public abstract void traverse(ASTVisitor visitor, BlockScope scope);
235
507
236
public abstract void traverse(ASTVisitor visitor, ClassScope scope);
508
public abstract void traverse(ASTVisitor visitor, ClassScope scope);
509
510
protected void resolveAnnotations(BlockScope scope) {
511
	if (this.annotations != null) {
512
		resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
513
	}
514
}
237
}
515
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java (+9 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 156-159 Link Here
156
		return output;
160
		return output;
157
	}
161
	}
158
162
163
	public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
164
		// TODO Auto-generated method stub
165
		return null;
166
	}
167
159
}
168
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java (-3 / +9 lines)
Lines 1-10 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 59-65 Link Here
59
			boundType = scope.kind == Scope.CLASS_SCOPE
63
			boundType = scope.kind == Scope.CLASS_SCOPE
60
					? this.bound.resolveType((ClassScope)scope)
64
					? this.bound.resolveType((ClassScope)scope)
61
					: this.bound.resolveType((BlockScope)scope, true /* check bounds*/);
65
					: this.bound.resolveType((BlockScope)scope, true /* check bounds*/);
62
66
			this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
63
			if (boundType == null) {
67
			if (boundType == null) {
64
				return null;
68
				return null;
65
			}
69
			}
Lines 89-94 Link Here
89
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
93
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
90
		if (this.bound != null) {
94
		if (this.bound != null) {
91
			this.bound.resolveType(scope, checkBounds);
95
			this.bound.resolveType(scope, checkBounds);
96
			this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
92
		}
97
		}
93
		return null;
98
		return null;
94
	}
99
	}
Lines 96-101 Link Here
96
	public TypeBinding resolveType(ClassScope scope) {
101
	public TypeBinding resolveType(ClassScope scope) {
97
		if (this.bound != null) {
102
		if (this.bound != null) {
98
			this.bound.resolveType(scope);
103
			this.bound.resolveType(scope);
104
			this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
99
		}
105
		}
100
		return null;
106
		return null;
101
	}
107
	}
Lines 104-110 Link Here
104
	}
110
	}
105
111
106
	public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) {
112
	public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) {
107
	    return internalResolveType(classScope, genericType, rank);
113
		return internalResolveType(classScope, genericType, rank);
108
	}
114
	}
109
115
110
	public void traverse(ASTVisitor visitor, BlockScope scope) {
116
	public void traverse(ASTVisitor visitor, BlockScope scope) {
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java (+1 lines)
Lines 132-135 Link Here
132
	int ATTR_VARS = 0x4; // LocalVariableTableAttribute
132
	int ATTR_VARS = 0x4; // LocalVariableTableAttribute
133
	int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute
133
	int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute
134
	int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc
134
	int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc
135
	int ATTR_TYPE_ANNOTATION = 0x20; // annotation type annotation (jsr 308)
135
}
136
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java (+64 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
12
 * Contributors:
13
 *     IBM Corporation - initial API and implementation
14
 *******************************************************************************/
15
package org.eclipse.jdt.internal.compiler.codegen;
16
17
import org.eclipse.jdt.internal.compiler.ast.Annotation;
18
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
19
import org.eclipse.jdt.internal.compiler.ast.Wildcard;
20
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
21
22
public class AnnotationContext {
23
	public static final int VISIBLE = 0x1;
24
	public static final int INVISIBLE = 0x2;
25
	public Annotation annotation;
26
	public TypeReference typeReference;
27
	public int targetType;
28
	public int info;
29
	public int info2;
30
	public int visibility;
31
	public Annotation[] primaryAnnotations;
32
	public LocalVariableBinding variableBinding;
33
	public Annotation[][] annotationsOnDimensions;
34
	public Wildcard wildcard;
35
36
	public AnnotationContext(
37
			Annotation annotation,
38
			TypeReference typeReference,
39
			int targetType,
40
			Annotation[] primaryAnnotations,
41
			int visibility,
42
			Annotation[][] annotationsOnDimensions) {
43
		this.annotation = annotation;
44
		this.typeReference = typeReference;
45
		this.targetType = targetType;
46
		this.primaryAnnotations = primaryAnnotations;
47
		this.visibility = visibility;
48
		this.annotationsOnDimensions = annotationsOnDimensions;
49
	}
50
51
	public String toString() {
52
		return "AnnotationContext [annotation=" //$NON-NLS-1$
53
				+ this.annotation
54
				+ ", typeReference=" //$NON-NLS-1$
55
				+ this.typeReference
56
				+ ", targetType=" //$NON-NLS-1$
57
				+ this.targetType
58
				+ ", info =" //$NON-NLS-1$
59
				+ this.info
60
				+ ", boundIndex=" //$NON-NLS-1$
61
				+ this.info2
62
				+ "]"; //$NON-NLS-1$
63
	}
64
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java (+54 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
12
 * Contributors:
13
 *     IBM Corporation - initial API and implementation
14
 *******************************************************************************/
15
package org.eclipse.jdt.internal.compiler.codegen;
16
17
public interface AnnotationTargetTypeConstants {
18
	int METHOD_RECEIVER = 0x06;
19
	int METHOD_RECEIVER_GENERIC_OR_ARRAY = 0x07;
20
	int METHOD_RETURN_TYPE = 0x0A;
21
	int METHOD_RETURN_TYPE_GENERIC_OR_ARRAY = 0x0B;
22
	int METHOD_PARAMETER = 0x0C;
23
	int METHOD_PARAMETER_GENERIC_OR_ARRAY = 0x0D;
24
	int FIELD = 0x0E;
25
	int FIELD_GENERIC_OR_ARRAY = 0x0F;
26
	int CLASS_TYPE_PARAMETER_BOUND = 0x10;
27
	int CLASS_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x11;
28
	int METHOD_TYPE_PARAMETER_BOUND = 0x12;
29
	int METHOD_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x13;
30
	int CLASS_EXTENDS_IMPLEMENTS = 0x14;
31
	int CLASS_EXTENDS_IMPLEMENTS_GENERIC_OR_ARRAY = 0x15;
32
	int THROWS = 0x16;
33
	int THROWS_GENERIC_OR_ARRAY = 0x17;
34
	int WILDCARD_BOUND = 0x1C;
35
	int WILDCARD_BOUND_GENERIC_OR_ARRAY = 0x1D;
36
	int METHOD_TYPE_PARAMETER = 0x20;
37
	int METHOD_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x21;
38
	int CLASS_TYPE_PARAMETER = 0x22;
39
	int CLASS_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x23;
40
	int TYPE_CAST = 0x00;
41
	int TYPE_CAST_GENERIC_OR_ARRAY = 0x01;
42
	int TYPE_INSTANCEOF = 0x02;
43
	int TYPE_INSTANCEOF_GENERIC_OR_ARRAY = 0x03;
44
	int OBJECT_CREATION = 0x04;
45
	int OBJECT_CREATION_GENERIC_OR_ARRAY = 0x05;
46
	int LOCAL_VARIABLE = 0x08;
47
	int LOCAL_VARIABLE_GENERIC_OR_ARRAY = 0x09;
48
	int TYPE_ARGUMENT_CONSTRUCTOR_CALL = 0x18;
49
	int TYPE_ARGUMENT_CONSTRUCTOR_CALL_GENERIC_OR_ARRAY = 0x19;
50
	int TYPE_ARGUMENT_METHOD_CALL = 0x1A;
51
	int TYPE_ARGUMENT_METHOD_CALL_GENERIC_OR_ARRAY = 0x1B;
52
	int CLASS_LITERAL = 0x1E;
53
	int CLASS_LITERAL_GENERIC_OR_ARRAY = 0x1F;
54
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java (+6 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contribution for
14
 *     Stephan Herrmann - Contribution for
Lines 32-37 Link Here
32
	public static final int GENERIC_TYPE = TYPE | ASTNode.Bit12;
36
	public static final int GENERIC_TYPE = TYPE | ASTNode.Bit12;
33
	public static final int TYPE_PARAMETER = TYPE | ASTNode.Bit13;
37
	public static final int TYPE_PARAMETER = TYPE | ASTNode.Bit13;
34
	public static final int INTERSECTION_TYPE = TYPE | ASTNode.Bit14;
38
	public static final int INTERSECTION_TYPE = TYPE | ASTNode.Bit14;
39
	// jsr 308
40
	public static final int TYPE_USE = TYPE | ASTNode.Bit15;
35
41
36
	// Shared binding collections
42
	// Shared binding collections
37
	public static final TypeBinding[] NO_TYPES = new TypeBinding[0];
43
	public static final TypeBinding[] NO_TYPES = new TypeBinding[0];
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java (-4 / +29 lines)
Lines 13-21 Link Here
13
 *******************************************************************************/
13
 *******************************************************************************/
14
package org.eclipse.jdt.internal.compiler.lookup;
14
package org.eclipse.jdt.internal.compiler.lookup;
15
15
16
17
import org.eclipse.jdt.core.compiler.CharOperation;
16
import org.eclipse.jdt.internal.compiler.ast.*;
18
import org.eclipse.jdt.internal.compiler.ast.*;
17
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
19
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
18
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
20
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
21
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
19
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
22
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
20
import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
23
import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
21
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
24
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
Lines 324-336 Link Here
324
	this.isStatic = method.binding.isStatic();
327
	this.isStatic = method.binding.isStatic();
325
328
326
	Argument[] argTypes = method.arguments;
329
	Argument[] argTypes = method.arguments;
330
	
327
	int argLength = argTypes == null ? 0 : argTypes.length;
331
	int argLength = argTypes == null ? 0 : argTypes.length;
328
	if (argLength > 0 && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
332
	long sourceLevel = compilerOptions().sourceLevel;
329
		if (argTypes[--argLength].isVarArgs())
333
	if (argLength > 0 && sourceLevel >= ClassFileConstants.JDK1_5) {
334
		Argument argument = argTypes[--argLength];
335
		if (argument.isVarArgs())
330
			method.binding.modifiers |= ClassFileConstants.AccVarargs;
336
			method.binding.modifiers |= ClassFileConstants.AccVarargs;
337
		if (CharOperation.equals(argument.name, ConstantPool.This)) {
338
			if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) {
339
				problemReporter().illegalThis(argument, method, sourceLevel);
340
			}
341
			if (argument.annotations != null) {
342
				method.receiverAnnotations = argument.annotations;
343
				method.bits |= ASTNode.HasTypeAnnotations;
344
			}
345
		}
331
		while (--argLength >= 0) {
346
		while (--argLength >= 0) {
332
			if (argTypes[argLength].isVarArgs())
347
			argument = argTypes[argLength];
333
				problemReporter().illegalVararg(argTypes[argLength], method);
348
			if (argument.isVarArgs())
349
				problemReporter().illegalVararg(argument, method);
350
			if (CharOperation.equals(argument.name, ConstantPool.This)) {
351
				if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) {
352
					problemReporter().illegalThis(argument, method, sourceLevel);
353
				}
354
				if (argument.annotations != null) {
355
					method.receiverAnnotations = argument.annotations;
356
					method.bits |= ASTNode.HasTypeAnnotations;
357
				}
358
			}	
334
		}
359
		}
335
	}
360
	}
336
361
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (+23 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contribution for bug 186342 [compiler][null] Using annotations for null checking
14
 *     Stephan Herrmann - Contribution for bug 186342 [compiler][null] Using annotations for null checking
Lines 783-788 Link Here
783
			parameterBinding.fPackage = unitPackage;
787
			parameterBinding.fPackage = unitPackage;
784
			typeParameter.binding = parameterBinding;
788
			typeParameter.binding = parameterBinding;
785
789
790
			if ((typeParameter.bits & ASTNode.HasTypeAnnotations) != 0) {
791
				switch(declaringElement.kind()) {
792
					case Binding.METHOD :
793
						MethodBinding methodBinding = (MethodBinding) declaringElement;
794
						AbstractMethodDeclaration sourceMethod = methodBinding.sourceMethod();
795
						if (sourceMethod != null) {
796
							sourceMethod.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations);
797
						}
798
						break;
799
					case Binding.TYPE :
800
						if (declaringElement instanceof SourceTypeBinding) {
801
							SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) declaringElement;
802
							TypeDeclaration typeDeclaration = sourceTypeBinding.scope.referenceContext;
803
							if (typeDeclaration != null) {
804
								typeDeclaration.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations);
805
							}
806
						}
807
				}
808
			}
786
			// detect duplicates, but keep each variable to reduce secondary errors with instantiating this generic type (assume number of variables is correct)
809
			// detect duplicates, but keep each variable to reduce secondary errors with instantiating this generic type (assume number of variables is correct)
787
			for (int j = 0; j < count; j++) {
810
			for (int j = 0; j < count; j++) {
788
				TypeVariableBinding knownVar = typeVariableBindings[j];
811
				TypeVariableBinding knownVar = typeVariableBindings[j];
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java (-1 / +8 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contribution for bug 186342 - [compiler][null] Using annotations for null checking
14
 *     Stephan Herrmann - Contribution for bug 186342 - [compiler][null] Using annotations for null checking
Lines 109-119 Link Here
109
	long AnnotationForLocalVariable = ASTNode.Bit42L;
113
	long AnnotationForLocalVariable = ASTNode.Bit42L;
110
	long AnnotationForAnnotationType = ASTNode.Bit43L;
114
	long AnnotationForAnnotationType = ASTNode.Bit43L;
111
	long AnnotationForPackage = ASTNode.Bit44L;
115
	long AnnotationForPackage = ASTNode.Bit44L;
116
	long AnnotationForTypeUse = ASTNode.Bit54L;
117
	long AnnotationForTypeParameter = ASTNode.Bit55L;
112
	long AnnotationTargetMASK = AnnotationTarget
118
	long AnnotationTargetMASK = AnnotationTarget
113
				| AnnotationForType | AnnotationForField
119
				| AnnotationForType | AnnotationForField
114
				| AnnotationForMethod | AnnotationForParameter
120
				| AnnotationForMethod | AnnotationForParameter
115
				| AnnotationForConstructor | AnnotationForLocalVariable
121
				| AnnotationForConstructor | AnnotationForLocalVariable
116
				| AnnotationForAnnotationType | AnnotationForPackage;
122
				| AnnotationForAnnotationType | AnnotationForPackage
123
				| AnnotationForTypeUse | AnnotationForTypeParameter;
117
	// 2-bits for retention (should check (tagBits & RetentionMask) == RuntimeRetention
124
	// 2-bits for retention (should check (tagBits & RetentionMask) == RuntimeRetention
118
	long AnnotationSourceRetention = ASTNode.Bit45L;
125
	long AnnotationSourceRetention = ASTNode.Bit45L;
119
	long AnnotationClassRetention = ASTNode.Bit46L;
126
	long AnnotationClassRetention = ASTNode.Bit46L;
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java (+8 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann - Contributions for
14
 *     Stephan Herrmann - Contributions for
Lines 80-85 Link Here
80
    char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray(); //$NON-NLS-1$
84
    char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray(); //$NON-NLS-1$
81
    char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray(); //$NON-NLS-1$
85
    char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray(); //$NON-NLS-1$
82
    char[] UPPER_PACKAGE = "PACKAGE".toCharArray(); //$NON-NLS-1$
86
    char[] UPPER_PACKAGE = "PACKAGE".toCharArray(); //$NON-NLS-1$
87
    
88
	// jsr308
89
	char[] TYPE_USE_TARGET  = "TYPE_USE".toCharArray(); //$NON-NLS-1$
90
	char[] TYPE_PARAMETER_TARGET = "TYPE_PARAMETER".toCharArray(); //$NON-NLS-1$
83
91
84
	// Constant compound names
92
	// Constant compound names
85
	char[][] JAVA_LANG = {JAVA, LANG};
93
	char[][] JAVA_LANG = {JAVA, LANG};
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-502 / +1357 lines)
Lines 31-36 Link Here
31
import org.eclipse.jdt.internal.compiler.CompilationResult;
31
import org.eclipse.jdt.internal.compiler.CompilationResult;
32
import org.eclipse.jdt.internal.compiler.ast.*;
32
import org.eclipse.jdt.internal.compiler.ast.*;
33
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
33
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
34
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
34
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
35
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
35
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
36
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
36
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
37
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
Lines 71-76 Link Here
71
	//expression stack
72
	//expression stack
72
	protected final static int ExpressionStackIncrement = 100;
73
	protected final static int ExpressionStackIncrement = 100;
73
74
75
	// annotation stack
76
	protected final static int TypeAnnotationStackIncrement = 100;
77
	
74
	protected final static int GenericsStackIncrement = 10;
78
	protected final static int GenericsStackIncrement = 10;
75
79
76
	private final static String FILEPREFIX = "parser"; //$NON-NLS-1$
80
	private final static String FILEPREFIX = "parser"; //$NON-NLS-1$
Lines 788-794 Link Here
788
	protected int[] expressionLengthStack;
792
	protected int[] expressionLengthStack;
789
	protected int expressionPtr;
793
	protected int expressionPtr;
790
	protected Expression[] expressionStack = new Expression[ExpressionStackIncrement];
794
	protected Expression[] expressionStack = new Expression[ExpressionStackIncrement];
795
	protected int unattachedAnnotationPtr;  // used for figuring out whether some set of annotations are annotating a dimension or not.
791
	public int firstToken ; // handle for multiple parsing goals
796
	public int firstToken ; // handle for multiple parsing goals
797
	
798
	/* jsr308 -- Type annotation management, we now maintain type annotations in a separate stack
799
	   as otherwise they get interspersed with other expressions and some of the code is not prepared
800
	   to handle such interleaving and will look ugly if changed. 
801
	   
802
	   See consumeArrayCreationExpressionWithoutInitializer for example. 
803
	   
804
	   See that annotations gets pushed into expression stack the moment an annotation is discovered and
805
	   get moved to the new type annotations stack only later when the annotation is recognized to be a
806
	   type annotation. Where ambiguities exist (i.e 1.7 annotation occurs in a place sanctioned for an
807
	   1.5 type annotation, the annotation continues to stay in the expression stack, but in these case
808
	   interleaving is not an issue.
809
	*/  
810
	protected int typeAnnotationPtr;
811
	protected int typeAnnotationLengthPtr;
812
	protected Annotation [] typeAnnotationStack = new Annotation[TypeAnnotationStackIncrement];
813
	protected int [] typeAnnotationLengthStack;
792
	// generics management
814
	// generics management
793
	protected int genericsIdentifiersLengthPtr;
815
	protected int genericsIdentifiersLengthPtr;
794
	protected int[] genericsIdentifiersLengthStack = new int[GenericsStackIncrement];
816
	protected int[] genericsIdentifiersLengthStack = new int[GenericsStackIncrement];
Lines 884-889 Link Here
884
	this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8;
906
	this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8;
885
	this.astLengthStack = new int[50];
907
	this.astLengthStack = new int[50];
886
	this.expressionLengthStack = new int[30];
908
	this.expressionLengthStack = new int[30];
909
	this.typeAnnotationLengthStack = new int[30];
887
	this.intStack = new int[50];
910
	this.intStack = new int[50];
888
	this.identifierStack = new char[30][];
911
	this.identifierStack = new char[30][];
889
	this.identifierLengthStack = new int[30];
912
	this.identifierLengthStack = new int[30];
Lines 1232-1237 Link Here
1232
	}
1255
	}
1233
}
1256
}
1234
protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) {
1257
protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) {
1258
	Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
1235
	int nameSize = this.identifierLengthStack[this.identifierLengthPtr];
1259
	int nameSize = this.identifierLengthStack[this.identifierLengthPtr];
1236
	int tokensSize = nameSize;
1260
	int tokensSize = nameSize;
1237
	if (rightSide instanceof ParameterizedSingleTypeReference) {
1261
	if (rightSide instanceof ParameterizedSingleTypeReference) {
Lines 1287-1293 Link Here
1287
		typeArguments[nameSize - 1] = currentTypeArguments;
1311
		typeArguments[nameSize - 1] = currentTypeArguments;
1288
	}
1312
	}
1289
	this.identifierLengthPtr--;
1313
	this.identifierLengthPtr--;
1290
	return new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions);
1314
	ParameterizedQualifiedTypeReference typeRef = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions);
1315
	int length;
1316
	if (this.typeAnnotationLengthPtr >= 0 && (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
1317
		System.arraycopy(
1318
			this.typeAnnotationStack,
1319
			(this.typeAnnotationPtr -= length) + 1,
1320
			typeRef.annotations = new Annotation[length],
1321
			0,
1322
			length);
1323
		typeRef.sourceStart = typeRef.annotations[0].sourceStart;
1324
		typeRef.bits |= ASTNode.HasTypeAnnotations;
1325
	}
1326
	return typeRef;
1291
}
1327
}
1292
protected void concatExpressionLists() {
1328
protected void concatExpressionLists() {
1293
	this.expressionLengthStack[--this.expressionLengthPtr]++;
1329
	this.expressionLengthStack[--this.expressionLengthPtr]++;
Lines 1630-1637 Link Here
1630
	this.expressionLengthPtr -- ;
1666
	this.expressionLengthPtr -- ;
1631
	arrayAllocation.initializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--];
1667
	arrayAllocation.initializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--];
1632
1668
1633
	arrayAllocation.type = getTypeReference(0);
1634
	arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
1635
	length = (this.expressionLengthStack[this.expressionLengthPtr--]);
1669
	length = (this.expressionLengthStack[this.expressionLengthPtr--]);
1636
	this.expressionPtr -= length ;
1670
	this.expressionPtr -= length ;
1637
	System.arraycopy(
1671
	System.arraycopy(
Lines 1640-1645 Link Here
1640
		arrayAllocation.dimensions = new Expression[length],
1674
		arrayAllocation.dimensions = new Expression[length],
1641
		0,
1675
		0,
1642
		length);
1676
		length);
1677
	Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length);
1678
	arrayAllocation.annotationsOnDimensions = annotationsOnDimensions;
1679
	if (annotationsOnDimensions != null) {
1680
		arrayAllocation.bits |= ASTNode.HasTypeAnnotations;
1681
	}
1682
	arrayAllocation.type = getTypeReference(0);
1683
	arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
1684
1643
	arrayAllocation.sourceStart = this.intStack[this.intPtr--];
1685
	arrayAllocation.sourceStart = this.intStack[this.intPtr--];
1644
	if (arrayAllocation.initializer == null) {
1686
	if (arrayAllocation.initializer == null) {
1645
		arrayAllocation.sourceEnd = this.endStatementPosition;
1687
		arrayAllocation.sourceEnd = this.endStatementPosition;
Lines 1654-1661 Link Here
1654
1696
1655
	int length;
1697
	int length;
1656
	ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression();
1698
	ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression();
1657
	arrayAllocation.type = getTypeReference(0);
1658
	arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
1659
	length = (this.expressionLengthStack[this.expressionLengthPtr--]);
1699
	length = (this.expressionLengthStack[this.expressionLengthPtr--]);
1660
	this.expressionPtr -= length ;
1700
	this.expressionPtr -= length ;
1661
	System.arraycopy(
1701
	System.arraycopy(
Lines 1664-1669 Link Here
1664
		arrayAllocation.dimensions = new Expression[length],
1704
		arrayAllocation.dimensions = new Expression[length],
1665
		0,
1705
		0,
1666
		length);
1706
		length);
1707
	Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length);
1708
	arrayAllocation.annotationsOnDimensions = annotationsOnDimensions;
1709
	if (annotationsOnDimensions != null) {
1710
		arrayAllocation.bits |= ASTNode.HasTypeAnnotations;
1711
	}
1712
	arrayAllocation.type = getTypeReference(0);
1713
	arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
1667
	arrayAllocation.sourceStart = this.intStack[this.intPtr--];
1714
	arrayAllocation.sourceStart = this.intStack[this.intPtr--];
1668
	if (arrayAllocation.initializer == null) {
1715
	if (arrayAllocation.initializer == null) {
1669
		arrayAllocation.sourceEnd = this.endStatementPosition;
1716
		arrayAllocation.sourceEnd = this.endStatementPosition;
Lines 2059-2065 Link Here
2059
	pushOnAstStack(caseStatement);
2106
	pushOnAstStack(caseStatement);
2060
}
2107
}
2061
protected void consumeCastExpressionLL1() {
2108
protected void consumeCastExpressionLL1() {
2062
	//CastExpression ::= '(' Expression ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
2109
	//CastExpression ::= '(' Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
2063
	// Expression is used in order to make the grammar LL1
2110
	// Expression is used in order to make the grammar LL1
2064
2111
2065
	//optimize push/pop
2112
	//optimize push/pop
Lines 2074-2079 Link Here
2074
	this.expressionLengthPtr -- ;
2121
	this.expressionLengthPtr -- ;
2075
	updateSourcePosition(cast);
2122
	updateSourcePosition(cast);
2076
	cast.sourceEnd=exp.sourceEnd;
2123
	cast.sourceEnd=exp.sourceEnd;
2124
}
2125
protected void consumeCastExpressionLL1WithTypeAnnotations() {
2126
	// CastExpression ::= '(' Modifiers Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
2127
	// Expression is used in order to make the grammar LL1
2128
2129
	//optimize push/pop
2130
2131
	// pop the expression
2132
	Expression expression = this.expressionStack[this.expressionPtr--];
2133
	this.expressionLengthPtr--;
2134
	// pop the type reference
2135
	TypeReference typeReference = (TypeReference) this.expressionStack[this.expressionPtr--];
2136
	this.expressionLengthPtr--;
2137
	
2138
	int length;
2139
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2140
		System.arraycopy(
2141
				this.expressionStack,
2142
				(this.expressionPtr -= length) + 1,
2143
				typeReference.annotations = new Annotation[length],
2144
				0,
2145
				length);
2146
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
2147
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
2148
			typeReferenceSourceStart = this.modifiersSourceStart;
2149
		}
2150
		typeReference.sourceStart = typeReferenceSourceStart;
2151
		typeReference.bits |= ASTNode.HasTypeAnnotations;
2152
	}
2153
	Expression cast;
2154
	pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
2155
	// pop the two positions for left and right parenthesis 
2156
	updateSourcePosition(cast);
2157
	cast.sourceEnd = expression.sourceEnd;
2158
	if (this.modifiers != ClassFileConstants.AccDefault) {
2159
		problemReporter().invalidLocationForModifiers(typeReference);
2160
	}
2161
	resetModifiers();
2077
}
2162
}
2078
protected void consumeCastExpressionWithGenericsArray() {
2163
protected void consumeCastExpressionWithGenericsArray() {
2079
	// CastExpression ::= PushLPAREN Name TypeArguments Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2164
	// CastExpression ::= PushLPAREN Name TypeArguments Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
Lines 2092-2097 Link Here
2092
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2177
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2093
	cast.sourceEnd = exp.sourceEnd;
2178
	cast.sourceEnd = exp.sourceEnd;
2094
}
2179
}
2180
protected void consumeCastExpressionWithGenericsArrayWithTypeAnnotations() {
2181
	// CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
2182
	int end = this.intStack[this.intPtr--];
2183
	int dim = this.intStack[this.intPtr--];
2184
2185
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
2186
	TypeReference typeReference = getTypeReference(dim);
2187
	
2188
	// pop expression
2189
	Expression expression = this.expressionStack[this.expressionPtr--];
2190
	this.expressionLengthPtr--;
2191
2192
	int length;
2193
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2194
		System.arraycopy(
2195
				this.expressionStack,
2196
				(this.expressionPtr -= length) + 1,
2197
				typeReference.annotations = new Annotation[length],
2198
				0,
2199
				length);
2200
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
2201
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
2202
			typeReferenceSourceStart = this.modifiersSourceStart;
2203
		}
2204
		typeReference.bits |= ASTNode.HasTypeAnnotations;
2205
		typeReference.sourceStart = typeReferenceSourceStart;
2206
	}
2207
	Expression cast;
2208
	pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
2209
	this.intPtr--;
2210
	typeReference.sourceEnd = end - 1;
2211
	typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2212
	cast.sourceEnd = expression.sourceEnd;
2213
	if (this.modifiers != ClassFileConstants.AccDefault) {
2214
		problemReporter().invalidLocationForModifiers(typeReference);
2215
	}
2216
	resetModifiers();
2217
}
2095
protected void consumeCastExpressionWithNameArray() {
2218
protected void consumeCastExpressionWithNameArray() {
2096
	// CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2219
	// CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2097
2220
Lines 2109-2114 Link Here
2109
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2232
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2110
	cast.sourceEnd = exp.sourceEnd;
2233
	cast.sourceEnd = exp.sourceEnd;
2111
}
2234
}
2235
protected void consumeCastExpressionWithNameArrayWithTypeAnnotations() {
2236
	// CastExpression ::= PushLPAREN Modifiers Name Dims PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
2237
2238
	int end = this.intStack[this.intPtr--];
2239
2240
	// handle type arguments
2241
	pushOnGenericsLengthStack(0);
2242
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
2243
2244
	// pop expression
2245
	Expression expression = this.expressionStack[this.expressionPtr--];
2246
	this.expressionLengthPtr--;
2247
	TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]);
2248
2249
	int length;
2250
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2251
		System.arraycopy(
2252
				this.expressionStack,
2253
				(this.expressionPtr -= length) + 1,
2254
				typeReference.annotations = new Annotation[length],
2255
				0,
2256
				length);
2257
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
2258
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
2259
			typeReferenceSourceStart = this.modifiersSourceStart;
2260
		}
2261
		typeReference.bits |= ASTNode.HasTypeAnnotations;
2262
		typeReference.sourceStart = typeReferenceSourceStart;
2263
	}
2264
	Expression cast;
2265
	pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
2266
	typeReference.sourceEnd = end - 1;
2267
	typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2268
	cast.sourceEnd = expression.sourceEnd;
2269
	if (this.modifiers != ClassFileConstants.AccDefault) {
2270
		problemReporter().invalidLocationForModifiers(typeReference);
2271
	}
2272
	resetModifiers();
2273
}
2112
protected void consumeCastExpressionWithPrimitiveType() {
2274
protected void consumeCastExpressionWithPrimitiveType() {
2113
	// CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
2275
	// CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
2114
2276
Lines 2125-2130 Link Here
2125
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2287
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2126
	cast.sourceEnd = exp.sourceEnd;
2288
	cast.sourceEnd = exp.sourceEnd;
2127
}
2289
}
2290
protected void consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations() {
2291
	// CastExpression ::= PushLPAREN Modifiers PrimitiveType Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpression
2292
2293
	//this.intStack : posOfLeftParen dim posOfRightParen
2294
	int end = this.intStack[this.intPtr--];
2295
2296
	// pop expression
2297
	Expression expression = this.expressionStack[this.expressionPtr--];
2298
	this.expressionLengthPtr--;
2299
2300
	TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]);
2301
	int length;
2302
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2303
		System.arraycopy(
2304
				this.expressionStack,
2305
				(this.expressionPtr -= length) + 1,
2306
				typeReference.annotations = new Annotation[length],
2307
				0,
2308
				length);
2309
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
2310
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
2311
			typeReferenceSourceStart = this.modifiersSourceStart;
2312
		}
2313
		typeReference.bits |= ASTNode.HasTypeAnnotations;
2314
		typeReference.sourceStart = typeReferenceSourceStart;
2315
	}
2316
	
2317
	Expression cast;
2318
	pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
2319
	
2320
	typeReference.sourceEnd = end - 1;
2321
	typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2322
	cast.sourceEnd = expression.sourceEnd;
2323
	if (this.modifiers != ClassFileConstants.AccDefault) {
2324
		problemReporter().invalidLocationForModifiers(typeReference);
2325
	}
2326
	resetModifiers();
2327
}
2128
protected void consumeCastExpressionWithQualifiedGenericsArray() {
2328
protected void consumeCastExpressionWithQualifiedGenericsArray() {
2129
	// CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2329
	// CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2130
	Expression exp;
2330
	Expression exp;
Lines 2133-2139 Link Here
2133
	int end = this.intStack[this.intPtr--];
2333
	int end = this.intStack[this.intPtr--];
2134
2334
2135
	int dim = this.intStack[this.intPtr--];
2335
	int dim = this.intStack[this.intPtr--];
2136
	TypeReference rightSide = getTypeReference(0);
2336
	TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
2137
2337
2138
	ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide(rightSide, dim);
2338
	ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide(rightSide, dim);
2139
	this.intPtr--;
2339
	this.intPtr--;
Lines 2141-2146 Link Here
2141
	castType.sourceEnd = end - 1;
2341
	castType.sourceEnd = end - 1;
2142
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2342
	castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2143
	cast.sourceEnd = exp.sourceEnd;
2343
	cast.sourceEnd = exp.sourceEnd;
2344
}
2345
protected void consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations() {
2346
	// CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
2347
	int end = this.intStack[this.intPtr--];
2348
2349
	int dim = this.intStack[this.intPtr--];
2350
	// pop expression
2351
	Expression expression = this.expressionStack[this.expressionPtr--];
2352
	this.expressionLengthPtr--;
2353
	
2354
	TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
2355
2356
	ParameterizedQualifiedTypeReference typeReference = computeQualifiedGenericsFromRightSide(rightSide, dim);
2357
	this.intPtr--;
2358
	int length;
2359
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
2360
		System.arraycopy(
2361
				this.expressionStack,
2362
				(this.expressionPtr -= length) + 1,
2363
				typeReference.annotations = new Annotation[length],
2364
				0,
2365
				length);
2366
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
2367
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
2368
			typeReferenceSourceStart = this.modifiersSourceStart;
2369
		}
2370
		typeReference.bits |= ASTNode.HasTypeAnnotations;
2371
		typeReference.sourceStart = typeReferenceSourceStart;
2372
	}
2373
	Expression cast;
2374
	pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
2375
	typeReference.sourceEnd = end - 1;
2376
	typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
2377
	cast.sourceEnd = expression.sourceEnd;
2378
	if (this.modifiers != ClassFileConstants.AccDefault) {
2379
		problemReporter().invalidLocationForModifiers(typeReference);
2380
	}
2381
	resetModifiers();
2144
}
2382
}
2145
protected void consumeCatches() {
2383
protected void consumeCatches() {
2146
	// Catches ::= Catches CatchClause
2384
	// Catches ::= Catches CatchClause
Lines 2334-2339 Link Here
2334
	TypeReference superClass = getTypeReference(0);
2572
	TypeReference superClass = getTypeReference(0);
2335
	// There is a class declaration on the top of stack
2573
	// There is a class declaration on the top of stack
2336
	TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
2574
	TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
2575
	typeDecl.bits |= (superClass.bits & ASTNode.HasTypeAnnotations);
2337
	typeDecl.superclass = superClass;
2576
	typeDecl.superclass = superClass;
2338
	superClass.bits |= ASTNode.IsSuperType;
2577
	superClass.bits |= ASTNode.IsSuperType;
2339
	typeDecl.bodyStart = typeDecl.superclass.sourceEnd + 1;
2578
	typeDecl.bodyStart = typeDecl.superclass.sourceEnd + 1;
Lines 2355-2362 Link Here
2355
		typeDecl.superInterfaces = new TypeReference[length],
2594
		typeDecl.superInterfaces = new TypeReference[length],
2356
		0,
2595
		0,
2357
		length);
2596
		length);
2358
	for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) {
2597
	TypeReference[] superinterfaces = typeDecl.superInterfaces;
2359
		typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType;
2598
	for (int i = 0, max = superinterfaces.length; i < max; i++) {
2599
		TypeReference typeReference = superinterfaces[i];
2600
		typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations);
2601
		typeReference.bits |= ASTNode.IsSuperType;
2360
	}
2602
	}
2361
	typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
2603
	typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
2362
	this.listLength = 0; // reset after having read super-interfaces
2604
	this.listLength = 0; // reset after having read super-interfaces
Lines 2690-2698 Link Here
2690
			}
2932
			}
2691
		}
2933
		}
2692
2934
2693
		if (!this.diet || insideFieldInitializer){
2935
		if (!this.options.ignoreMethodBodies) {
2694
			// add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere.
2936
			if (!this.diet || insideFieldInitializer){
2695
			constructorCall = SuperReference.implicitSuperConstructorCall();
2937
				// add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere.
2938
				constructorCall = SuperReference.implicitSuperConstructorCall();
2939
			}
2696
		}
2940
		}
2697
	}
2941
	}
2698
2942
Lines 2888-2893 Link Here
2888
}
3132
}
2889
protected void consumeDimWithOrWithOutExpr() {
3133
protected void consumeDimWithOrWithOutExpr() {
2890
	// DimWithOrWithOutExpr ::= '[' ']'
3134
	// DimWithOrWithOutExpr ::= '[' ']'
3135
	// DimWithOrWithOutExpr ::= OneOrMoreAnnotations '[' ']' 
2891
	pushOnExpressionStack(null);
3136
	pushOnExpressionStack(null);
2892
3137
2893
	if(this.currentElement != null && this.currentToken == TokenNameLBRACE) {
3138
	if(this.currentElement != null && this.currentToken == TokenNameLBRACE) {
Lines 3097-3102 Link Here
3097
			localDeclaration.annotations = new Annotation[length],
3342
			localDeclaration.annotations = new Annotation[length],
3098
			0,
3343
			0,
3099
			length);
3344
			length);
3345
		localDeclaration.bits |= ASTNode.HasTypeAnnotations;
3100
	}
3346
	}
3101
	if (hasModifiers) {
3347
	if (hasModifiers) {
3102
		localDeclaration.declarationSourceStart = declarationSourceStart;
3348
		localDeclaration.declarationSourceStart = declarationSourceStart;
Lines 3105-3110 Link Here
3105
		localDeclaration.declarationSourceStart = type.sourceStart;
3351
		localDeclaration.declarationSourceStart = type.sourceStart;
3106
	}
3352
	}
3107
	localDeclaration.type = type;
3353
	localDeclaration.type = type;
3354
	localDeclaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
3108
3355
3109
	ForeachStatement iteratorForStatement =
3356
	ForeachStatement iteratorForStatement =
3110
		new ForeachStatement(
3357
		new ForeachStatement(
Lines 3195-3200 Link Here
3195
	char[] identifierName = this.identifierStack[this.identifierPtr];
3442
	char[] identifierName = this.identifierStack[this.identifierPtr];
3196
	long namePosition = this.identifierPositionStack[this.identifierPtr];
3443
	long namePosition = this.identifierPositionStack[this.identifierPtr];
3197
	int extendedDimension = this.intStack[this.intPtr--];
3444
	int extendedDimension = this.intStack[this.intPtr--];
3445
	// pop any annotations on extended dimensions now, so they don't pollute the base dimensions.
3446
	Annotation [][] annotationsOnExtendedDimensions = extendedDimension == 0 ? null : getAnnotationsOnDimensions(extendedDimension);
3198
	AbstractVariableDeclaration declaration;
3447
	AbstractVariableDeclaration declaration;
3199
	// create the ast node
3448
	// create the ast node
3200
	boolean isLocalDeclaration = this.nestedMethod[this.nestedType] != 0;
3449
	boolean isLocalDeclaration = this.nestedMethod[this.nestedType] != 0;
Lines 3227-3232 Link Here
3227
					declaration.annotations = new Annotation[length],
3476
					declaration.annotations = new Annotation[length],
3228
					0,
3477
					0,
3229
					length);
3478
					length);
3479
				declaration.bits |= ASTNode.HasTypeAnnotations;
3230
			}
3480
			}
3231
			type = getTypeReference(typeDim = this.intStack[this.intPtr--]); // type dimension
3481
			type = getTypeReference(typeDim = this.intStack[this.intPtr--]); // type dimension
3232
			if (declaration.declarationSourceStart == -1) {
3482
			if (declaration.declarationSourceStart == -1) {
Lines 3248-3253 Link Here
3248
					declaration.annotations = new Annotation[length],
3498
					declaration.annotations = new Annotation[length],
3249
					0,
3499
					0,
3250
					length);
3500
					length);
3501
				declaration.bits |= ASTNode.HasTypeAnnotations;
3251
			}
3502
			}
3252
			// Store javadoc only on first declaration as it is the same for all ones
3503
			// Store javadoc only on first declaration as it is the same for all ones
3253
			FieldDeclaration fieldDeclaration = (FieldDeclaration) declaration;
3504
			FieldDeclaration fieldDeclaration = (FieldDeclaration) declaration;
Lines 3265-3278 Link Here
3265
		if (annotations != null) {
3516
		if (annotations != null) {
3266
			final int annotationsLength = annotations.length;
3517
			final int annotationsLength = annotations.length;
3267
			System.arraycopy(annotations, 0, declaration.annotations = new Annotation[annotationsLength], 0, annotationsLength);
3518
			System.arraycopy(annotations, 0, declaration.annotations = new Annotation[annotationsLength], 0, annotationsLength);
3519
			declaration.bits |= ASTNode.HasTypeAnnotations;
3268
		}
3520
		}
3269
	}
3521
	}
3270
3522
3271
	if (extendedDimension == 0) {
3523
	if (extendedDimension == 0) {
3272
		declaration.type = type;
3524
		declaration.type = type;
3525
		declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
3273
	} else {
3526
	} else {
3274
		int dimension = typeDim + extendedDimension;
3527
		int dimension = typeDim + extendedDimension;
3275
		declaration.type = copyDims(type, dimension);
3528
		Annotation [][] annotationsOnAllDimensions = null;
3529
		Annotation[][] annotationsOnDimensions = type.getAnnotationsOnDimensions();
3530
		if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
3531
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(typeDim, annotationsOnDimensions, extendedDimension, annotationsOnExtendedDimensions); 
3532
			declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
3533
		}
3534
		declaration.type = copyDims(type, dimension, annotationsOnAllDimensions);
3276
	}
3535
	}
3277
	this.variablesCounter[this.nestedType]++;
3536
	this.variablesCounter[this.nestedType]++;
3278
	pushOnAstStack(declaration);
3537
	pushOnAstStack(declaration);
Lines 3298-3303 Link Here
3298
		}
3557
		}
3299
		this.lastIgnoredToken = -1;
3558
		this.lastIgnoredToken = -1;
3300
	}
3559
	}
3560
}
3561
protected Annotation[][] getMergedAnnotationsOnDimensions(int dims, Annotation[][] annotationsOnDimensions,
3562
		int extendedDims, Annotation[][] annotationsOnExtendedDimensions) {
3563
3564
if (annotationsOnDimensions == null && annotationsOnExtendedDimensions == null)
3565
return null;
3566
3567
Annotation [][] mergedAnnotations = new Annotation[dims + extendedDims][];
3568
for (int i = 0; i < dims; i++) {
3569
if (annotationsOnDimensions != null) {
3570
mergedAnnotations[i] = annotationsOnDimensions[i];
3571
} else {
3572
mergedAnnotations[i] = null;
3573
}
3574
}
3575
for (int i = dims, j = 0; i < dims + extendedDims; i++, j++) {
3576
if (annotationsOnExtendedDimensions != null) {
3577
mergedAnnotations[i] = annotationsOnExtendedDimensions[j];
3578
} else {
3579
mergedAnnotations[i] = null;
3580
}
3581
}
3582
3583
return mergedAnnotations;
3301
}
3584
}
3302
protected void consumeEnumBodyNoConstants() {
3585
protected void consumeEnumBodyNoConstants() {
3303
	// nothing to do
3586
	// nothing to do
Lines 3409-3414 Link Here
3409
         enumConstant.annotations = new Annotation[length],
3692
         enumConstant.annotations = new Annotation[length],
3410
         0,
3693
         0,
3411
         length);
3694
         length);
3695
		enumConstant.bits |= ASTNode.HasTypeAnnotations;
3412
   }
3696
   }
3413
   pushOnAstStack(enumConstant);
3697
   pushOnAstStack(enumConstant);
3414
	if (this.currentElement != null){
3698
	if (this.currentElement != null){
Lines 3918-3925 Link Here
3918
	this.identifierStack :
4202
	this.identifierStack :
3919
	this.intStack :
4203
	this.intStack :
3920
	*/
4204
	*/
3921
4205
 	this.identifierLengthPtr--;
3922
	this.identifierLengthPtr--;
3923
	char[] identifierName = this.identifierStack[this.identifierPtr];
4206
	char[] identifierName = this.identifierStack[this.identifierPtr];
3924
	long namePositions = this.identifierPositionStack[this.identifierPtr--];
4207
	long namePositions = this.identifierPositionStack[this.identifierPtr--];
3925
	int extendedDimensions = this.intStack[this.intPtr--];
4208
	int extendedDimensions = this.intStack[this.intPtr--];
Lines 3928-3937 Link Here
3928
		endOfEllipsis = this.intStack[this.intPtr--];
4211
		endOfEllipsis = this.intStack[this.intPtr--];
3929
	}
4212
	}
3930
	int firstDimensions = this.intStack[this.intPtr--];
4213
	int firstDimensions = this.intStack[this.intPtr--];
3931
	final int typeDimensions = firstDimensions + extendedDimensions;
4214
	TypeReference type = getUnannotatedTypeReference(extendedDimensions);
3932
	TypeReference type = getTypeReference(typeDimensions);
4215
	Annotation [] varArgsAnnotations = null;
4216
	int length;
4217
	if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
4218
		System.arraycopy(
4219
			this.typeAnnotationStack,
4220
			(this.typeAnnotationPtr -= length) + 1,
4221
			varArgsAnnotations = new Annotation[length],
4222
			0,
4223
			length);
4224
	} 
4225
	final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0);
4226
4227
	if (typeDimensions != extendedDimensions) {
4228
		// jsr308 type annotations management
4229
		Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions);
4230
		Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions();
4231
		Annotation [][] annotationsOnAllDimensions = null;
4232
		if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) {
4233
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); 
4234
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null);
4235
		}
4236
		type = copyDims(type, typeDimensions, annotationsOnAllDimensions);
4237
		type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition;
4238
	}
3933
	if (isVarArgs) {
4239
	if (isVarArgs) {
3934
		type = copyDims(type, typeDimensions + 1);
3935
		if (extendedDimensions == 0) {
4240
		if (extendedDimensions == 0) {
3936
			type.sourceEnd = endOfEllipsis;
4241
			type.sourceEnd = endOfEllipsis;
3937
		}
4242
		}
Lines 3946-3953 Link Here
3946
			type,
4251
			type,
3947
			this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
4252
			this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
3948
	arg.declarationSourceStart = modifierPositions;
4253
	arg.declarationSourceStart = modifierPositions;
4254
	arg.bits |= (type.bits & ASTNode.HasTypeAnnotations);
3949
	// consume annotations
4255
	// consume annotations
3950
	int length;
3951
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
4256
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
3952
		System.arraycopy(
4257
		System.arraycopy(
3953
			this.expressionStack,
4258
			this.expressionStack,
Lines 3955-3960 Link Here
3955
			arg.annotations = new Annotation[length],
4260
			arg.annotations = new Annotation[length],
3956
			0,
4261
			0,
3957
			length);
4262
			length);
4263
		arg.bits |= ASTNode.HasTypeAnnotations;
3958
		RecoveredType currentRecoveryType = this.currentRecoveryType();
4264
		RecoveredType currentRecoveryType = this.currentRecoveryType();
3959
		if (currentRecoveryType != null)
4265
		if (currentRecoveryType != null)
3960
			currentRecoveryType.annotationsConsumed(arg.annotations);
4266
			currentRecoveryType.annotationsConsumed(arg.annotations);
Lines 3974-3980 Link Here
3974
				extendedDimensions > 0) {
4280
				extendedDimensions > 0) {
3975
			problemReporter().illegalExtendedDimensions(arg);
4281
			problemReporter().illegalExtendedDimensions(arg);
3976
		}
4282
		}
4283
	} else {
4284
		// The grammar allows trailing annotations in FormalParameter as in 
4285
		// "int @NonNull[] @Misplaced parameter" in order to allow for constructs such as
4286
		// "Object @NonNull[] @Correct ... objects" -- we prune these here.
4287
		if (varArgsAnnotations != null) {
4288
			problemReporter().misplacedTypeAnnotations(varArgsAnnotations[0],
4289
					varArgsAnnotations[varArgsAnnotations.length-1]);
4290
		}
3977
	}
4291
	}
4292
}
4293
protected Annotation[][] getAnnotationsOnDimensions(int dimensionsCount) {
4294
	Annotation [][] dimensionsAnnotations = null;
4295
	if (dimensionsCount > 0) {
4296
		for (int i = 0; i < dimensionsCount; i++) {
4297
			Annotation [] annotations = null;
4298
			int length;
4299
			if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
4300
				System.arraycopy(
4301
						this.typeAnnotationStack,
4302
						(this.typeAnnotationPtr -= length) + 1,
4303
						annotations = new Annotation[length],
4304
						0,
4305
						length);
4306
				if (dimensionsAnnotations == null) {
4307
					dimensionsAnnotations = new Annotation[dimensionsCount][];
4308
				}
4309
				dimensionsAnnotations[dimensionsCount - i - 1] = annotations;
4310
			}
4311
		}
4312
	}
4313
	return dimensionsAnnotations;
3978
}
4314
}
3979
protected void consumeFormalParameterList() {
4315
protected void consumeFormalParameterList() {
3980
	// FormalParameterList ::= FormalParameterList ',' FormalParameter
4316
	// FormalParameterList ::= FormalParameterList ',' FormalParameter
Lines 4036-4041 Link Here
4036
}
4372
}
4037
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
4373
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
4038
	// InsideCastExpressionWithQualifiedGenerics ::= $empty
4374
	// InsideCastExpressionWithQualifiedGenerics ::= $empty
4375
}
4376
protected void consumeInsideCastExpressionWithAnnotatedQualifiedGenerics() {
4377
	// InsideCastExpressionWithAnnotatedQualifiedGenerics ::= $empty
4039
}
4378
}
4040
protected void consumeInstanceOfExpression() {
4379
protected void consumeInstanceOfExpression() {
4041
	// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType
4380
	// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType
Lines 4133-4140 Link Here
4133
		typeDecl.superInterfaces = new TypeReference[length],
4472
		typeDecl.superInterfaces = new TypeReference[length],
4134
		0,
4473
		0,
4135
		length);
4474
		length);
4136
	for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) {
4475
	TypeReference[] superinterfaces = typeDecl.superInterfaces;
4137
		typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType;
4476
	for (int i = 0, max = superinterfaces.length; i < max; i++) {
4477
		TypeReference typeReference = superinterfaces[i];
4478
		typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations);
4479
		typeReference.bits |= ASTNode.IsSuperType;
4138
	}
4480
	}
4139
	typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
4481
	typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
4140
	this.listLength = 0; // reset after having read super-interfaces
4482
	this.listLength = 0; // reset after having read super-interfaces
Lines 4494-4501 Link Here
4494
	if (isNotAbstract) {
4836
	if (isNotAbstract) {
4495
		//statements
4837
		//statements
4496
		explicitDeclarations = this.realBlockStack[this.realBlockPtr--];
4838
		explicitDeclarations = this.realBlockStack[this.realBlockPtr--];
4497
		if (!this.options.ignoreMethodBodies) {
4839
		if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {
4498
			if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {
4840
			if (this.options.ignoreMethodBodies) {
4841
				this.astPtr -= length;
4842
			} else {
4499
				System.arraycopy(
4843
				System.arraycopy(
4500
					this.astStack,
4844
					this.astStack,
4501
					(this.astPtr -= length) + 1,
4845
					(this.astPtr -= length) + 1,
Lines 4503-4511 Link Here
4503
					0,
4847
					0,
4504
					length);
4848
					length);
4505
			}
4849
			}
4506
		} else {
4507
			length = this.astLengthStack[this.astLengthPtr--];
4508
			this.astPtr -= length;
4509
		}
4850
		}
4510
	}
4851
	}
4511
4852
Lines 4598-4604 Link Here
4598
		TypeReference returnType = md.returnType;
4939
		TypeReference returnType = md.returnType;
4599
		md.sourceEnd = this.endPosition;
4940
		md.sourceEnd = this.endPosition;
4600
		int dims = returnType.dimensions() + extendedDims;
4941
		int dims = returnType.dimensions() + extendedDims;
4601
		md.returnType = copyDims(returnType, dims);
4942
		Annotation [][] annotationsOnDimensions = returnType.getAnnotationsOnDimensions();
4943
		Annotation [][] annotationsOnExtendedDimensions = getAnnotationsOnDimensions(extendedDims);
4944
		Annotation [][] annotationsOnAllDimensions = null;
4945
		if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
4946
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(returnType.dimensions(), annotationsOnDimensions, extendedDims, annotationsOnExtendedDimensions);
4947
		}
4948
		md.returnType = copyDims(returnType, dims, annotationsOnAllDimensions);
4602
		if (this.currentToken == TokenNameLBRACE){
4949
		if (this.currentToken == TokenNameLBRACE){
4603
			md.bodyStart = this.endPosition + 1;
4950
			md.bodyStart = this.endPosition + 1;
4604
		}
4951
		}
Lines 4682-4688 Link Here
4682
	long selectorSource = this.identifierPositionStack[this.identifierPtr--];
5029
	long selectorSource = this.identifierPositionStack[this.identifierPtr--];
4683
	this.identifierLengthPtr--;
5030
	this.identifierLengthPtr--;
4684
	//type
5031
	//type
4685
	md.returnType = getTypeReference(this.intStack[this.intPtr--]);
5032
	TypeReference returnType = getTypeReference(this.intStack[this.intPtr--]);
5033
	md.returnType = returnType;
5034
	md.bits |= (returnType.bits & ASTNode.HasTypeAnnotations);
4686
5035
4687
	// consume type parameters
5036
	// consume type parameters
4688
	int length = this.genericsLengthStack[this.genericsLengthPtr--];
5037
	int length = this.genericsLengthStack[this.genericsLengthPtr--];
Lines 4908-4913 Link Here
4908
	// Resources ::= Resources ';' Resource
5257
	// Resources ::= Resources ';' Resource
4909
	concatNodeLists();
5258
	concatNodeLists();
4910
}
5259
}
5260
protected void consumeOneMoreTypeAnnotation() {
5261
	// OneOrMoreAnnotations ::= OneOrMoreAnnotations Annotation
5262
	this.expressionLengthPtr --;
5263
	Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--];
5264
	pushOnTypeAnnotationStack(annotation);
5265
	this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++;
5266
	if(!this.statementRecoveryActivated &&
5267
			this.options.sourceLevel < ClassFileConstants.JDK1_7 &&
5268
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
5269
		problemReporter().invalidUsageOfTypeAnnotations(annotation);
5270
}
5271
}
5272
protected void consumePotentialNameArrayType () {
5273
	
5274
	// FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray VariableDeclaratorId
5275
	// FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray '...' VariableDeclaratorId
5276
	// PotentialNameArray -> $empty
5277
	// Dimensions including lack of have been pushed appropriately by action attached to DimsoptAnnotsopt
5278
	pushOnGenericsLengthStack(0); // handle type arguments
5279
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5280
}
5281
4911
protected void consumeNameArrayType() {
5282
protected void consumeNameArrayType() {
4912
	pushOnGenericsLengthStack(0); // handle type arguments
5283
	pushOnGenericsLengthStack(0); // handle type arguments
4913
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5284
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
Lines 4971-4979 Link Here
4971
	}
5342
	}
4972
	this.recordStringLiterals = true;
5343
	this.recordStringLiterals = true;
4973
}
5344
}
4974
protected void consumeOneDimLoop() {
5345
protected void consumeOneDimLoop(boolean expressionStackMayHaveAnnotations) {
4975
	// OneDimLoop ::= '[' ']'
5346
	// OneDimLoop ::= '[' ']'
5347
	// OneDimOrAnnot -> '[' ']'
4976
	this.dimensions++;
5348
	this.dimensions++;
5349
	if (!expressionStackMayHaveAnnotations || this.unattachedAnnotationPtr == -1 ) {
5350
		pushOnTypeAnnotationLengthStack(0); // no annotations for the current dimension.
5351
	} else { 
5352
		this.unattachedAnnotationPtr = -1;	// Leave type annotation stacks they are. 
5353
	}
5354
}
5355
protected void consumeOneDimLoopWithAnnotations() {
5356
	// OneDimLoop ::= OneOrMoreAnnotations '[' ']'
5357
	this.dimensions++;
5358
	// Top of expression stack contains annotations of length specified
5359
	// by top of expression length stack that apply to this dimension.
4977
}
5360
}
4978
protected void consumeOnlySynchronized() {
5361
protected void consumeOnlySynchronized() {
4979
	// OnlySynchronized ::= 'synchronized'
5362
	// OnlySynchronized ::= 'synchronized'
Lines 5143-5149 Link Here
5143
	pushOnGenericsLengthStack(0);
5526
	pushOnGenericsLengthStack(0);
5144
5527
5145
	pushOnExpressionStack(
5528
	pushOnExpressionStack(
5146
		new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--])));
5529
		new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--])));
5147
}
5530
}
5148
protected void consumePrimaryNoNewArrayName() {
5531
protected void consumePrimaryNoNewArrayName() {
5149
	// PrimaryNoNewArray ::= Name '.' 'class'
5532
	// PrimaryNoNewArray ::= Name '.' 'class'
Lines 5152-5158 Link Here
5152
	// handle type arguments
5535
	// handle type arguments
5153
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5536
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5154
	pushOnGenericsLengthStack(0);
5537
	pushOnGenericsLengthStack(0);
5155
	TypeReference typeReference = getTypeReference(0);
5538
	TypeReference typeReference = getUnannotatedTypeReference(0); // TODO (Srikanth) needs fix
5156
5539
5157
	pushOnExpressionStack(
5540
	pushOnExpressionStack(
5158
		new ClassLiteralAccess(this.intStack[this.intPtr--], typeReference));
5541
		new ClassLiteralAccess(this.intStack[this.intPtr--], typeReference));
Lines 5162-5167 Link Here
5162
	// handle type arguments
5545
	// handle type arguments
5163
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5546
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5164
	pushOnGenericsLengthStack(0);
5547
	pushOnGenericsLengthStack(0);
5548
	pushOnTypeAnnotationLengthStack(0); // javac complains on annotations here.
5165
	TypeReference typeReference = getTypeReference(0);
5549
	TypeReference typeReference = getTypeReference(0);
5166
5550
5167
	pushOnExpressionStack(
5551
	pushOnExpressionStack(
Lines 5175-5181 Link Here
5175
	// handle type arguments
5559
	// handle type arguments
5176
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5560
	pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
5177
	pushOnGenericsLengthStack(0); // handle type arguments
5561
	pushOnGenericsLengthStack(0); // handle type arguments
5178
5562
	pushOnTypeAnnotationLengthStack(0); // javac complains on annotations here.
5179
	TypeReference typeReference = getTypeReference(0);
5563
	TypeReference typeReference = getTypeReference(0);
5180
5564
5181
	pushOnExpressionStack(
5565
	pushOnExpressionStack(
Lines 5188-5200 Link Here
5188
	// PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
5572
	// PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
5189
	this.intPtr--; // remove the class start position
5573
	this.intPtr--; // remove the class start position
5190
	pushOnExpressionStack(
5574
	pushOnExpressionStack(
5191
		new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--])));
5575
		new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--])));
5192
}
5576
}
5193
protected void consumePrimaryNoNewArrayPrimitiveType() {
5577
protected void consumePrimaryNoNewArrayPrimitiveType() {
5194
	// PrimaryNoNewArray ::= PrimitiveType '.' 'class'
5578
	// PrimaryNoNewArray ::= PrimitiveType '.' 'class'
5195
	this.intPtr--; // remove the class start position
5579
	this.intPtr--; // remove the class start position
5196
	pushOnExpressionStack(
5580
	pushOnExpressionStack(
5197
		new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(0)));
5581
		new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(0)));
5198
}
5582
}
5199
protected void consumePrimaryNoNewArrayThis() {
5583
protected void consumePrimaryNoNewArrayThis() {
5200
	// PrimaryNoNewArray ::= 'this'
5584
	// PrimaryNoNewArray ::= 'this'
Lines 5325-7144 Link Here
5325
	// PushRPAREN ::= ')'
5709
	// PushRPAREN ::= ')'
5326
	pushOnIntStack(this.rParenPos);
5710
	pushOnIntStack(this.rParenPos);
5327
}
5711
}
5712
protected void consumeUnannotatedType() {
5713
	/* We go through some song & dance here to get the type annotations stacks
5714
	   to reflect the fact that this type was unannotated. Using a dummy non-terminal
5715
	   with an empty rhs leads to conflicts in many places :-(
5716
	*/
5717
	pushOnTypeAnnotationLengthStack(0); // either done or else made room.
5718
	int dims = this.intStack[this.intPtr];
5719
	if (dims != 0) {
5720
		System.arraycopy(
5721
				this.typeAnnotationLengthStack,
5722
				this.typeAnnotationLengthPtr - dims,
5723
				this.typeAnnotationLengthStack,
5724
				this.typeAnnotationLengthPtr - dims + 1,
5725
				dims);
5726
		this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims] = 0; // tag type as unannotated
5727
	}
5728
}
5729
protected void consumeAnnotatedType() {
5730
	/* We go through some song & dance here to get the type annotations stacks
5731
	   to reflect the fact that this type was unannotated. Using a dummy non-terminal
5732
	   with an empty rhs leads to conflicts in many places :-(
5733
	*/
5734
	int dims = this.intStack[this.intPtr];
5735
	if (dims != 0) {
5736
		int counter = 0;
5737
		for (int i = 0; i < dims; i++) {
5738
			// we count existing dimensions with annotations
5739
			counter += this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1 + i];
5740
		}
5741
		System.arraycopy(
5742
				this.typeAnnotationLengthStack,
5743
				this.typeAnnotationLengthPtr - dims + 1,
5744
				this.typeAnnotationLengthStack,
5745
				this.typeAnnotationLengthPtr - dims + 2,
5746
				dims);
5747
		int length = this.expressionLengthStack[this.expressionLengthPtr--];
5748
		this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1] = length;
5749
		int typeAnnotationStackLength = this.typeAnnotationStack.length;
5750
		if (this.typeAnnotationPtr + counter + length >= typeAnnotationStackLength) {
5751
			System.arraycopy(
5752
					this.typeAnnotationStack,
5753
					0,
5754
					this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement],
5755
					0,
5756
					typeAnnotationStackLength);
5757
		}
5758
		System.arraycopy(
5759
				this.typeAnnotationStack,
5760
				this.typeAnnotationPtr - counter + 1,
5761
				this.typeAnnotationStack,
5762
				this.typeAnnotationPtr - counter + 1 + length,
5763
				counter);
5764
		System.arraycopy(
5765
				this.expressionStack,
5766
				(this.expressionPtr -= length) + 1,
5767
				this.typeAnnotationStack,
5768
				this.typeAnnotationPtr - counter + 1,
5769
				length);
5770
		this.typeAnnotationPtr += length;
5771
		this.typeAnnotationLengthPtr++;
5772
	} else {
5773
		int length = this.expressionLengthStack[this.expressionLengthPtr--];
5774
		int typeAnnotationStackLength = this.typeAnnotationStack.length;
5775
		if (this.typeAnnotationPtr + length >= typeAnnotationStackLength) {
5776
			System.arraycopy(
5777
					this.typeAnnotationStack,
5778
					0,
5779
					this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement],
5780
					0,
5781
					typeAnnotationStackLength);
5782
		}
5783
		System.arraycopy(
5784
				this.expressionStack,
5785
				(this.expressionPtr -= length) + 1,
5786
				this.typeAnnotationStack,
5787
				this.typeAnnotationPtr + 1,
5788
				length);
5789
		this.typeAnnotationPtr += length;
5790
		pushOnTypeAnnotationLengthStack(length);
5791
	}
5792
//	if (this.modifiers != ClassFileConstants.AccDefault) {
5793
//		problemReporter().invalidLocationForModifiers(typeReference);
5794
//	}
5795
//	resetModifiers();
5796
}
5797
protected void consumeTypeAnnotation (boolean markAsUnattached) {
5798
	if(!this.statementRecoveryActivated &&
5799
			this.options.sourceLevel < ClassFileConstants.JDK1_7 &&
5800
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
5801
		problemReporter().invalidUsageOfTypeAnnotations((Annotation) this.expressionStack[this.expressionPtr]);
5802
	}
5803
	this.expressionLengthPtr --;
5804
	Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--];
5805
	pushOnTypeAnnotationStack(annotation);
5806
	if (markAsUnattached) {
5807
		if (this.unattachedAnnotationPtr == -1) {
5808
			this.unattachedAnnotationPtr = this.typeAnnotationPtr;
5809
		} else {
5810
			this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++;
5811
		}
5812
	} 
5813
}
5814
protected void consumeDimsWithTrailingAnnotsopt() {
5815
	// DimsoptAnnotsopt -> DimsAnnotLoop
5816
	pushOnIntStack(this.dimensions);
5817
	this.dimensions = 0;
5818
	if (this.unattachedAnnotationPtr == -1) {
5819
		pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg)
5820
	} else {
5821
		this.unattachedAnnotationPtr = -1;  // reset this and leave the annotation stacks as they are.
5822
	}
5823
}
5824
protected void consumeZeroTypeAnnotations(boolean shouldPush) {
5825
	if (shouldPush) {
5826
		pushOnTypeAnnotationLengthStack(0);
5827
	} else {
5828
		this.typeAnnotationLengthPtr --; // pop the 0 from the length stack
5829
	}
5830
}
5831
protected void consumeEmptyDimsoptAnnotsopt() {
5832
	// DimsoptAnnotsopt ::= $empty
5833
	pushOnIntStack(0);  // signal a non array
5834
	pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg)
5835
}
5836
protected void consumeRightParenForUnannotatedTypeCast() {
5837
	consumeUnannotatedType();
5838
	// PushRPAREN ::= ')'
5839
	pushOnIntStack(this.rParenPos);
5840
}
5841
protected void consumeRightParenForNameUnannotatedTypeCast() {
5842
	pushOnIntStack(0);  // signal a non array
5843
	consumeUnannotatedType();
5844
	// remove the fake dimension
5845
	this.intPtr--;
5846
	// PushRPAREN ::= ')'
5847
	pushOnIntStack(this.rParenPos);
5848
}
5849
protected void consumeRightParenForAnnotatedTypeCast() {
5850
	consumeUnannotatedType();
5851
	// PushRPAREN ::= ')'
5852
	pushOnIntStack(this.rParenPos);
5853
}
5854
protected void consumeRightParenForNameAndAnnotatedTypeCast() {
5855
	// push a zero for dimensions
5856
	pushOnIntStack(0);
5857
	consumeUnannotatedType();
5858
	// remove the fake dimension
5859
	this.intPtr--;
5860
	// PushRPAREN ::= ')'
5861
	pushOnIntStack(this.rParenPos);
5862
}
5328
// This method is part of an automatic generation : do NOT edit-modify
5863
// This method is part of an automatic generation : do NOT edit-modify
5329
protected void consumeRule(int act) {
5864
protected void consumeRule(int act) {
5330
  switch ( act ) {
5865
  switch ( act ) {
5331
    case 30 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); }  //$NON-NLS-1$
5866
    case 32 : if (DEBUG) { System.out.println("Type ::= TypeInternal"); }  //$NON-NLS-1$
5867
		    consumeUnannotatedType();   
5868
			break;
5869
 
5870
    case 34 : if (DEBUG) { System.out.println("Type0 ::= TypeInternal"); }  //$NON-NLS-1$
5871
		    consumeUnannotatedType();   
5872
			break;
5873
 
5874
    case 35 : if (DEBUG) { System.out.println("TypeInternal ::= PrimitiveType"); }  //$NON-NLS-1$
5332
		    consumePrimitiveType();  
5875
		    consumePrimitiveType();  
5333
			break;
5876
			break;
5334
 
5877
 
5335
    case 44 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); }  //$NON-NLS-1$
5878
    case 49 : if (DEBUG) { System.out.println("ReferenceType ::= ReferenceType0"); }  //$NON-NLS-1$
5336
		    consumeReferenceType();  
5879
		    consumeUnannotatedType();   
5337
			break;
5880
			break;
5338
 
5881
 
5339
    case 48 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); }  //$NON-NLS-1$
5882
    case 50 : if (DEBUG) { System.out.println("ReferenceType ::= Modifiers ReferenceType0"); }  //$NON-NLS-1$
5340
		    consumeClassOrInterfaceName();  
5883
		    consumeAnnotatedType();   
5341
			break;
5884
			break;
5342
 
5885
 
5343
    case 49 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); }  //$NON-NLS-1$
5886
    case 51 : if (DEBUG) { System.out.println("ReferenceType0 ::= ClassOrInterfaceType0"); }  //$NON-NLS-1$
5344
		    consumeClassOrInterface();  
5887
		    consumeReferenceType();   
5345
			break;
5888
			break;
5346
 
5889
 
5347
    case 50 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); }  //$NON-NLS-1$
5890
    case 53 : if (DEBUG) { System.out.println("Annotationsopt ::="); }  //$NON-NLS-1$
5348
		    consumeGenericType();  
5891
		    consumeZeroTypeAnnotations(true);  
5349
			break;
5892
			break;
5350
 
5893
 
5351
    case 51 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); }  //$NON-NLS-1$
5894
    case 58 : if (DEBUG) { System.out.println("ClassOrInterface ::= ClassOrInterface0"); }  //$NON-NLS-1$
5895
		    consumeZeroTypeAnnotations(true);  
5896
			break;
5897
 
5898
    case 59 : if (DEBUG) { System.out.println("ClassOrInterface0 ::= Name"); }  //$NON-NLS-1$
5899
		    consumeClassOrInterfaceName();   
5900
			break;
5901
 
5902
    case 61 : if (DEBUG) { System.out.println("PopZeroTypeAnnotations ::="); }  //$NON-NLS-1$
5903
		    consumeZeroTypeAnnotations(false);  
5904
			break;
5905
 
5906
    case 62 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments..."); }  //$NON-NLS-1$
5907
		    consumeGenericType();   
5908
			break;
5909
 
5910
    case 63 : if (DEBUG) { System.out.println("GenericTypeDotName ::= GenericType DOT Name"); }  //$NON-NLS-1$
5911
		    consumeClassOrInterface();   
5912
			break;
5913
 
5914
    case 64 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); }  //$NON-NLS-1$
5352
		    consumeGenericTypeWithDiamond();  
5915
		    consumeGenericTypeWithDiamond();  
5353
			break;
5916
			break;
5354
 
5917
 
5355
    case 52 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); }  //$NON-NLS-1$
5918
    case 66 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); }  //$NON-NLS-1$
5356
		    consumeArrayTypeWithTypeArgumentsName();  
5357
			break;
5358
 
5359
    case 53 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); }  //$NON-NLS-1$
5360
		    consumePrimitiveArrayType();  
5919
		    consumePrimitiveArrayType();  
5361
			break;
5920
			break;
5362
 
5921
 
5363
    case 54 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); }  //$NON-NLS-1$
5922
    case 67 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); }  //$NON-NLS-1$
5364
		    consumeNameArrayType();  
5923
		    consumeNameArrayType();  
5365
			break;
5924
			break;
5366
 
5925
 
5367
    case 55 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); }  //$NON-NLS-1$
5926
    case 68 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); }  //$NON-NLS-1$
5368
		    consumeGenericTypeNameArrayType();  
5927
		    consumeGenericTypeNameArrayType();  
5369
			break;
5928
			break;
5370
 
5929
 
5371
    case 56 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); }  //$NON-NLS-1$
5930
    case 69 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); }  //$NON-NLS-1$
5372
		    consumeGenericTypeArrayType();  
5931
		    consumeGenericTypeArrayType();  
5373
			break;
5932
			break;
5374
 
5933
 
5375
    case 61 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); }  //$NON-NLS-1$
5934
    case 74 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); }  //$NON-NLS-1$
5376
		    consumeQualifiedName();  
5935
		    consumeQualifiedName();  
5377
			break;
5936
			break;
5378
 
5937
 
5379
    case 62 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); }  //$NON-NLS-1$
5938
    case 75 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); }  //$NON-NLS-1$
5380
		    consumeCompilationUnit();  
5939
		    consumeCompilationUnit();  
5381
			break;
5940
			break;
5382
 
5941
 
5383
    case 63 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); }  //$NON-NLS-1$
5942
    case 76 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); }  //$NON-NLS-1$
5384
		    consumeInternalCompilationUnit();  
5943
		    consumeInternalCompilationUnit();  
5385
			break;
5944
			break;
5386
 
5945
 
5387
    case 64 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5946
    case 77 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5388
		    consumeInternalCompilationUnit();  
5947
		    consumeInternalCompilationUnit();  
5389
			break;
5948
			break;
5390
 
5949
 
5391
    case 65 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5950
    case 78 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5392
		    consumeInternalCompilationUnitWithTypes();  
5951
		    consumeInternalCompilationUnitWithTypes();  
5393
			break;
5952
			break;
5394
 
5953
 
5395
    case 66 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5954
    case 79 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); }  //$NON-NLS-1$
5396
		    consumeInternalCompilationUnitWithTypes();  
5955
		    consumeInternalCompilationUnitWithTypes();  
5397
			break;
5956
			break;
5398
 
5957
 
5399
    case 67 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); }  //$NON-NLS-1$
5958
    case 80 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); }  //$NON-NLS-1$
5400
		    consumeInternalCompilationUnit();  
5959
		    consumeInternalCompilationUnit();  
5401
			break;
5960
			break;
5402
 
5961
 
5403
    case 68 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); }  //$NON-NLS-1$
5962
    case 81 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); }  //$NON-NLS-1$
5404
		    consumeInternalCompilationUnitWithTypes();  
5963
		    consumeInternalCompilationUnitWithTypes();  
5405
			break;
5964
			break;
5406
 
5965
 
5407
    case 69 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); }  //$NON-NLS-1$
5966
    case 82 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); }  //$NON-NLS-1$
5408
		    consumeInternalCompilationUnitWithTypes();  
5967
		    consumeInternalCompilationUnitWithTypes();  
5409
			break;
5968
			break;
5410
 
5969
 
5411
    case 70 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); }  //$NON-NLS-1$
5970
    case 83 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); }  //$NON-NLS-1$
5412
		    consumeEmptyInternalCompilationUnit();  
5971
		    consumeEmptyInternalCompilationUnit();  
5413
			break;
5972
			break;
5414
 
5973
 
5415
    case 71 : if (DEBUG) { System.out.println("ReduceImports ::="); }  //$NON-NLS-1$
5974
    case 84 : if (DEBUG) { System.out.println("ReduceImports ::="); }  //$NON-NLS-1$
5416
		    consumeReduceImports();  
5975
		    consumeReduceImports();  
5417
			break;
5976
			break;
5418
 
5977
 
5419
    case 72 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); }  //$NON-NLS-1$
5978
    case 85 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); }  //$NON-NLS-1$
5420
		    consumeEnterCompilationUnit();  
5979
		    consumeEnterCompilationUnit();  
5421
			break;
5980
			break;
5422
 
5981
 
5423
    case 88 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); }  //$NON-NLS-1$
5982
    case 104 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); }  //$NON-NLS-1$
5424
		    consumeCatchHeader();  
5983
		    consumeCatchHeader();  
5425
			break;
5984
			break;
5426
 
5985
 
5427
    case 90 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); }  //$NON-NLS-1$
5986
    case 106 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); }  //$NON-NLS-1$
5428
		    consumeImportDeclarations();  
5987
		    consumeImportDeclarations();  
5429
			break;
5988
			break;
5430
 
5989
 
5431
    case 92 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); }  //$NON-NLS-1$
5990
    case 108 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); }  //$NON-NLS-1$
5432
		    consumeTypeDeclarations();  
5991
		    consumeTypeDeclarations();  
5433
			break;
5992
			break;
5434
 
5993
 
5435
    case 93 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); }  //$NON-NLS-1$
5994
    case 109 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); }  //$NON-NLS-1$
5436
		    consumePackageDeclaration();  
5995
		    consumePackageDeclaration();  
5437
			break;
5996
			break;
5438
 
5997
 
5439
    case 94 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); }  //$NON-NLS-1$
5998
    case 110 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); }  //$NON-NLS-1$
5440
		    consumePackageDeclarationNameWithModifiers();  
5999
		    consumePackageDeclarationNameWithModifiers();  
5441
			break;
6000
			break;
5442
 
6001
 
5443
    case 95 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); }  //$NON-NLS-1$
6002
    case 111 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); }  //$NON-NLS-1$
5444
		    consumePackageDeclarationName();  
6003
		     consumePackageDeclarationName();  
5445
			break;
6004
			break;
5446
 
6005
 
5447
    case 96 : if (DEBUG) { System.out.println("PackageComment ::="); }  //$NON-NLS-1$
6006
    case 112 : if (DEBUG) { System.out.println("PackageComment ::="); }  //$NON-NLS-1$
5448
		    consumePackageComment();  
6007
		    consumePackageComment();  
5449
			break;
6008
			break;
5450
 
6009
 
5451
    case 101 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); }  //$NON-NLS-1$
6010
    case 117 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); }  //$NON-NLS-1$
5452
		    consumeImportDeclaration();  
6011
		    consumeImportDeclaration();  
5453
			break;
6012
			break;
5454
 
6013
 
5455
    case 102 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name"); }  //$NON-NLS-1$
6014
    case 118 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name"); }  //$NON-NLS-1$
5456
		    consumeSingleTypeImportDeclarationName();  
6015
		    consumeSingleTypeImportDeclarationName();  
5457
			break;
6016
			break;
5458
 
6017
 
5459
    case 103 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); }  //$NON-NLS-1$
6018
    case 119 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); }  //$NON-NLS-1$
5460
		    consumeImportDeclaration();  
6019
		    consumeImportDeclaration();  
5461
			break;
6020
			break;
5462
 
6021
 
5463
    case 104 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); }  //$NON-NLS-1$
6022
    case 120 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); }  //$NON-NLS-1$
5464
		    consumeTypeImportOnDemandDeclarationName();  
6023
		    consumeTypeImportOnDemandDeclarationName();  
5465
			break;
6024
			break;
5466
 
6025
 
5467
     case 107 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
6026
     case 123 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
5468
		    consumeEmptyTypeDeclaration();  
6027
		    consumeEmptyTypeDeclaration();  
5469
			break;
6028
			break;
5470
 
6029
 
5471
    case 111 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); }  //$NON-NLS-1$
6030
    case 127 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); }  //$NON-NLS-1$
5472
		    consumeModifiers2();  
6031
		    consumeModifiers2();  
5473
			break;
6032
			break;
5474
 
6033
 
5475
    case 123 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); }  //$NON-NLS-1$
6034
    case 139 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); }  //$NON-NLS-1$
5476
		    consumeAnnotationAsModifier();  
6035
		    consumeAnnotationAsModifier();  
5477
			break;
6036
			break;
5478
 
6037
 
5479
    case 124 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); }  //$NON-NLS-1$
6038
    case 140 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); }  //$NON-NLS-1$
5480
		    consumeClassDeclaration();  
6039
		    consumeClassDeclaration();  
5481
			break;
6040
			break;
5482
 
6041
 
5483
    case 125 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); }  //$NON-NLS-1$
6042
    case 141 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); }  //$NON-NLS-1$
5484
		    consumeClassHeader();  
6043
		    consumeClassHeader();  
5485
			break;
6044
			break;
5486
 
6045
 
5487
    case 126 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); }  //$NON-NLS-1$
6046
    case 142 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); }  //$NON-NLS-1$
5488
		    consumeTypeHeaderNameWithTypeParameters();  
6047
		    consumeTypeHeaderNameWithTypeParameters();  
5489
			break;
6048
			break;
5490
 
6049
 
5491
    case 128 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); }  //$NON-NLS-1$
6050
    case 144 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); }  //$NON-NLS-1$
5492
		    consumeClassHeaderName1();  
6051
		    consumeClassHeaderName1();  
5493
			break;
6052
			break;
5494
 
6053
 
5495
    case 129 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); }  //$NON-NLS-1$
6054
    case 145 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); }  //$NON-NLS-1$
5496
		    consumeClassHeaderExtends();  
6055
		    consumeClassHeaderExtends();  
5497
			break;
6056
			break;
5498
 
6057
 
5499
    case 130 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); }  //$NON-NLS-1$
6058
    case 146 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); }  //$NON-NLS-1$
5500
		    consumeClassHeaderImplements();  
6059
		    consumeClassHeaderImplements();  
5501
			break;
6060
			break;
5502
 
6061
 
5503
    case 132 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); }  //$NON-NLS-1$
6062
    case 148 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); }  //$NON-NLS-1$
5504
		    consumeInterfaceTypeList();  
6063
		    consumeInterfaceTypeList();  
5505
			break;
6064
			break;
5506
 
6065
 
5507
    case 133 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); }  //$NON-NLS-1$
6066
    case 149 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); }  //$NON-NLS-1$
5508
		    consumeInterfaceType();  
6067
		    consumeInterfaceType();  
5509
			break;
6068
			break;
5510
 
6069
 
5511
    case 136 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); }  //$NON-NLS-1$
6070
    case 152 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); }  //$NON-NLS-1$
5512
		    consumeClassBodyDeclarations();  
6071
		    consumeClassBodyDeclarations();  
5513
			break;
6072
			break;
5514
 
6073
 
5515
    case 140 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); }  //$NON-NLS-1$
6074
    case 156 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); }  //$NON-NLS-1$
5516
		    consumeClassBodyDeclaration();  
6075
		    consumeClassBodyDeclaration();  
5517
			break;
6076
			break;
5518
 
6077
 
5519
    case 141 : if (DEBUG) { System.out.println("Diet ::="); }  //$NON-NLS-1$
6078
    case 157 : if (DEBUG) { System.out.println("Diet ::="); }  //$NON-NLS-1$
5520
		    consumeDiet();  
6079
		    consumeDiet();  
5521
			break;
6080
			break;
5522
6081
5523
    case 142 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); }  //$NON-NLS-1$
6082
    case 158 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); }  //$NON-NLS-1$
5524
		    consumeClassBodyDeclaration();  
6083
		    consumeClassBodyDeclaration();  
5525
			break;
6084
			break;
5526
 
6085
 
5527
    case 143 : if (DEBUG) { System.out.println("CreateInitializer ::="); }  //$NON-NLS-1$
6086
    case 159 : if (DEBUG) { System.out.println("CreateInitializer ::="); }  //$NON-NLS-1$
5528
		    consumeCreateInitializer();  
6087
		    consumeCreateInitializer();  
5529
			break;
6088
			break;
5530
6089
5531
    case 150 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
6090
    case 166 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
5532
		    consumeEmptyTypeDeclaration();  
6091
		    consumeEmptyTypeDeclaration();  
5533
			break;
6092
			break;
5534
6093
5535
    case 153 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); }  //$NON-NLS-1$
6094
    case 169 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type0..."); }  //$NON-NLS-1$
5536
		    consumeFieldDeclaration();  
6095
		    consumeFieldDeclaration();  
5537
			break;
6096
			break;
5538
 
6097
 
5539
    case 155 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); }  //$NON-NLS-1$
6098
    case 171 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); }  //$NON-NLS-1$
5540
		    consumeVariableDeclarators();  
6099
		    consumeVariableDeclarators();  
5541
			break;
6100
			break;
5542
 
6101
 
5543
    case 158 : if (DEBUG) { System.out.println("EnterVariable ::="); }  //$NON-NLS-1$
6102
    case 174 : if (DEBUG) { System.out.println("EnterVariable ::="); }  //$NON-NLS-1$
5544
		    consumeEnterVariable();  
6103
		    consumeEnterVariable();  
5545
			break;
6104
			break;
5546
 
6105
 
5547
    case 159 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); }  //$NON-NLS-1$
6106
    case 175 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); }  //$NON-NLS-1$
5548
		    consumeExitVariableWithInitialization();  
6107
		    consumeExitVariableWithInitialization();  
5549
			break;
6108
			break;
5550
 
6109
 
5551
    case 160 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); }  //$NON-NLS-1$
6110
    case 176 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); }  //$NON-NLS-1$
5552
		    consumeExitVariableWithoutInitialization();  
6111
		    consumeExitVariableWithoutInitialization();  
5553
			break;
6112
			break;
5554
 
6113
 
5555
    case 161 : if (DEBUG) { System.out.println("ForceNoDiet ::="); }  //$NON-NLS-1$
6114
    case 177 : if (DEBUG) { System.out.println("ForceNoDiet ::="); }  //$NON-NLS-1$
5556
		    consumeForceNoDiet();  
6115
		    consumeForceNoDiet();  
5557
			break;
6116
			break;
5558
 
6117
 
5559
    case 162 : if (DEBUG) { System.out.println("RestoreDiet ::="); }  //$NON-NLS-1$
6118
    case 178 : if (DEBUG) { System.out.println("RestoreDiet ::="); }  //$NON-NLS-1$
5560
		    consumeRestoreDiet();  
6119
		    consumeRestoreDiet();  
5561
			break;
6120
			break;
5562
 
6121
 
5563
    case 167 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); }  //$NON-NLS-1$
6122
    case 179 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); }  //$NON-NLS-1$
6123
		    consumeExplicitThisParameter();  
6124
			break;
6125
 
6126
    case 185 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); }  //$NON-NLS-1$
5564
		    // set to true to consume a method with a body
6127
		    // set to true to consume a method with a body
5565
 consumeMethodDeclaration(true);  
6128
 consumeMethodDeclaration(true);  
5566
			break;
6129
			break;
5567
 
6130
 
5568
    case 168 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); }  //$NON-NLS-1$
6131
    case 186 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); }  //$NON-NLS-1$
5569
		    // set to false to consume a method without body
6132
		    // set to false to consume a method without body
5570
 consumeMethodDeclaration(false);  
6133
 consumeMethodDeclaration(false);  
5571
			break;
6134
			break;
5572
 
6135
 
5573
    case 169 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); }  //$NON-NLS-1$
6136
    case 187 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); }  //$NON-NLS-1$
5574
		    consumeMethodHeader();  
6137
		    consumeMethodHeader();  
5575
			break;
6138
			break;
5576
 
6139
 
5577
    case 170 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); }  //$NON-NLS-1$
6140
    case 188 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); }  //$NON-NLS-1$
5578
		    consumeMethodHeaderNameWithTypeParameters(false);  
6141
		    consumeMethodHeaderNameWithTypeParameters(false);  
5579
			break;
6142
			break;
5580
 
6143
 
5581
    case 171 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); }  //$NON-NLS-1$
6144
    case 189 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type0 Identifier..."); }  //$NON-NLS-1$
5582
		    consumeMethodHeaderName(false);  
6145
		    consumeMethodHeaderName(false);  
5583
			break;
6146
			break;
5584
 
6147
 
5585
    case 172 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); }  //$NON-NLS-1$
6148
    case 190 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); }  //$NON-NLS-1$
5586
		    consumeMethodHeaderRightParen();  
6149
		    consumeMethodHeaderRightParen();  
5587
			break;
6150
			break;
5588
 
6151
 
5589
    case 173 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); }  //$NON-NLS-1$
6152
    case 191 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); }  //$NON-NLS-1$
5590
		    consumeMethodHeaderExtendedDims();  
6153
		    consumeMethodHeaderExtendedDims();  
5591
			break;
6154
			break;
5592
 
6155
 
5593
    case 174 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); }  //$NON-NLS-1$
6156
    case 192 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); }  //$NON-NLS-1$
5594
		    consumeMethodHeaderThrowsClause();  
6157
		    consumeMethodHeaderThrowsClause();  
5595
			break;
6158
			break;
5596
 
6159
 
5597
    case 175 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); }  //$NON-NLS-1$
6160
    case 193 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); }  //$NON-NLS-1$
5598
		    consumeConstructorHeader();  
6161
		    consumeConstructorHeader();  
5599
			break;
6162
			break;
5600
 
6163
 
5601
    case 176 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); }  //$NON-NLS-1$
6164
    case 194 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); }  //$NON-NLS-1$
5602
		    consumeConstructorHeaderNameWithTypeParameters();  
6165
		    consumeConstructorHeaderNameWithTypeParameters();  
5603
			break;
6166
			break;
5604
 
6167
 
5605
    case 177 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); }  //$NON-NLS-1$
6168
    case 195 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); }  //$NON-NLS-1$
5606
		    consumeConstructorHeaderName();  
6169
		    consumeConstructorHeaderName();  
5607
			break;
6170
			break;
5608
 
6171
 
5609
    case 179 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); }  //$NON-NLS-1$
6172
    case 197 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); }  //$NON-NLS-1$
5610
		    consumeFormalParameterList();  
6173
		    consumeFormalParameterList();  
5611
			break;
6174
			break;
5612
 
6175
 
5613
    case 180 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); }  //$NON-NLS-1$
6176
    case 198 : if (DEBUG) { System.out.println("PotentialNameArray ::="); }  //$NON-NLS-1$
6177
		    consumePotentialNameArrayType();  
6178
			break;
6179
 
6180
    case 199 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); }  //$NON-NLS-1$
5614
		    consumeFormalParameter(false);  
6181
		    consumeFormalParameter(false);  
5615
			break;
6182
			break;
5616
 
6183
 
5617
    case 181 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type ELLIPSIS..."); }  //$NON-NLS-1$
6184
    case 200 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); }  //$NON-NLS-1$
5618
		    consumeFormalParameter(true);  
6185
		    consumeFormalParameter(true);  
5619
			break;
6186
			break;
5620
 
6187
 
5621
    case 182 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); }  //$NON-NLS-1$
6188
    case 201 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); }  //$NON-NLS-1$
6189
		    consumeFormalParameter(false);  
6190
			break;
6191
 
6192
    case 202 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); }  //$NON-NLS-1$
6193
		    consumeFormalParameter(true);  
6194
			break;
6195
 
6196
    case 203 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); }  //$NON-NLS-1$
6197
		    consumeFormalParameter(false);  
6198
			break;
6199
 
6200
    case 204 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); }  //$NON-NLS-1$
6201
		    consumeFormalParameter(true);  
6202
			break;
6203
 
6204
    case 205 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); }  //$NON-NLS-1$
6205
		    consumeFormalParameter(false);  
6206
			break;
6207
 
6208
    case 206 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); }  //$NON-NLS-1$
6209
		    consumeFormalParameter(true);  
6210
			break;
6211
 
6212
    case 207 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); }  //$NON-NLS-1$
5622
		    consumeCatchFormalParameter();  
6213
		    consumeCatchFormalParameter();  
5623
			break;
6214
			break;
5624
 
6215
 
5625
    case 183 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); }  //$NON-NLS-1$
6216
    case 208 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); }  //$NON-NLS-1$
5626
		    consumeCatchType();  
6217
		    consumeCatchType();  
5627
			break;
6218
			break;
5628
 
6219
 
5629
    case 184 : if (DEBUG) { System.out.println("UnionType ::= Type"); }  //$NON-NLS-1$
6220
    case 209 : if (DEBUG) { System.out.println("UnionType ::= TypeInternal"); }  //$NON-NLS-1$
5630
		    consumeUnionTypeAsClassType();  
6221
		    consumeUnionTypeAsClassType();  
5631
			break;
6222
			break;
5632
 
6223
 
5633
    case 185 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); }  //$NON-NLS-1$
6224
    case 210 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); }  //$NON-NLS-1$
5634
		    consumeUnionType();  
6225
		    consumeUnionType();  
5635
			break;
6226
			break;
5636
 
6227
 
5637
    case 187 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); }  //$NON-NLS-1$
6228
    case 212 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); }  //$NON-NLS-1$
5638
		    consumeClassTypeList();  
6229
		    consumeClassTypeList();  
5639
			break;
6230
			break;
5640
 
6231
 
5641
    case 188 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); }  //$NON-NLS-1$
6232
    case 213 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); }  //$NON-NLS-1$
5642
		    consumeClassTypeElt();  
6233
		    consumeClassTypeElt();  
5643
			break;
6234
			break;
5644
 
6235
 
5645
    case 189 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); }  //$NON-NLS-1$
6236
    case 214 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); }  //$NON-NLS-1$
5646
		    consumeMethodBody();  
6237
		    consumeMethodBody();  
5647
			break;
6238
			break;
5648
 
6239
 
5649
    case 190 : if (DEBUG) { System.out.println("NestedMethod ::="); }  //$NON-NLS-1$
6240
    case 215 : if (DEBUG) { System.out.println("NestedMethod ::="); }  //$NON-NLS-1$
5650
		    consumeNestedMethod();  
6241
		    consumeNestedMethod();  
5651
			break;
6242
			break;
5652
 
6243
 
5653
    case 191 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); }  //$NON-NLS-1$
6244
    case 216 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); }  //$NON-NLS-1$
5654
		    consumeStaticInitializer();  
6245
		    consumeStaticInitializer();  
5655
			break;
6246
			break;
5656
6247
5657
    case 192 : if (DEBUG) { System.out.println("StaticOnly ::= static"); }  //$NON-NLS-1$
6248
    case 217 : if (DEBUG) { System.out.println("StaticOnly ::= static"); }  //$NON-NLS-1$
5658
		    consumeStaticOnly();  
6249
		    consumeStaticOnly();  
5659
			break;
6250
			break;
5660
 
6251
 
5661
    case 193 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); }  //$NON-NLS-1$
6252
    case 218 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); }  //$NON-NLS-1$
5662
		    consumeConstructorDeclaration() ;  
6253
		    consumeConstructorDeclaration() ;  
5663
			break;
6254
			break;
5664
 
6255
 
5665
    case 194 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); }  //$NON-NLS-1$
6256
    case 219 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); }  //$NON-NLS-1$
5666
		    consumeInvalidConstructorDeclaration() ;  
6257
		    consumeInvalidConstructorDeclaration() ;  
5667
			break;
6258
			break;
5668
 
6259
 
5669
    case 195 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); }  //$NON-NLS-1$
6260
    case 220 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); }  //$NON-NLS-1$
5670
		    consumeExplicitConstructorInvocation(0, THIS_CALL);  
6261
		    consumeExplicitConstructorInvocation(0, THIS_CALL);  
5671
			break;
6262
			break;
5672
 
6263
 
5673
    case 196 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); }  //$NON-NLS-1$
6264
    case 221 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); }  //$NON-NLS-1$
5674
		    consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);  
6265
		    consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);  
5675
			break;
6266
			break;
5676
 
6267
 
5677
    case 197 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); }  //$NON-NLS-1$
6268
    case 222 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); }  //$NON-NLS-1$
5678
		    consumeExplicitConstructorInvocation(0,SUPER_CALL);  
6269
		    consumeExplicitConstructorInvocation(0,SUPER_CALL);  
5679
			break;
6270
			break;
5680
 
6271
 
5681
    case 198 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); }  //$NON-NLS-1$
6272
    case 223 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); }  //$NON-NLS-1$
5682
		    consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);  
6273
		    consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);  
5683
			break;
6274
			break;
5684
 
6275
 
5685
    case 199 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); }  //$NON-NLS-1$
6276
    case 224 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); }  //$NON-NLS-1$
5686
		    consumeExplicitConstructorInvocation(1, SUPER_CALL);  
6277
		    consumeExplicitConstructorInvocation(1, SUPER_CALL);  
5687
			break;
6278
			break;
5688
 
6279
 
5689
    case 200 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); }  //$NON-NLS-1$
6280
    case 225 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); }  //$NON-NLS-1$
5690
		    consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);  
6281
		    consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);  
5691
			break;
6282
			break;
5692
 
6283
 
5693
    case 201 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); }  //$NON-NLS-1$
6284
    case 226 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); }  //$NON-NLS-1$
5694
		    consumeExplicitConstructorInvocation(2, SUPER_CALL);  
6285
		    consumeExplicitConstructorInvocation(2, SUPER_CALL);  
5695
			break;
6286
			break;
5696
 
6287
 
5697
    case 202 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); }  //$NON-NLS-1$
6288
    case 227 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); }  //$NON-NLS-1$
5698
		    consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);  
6289
		    consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);  
5699
			break;
6290
			break;
5700
 
6291
 
5701
    case 203 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); }  //$NON-NLS-1$
6292
    case 228 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); }  //$NON-NLS-1$
5702
		    consumeExplicitConstructorInvocation(1, THIS_CALL);  
6293
		    consumeExplicitConstructorInvocation(1, THIS_CALL);  
5703
			break;
6294
			break;
5704
 
6295
 
5705
    case 204 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); }  //$NON-NLS-1$
6296
    case 229 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); }  //$NON-NLS-1$
5706
		    consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);  
6297
		    consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);  
5707
			break;
6298
			break;
5708
 
6299
 
5709
    case 205 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); }  //$NON-NLS-1$
6300
    case 230 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); }  //$NON-NLS-1$
5710
		    consumeExplicitConstructorInvocation(2, THIS_CALL);  
6301
		    consumeExplicitConstructorInvocation(2, THIS_CALL);  
5711
			break;
6302
			break;
5712
 
6303
 
5713
    case 206 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); }  //$NON-NLS-1$
6304
    case 231 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); }  //$NON-NLS-1$
5714
		    consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);  
6305
		    consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);  
5715
			break;
6306
			break;
5716
 
6307
 
5717
    case 207 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); }  //$NON-NLS-1$
6308
    case 232 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); }  //$NON-NLS-1$
5718
		    consumeInterfaceDeclaration();  
6309
		    consumeInterfaceDeclaration();  
5719
			break;
6310
			break;
5720
 
6311
 
5721
    case 208 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); }  //$NON-NLS-1$
6312
    case 233 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); }  //$NON-NLS-1$
5722
		    consumeInterfaceHeader();  
6313
		    consumeInterfaceHeader();  
5723
			break;
6314
			break;
5724
 
6315
 
5725
    case 209 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); }  //$NON-NLS-1$
6316
    case 234 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); }  //$NON-NLS-1$
5726
		    consumeTypeHeaderNameWithTypeParameters();  
6317
		    consumeTypeHeaderNameWithTypeParameters();  
5727
			break;
6318
			break;
5728
 
6319
 
5729
    case 211 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); }  //$NON-NLS-1$
6320
    case 236 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); }  //$NON-NLS-1$
5730
		    consumeInterfaceHeaderName1();  
6321
		    consumeInterfaceHeaderName1();  
5731
			break;
6322
			break;
5732
 
6323
 
5733
    case 212 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); }  //$NON-NLS-1$
6324
    case 237 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); }  //$NON-NLS-1$
5734
		    consumeInterfaceHeaderExtends();  
6325
		    consumeInterfaceHeaderExtends();  
5735
			break;
6326
			break;
5736
 
6327
 
5737
    case 215 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); }  //$NON-NLS-1$
6328
    case 240 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); }  //$NON-NLS-1$
5738
		    consumeInterfaceMemberDeclarations();  
6329
		    consumeInterfaceMemberDeclarations();  
5739
			break;
6330
			break;
5740
 
6331
 
5741
    case 216 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
6332
    case 241 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); }  //$NON-NLS-1$
5742
		    consumeEmptyTypeDeclaration();  
6333
		    consumeEmptyTypeDeclaration();  
5743
			break;
6334
			break;
5744
 
6335
 
5745
    case 217 : if (DEBUG) { System.out.println("PushDefault ::="); }  //$NON-NLS-1$
6336
    case 242 : if (DEBUG) { System.out.println("PushDefault ::="); }  //$NON-NLS-1$
5746
		    consumeInterfaceMethodDefault();  
6337
		    consumeInterfaceMethodDefault();  
5747
			break;
6338
			break;
5748
 
6339
 
5749
    case 219 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader default..."); }  //$NON-NLS-1$
6340
    case 244 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader default..."); }  //$NON-NLS-1$
5750
		    consumeInterfaceMethodDeclaration(true);  
6341
		    consumeInterfaceMethodDeclaration(true);  
5751
			break;
6342
			break;
5752
 
6343
 
5753
    case 220 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); }  //$NON-NLS-1$
6344
    case 245 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); }  //$NON-NLS-1$
5754
		    consumeInterfaceMethodDeclaration(false);  
6345
		    consumeInterfaceMethodDeclaration(false);  
5755
			break;
6346
			break;
5756
 
6347
 
5757
    case 221 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); }  //$NON-NLS-1$
6348
    case 246 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); }  //$NON-NLS-1$
5758
		    consumeInvalidConstructorDeclaration(true);  
6349
		    consumeInvalidConstructorDeclaration(true);  
5759
			break;
6350
			break;
5760
 
6351
 
5761
    case 222 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); }  //$NON-NLS-1$
6352
    case 247 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); }  //$NON-NLS-1$
5762
		    consumeInvalidConstructorDeclaration(false);  
6353
		    consumeInvalidConstructorDeclaration(false);  
5763
			break;
6354
			break;
5764
 
6355
 
5765
    case 233 : if (DEBUG) { System.out.println("PushLeftBrace ::="); }  //$NON-NLS-1$
6356
    case 258 : if (DEBUG) { System.out.println("PushLeftBrace ::="); }  //$NON-NLS-1$
5766
		    consumePushLeftBrace();  
6357
		    consumePushLeftBrace();  
5767
			break;
6358
			break;
5768
 
6359
 
5769
    case 234 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); }  //$NON-NLS-1$
6360
    case 259 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); }  //$NON-NLS-1$
5770
		    consumeEmptyArrayInitializer();  
6361
		    consumeEmptyArrayInitializer();  
5771
			break;
6362
			break;
5772
 
6363
 
5773
    case 235 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); }  //$NON-NLS-1$
6364
    case 260 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); }  //$NON-NLS-1$
5774
		    consumeArrayInitializer();  
6365
		    consumeArrayInitializer();  
5775
			break;
6366
			break;
5776
 
6367
 
5777
    case 236 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); }  //$NON-NLS-1$
6368
    case 261 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); }  //$NON-NLS-1$
5778
		    consumeArrayInitializer();  
6369
		    consumeArrayInitializer();  
5779
			break;
6370
			break;
5780
 
6371
 
5781
    case 238 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); }  //$NON-NLS-1$
6372
    case 263 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); }  //$NON-NLS-1$
5782
		    consumeVariableInitializers();  
6373
		    consumeVariableInitializers();  
5783
			break;
6374
			break;
5784
 
6375
 
5785
    case 239 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); }  //$NON-NLS-1$
6376
    case 264 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); }  //$NON-NLS-1$
5786
		    consumeBlock();  
6377
		    consumeBlock();  
5787
			break;
6378
			break;
5788
 
6379
 
5789
    case 240 : if (DEBUG) { System.out.println("OpenBlock ::="); }  //$NON-NLS-1$
6380
    case 265 : if (DEBUG) { System.out.println("OpenBlock ::="); }  //$NON-NLS-1$
5790
		    consumeOpenBlock() ;  
6381
		    consumeOpenBlock() ;  
5791
			break;
6382
			break;
5792
 
6383
 
5793
    case 242 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); }  //$NON-NLS-1$
6384
    case 267 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); }  //$NON-NLS-1$
5794
		    consumeBlockStatements() ;  
6385
		    consumeBlockStatements() ;  
5795
			break;
6386
			break;
5796
 
6387
 
5797
    case 246 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); }  //$NON-NLS-1$
6388
    case 271 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); }  //$NON-NLS-1$
5798
		    consumeInvalidInterfaceDeclaration();  
6389
		    consumeInvalidInterfaceDeclaration();  
5799
			break;
6390
			break;
5800
 
6391
 
5801
    case 247 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); }  //$NON-NLS-1$
6392
    case 272 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); }  //$NON-NLS-1$
5802
		    consumeInvalidAnnotationTypeDeclaration();  
6393
		    consumeInvalidAnnotationTypeDeclaration();  
5803
			break;
6394
			break;
5804
 
6395
 
5805
    case 248 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); }  //$NON-NLS-1$
6396
    case 273 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); }  //$NON-NLS-1$
5806
		    consumeInvalidEnumDeclaration();  
6397
		    consumeInvalidEnumDeclaration();  
5807
			break;
6398
			break;
5808
 
6399
 
5809
    case 249 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); }  //$NON-NLS-1$
6400
    case 274 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); }  //$NON-NLS-1$
5810
		    consumeLocalVariableDeclarationStatement();  
6401
		    consumeLocalVariableDeclarationStatement();  
5811
			break;
6402
			break;
5812
 
6403
 
5813
    case 250 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); }  //$NON-NLS-1$
6404
    case 275 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type0 PushModifiers..."); }  //$NON-NLS-1$
5814
		    consumeLocalVariableDeclaration();  
6405
		    consumeLocalVariableDeclaration();  
5815
			break;
6406
			break;
5816
 
6407
 
5817
    case 251 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); }  //$NON-NLS-1$
6408
    case 276 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type0..."); }  //$NON-NLS-1$
5818
		    consumeLocalVariableDeclaration();  
6409
		    consumeLocalVariableDeclaration();  
5819
			break;
6410
			break;
5820
 
6411
 
5821
    case 252 : if (DEBUG) { System.out.println("PushModifiers ::="); }  //$NON-NLS-1$
6412
    case 277 : if (DEBUG) { System.out.println("PushModifiers ::="); }  //$NON-NLS-1$
5822
		    consumePushModifiers();  
6413
		    consumePushModifiers();  
5823
			break;
6414
			break;
5824
 
6415
 
5825
    case 253 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); }  //$NON-NLS-1$
6416
    case 278 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); }  //$NON-NLS-1$
5826
		    consumePushModifiersForHeader();  
6417
		    consumePushModifiersForHeader();  
5827
			break;
6418
			break;
5828
 
6419
 
5829
    case 254 : if (DEBUG) { System.out.println("PushRealModifiers ::="); }  //$NON-NLS-1$
6420
    case 279 : if (DEBUG) { System.out.println("PushRealModifiers ::="); }  //$NON-NLS-1$
5830
		    consumePushRealModifiers();  
6421
		    consumePushRealModifiers();  
5831
			break;
6422
			break;
5832
 
6423
 
5833
    case 281 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); }  //$NON-NLS-1$
6424
    case 306 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); }  //$NON-NLS-1$
5834
		    consumeEmptyStatement();  
6425
		    consumeEmptyStatement();  
5835
			break;
6426
			break;
5836
 
6427
 
5837
    case 282 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); }  //$NON-NLS-1$
6428
    case 307 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); }  //$NON-NLS-1$
5838
		    consumeStatementLabel() ;  
6429
		    consumeStatementLabel() ;  
5839
			break;
6430
			break;
5840
 
6431
 
5841
    case 283 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); }  //$NON-NLS-1$
6432
    case 308 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); }  //$NON-NLS-1$
5842
		    consumeStatementLabel() ;  
6433
		    consumeStatementLabel() ;  
5843
			break;
6434
			break;
5844
 
6435
 
5845
    case 284 : if (DEBUG) { System.out.println("Label ::= Identifier"); }  //$NON-NLS-1$
6436
    case 309 : if (DEBUG) { System.out.println("Label ::= Identifier"); }  //$NON-NLS-1$
5846
		    consumeLabel() ;  
6437
		    consumeLabel();  
5847
			break;
6438
			break;
5848
 
6439
 
5849
     case 285 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); }  //$NON-NLS-1$
6440
     case 310 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); }  //$NON-NLS-1$
5850
		    consumeExpressionStatement();  
6441
		    consumeExpressionStatement();  
5851
			break;
6442
			break;
5852
 
6443
 
5853
    case 294 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
6444
    case 319 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
5854
		    consumeStatementIfNoElse();  
6445
		    consumeStatementIfNoElse();  
5855
			break;
6446
			break;
5856
 
6447
 
5857
    case 295 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
6448
    case 320 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
5858
		    consumeStatementIfWithElse();  
6449
		    consumeStatementIfWithElse();  
5859
			break;
6450
			break;
5860
 
6451
 
5861
    case 296 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); }  //$NON-NLS-1$
6452
    case 321 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); }  //$NON-NLS-1$
5862
		    consumeStatementIfWithElse();  
6453
		    consumeStatementIfWithElse();  
5863
			break;
6454
			break;
5864
 
6455
 
5865
    case 297 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
6456
    case 322 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
5866
		    consumeStatementSwitch() ;  
6457
		    consumeStatementSwitch() ;  
5867
			break;
6458
			break;
5868
 
6459
 
5869
    case 298 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); }  //$NON-NLS-1$
6460
    case 323 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); }  //$NON-NLS-1$
5870
		    consumeEmptySwitchBlock() ;  
6461
		    consumeEmptySwitchBlock() ;  
5871
			break;
6462
			break;
5872
 
6463
 
5873
    case 301 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); }  //$NON-NLS-1$
6464
    case 326 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); }  //$NON-NLS-1$
5874
		    consumeSwitchBlock() ;  
6465
		    consumeSwitchBlock() ;  
5875
			break;
6466
			break;
5876
 
6467
 
5877
    case 303 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); }  //$NON-NLS-1$
6468
    case 328 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); }  //$NON-NLS-1$
5878
		    consumeSwitchBlockStatements() ;  
6469
		    consumeSwitchBlockStatements() ;  
5879
			break;
6470
			break;
5880
 
6471
 
5881
    case 304 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); }  //$NON-NLS-1$
6472
    case 329 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); }  //$NON-NLS-1$
5882
		    consumeSwitchBlockStatement() ;  
6473
		    consumeSwitchBlockStatement() ;  
5883
			break;
6474
			break;
5884
 
6475
 
5885
    case 306 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); }  //$NON-NLS-1$
6476
    case 331 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); }  //$NON-NLS-1$
5886
		    consumeSwitchLabels() ;  
6477
		    consumeSwitchLabels() ;  
5887
			break;
6478
			break;
5888
 
6479
 
5889
     case 307 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); }  //$NON-NLS-1$
6480
     case 332 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); }  //$NON-NLS-1$
5890
		    consumeCaseLabel();  
6481
		    consumeCaseLabel();  
5891
			break;
6482
			break;
5892
 
6483
 
5893
     case 308 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); }  //$NON-NLS-1$
6484
     case 333 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); }  //$NON-NLS-1$
5894
		    consumeDefaultLabel();  
6485
		    consumeDefaultLabel();  
5895
			break;
6486
			break;
5896
 
6487
 
5897
    case 309 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
6488
    case 334 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); }  //$NON-NLS-1$
5898
		    consumeStatementWhile() ;  
6489
		    consumeStatementWhile() ;  
5899
			break;
6490
			break;
5900
 
6491
 
5901
    case 310 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); }  //$NON-NLS-1$
6492
    case 335 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); }  //$NON-NLS-1$
5902
		    consumeStatementWhile() ;  
6493
		    consumeStatementWhile() ;  
5903
			break;
6494
			break;
5904
 
6495
 
5905
    case 311 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); }  //$NON-NLS-1$
6496
    case 336 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); }  //$NON-NLS-1$
5906
		    consumeStatementDo() ;  
6497
		    consumeStatementDo() ;  
5907
			break;
6498
			break;
5908
 
6499
 
5909
    case 312 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); }  //$NON-NLS-1$
6500
    case 337 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); }  //$NON-NLS-1$
5910
		    consumeStatementFor() ;  
6501
		    consumeStatementFor() ;  
5911
			break;
6502
			break;
5912
 
6503
 
5913
    case 313 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); }  //$NON-NLS-1$
6504
    case 338 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); }  //$NON-NLS-1$
5914
		    consumeStatementFor() ;  
6505
		    consumeStatementFor() ;  
5915
			break;
6506
			break;
5916
 
6507
 
5917
    case 314 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); }  //$NON-NLS-1$
6508
    case 339 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); }  //$NON-NLS-1$
5918
		    consumeForInit() ;  
6509
		    consumeForInit() ;  
5919
			break;
6510
			break;
5920
 
6511
 
5921
    case 318 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); }  //$NON-NLS-1$
6512
    case 343 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); }  //$NON-NLS-1$
5922
		    consumeStatementExpressionList() ;  
6513
		    consumeStatementExpressionList() ;  
5923
			break;
6514
			break;
5924
 
6515
 
5925
    case 319 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); }  //$NON-NLS-1$
6516
    case 344 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); }  //$NON-NLS-1$
5926
		    consumeSimpleAssertStatement() ;  
6517
		    consumeSimpleAssertStatement() ;  
5927
			break;
6518
			break;
5928
 
6519
 
5929
    case 320 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); }  //$NON-NLS-1$
6520
    case 345 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); }  //$NON-NLS-1$
5930
		    consumeAssertStatement() ;  
6521
		    consumeAssertStatement() ;  
5931
			break;
6522
			break;
5932
 
6523
 
5933
    case 321 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); }  //$NON-NLS-1$
6524
    case 346 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); }  //$NON-NLS-1$
5934
		    consumeStatementBreak() ;  
6525
		    consumeStatementBreak() ;  
5935
			break;
6526
			break;
5936
 
6527
 
5937
    case 322 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); }  //$NON-NLS-1$
6528
    case 347 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); }  //$NON-NLS-1$
5938
		    consumeStatementBreakWithLabel() ;  
6529
		    consumeStatementBreakWithLabel() ;  
5939
			break;
6530
			break;
5940
 
6531
 
5941
    case 323 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); }  //$NON-NLS-1$
6532
    case 348 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); }  //$NON-NLS-1$
5942
		    consumeStatementContinue() ;  
6533
		    consumeStatementContinue() ;  
5943
			break;
6534
			break;
5944
 
6535
 
5945
    case 324 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); }  //$NON-NLS-1$
6536
    case 349 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); }  //$NON-NLS-1$
5946
		    consumeStatementContinueWithLabel() ;  
6537
		    consumeStatementContinueWithLabel() ;  
5947
			break;
6538
			break;
5948
 
6539
 
5949
    case 325 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); }  //$NON-NLS-1$
6540
    case 350 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); }  //$NON-NLS-1$
5950
		    consumeStatementReturn() ;  
6541
		    consumeStatementReturn() ;  
5951
			break;
6542
			break;
5952
 
6543
 
5953
    case 326 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); }  //$NON-NLS-1$
6544
    case 351 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); }  //$NON-NLS-1$
5954
		    consumeStatementThrow();  
6545
		    consumeStatementThrow();  
5955
			break;
6546
			break;
5956
 
6547
 
5957
    case 327 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); }  //$NON-NLS-1$
6548
    case 352 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); }  //$NON-NLS-1$
5958
		    consumeStatementSynchronized();  
6549
		    consumeStatementSynchronized();  
5959
			break;
6550
			break;
5960
 
6551
 
5961
    case 328 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); }  //$NON-NLS-1$
6552
    case 353 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); }  //$NON-NLS-1$
5962
		    consumeOnlySynchronized();  
6553
		    consumeOnlySynchronized();  
5963
			break;
6554
			break;
5964
 
6555
 
5965
    case 329 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); }  //$NON-NLS-1$
6556
    case 354 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); }  //$NON-NLS-1$
5966
		    consumeStatementTry(false, false);  
6557
		    consumeStatementTry(false, false);  
5967
			break;
6558
			break;
5968
 
6559
 
5969
    case 330 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); }  //$NON-NLS-1$
6560
    case 355 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); }  //$NON-NLS-1$
5970
		    consumeStatementTry(true, false);  
6561
		    consumeStatementTry(true, false);  
5971
			break;
6562
			break;
5972
 
6563
 
5973
    case 331 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); }  //$NON-NLS-1$
6564
    case 356 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); }  //$NON-NLS-1$
5974
		    consumeStatementTry(false, true);  
6565
		    consumeStatementTry(false, true);  
5975
			break;
6566
			break;
5976
 
6567
 
5977
    case 332 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); }  //$NON-NLS-1$
6568
    case 357 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); }  //$NON-NLS-1$
5978
		    consumeStatementTry(true, true);  
6569
		    consumeStatementTry(true, true);  
5979
			break;
6570
			break;
5980
 
6571
 
5981
    case 333 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); }  //$NON-NLS-1$
6572
    case 358 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); }  //$NON-NLS-1$
5982
		    consumeResourceSpecification();  
6573
		    consumeResourceSpecification();  
5983
			break;
6574
			break;
5984
 
6575
 
5985
    case 334 : if (DEBUG) { System.out.println(";opt ::="); }  //$NON-NLS-1$
6576
    case 359 : if (DEBUG) { System.out.println(";opt ::="); }  //$NON-NLS-1$
5986
		    consumeResourceOptionalTrailingSemiColon(false);  
6577
		    consumeResourceOptionalTrailingSemiColon(false);  
5987
			break;
6578
			break;
5988
 
6579
 
5989
    case 335 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); }  //$NON-NLS-1$
6580
    case 360 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); }  //$NON-NLS-1$
5990
		    consumeResourceOptionalTrailingSemiColon(true);  
6581
		    consumeResourceOptionalTrailingSemiColon(true);  
5991
			break;
6582
			break;
5992
 
6583
 
5993
    case 336 : if (DEBUG) { System.out.println("Resources ::= Resource"); }  //$NON-NLS-1$
6584
    case 361 : if (DEBUG) { System.out.println("Resources ::= Resource"); }  //$NON-NLS-1$
5994
		    consumeSingleResource();  
6585
		    consumeSingleResource();  
5995
			break;
6586
			break;
5996
 
6587
 
5997
    case 337 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); }  //$NON-NLS-1$
6588
    case 362 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); }  //$NON-NLS-1$
5998
		    consumeMultipleResources();  
6589
		    consumeMultipleResources();  
5999
			break;
6590
			break;
6000
 
6591
 
6001
    case 338 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); }  //$NON-NLS-1$
6592
    case 363 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); }  //$NON-NLS-1$
6002
		    consumeResourceOptionalTrailingSemiColon(true);  
6593
		    consumeResourceOptionalTrailingSemiColon(true);  
6003
			break;
6594
			break;
6004
 
6595
 
6005
    case 339 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); }  //$NON-NLS-1$
6596
    case 364 : if (DEBUG) { System.out.println("Resource ::= TypeInternal PushModifiers..."); }  //$NON-NLS-1$
6006
		    consumeResourceAsLocalVariableDeclaration();  
6597
		    consumeResourceAsLocalVariableDeclaration();  
6007
			break;
6598
			break;
6008
 
6599
 
6009
    case 340 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); }  //$NON-NLS-1$
6600
    case 365 : if (DEBUG) { System.out.println("Resource ::= Modifiers TypeInternal PushRealModifiers..."); }  //$NON-NLS-1$
6010
		    consumeResourceAsLocalVariableDeclaration();  
6601
		    consumeResourceAsLocalVariableDeclaration();  
6011
			break;
6602
			break;
6012
 
6603
 
6013
    case 342 : if (DEBUG) { System.out.println("ExitTryBlock ::="); }  //$NON-NLS-1$
6604
    case 367 : if (DEBUG) { System.out.println("ExitTryBlock ::="); }  //$NON-NLS-1$
6014
		    consumeExitTryBlock();  
6605
		    consumeExitTryBlock();  
6015
			break;
6606
			break;
6016
 
6607
 
6017
    case 344 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); }  //$NON-NLS-1$
6608
    case 369 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); }  //$NON-NLS-1$
6018
		    consumeCatches();  
6609
		    consumeCatches();  
6019
			break;
6610
			break;
6020
 
6611
 
6021
    case 345 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); }  //$NON-NLS-1$
6612
    case 370 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); }  //$NON-NLS-1$
6022
		    consumeStatementCatch() ;  
6613
		    consumeStatementCatch() ;  
6023
			break;
6614
			break;
6024
 
6615
 
6025
    case 347 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); }  //$NON-NLS-1$
6616
    case 372 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); }  //$NON-NLS-1$
6026
		    consumeLeftParen();  
6617
		    consumeLeftParen();  
6027
			break;
6618
			break;
6028
 
6619
 
6029
    case 348 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); }  //$NON-NLS-1$
6620
    case 373 : if (DEBUG) { System.out.println("PushRPARENForUnannotatedTypeCast ::= RPAREN"); }  //$NON-NLS-1$
6621
		    consumeRightParenForUnannotatedTypeCast();  
6622
			break;
6623
 
6624
    case 374 : if (DEBUG) { System.out.println("PushRPARENForNameUnannotatedTypeCast ::= RPAREN"); }  //$NON-NLS-1$
6625
		    consumeRightParenForNameUnannotatedTypeCast();  
6626
			break;
6627
 
6628
    case 375 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); }  //$NON-NLS-1$
6030
		    consumeRightParen();  
6629
		    consumeRightParen();  
6031
			break;
6630
			break;
6032
 
6631
 
6033
    case 353 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); }  //$NON-NLS-1$
6632
    case 376 : if (DEBUG) { System.out.println("PushRPARENForAnnotatedTypeCast ::= RPAREN"); }  //$NON-NLS-1$
6633
		    consumeRightParenForAnnotatedTypeCast();  
6634
			break;
6635
 
6636
    case 377 : if (DEBUG) { System.out.println("PushRPARENForNameAndAnnotatedTypeCast ::= RPAREN"); }  //$NON-NLS-1$
6637
		    consumeRightParenForNameAndAnnotatedTypeCast();  
6638
			break;
6639
 
6640
    case 382 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); }  //$NON-NLS-1$
6034
		    consumePrimaryNoNewArrayThis();  
6641
		    consumePrimaryNoNewArrayThis();  
6035
			break;
6642
			break;
6036
 
6643
 
6037
    case 354 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); }  //$NON-NLS-1$
6644
    case 383 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); }  //$NON-NLS-1$
6038
		    consumePrimaryNoNewArray();  
6645
		    consumePrimaryNoNewArray();  
6039
			break;
6646
			break;
6040
 
6647
 
6041
    case 355 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); }  //$NON-NLS-1$
6648
    case 384 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); }  //$NON-NLS-1$
6042
		    consumePrimaryNoNewArrayWithName();  
6649
		    consumePrimaryNoNewArrayWithName();  
6043
			break;
6650
			break;
6044
 
6651
 
6045
    case 358 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); }  //$NON-NLS-1$
6652
    case 387 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); }  //$NON-NLS-1$
6046
		    consumePrimaryNoNewArrayNameThis();  
6653
		    consumePrimaryNoNewArrayNameThis();  
6047
			break;
6654
			break;
6048
 
6655
 
6049
    case 359 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); }  //$NON-NLS-1$
6656
    case 388 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); }  //$NON-NLS-1$
6050
		    consumePrimaryNoNewArrayNameSuper();  
6657
		    consumePrimaryNoNewArrayNameSuper();  
6051
			break;
6658
			break;
6052
 
6659
 
6053
    case 360 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); }  //$NON-NLS-1$
6660
    case 389 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); }  //$NON-NLS-1$
6054
		    consumePrimaryNoNewArrayName();  
6661
		    consumePrimaryNoNewArrayName();  
6055
			break;
6662
			break;
6056
 
6663
 
6057
    case 361 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); }  //$NON-NLS-1$
6664
    case 390 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); }  //$NON-NLS-1$
6058
		    consumePrimaryNoNewArrayArrayType();  
6665
		    consumePrimaryNoNewArrayArrayType();  
6059
			break;
6666
			break;
6060
 
6667
 
6061
    case 362 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); }  //$NON-NLS-1$
6668
    case 391 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); }  //$NON-NLS-1$
6062
		    consumePrimaryNoNewArrayPrimitiveArrayType();  
6669
		    consumePrimaryNoNewArrayPrimitiveArrayType();  
6063
			break;
6670
			break;
6064
 
6671
 
6065
    case 363 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); }  //$NON-NLS-1$
6672
    case 392 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); }  //$NON-NLS-1$
6066
		    consumePrimaryNoNewArrayPrimitiveType();  
6673
		    consumePrimaryNoNewArrayPrimitiveType();  
6067
			break;
6674
			break;
6068
 
6675
 
6069
    case 369 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name COLON_COLON..."); }  //$NON-NLS-1$
6676
    case 398 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name COLON_COLON..."); }  //$NON-NLS-1$
6070
		    consumeReferenceExpressionNameForm();  
6677
		    consumeReferenceExpressionNameForm();  
6071
			break;
6678
			break;
6072
 
6679
 
6073
    case 370 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); }  //$NON-NLS-1$
6680
    case 399 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); }  //$NON-NLS-1$
6074
		    consumeReferenceExpressionTypeForm(false);  
6681
		    consumeReferenceExpressionTypeForm(false);  
6075
			break;
6682
			break;
6076
 
6683
 
6077
    case 371 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); }  //$NON-NLS-1$
6684
    case 400 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); }  //$NON-NLS-1$
6078
		    consumeReferenceExpressionTypeForm(true);  
6685
		    consumeReferenceExpressionTypeForm(true);  
6079
			break;
6686
			break;
6080
 
6687
 
6081
    case 372 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); }  //$NON-NLS-1$
6688
    case 401 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); }  //$NON-NLS-1$
6082
		    consumeReferenceExpressionPrimaryForm();  
6689
		    consumeReferenceExpressionPrimaryForm();  
6083
			break;
6690
			break;
6084
 
6691
 
6085
    case 373 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); }  //$NON-NLS-1$
6692
    case 402 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); }  //$NON-NLS-1$
6086
		    consumeReferenceExpressionSuperForm();  
6693
		    consumeReferenceExpressionSuperForm();  
6087
			break;
6694
			break;
6088
 
6695
 
6089
    case 374 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); }  //$NON-NLS-1$
6696
    case 403 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); }  //$NON-NLS-1$
6090
		    consumeEmptyTypeArguments();  
6697
		    consumeEmptyTypeArguments();  
6091
			break;
6698
			break;
6092
 
6699
 
6093
    case 376 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); }  //$NON-NLS-1$
6700
    case 405 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); }  //$NON-NLS-1$
6094
		    consumeIdentifierOrNew(false);  
6701
		    consumeIdentifierOrNew(false);  
6095
			break;
6702
			break;
6096
 
6703
 
6097
    case 377 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); }  //$NON-NLS-1$
6704
    case 406 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); }  //$NON-NLS-1$
6098
		    consumeIdentifierOrNew(true);  
6705
		    consumeIdentifierOrNew(true);  
6099
			break;
6706
			break;
6100
 
6707
 
6101
    case 378 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); }  //$NON-NLS-1$
6708
    case 407 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); }  //$NON-NLS-1$
6102
		    consumeLambdaExpression();  
6709
		    consumeLambdaExpression();  
6103
			break;
6710
			break;
6104
 
6711
 
6105
    case 379 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier"); }  //$NON-NLS-1$
6712
    case 408 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier"); }  //$NON-NLS-1$
6106
		    consumeTypeElidedLambdaParameter(false);  
6713
		    consumeTypeElidedLambdaParameter(false);  
6107
			break;
6714
			break;
6108
 
6715
 
6109
    case 383 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); }  //$NON-NLS-1$
6716
    case 412 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); }  //$NON-NLS-1$
6110
		    consumeFormalParameterList();  
6717
		    consumeFormalParameterList();  
6111
			break;
6718
			break;
6112
 
6719
 
6113
    case 384 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); }  //$NON-NLS-1$
6720
    case 413 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); }  //$NON-NLS-1$
6114
		    consumeTypeElidedLambdaParameter(true);  
6721
		    consumeTypeElidedLambdaParameter(true);  
6115
			break;
6722
			break;
6116
 
6723
 
6117
    case 386 : if (DEBUG) { System.out.println("LambdaBody ::= NestedType NestedMethod LBRACE..."); }  //$NON-NLS-1$
6724
    case 415 : if (DEBUG) { System.out.println("LambdaBody ::= NestedType NestedMethod LBRACE..."); }  //$NON-NLS-1$
6118
		    consumeBlock();  
6725
		    consumeBlock();  
6119
			break;
6726
			break;
6120
 
6727
 
6121
    case 387 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); }  //$NON-NLS-1$
6728
    case 416 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); }  //$NON-NLS-1$
6122
		    consumeElidedLeftBraceAndReturn();  
6729
		    consumeElidedLeftBraceAndReturn();  
6123
			break;
6730
			break;
6124
 
6731
 
6125
    case 388 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); }  //$NON-NLS-1$
6732
    case 417 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); }  //$NON-NLS-1$
6126
		    consumeAllocationHeader();  
6733
		    consumeAllocationHeader();  
6127
			break;
6734
			break;
6128
 
6735
 
6129
    case 389 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); }  //$NON-NLS-1$
6736
    case 418 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); }  //$NON-NLS-1$
6130
		    consumeClassInstanceCreationExpressionWithTypeArguments();  
6737
		    consumeClassInstanceCreationExpressionWithTypeArguments();  
6131
			break;
6738
			break;
6132
 
6739
 
6133
    case 390 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); }  //$NON-NLS-1$
6740
    case 419 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); }  //$NON-NLS-1$
6134
		    consumeClassInstanceCreationExpression();  
6741
		    consumeClassInstanceCreationExpression();  
6135
			break;
6742
			break;
6136
 
6743
 
6137
    case 391 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); }  //$NON-NLS-1$
6744
    case 420 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); }  //$NON-NLS-1$
6138
		    consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;  
6745
		    consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;  
6139
			break;
6746
			break;
6140
 
6747
 
6141
    case 392 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); }  //$NON-NLS-1$
6748
    case 421 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); }  //$NON-NLS-1$
6142
		    consumeClassInstanceCreationExpressionQualified() ;  
6749
		    consumeClassInstanceCreationExpressionQualified() ;  
6143
			break;
6750
			break;
6144
 
6751
 
6145
    case 393 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); }  //$NON-NLS-1$
6752
    case 422 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); }  //$NON-NLS-1$
6146
		    consumeClassInstanceCreationExpressionQualified() ;  
6753
		    consumeClassInstanceCreationExpressionQualified() ;  
6147
			break;
6754
			break;
6148
 
6755
 
6149
    case 394 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); }  //$NON-NLS-1$
6756
    case 423 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); }  //$NON-NLS-1$
6150
		    consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;  
6757
		    consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;  
6151
			break;
6758
			break;
6152
 
6759
 
6153
    case 395 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); }  //$NON-NLS-1$
6760
    case 424 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); }  //$NON-NLS-1$
6154
		    consumeEnterInstanceCreationArgumentList();  
6761
		    consumeEnterInstanceCreationArgumentList();  
6155
			break;
6762
			break;
6156
 
6763
 
6157
    case 396 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); }  //$NON-NLS-1$
6764
    case 425 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); }  //$NON-NLS-1$
6158
		    consumeClassInstanceCreationExpressionName() ;  
6765
		    consumeClassInstanceCreationExpressionName() ;  
6159
			break;
6766
			break;
6160
 
6767
 
6161
    case 397 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); }  //$NON-NLS-1$
6768
    case 426 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); }  //$NON-NLS-1$
6162
		    consumeClassBodyopt();  
6769
		    consumeClassBodyopt();  
6163
			break;
6770
			break;
6164
 
6771
 
6165
    case 399 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); }  //$NON-NLS-1$
6772
    case 428 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); }  //$NON-NLS-1$
6166
		    consumeEnterAnonymousClassBody(false);  
6773
		    consumeEnterAnonymousClassBody(false);  
6167
			break;
6774
			break;
6168
 
6775
 
6169
    case 400 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); }  //$NON-NLS-1$
6776
    case 429 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); }  //$NON-NLS-1$
6170
		    consumeClassBodyopt();  
6777
		    consumeClassBodyopt();  
6171
			break;
6778
			break;
6172
 
6779
 
6173
    case 402 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); }  //$NON-NLS-1$
6780
    case 431 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); }  //$NON-NLS-1$
6174
		    consumeEnterAnonymousClassBody(true);  
6781
		    consumeEnterAnonymousClassBody(true);  
6175
			break;
6782
			break;
6176
 
6783
 
6177
    case 404 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); }  //$NON-NLS-1$
6784
    case 433 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); }  //$NON-NLS-1$
6178
		    consumeArgumentList();  
6785
		    consumeArgumentList();  
6179
			break;
6786
			break;
6180
 
6787
 
6181
    case 405 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); }  //$NON-NLS-1$
6788
    case 434 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new Annotationsopt PrimitiveType"); }  //$NON-NLS-1$
6182
		    consumeArrayCreationHeader();  
6789
		    consumeArrayCreationHeader();  
6183
			break;
6790
			break;
6184
 
6791
 
6185
    case 406 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); }  //$NON-NLS-1$
6792
    case 435 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); }  //$NON-NLS-1$
6186
		    consumeArrayCreationHeader();  
6793
		    consumeArrayCreationHeader();  
6187
			break;
6794
			break;
6188
 
6795
 
6189
    case 407 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); }  //$NON-NLS-1$
6796
    case 436 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); }  //$NON-NLS-1$
6190
		    consumeArrayCreationExpressionWithoutInitializer();  
6797
		    consumeArrayCreationExpressionWithoutInitializer();  
6191
			break;
6798
			break;
6192
 
6799
 
6193
    case 408 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); }  //$NON-NLS-1$
6800
    case 437 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new Annotationsopt"); }  //$NON-NLS-1$
6194
		    consumeArrayCreationExpressionWithInitializer();  
6801
		    consumeArrayCreationExpressionWithInitializer();  
6195
			break;
6802
			break;
6196
 
6803
 
6197
    case 409 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); }  //$NON-NLS-1$
6804
    case 438 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); }  //$NON-NLS-1$
6198
		    consumeArrayCreationExpressionWithoutInitializer();  
6805
		    consumeArrayCreationExpressionWithoutInitializer();  
6199
			break;
6806
			break;
6200
 
6807
 
6201
    case 410 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); }  //$NON-NLS-1$
6808
    case 439 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); }  //$NON-NLS-1$
6202
		    consumeArrayCreationExpressionWithInitializer();  
6809
		    consumeArrayCreationExpressionWithInitializer();  
6203
			break;
6810
			break;
6204
 
6811
 
6205
    case 412 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); }  //$NON-NLS-1$
6812
    case 441 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); }  //$NON-NLS-1$
6206
		    consumeDimWithOrWithOutExprs();  
6813
		    consumeDimWithOrWithOutExprs();  
6207
			break;
6814
			break;
6208
 
6815
 
6209
     case 414 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET"); }  //$NON-NLS-1$
6816
     case 444 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET..."); }  //$NON-NLS-1$
6210
		    consumeDimWithOrWithOutExpr();  
6817
		    consumeDimWithOrWithOutExpr();  
6211
			break;
6818
			break;
6212
 
6819
 
6213
     case 415 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); }  //$NON-NLS-1$
6820
     case 445 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotations LBRACKET..."); }  //$NON-NLS-1$
6821
		    consumeDimWithOrWithOutExpr();  
6822
			break;
6823
 
6824
     case 446 : if (DEBUG) { System.out.println("DimsoptAnnotsopt ::="); }  //$NON-NLS-1$
6825
		    consumeEmptyDimsoptAnnotsopt();  
6826
			break;
6827
 
6828
     case 447 : if (DEBUG) { System.out.println("DimsoptAnnotsopt -> DimsAnnotLoop"); }  //$NON-NLS-1$
6829
		    consumeDimsWithTrailingAnnotsopt();  
6830
			break;
6831
 
6832
     case 450 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= Annotation"); }  //$NON-NLS-1$
6833
		    consumeTypeAnnotation(true);  
6834
			break;
6835
 
6836
     case 451 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= LBRACKET RBRACKET"); }  //$NON-NLS-1$
6837
		    consumeOneDimLoop(true);  
6838
			break;
6839
 
6840
     case 452 : if (DEBUG) { System.out.println("TypeAnnotations ::= Annotation"); }  //$NON-NLS-1$
6841
		    consumeTypeAnnotation(false);  
6842
			break;
6843
 
6844
     case 453 : if (DEBUG) { System.out.println("TypeAnnotations ::= TypeAnnotations Annotation"); }  //$NON-NLS-1$
6845
		    consumeOneMoreTypeAnnotation();  
6846
			break;
6847
 
6848
     case 454 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); }  //$NON-NLS-1$
6214
		    consumeDims();  
6849
		    consumeDims();  
6215
			break;
6850
			break;
6216
 
6851
 
6217
     case 418 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); }  //$NON-NLS-1$
6852
     case 457 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); }  //$NON-NLS-1$
6218
		    consumeOneDimLoop();  
6853
		    consumeOneDimLoop(false);  
6219
			break;
6854
			break;
6220
 
6855
 
6221
    case 419 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); }  //$NON-NLS-1$
6856
     case 458 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); }  //$NON-NLS-1$
6857
		    consumeOneDimLoopWithAnnotations();  
6858
			break;
6859
 
6860
    case 459 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); }  //$NON-NLS-1$
6222
		    consumeFieldAccess(false);  
6861
		    consumeFieldAccess(false);  
6223
			break;
6862
			break;
6224
 
6863
 
6225
    case 420 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); }  //$NON-NLS-1$
6864
    case 460 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); }  //$NON-NLS-1$
6226
		    consumeFieldAccess(true);  
6865
		    consumeFieldAccess(true);  
6227
			break;
6866
			break;
6228
 
6867
 
6229
    case 421 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); }  //$NON-NLS-1$
6868
    case 461 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); }  //$NON-NLS-1$
6230
		    consumeMethodInvocationName();  
6869
		    consumeMethodInvocationName();  
6231
			break;
6870
			break;
6232
 
6871
 
6233
    case 422 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6872
    case 462 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6234
		    consumeMethodInvocationNameWithTypeArguments();  
6873
		    consumeMethodInvocationNameWithTypeArguments();  
6235
			break;
6874
			break;
6236
 
6875
 
6237
    case 423 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6876
    case 463 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6238
		    consumeMethodInvocationPrimaryWithTypeArguments();  
6877
		    consumeMethodInvocationPrimaryWithTypeArguments();  
6239
			break;
6878
			break;
6240
 
6879
 
6241
    case 424 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); }  //$NON-NLS-1$
6880
    case 464 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); }  //$NON-NLS-1$
6242
		    consumeMethodInvocationPrimary();  
6881
		    consumeMethodInvocationPrimary();  
6243
			break;
6882
			break;
6244
 
6883
 
6245
    case 425 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6884
    case 465 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); }  //$NON-NLS-1$
6246
		    consumeMethodInvocationSuperWithTypeArguments();  
6885
		    consumeMethodInvocationSuperWithTypeArguments();  
6247
			break;
6886
			break;
6248
 
6887
 
6249
    case 426 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); }  //$NON-NLS-1$
6888
    case 466 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); }  //$NON-NLS-1$
6250
		    consumeMethodInvocationSuper();  
6889
		    consumeMethodInvocationSuper();  
6251
			break;
6890
			break;
6252
 
6891
 
6253
    case 427 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); }  //$NON-NLS-1$
6892
    case 467 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); }  //$NON-NLS-1$
6254
		    consumeArrayAccess(true);  
6893
		    consumeArrayAccess(true);  
6255
			break;
6894
			break;
6256
 
6895
 
6257
    case 428 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); }  //$NON-NLS-1$
6896
    case 468 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); }  //$NON-NLS-1$
6258
		    consumeArrayAccess(false);  
6897
		    consumeArrayAccess(false);  
6259
			break;
6898
			break;
6260
 
6899
 
6261
    case 429 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); }  //$NON-NLS-1$
6900
    case 469 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); }  //$NON-NLS-1$
6262
		    consumeArrayAccess(false);  
6901
		    consumeArrayAccess(false);  
6263
			break;
6902
			break;
6264
 
6903
 
6265
    case 431 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); }  //$NON-NLS-1$
6904
    case 471 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); }  //$NON-NLS-1$
6266
		    consumePostfixExpression();  
6905
		    consumePostfixExpression();  
6267
			break;
6906
			break;
6268
 
6907
 
6269
    case 434 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); }  //$NON-NLS-1$
6908
    case 474 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); }  //$NON-NLS-1$
6270
		    consumeUnaryExpression(OperatorIds.PLUS,true);  
6909
		    consumeUnaryExpression(OperatorIds.PLUS,true);  
6271
			break;
6910
			break;
6272
 
6911
 
6273
    case 435 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); }  //$NON-NLS-1$
6912
    case 475 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); }  //$NON-NLS-1$
6274
		    consumeUnaryExpression(OperatorIds.MINUS,true);  
6913
		    consumeUnaryExpression(OperatorIds.MINUS,true);  
6275
			break;
6914
			break;
6276
 
6915
 
6277
    case 436 : if (DEBUG) { System.out.println("PushPosition ::="); }  //$NON-NLS-1$
6916
    case 476 : if (DEBUG) { System.out.println("PushPosition ::="); }  //$NON-NLS-1$
6278
		    consumePushPosition();  
6917
		    consumePushPosition();  
6279
			break;
6918
			break;
6280
 
6919
 
6281
    case 439 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); }  //$NON-NLS-1$
6920
    case 479 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); }  //$NON-NLS-1$
6282
		    consumeUnaryExpression(OperatorIds.PLUS);  
6921
		    consumeUnaryExpression(OperatorIds.PLUS);  
6283
			break;
6922
			break;
6284
 
6923
 
6285
    case 440 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); }  //$NON-NLS-1$
6924
    case 480 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); }  //$NON-NLS-1$
6286
		    consumeUnaryExpression(OperatorIds.MINUS);  
6925
		    consumeUnaryExpression(OperatorIds.MINUS);  
6287
			break;
6926
			break;
6288
 
6927
 
6289
    case 442 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); }  //$NON-NLS-1$
6928
    case 482 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); }  //$NON-NLS-1$
6290
		    consumeUnaryExpression(OperatorIds.PLUS,false);  
6929
		    consumeUnaryExpression(OperatorIds.PLUS,false);  
6291
			break;
6930
			break;
6292
 
6931
 
6293
    case 443 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); }  //$NON-NLS-1$
6932
    case 483 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); }  //$NON-NLS-1$
6294
		    consumeUnaryExpression(OperatorIds.MINUS,false);  
6933
		    consumeUnaryExpression(OperatorIds.MINUS,false);  
6295
			break;
6934
			break;
6296
 
6935
 
6297
    case 445 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); }  //$NON-NLS-1$
6936
    case 485 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); }  //$NON-NLS-1$
6298
		    consumeUnaryExpression(OperatorIds.TWIDDLE);  
6937
		    consumeUnaryExpression(OperatorIds.TWIDDLE);  
6299
			break;
6938
			break;
6300
 
6939
 
6301
    case 446 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); }  //$NON-NLS-1$
6940
    case 486 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); }  //$NON-NLS-1$
6302
		    consumeUnaryExpression(OperatorIds.NOT);  
6941
		    consumeUnaryExpression(OperatorIds.NOT);  
6303
			break;
6942
			break;
6304
 
6943
 
6305
    case 448 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); }  //$NON-NLS-1$
6944
    case 488 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); }  //$NON-NLS-1$
6306
		    consumeCastExpressionWithPrimitiveType();  
6945
		    consumeCastExpressionWithPrimitiveType();  
6307
			break;
6946
			break;
6308
 
6947
 
6309
    case 449 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); }  //$NON-NLS-1$
6948
    case 489 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers PrimitiveType..."); }  //$NON-NLS-1$
6949
		    consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations();  
6950
			break;
6951
 
6952
    case 490 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); }  //$NON-NLS-1$
6310
		    consumeCastExpressionWithGenericsArray();  
6953
		    consumeCastExpressionWithGenericsArray();  
6311
			break;
6954
			break;
6312
 
6955
 
6313
    case 450 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); }  //$NON-NLS-1$
6956
    case 491 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); }  //$NON-NLS-1$
6957
		    consumeCastExpressionWithGenericsArrayWithTypeAnnotations();  
6958
			break;
6959
 
6960
    case 492 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); }  //$NON-NLS-1$
6314
		    consumeCastExpressionWithQualifiedGenericsArray();  
6961
		    consumeCastExpressionWithQualifiedGenericsArray();  
6315
			break;
6962
			break;
6316
 
6963
 
6317
    case 451 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); }  //$NON-NLS-1$
6964
    case 493 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); }  //$NON-NLS-1$
6965
		    consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations();  
6966
			break;
6967
 
6968
    case 494 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); }  //$NON-NLS-1$
6318
		    consumeCastExpressionLL1();  
6969
		    consumeCastExpressionLL1();  
6319
			break;
6970
			break;
6320
 
6971
 
6321
    case 452 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN..."); }  //$NON-NLS-1$
6972
    case 495 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); }  //$NON-NLS-1$
6973
		    consumeCastExpressionLL1WithTypeAnnotations();  
6974
			break;
6975
 
6976
    case 496 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); }  //$NON-NLS-1$
6322
		    consumeCastExpressionWithNameArray();  
6977
		    consumeCastExpressionWithNameArray();  
6323
			break;
6978
			break;
6324
 
6979
 
6325
    case 453 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); }  //$NON-NLS-1$
6980
    case 497 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name Dims..."); }  //$NON-NLS-1$
6981
		    consumeCastExpressionWithNameArrayWithTypeAnnotations();  
6982
			break;
6983
 
6984
    case 498 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); }  //$NON-NLS-1$
6326
		    consumeOnlyTypeArgumentsForCastExpression();  
6985
		    consumeOnlyTypeArgumentsForCastExpression();  
6327
			break;
6986
			break;
6328
 
6987
 
6329
    case 454 : if (DEBUG) { System.out.println("InsideCastExpression ::="); }  //$NON-NLS-1$
6988
    case 499 : if (DEBUG) { System.out.println("InsideCastExpression ::="); }  //$NON-NLS-1$
6330
		    consumeInsideCastExpression();  
6989
		    consumeInsideCastExpression();  
6331
			break;
6990
			break;
6332
 
6991
 
6333
    case 455 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); }  //$NON-NLS-1$
6992
    case 500 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); }  //$NON-NLS-1$
6334
		    consumeInsideCastExpressionLL1();  
6993
		    consumeInsideCastExpressionLL1();  
6335
			break;
6994
			break;
6336
 
6995
 
6337
    case 456 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); }  //$NON-NLS-1$
6996
    case 501 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); }  //$NON-NLS-1$
6338
		    consumeInsideCastExpressionWithQualifiedGenerics();  
6997
		    consumeInsideCastExpressionWithQualifiedGenerics();  
6339
			break;
6998
			break;
6340
 
6999
 
6341
    case 458 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
7000
    case 502 : if (DEBUG) { System.out.println("InsideCastExpressionWithAnnotatedQualifiedGenerics ::="); }  //$NON-NLS-1$
7001
		    consumeInsideCastExpressionWithAnnotatedQualifiedGenerics();  
7002
			break;
7003
 
7004
    case 504 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
6342
		    consumeBinaryExpression(OperatorIds.MULTIPLY);  
7005
		    consumeBinaryExpression(OperatorIds.MULTIPLY);  
6343
			break;
7006
			break;
6344
 
7007
 
6345
    case 459 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
7008
    case 505 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
6346
		    consumeBinaryExpression(OperatorIds.DIVIDE);  
7009
		    consumeBinaryExpression(OperatorIds.DIVIDE);  
6347
			break;
7010
			break;
6348
 
7011
 
6349
    case 460 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
7012
    case 506 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); }  //$NON-NLS-1$
6350
		    consumeBinaryExpression(OperatorIds.REMAINDER);  
7013
		    consumeBinaryExpression(OperatorIds.REMAINDER);  
6351
			break;
7014
			break;
6352
 
7015
 
6353
    case 462 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); }  //$NON-NLS-1$
7016
    case 508 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); }  //$NON-NLS-1$
6354
		    consumeBinaryExpression(OperatorIds.PLUS);  
7017
		    consumeBinaryExpression(OperatorIds.PLUS);  
6355
			break;
7018
			break;
6356
 
7019
 
6357
    case 463 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); }  //$NON-NLS-1$
7020
    case 509 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); }  //$NON-NLS-1$
6358
		    consumeBinaryExpression(OperatorIds.MINUS);  
7021
		    consumeBinaryExpression(OperatorIds.MINUS);  
6359
			break;
7022
			break;
6360
 
7023
 
6361
    case 465 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); }  //$NON-NLS-1$
7024
    case 511 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); }  //$NON-NLS-1$
6362
		    consumeBinaryExpression(OperatorIds.LEFT_SHIFT);  
7025
		    consumeBinaryExpression(OperatorIds.LEFT_SHIFT);  
6363
			break;
7026
			break;
6364
 
7027
 
6365
    case 466 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); }  //$NON-NLS-1$
7028
    case 512 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); }  //$NON-NLS-1$
6366
		    consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);  
7029
		    consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);  
6367
			break;
7030
			break;
6368
 
7031
 
6369
    case 467 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
7032
    case 513 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
6370
		    consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
7033
		    consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
6371
			break;
7034
			break;
6372
 
7035
 
6373
    case 469 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); }  //$NON-NLS-1$
7036
    case 515 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); }  //$NON-NLS-1$
6374
		    consumeBinaryExpression(OperatorIds.LESS);  
7037
		    consumeBinaryExpression(OperatorIds.LESS);  
6375
			break;
7038
			break;
6376
 
7039
 
6377
    case 470 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); }  //$NON-NLS-1$
7040
    case 516 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); }  //$NON-NLS-1$
6378
		    consumeBinaryExpression(OperatorIds.GREATER);  
7041
		    consumeBinaryExpression(OperatorIds.GREATER);  
6379
			break;
7042
			break;
6380
 
7043
 
6381
    case 471 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); }  //$NON-NLS-1$
7044
    case 517 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); }  //$NON-NLS-1$
6382
		    consumeBinaryExpression(OperatorIds.LESS_EQUAL);  
7045
		    consumeBinaryExpression(OperatorIds.LESS_EQUAL);  
6383
			break;
7046
			break;
6384
 
7047
 
6385
    case 472 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); }  //$NON-NLS-1$
7048
    case 518 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); }  //$NON-NLS-1$
6386
		    consumeBinaryExpression(OperatorIds.GREATER_EQUAL);  
7049
		    consumeBinaryExpression(OperatorIds.GREATER_EQUAL);  
6387
			break;
7050
			break;
6388
 
7051
 
6389
    case 474 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); }  //$NON-NLS-1$
7052
    case 520 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); }  //$NON-NLS-1$
6390
		    consumeInstanceOfExpression();  
7053
		    consumeInstanceOfExpression();  
6391
			break;
7054
			break;
6392
 
7055
 
6393
    case 476 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); }  //$NON-NLS-1$
7056
    case 522 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); }  //$NON-NLS-1$
6394
		    consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);  
7057
		    consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);  
6395
			break;
7058
			break;
6396
 
7059
 
6397
    case 477 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); }  //$NON-NLS-1$
7060
    case 523 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); }  //$NON-NLS-1$
6398
		    consumeEqualityExpression(OperatorIds.NOT_EQUAL);  
7061
		    consumeEqualityExpression(OperatorIds.NOT_EQUAL);  
6399
			break;
7062
			break;
6400
 
7063
 
6401
    case 479 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); }  //$NON-NLS-1$
7064
    case 525 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); }  //$NON-NLS-1$
6402
		    consumeBinaryExpression(OperatorIds.AND);  
7065
		    consumeBinaryExpression(OperatorIds.AND);  
6403
			break;
7066
			break;
6404
 
7067
 
6405
    case 481 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); }  //$NON-NLS-1$
7068
    case 527 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); }  //$NON-NLS-1$
6406
		    consumeBinaryExpression(OperatorIds.XOR);  
7069
		    consumeBinaryExpression(OperatorIds.XOR);  
6407
			break;
7070
			break;
6408
 
7071
 
6409
    case 483 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); }  //$NON-NLS-1$
7072
    case 529 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); }  //$NON-NLS-1$
6410
		    consumeBinaryExpression(OperatorIds.OR);  
7073
		    consumeBinaryExpression(OperatorIds.OR);  
6411
			break;
7074
			break;
6412
 
7075
 
6413
    case 485 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); }  //$NON-NLS-1$
7076
    case 531 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); }  //$NON-NLS-1$
6414
		    consumeBinaryExpression(OperatorIds.AND_AND);  
7077
		    consumeBinaryExpression(OperatorIds.AND_AND);  
6415
			break;
7078
			break;
6416
 
7079
 
6417
    case 487 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); }  //$NON-NLS-1$
7080
    case 533 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); }  //$NON-NLS-1$
6418
		    consumeBinaryExpression(OperatorIds.OR_OR);  
7081
		    consumeBinaryExpression(OperatorIds.OR_OR);  
6419
			break;
7082
			break;
6420
 
7083
 
6421
    case 489 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); }  //$NON-NLS-1$
7084
    case 535 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); }  //$NON-NLS-1$
6422
		    consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;  
7085
		    consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;  
6423
			break;
7086
			break;
6424
 
7087
 
6425
    case 492 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); }  //$NON-NLS-1$
7088
    case 538 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); }  //$NON-NLS-1$
6426
		    consumeAssignment();  
7089
		    consumeAssignment();  
6427
			break;
7090
			break;
6428
 
7091
 
6429
    case 494 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); }  //$NON-NLS-1$
7092
    case 540 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); }  //$NON-NLS-1$
6430
		    ignoreExpressionAssignment(); 
7093
		    ignoreExpressionAssignment(); 
6431
			break;
7094
			break;
6432
 
7095
 
6433
    case 495 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); }  //$NON-NLS-1$
7096
    case 541 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); }  //$NON-NLS-1$
6434
		    consumeAssignmentOperator(EQUAL);  
7097
		    consumeAssignmentOperator(EQUAL);  
6435
			break;
7098
			break;
6436
 
7099
 
6437
    case 496 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); }  //$NON-NLS-1$
7100
    case 542 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); }  //$NON-NLS-1$
6438
		    consumeAssignmentOperator(MULTIPLY);  
7101
		    consumeAssignmentOperator(MULTIPLY);  
6439
			break;
7102
			break;
6440
 
7103
 
6441
    case 497 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); }  //$NON-NLS-1$
7104
    case 543 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); }  //$NON-NLS-1$
6442
		    consumeAssignmentOperator(DIVIDE);  
7105
		    consumeAssignmentOperator(DIVIDE);  
6443
			break;
7106
			break;
6444
 
7107
 
6445
    case 498 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); }  //$NON-NLS-1$
7108
    case 544 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); }  //$NON-NLS-1$
6446
		    consumeAssignmentOperator(REMAINDER);  
7109
		    consumeAssignmentOperator(REMAINDER);  
6447
			break;
7110
			break;
6448
 
7111
 
6449
    case 499 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); }  //$NON-NLS-1$
7112
    case 545 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); }  //$NON-NLS-1$
6450
		    consumeAssignmentOperator(PLUS);  
7113
		    consumeAssignmentOperator(PLUS);  
6451
			break;
7114
			break;
6452
 
7115
 
6453
    case 500 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); }  //$NON-NLS-1$
7116
    case 546 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); }  //$NON-NLS-1$
6454
		    consumeAssignmentOperator(MINUS);  
7117
		    consumeAssignmentOperator(MINUS);  
6455
			break;
7118
			break;
6456
 
7119
 
6457
    case 501 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); }  //$NON-NLS-1$
7120
    case 547 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); }  //$NON-NLS-1$
6458
		    consumeAssignmentOperator(LEFT_SHIFT);  
7121
		    consumeAssignmentOperator(LEFT_SHIFT);  
6459
			break;
7122
			break;
6460
 
7123
 
6461
    case 502 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); }  //$NON-NLS-1$
7124
    case 548 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); }  //$NON-NLS-1$
6462
		    consumeAssignmentOperator(RIGHT_SHIFT);  
7125
		    consumeAssignmentOperator(RIGHT_SHIFT);  
6463
			break;
7126
			break;
6464
 
7127
 
6465
    case 503 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); }  //$NON-NLS-1$
7128
    case 549 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); }  //$NON-NLS-1$
6466
		    consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);  
7129
		    consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);  
6467
			break;
7130
			break;
6468
 
7131
 
6469
    case 504 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); }  //$NON-NLS-1$
7132
    case 550 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); }  //$NON-NLS-1$
6470
		    consumeAssignmentOperator(AND);  
7133
		    consumeAssignmentOperator(AND);  
6471
			break;
7134
			break;
6472
 
7135
 
6473
    case 505 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); }  //$NON-NLS-1$
7136
    case 551 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); }  //$NON-NLS-1$
6474
		    consumeAssignmentOperator(XOR);  
7137
		    consumeAssignmentOperator(XOR);  
6475
			break;
7138
			break;
6476
 
7139
 
6477
    case 506 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); }  //$NON-NLS-1$
7140
    case 552 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); }  //$NON-NLS-1$
6478
		    consumeAssignmentOperator(OR);  
7141
		    consumeAssignmentOperator(OR);  
6479
			break;
7142
			break;
6480
 
7143
 
6481
    case 507 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); }  //$NON-NLS-1$
7144
    case 553 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); }  //$NON-NLS-1$
6482
		    consumeExpression();  
7145
		    consumeExpression();  
6483
			break;
7146
			break;
6484
 
7147
 
6485
    case 510 : if (DEBUG) { System.out.println("Expressionopt ::="); }  //$NON-NLS-1$
7148
    case 556 : if (DEBUG) { System.out.println("Expressionopt ::="); }  //$NON-NLS-1$
6486
		    consumeEmptyExpression();  
7149
		    consumeEmptyExpression();  
6487
			break;
7150
			break;
6488
 
7151
 
6489
    case 515 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); }  //$NON-NLS-1$
7152
    case 561 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); }  //$NON-NLS-1$
6490
		    consumeEmptyClassBodyDeclarationsopt();  
7153
		    consumeEmptyClassBodyDeclarationsopt();  
6491
			break;
7154
			break;
6492
 
7155
 
6493
    case 516 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
7156
    case 562 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
6494
		    consumeClassBodyDeclarationsopt();  
7157
		    consumeClassBodyDeclarationsopt();  
6495
			break;
7158
			break;
6496
 
7159
 
6497
     case 517 : if (DEBUG) { System.out.println("Modifiersopt ::="); }  //$NON-NLS-1$
7160
     case 563 : if (DEBUG) { System.out.println("Modifiersopt ::="); }  //$NON-NLS-1$
6498
		    consumeDefaultModifiers();  
7161
		    consumeDefaultModifiers();  
6499
			break;
7162
			break;
6500
 
7163
 
6501
    case 518 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); }  //$NON-NLS-1$
7164
    case 564 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); }  //$NON-NLS-1$
6502
		    consumeModifiers();  
7165
		    consumeModifiers();  
6503
			break;
7166
			break;
6504
 
7167
 
6505
    case 519 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); }  //$NON-NLS-1$
7168
    case 565 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); }  //$NON-NLS-1$
6506
		    consumeEmptyBlockStatementsopt();  
7169
		    consumeEmptyBlockStatementsopt();  
6507
			break;
7170
			break;
6508
 
7171
 
6509
     case 521 : if (DEBUG) { System.out.println("Dimsopt ::="); }  //$NON-NLS-1$
7172
     case 567 : if (DEBUG) { System.out.println("Dimsopt ::="); }  //$NON-NLS-1$
6510
		    consumeEmptyDimsopt();  
7173
		    consumeEmptyDimsopt();  
6511
			break;
7174
			break;
6512
 
7175
 
6513
     case 523 : if (DEBUG) { System.out.println("ArgumentListopt ::="); }  //$NON-NLS-1$
7176
     case 569 : if (DEBUG) { System.out.println("ArgumentListopt ::="); }  //$NON-NLS-1$
6514
		    consumeEmptyArgumentListopt();  
7177
		    consumeEmptyArgumentListopt();  
6515
			break;
7178
			break;
6516
 
7179
 
6517
    case 527 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); }  //$NON-NLS-1$
7180
    case 573 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); }  //$NON-NLS-1$
6518
		    consumeFormalParameterListopt();  
7181
		    consumeFormalParameterListopt();  
6519
			break;
7182
			break;
6520
 
7183
 
6521
     case 531 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); }  //$NON-NLS-1$
7184
     case 577 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); }  //$NON-NLS-1$
6522
		    consumeEmptyInterfaceMemberDeclarationsopt();  
7185
		    consumeEmptyInterfaceMemberDeclarationsopt();  
6523
			break;
7186
			break;
6524
 
7187
 
6525
     case 532 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
7188
     case 578 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
6526
		    consumeInterfaceMemberDeclarationsopt();  
7189
		    consumeInterfaceMemberDeclarationsopt();  
6527
			break;
7190
			break;
6528
 
7191
 
6529
    case 533 : if (DEBUG) { System.out.println("NestedType ::="); }  //$NON-NLS-1$
7192
    case 579 : if (DEBUG) { System.out.println("NestedType ::="); }  //$NON-NLS-1$
6530
		    consumeNestedType();  
7193
		    consumeNestedType();  
6531
			break;
7194
			break;
6532
7195
6533
     case 534 : if (DEBUG) { System.out.println("ForInitopt ::="); }  //$NON-NLS-1$
7196
     case 580 : if (DEBUG) { System.out.println("ForInitopt ::="); }  //$NON-NLS-1$
6534
		    consumeEmptyForInitopt();  
7197
		    consumeEmptyForInitopt();  
6535
			break;
7198
			break;
6536
 
7199
 
6537
     case 536 : if (DEBUG) { System.out.println("ForUpdateopt ::="); }  //$NON-NLS-1$
7200
     case 582 : if (DEBUG) { System.out.println("ForUpdateopt ::="); }  //$NON-NLS-1$
6538
		    consumeEmptyForUpdateopt();  
7201
		    consumeEmptyForUpdateopt();  
6539
			break;
7202
			break;
6540
 
7203
 
6541
     case 540 : if (DEBUG) { System.out.println("Catchesopt ::="); }  //$NON-NLS-1$
7204
     case 586 : if (DEBUG) { System.out.println("Catchesopt ::="); }  //$NON-NLS-1$
6542
		    consumeEmptyCatchesopt();  
7205
		    consumeEmptyCatchesopt();  
6543
			break;
7206
			break;
6544
 
7207
 
6545
     case 542 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); }  //$NON-NLS-1$
7208
     case 588 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); }  //$NON-NLS-1$
6546
		    consumeEnumDeclaration();  
7209
		    consumeEnumDeclaration();  
6547
			break;
7210
			break;
6548
 
7211
 
6549
     case 543 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); }  //$NON-NLS-1$
7212
     case 589 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); }  //$NON-NLS-1$
6550
		    consumeEnumHeader();  
7213
		    consumeEnumHeader();  
6551
			break;
7214
			break;
6552
 
7215
 
6553
     case 544 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); }  //$NON-NLS-1$
7216
     case 590 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); }  //$NON-NLS-1$
6554
		    consumeEnumHeaderName();  
7217
		    consumeEnumHeaderName();  
6555
			break;
7218
			break;
6556
 
7219
 
6557
     case 545 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); }  //$NON-NLS-1$
7220
     case 591 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); }  //$NON-NLS-1$
6558
		    consumeEnumHeaderNameWithTypeParameters();  
7221
		    consumeEnumHeaderNameWithTypeParameters();  
6559
			break;
7222
			break;
6560
 
7223
 
6561
     case 546 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); }  //$NON-NLS-1$
7224
     case 592 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); }  //$NON-NLS-1$
6562
		    consumeEnumBodyNoConstants();  
7225
		    consumeEnumBodyNoConstants();  
6563
			break;
7226
			break;
6564
 
7227
 
6565
     case 547 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); }  //$NON-NLS-1$
7228
     case 593 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); }  //$NON-NLS-1$
6566
		    consumeEnumBodyNoConstants();  
7229
		    consumeEnumBodyNoConstants();  
6567
			break;
7230
			break;
6568
 
7231
 
6569
     case 548 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); }  //$NON-NLS-1$
7232
     case 594 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); }  //$NON-NLS-1$
6570
		    consumeEnumBodyWithConstants();  
7233
		    consumeEnumBodyWithConstants();  
6571
			break;
7234
			break;
6572
 
7235
 
6573
     case 549 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); }  //$NON-NLS-1$
7236
     case 595 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); }  //$NON-NLS-1$
6574
		    consumeEnumBodyWithConstants();  
7237
		    consumeEnumBodyWithConstants();  
6575
			break;
7238
			break;
6576
 
7239
 
6577
    case 551 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); }  //$NON-NLS-1$
7240
    case 597 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); }  //$NON-NLS-1$
6578
		    consumeEnumConstants();  
7241
		    consumeEnumConstants();  
6579
			break;
7242
			break;
6580
 
7243
 
6581
    case 552 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); }  //$NON-NLS-1$
7244
    case 598 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); }  //$NON-NLS-1$
6582
		    consumeEnumConstantHeaderName();  
7245
		    consumeEnumConstantHeaderName();  
6583
			break;
7246
			break;
6584
 
7247
 
6585
    case 553 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); }  //$NON-NLS-1$
7248
    case 599 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); }  //$NON-NLS-1$
6586
		    consumeEnumConstantHeader();  
7249
		    consumeEnumConstantHeader();  
6587
			break;
7250
			break;
6588
 
7251
 
6589
    case 554 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); }  //$NON-NLS-1$
7252
    case 600 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); }  //$NON-NLS-1$
6590
		    consumeEnumConstantWithClassBody();  
7253
		    consumeEnumConstantWithClassBody();  
6591
			break;
7254
			break;
6592
 
7255
 
6593
    case 555 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); }  //$NON-NLS-1$
7256
    case 601 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); }  //$NON-NLS-1$
6594
		    consumeEnumConstantNoClassBody();  
7257
		    consumeEnumConstantNoClassBody();  
6595
			break;
7258
			break;
6596
 
7259
 
6597
    case 556 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); }  //$NON-NLS-1$
7260
    case 602 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); }  //$NON-NLS-1$
6598
		    consumeArguments();  
7261
		    consumeArguments();  
6599
			break;
7262
			break;
6600
 
7263
 
6601
    case 557 : if (DEBUG) { System.out.println("Argumentsopt ::="); }  //$NON-NLS-1$
7264
    case 603 : if (DEBUG) { System.out.println("Argumentsopt ::="); }  //$NON-NLS-1$
6602
		    consumeEmptyArguments();  
7265
		    consumeEmptyArguments();  
6603
			break;
7266
			break;
6604
 
7267
 
6605
    case 559 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); }  //$NON-NLS-1$
7268
    case 605 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); }  //$NON-NLS-1$
6606
		    consumeEnumDeclarations();  
7269
		    consumeEnumDeclarations();  
6607
			break;
7270
			break;
6608
 
7271
 
6609
    case 560 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); }  //$NON-NLS-1$
7272
    case 606 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); }  //$NON-NLS-1$
6610
		    consumeEmptyEnumDeclarations();  
7273
		    consumeEmptyEnumDeclarations();  
6611
			break;
7274
			break;
6612
 
7275
 
6613
    case 562 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); }  //$NON-NLS-1$
7276
    case 608 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); }  //$NON-NLS-1$
6614
		    consumeEnhancedForStatement();  
7277
		    consumeEnhancedForStatement();  
6615
			break;
7278
			break;
6616
 
7279
 
6617
    case 563 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); }  //$NON-NLS-1$
7280
    case 609 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); }  //$NON-NLS-1$
6618
		    consumeEnhancedForStatement();  
7281
		    consumeEnhancedForStatement();  
6619
			break;
7282
			break;
6620
 
7283
 
6621
    case 564 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); }  //$NON-NLS-1$
7284
    case 610 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type0..."); }  //$NON-NLS-1$
6622
		    consumeEnhancedForStatementHeaderInit(false);  
7285
		    consumeEnhancedForStatementHeaderInit(false);  
6623
			break;
7286
			break;
6624
 
7287
 
6625
    case 565 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); }  //$NON-NLS-1$
7288
    case 611 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); }  //$NON-NLS-1$
6626
		    consumeEnhancedForStatementHeaderInit(true);  
7289
		    consumeEnhancedForStatementHeaderInit(true);  
6627
			break;
7290
			break;
6628
 
7291
 
6629
    case 566 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); }  //$NON-NLS-1$
7292
    case 612 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); }  //$NON-NLS-1$
6630
		    consumeEnhancedForStatementHeader();  
7293
		    consumeEnhancedForStatementHeader();  
6631
			break;
7294
			break;
6632
 
7295
 
6633
    case 567 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); }  //$NON-NLS-1$
7296
    case 613 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); }  //$NON-NLS-1$
6634
		    consumeImportDeclaration();  
7297
		    consumeImportDeclaration();  
6635
			break;
7298
			break;
6636
 
7299
 
6637
    case 568 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); }  //$NON-NLS-1$
7300
    case 614 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); }  //$NON-NLS-1$
6638
		    consumeSingleStaticImportDeclarationName();  
7301
		    consumeSingleStaticImportDeclarationName();  
6639
			break;
7302
			break;
6640
 
7303
 
6641
    case 569 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); }  //$NON-NLS-1$
7304
    case 615 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); }  //$NON-NLS-1$
6642
		    consumeImportDeclaration();  
7305
		    consumeImportDeclaration();  
6643
			break;
7306
			break;
6644
 
7307
 
6645
    case 570 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); }  //$NON-NLS-1$
7308
    case 616 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); }  //$NON-NLS-1$
6646
		    consumeStaticImportOnDemandDeclarationName();  
7309
		    consumeStaticImportOnDemandDeclarationName();  
6647
			break;
7310
			break;
6648
 
7311
 
6649
    case 571 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); }  //$NON-NLS-1$
7312
    case 617 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); }  //$NON-NLS-1$
6650
		    consumeTypeArguments();  
7313
		    consumeTypeArguments();  
6651
			break;
7314
			break;
6652
 
7315
 
6653
    case 572 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); }  //$NON-NLS-1$
7316
    case 618 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); }  //$NON-NLS-1$
6654
		    consumeOnlyTypeArguments();  
7317
		    consumeOnlyTypeArguments();  
6655
			break;
7318
			break;
6656
 
7319
 
6657
    case 574 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
7320
    case 620 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
6658
		    consumeTypeArgumentList1();  
7321
		    consumeTypeArgumentList1();  
6659
			break;
7322
			break;
6660
 
7323
 
6661
    case 576 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); }  //$NON-NLS-1$
7324
    case 622 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); }  //$NON-NLS-1$
6662
		    consumeTypeArgumentList();  
7325
		    consumeTypeArgumentList();  
6663
			break;
7326
			break;
6664
 
7327
 
6665
    case 577 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); }  //$NON-NLS-1$
7328
    case 623 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); }  //$NON-NLS-1$
6666
		    consumeTypeArgument();  
7329
		    consumeTypeArgument();  
6667
			break;
7330
			break;
6668
 
7331
 
6669
    case 581 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); }  //$NON-NLS-1$
7332
    case 627 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); }  //$NON-NLS-1$
6670
		    consumeReferenceType1();  
7333
		    consumeReferenceType1();  
6671
			break;
7334
			break;
6672
 
7335
 
6673
    case 582 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); }  //$NON-NLS-1$
7336
    case 628 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); }  //$NON-NLS-1$
6674
		    consumeTypeArgumentReferenceType1();  
7337
		    consumeTypeArgumentReferenceType1();  
6675
			break;
7338
			break;
6676
 
7339
 
6677
    case 584 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
7340
    case 629 : if (DEBUG) { System.out.println("ReferenceType1 ::= Modifiers ClassOrInterface LESS..."); }  //$NON-NLS-1$
7341
		    consumeTypeArgumentReferenceType1WithTypeAnnotations();  
7342
			break;
7343
 
7344
    case 631 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
6678
		    consumeTypeArgumentList2();  
7345
		    consumeTypeArgumentList2();  
6679
			break;
7346
			break;
6680
 
7347
 
6681
    case 587 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); }  //$NON-NLS-1$
7348
    case 634 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); }  //$NON-NLS-1$
6682
		    consumeReferenceType2();  
7349
		    consumeReferenceType2();  
6683
			break;
7350
			break;
6684
 
7351
 
6685
    case 588 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); }  //$NON-NLS-1$
7352
    case 635 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); }  //$NON-NLS-1$
6686
		    consumeTypeArgumentReferenceType2();  
7353
		    consumeTypeArgumentReferenceType2();  
6687
			break;
7354
			break;
6688
 
7355
 
6689
    case 590 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
7356
    case 636 : if (DEBUG) { System.out.println("ReferenceType2 ::= Modifiers ClassOrInterface LESS..."); }  //$NON-NLS-1$
7357
		    consumeTypeArgumentReferenceType2WithTypeAnnotations();  
7358
			break;
7359
 
7360
    case 638 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); }  //$NON-NLS-1$
6690
		    consumeTypeArgumentList3();  
7361
		    consumeTypeArgumentList3();  
6691
			break;
7362
			break;
6692
 
7363
 
6693
    case 593 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
7364
    case 641 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
6694
		    consumeReferenceType3();  
7365
		    consumeReferenceType3();  
6695
			break;
7366
			break;
6696
 
7367
 
6697
    case 594 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); }  //$NON-NLS-1$
7368
    case 642 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); }  //$NON-NLS-1$
6698
		    consumeWildcard();  
7369
		    consumeWildcard();  
6699
			break;
7370
			break;
6700
 
7371
 
6701
    case 595 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); }  //$NON-NLS-1$
7372
    case 643 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); }  //$NON-NLS-1$
6702
		    consumeWildcardWithBounds();  
7373
		    consumeWildcardWithBounds();  
6703
			break;
7374
			break;
6704
 
7375
 
6705
    case 596 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); }  //$NON-NLS-1$
7376
    case 644 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); }  //$NON-NLS-1$
6706
		    consumeWildcardBoundsExtends();  
7377
		    consumeWildcardBoundsExtends();  
6707
			break;
7378
			break;
6708
 
7379
 
6709
    case 597 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); }  //$NON-NLS-1$
7380
    case 645 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); }  //$NON-NLS-1$
6710
		    consumeWildcardBoundsSuper();  
7381
		    consumeWildcardBoundsSuper();  
6711
			break;
7382
			break;
6712
 
7383
 
6713
    case 598 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); }  //$NON-NLS-1$
7384
    case 646 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); }  //$NON-NLS-1$
6714
		    consumeWildcard1();  
7385
		    consumeWildcard1();  
6715
			break;
7386
			break;
6716
 
7387
 
6717
    case 599 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); }  //$NON-NLS-1$
7388
    case 647 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); }  //$NON-NLS-1$
6718
		    consumeWildcard1WithBounds();  
7389
		    consumeWildcard1WithBounds();  
6719
			break;
7390
			break;
6720
 
7391
 
6721
    case 600 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); }  //$NON-NLS-1$
7392
    case 648 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); }  //$NON-NLS-1$
6722
		    consumeWildcardBounds1Extends();  
7393
		    consumeWildcardBounds1Extends();  
6723
			break;
7394
			break;
6724
 
7395
 
6725
    case 601 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); }  //$NON-NLS-1$
7396
    case 649 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); }  //$NON-NLS-1$
6726
		    consumeWildcardBounds1Super();  
7397
		    consumeWildcardBounds1Super();  
6727
			break;
7398
			break;
6728
 
7399
 
6729
    case 602 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); }  //$NON-NLS-1$
7400
    case 650 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); }  //$NON-NLS-1$
6730
		    consumeWildcard2();  
7401
		    consumeWildcard2();  
6731
			break;
7402
			break;
6732
 
7403
 
6733
    case 603 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); }  //$NON-NLS-1$
7404
    case 651 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); }  //$NON-NLS-1$
6734
		    consumeWildcard2WithBounds();  
7405
		    consumeWildcard2WithBounds();  
6735
			break;
7406
			break;
6736
 
7407
 
6737
    case 604 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); }  //$NON-NLS-1$
7408
    case 652 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); }  //$NON-NLS-1$
6738
		    consumeWildcardBounds2Extends();  
7409
		    consumeWildcardBounds2Extends();  
6739
			break;
7410
			break;
6740
 
7411
 
6741
    case 605 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); }  //$NON-NLS-1$
7412
    case 653 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); }  //$NON-NLS-1$
6742
		    consumeWildcardBounds2Super();  
7413
		    consumeWildcardBounds2Super();  
6743
			break;
7414
			break;
6744
 
7415
 
6745
    case 606 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
7416
    case 654 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); }  //$NON-NLS-1$
6746
		    consumeWildcard3();  
7417
		    consumeWildcard3();  
6747
			break;
7418
			break;
6748
 
7419
 
6749
    case 607 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); }  //$NON-NLS-1$
7420
    case 655 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); }  //$NON-NLS-1$
6750
		    consumeWildcard3WithBounds();  
7421
		    consumeWildcard3WithBounds();  
6751
			break;
7422
			break;
6752
 
7423
 
6753
    case 608 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); }  //$NON-NLS-1$
7424
    case 656 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); }  //$NON-NLS-1$
6754
		    consumeWildcardBounds3Extends();  
7425
		    consumeWildcardBounds3Extends();  
6755
			break;
7426
			break;
6756
 
7427
 
6757
    case 609 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); }  //$NON-NLS-1$
7428
    case 657 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); }  //$NON-NLS-1$
6758
		    consumeWildcardBounds3Super();  
7429
		    consumeWildcardBounds3Super();  
6759
			break;
7430
			break;
6760
 
7431
 
6761
    case 610 : if (DEBUG) { System.out.println("TypeParameterHeader ::= Identifier"); }  //$NON-NLS-1$
7432
    case 658 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); }  //$NON-NLS-1$
7433
		    consumeZeroTypeAnnotations(true);  
7434
			break;
7435
 
7436
    case 659 : if (DEBUG) { System.out.println("TypeParameterHeader ::= PushZeroTypeAnnotations..."); }  //$NON-NLS-1$
6762
		    consumeTypeParameterHeader();  
7437
		    consumeTypeParameterHeader();  
6763
			break;
7438
			break;
6764
 
7439
 
6765
    case 611 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); }  //$NON-NLS-1$
7440
    case 660 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotations Identifier"); }  //$NON-NLS-1$
7441
		    consumeTypeParameterHeader();  
7442
			break;
7443
 
7444
    case 661 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); }  //$NON-NLS-1$
6766
		    consumeTypeParameters();  
7445
		    consumeTypeParameters();  
6767
			break;
7446
			break;
6768
 
7447
 
6769
    case 613 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); }  //$NON-NLS-1$
7448
    case 663 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); }  //$NON-NLS-1$
6770
		    consumeTypeParameterList();  
7449
		    consumeTypeParameterList();  
6771
			break;
7450
			break;
6772
 
7451
 
6773
    case 615 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
7452
    case 665 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
6774
		    consumeTypeParameterWithExtends();  
7453
		    consumeTypeParameterWithExtends();  
6775
			break;
7454
			break;
6776
 
7455
 
6777
    case 616 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
7456
    case 666 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
6778
		    consumeTypeParameterWithExtendsAndBounds();  
7457
		    consumeTypeParameterWithExtendsAndBounds();  
6779
			break;
7458
			break;
6780
 
7459
 
6781
    case 618 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); }  //$NON-NLS-1$
7460
    case 668 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); }  //$NON-NLS-1$
6782
		    consumeAdditionalBoundList();  
7461
		    consumeAdditionalBoundList();  
6783
			break;
7462
			break;
6784
 
7463
 
6785
    case 619 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); }  //$NON-NLS-1$
7464
    case 669 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); }  //$NON-NLS-1$
6786
		    consumeAdditionalBound();  
7465
		    consumeAdditionalBound();  
6787
			break;
7466
			break;
6788
 
7467
 
6789
    case 621 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); }  //$NON-NLS-1$
7468
    case 671 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); }  //$NON-NLS-1$
6790
		    consumeTypeParameterList1();  
7469
		    consumeTypeParameterList1();  
6791
			break;
7470
			break;
6792
 
7471
 
6793
    case 622 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); }  //$NON-NLS-1$
7472
    case 672 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); }  //$NON-NLS-1$
6794
		    consumeTypeParameter1();  
7473
		    consumeTypeParameter1();  
6795
			break;
7474
			break;
6796
 
7475
 
6797
    case 623 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
7476
    case 673 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
6798
		    consumeTypeParameter1WithExtends();  
7477
		    consumeTypeParameter1WithExtends();  
6799
			break;
7478
			break;
6800
 
7479
 
6801
    case 624 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
7480
    case 674 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); }  //$NON-NLS-1$
6802
		    consumeTypeParameter1WithExtendsAndBounds();  
7481
		    consumeTypeParameter1WithExtendsAndBounds();  
6803
			break;
7482
			break;
6804
 
7483
 
6805
    case 626 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); }  //$NON-NLS-1$
7484
    case 676 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); }  //$NON-NLS-1$
6806
		    consumeAdditionalBoundList1();  
7485
		    consumeAdditionalBoundList1();  
6807
			break;
7486
			break;
6808
 
7487
 
6809
    case 627 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); }  //$NON-NLS-1$
7488
    case 677 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); }  //$NON-NLS-1$
6810
		    consumeAdditionalBound1();  
7489
		    consumeAdditionalBound1();  
6811
			break;
7490
			break;
6812
 
7491
 
6813
    case 633 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); }  //$NON-NLS-1$
7492
    case 683 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); }  //$NON-NLS-1$
6814
		    consumeUnaryExpression(OperatorIds.PLUS);  
7493
		    consumeUnaryExpression(OperatorIds.PLUS);  
6815
			break;
7494
			break;
6816
 
7495
 
6817
    case 634 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); }  //$NON-NLS-1$
7496
    case 684 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); }  //$NON-NLS-1$
6818
		    consumeUnaryExpression(OperatorIds.MINUS);  
7497
		    consumeUnaryExpression(OperatorIds.MINUS);  
6819
			break;
7498
			break;
6820
 
7499
 
6821
    case 637 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); }  //$NON-NLS-1$
7500
    case 687 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); }  //$NON-NLS-1$
6822
		    consumeUnaryExpression(OperatorIds.TWIDDLE);  
7501
		    consumeUnaryExpression(OperatorIds.TWIDDLE);  
6823
			break;
7502
			break;
6824
 
7503
 
6825
    case 638 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); }  //$NON-NLS-1$
7504
    case 688 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); }  //$NON-NLS-1$
6826
		    consumeUnaryExpression(OperatorIds.NOT);  
7505
		    consumeUnaryExpression(OperatorIds.NOT);  
6827
			break;
7506
			break;
6828
 
7507
 
6829
    case 641 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
7508
    case 691 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
6830
		    consumeBinaryExpression(OperatorIds.MULTIPLY);  
7509
		    consumeBinaryExpression(OperatorIds.MULTIPLY);  
6831
			break;
7510
			break;
6832
 
7511
 
6833
    case 642 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); }  //$NON-NLS-1$
7512
    case 692 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); }  //$NON-NLS-1$
6834
		    consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);  
7513
		    consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);  
6835
			break;
7514
			break;
6836
 
7515
 
6837
    case 643 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
7516
    case 693 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
6838
		    consumeBinaryExpression(OperatorIds.DIVIDE);  
7517
		    consumeBinaryExpression(OperatorIds.DIVIDE);  
6839
			break;
7518
			break;
6840
 
7519
 
6841
    case 644 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); }  //$NON-NLS-1$
7520
    case 694 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); }  //$NON-NLS-1$
6842
		    consumeBinaryExpressionWithName(OperatorIds.DIVIDE);  
7521
		    consumeBinaryExpressionWithName(OperatorIds.DIVIDE);  
6843
			break;
7522
			break;
6844
 
7523
 
6845
    case 645 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
7524
    case 695 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); }  //$NON-NLS-1$
6846
		    consumeBinaryExpression(OperatorIds.REMAINDER);  
7525
		    consumeBinaryExpression(OperatorIds.REMAINDER);  
6847
			break;
7526
			break;
6848
 
7527
 
6849
    case 646 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); }  //$NON-NLS-1$
7528
    case 696 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); }  //$NON-NLS-1$
6850
		    consumeBinaryExpressionWithName(OperatorIds.REMAINDER);  
7529
		    consumeBinaryExpressionWithName(OperatorIds.REMAINDER);  
6851
			break;
7530
			break;
6852
 
7531
 
6853
    case 648 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); }  //$NON-NLS-1$
7532
    case 698 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); }  //$NON-NLS-1$
6854
		    consumeBinaryExpression(OperatorIds.PLUS);  
7533
		    consumeBinaryExpression(OperatorIds.PLUS);  
6855
			break;
7534
			break;
6856
 
7535
 
6857
    case 649 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); }  //$NON-NLS-1$
7536
    case 699 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); }  //$NON-NLS-1$
6858
		    consumeBinaryExpressionWithName(OperatorIds.PLUS);  
7537
		    consumeBinaryExpressionWithName(OperatorIds.PLUS);  
6859
			break;
7538
			break;
6860
 
7539
 
6861
    case 650 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); }  //$NON-NLS-1$
7540
    case 700 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); }  //$NON-NLS-1$
6862
		    consumeBinaryExpression(OperatorIds.MINUS);  
7541
		    consumeBinaryExpression(OperatorIds.MINUS);  
6863
			break;
7542
			break;
6864
 
7543
 
6865
    case 651 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); }  //$NON-NLS-1$
7544
    case 701 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); }  //$NON-NLS-1$
6866
		    consumeBinaryExpressionWithName(OperatorIds.MINUS);  
7545
		    consumeBinaryExpressionWithName(OperatorIds.MINUS);  
6867
			break;
7546
			break;
6868
 
7547
 
6869
    case 653 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
7548
    case 703 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
6870
		    consumeBinaryExpression(OperatorIds.LEFT_SHIFT);  
7549
		    consumeBinaryExpression(OperatorIds.LEFT_SHIFT);  
6871
			break;
7550
			break;
6872
 
7551
 
6873
    case 654 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); }  //$NON-NLS-1$
7552
    case 704 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); }  //$NON-NLS-1$
6874
		    consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);  
7553
		    consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);  
6875
			break;
7554
			break;
6876
 
7555
 
6877
    case 655 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
7556
    case 705 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
6878
		    consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);  
7557
		    consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);  
6879
			break;
7558
			break;
6880
 
7559
 
6881
    case 656 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); }  //$NON-NLS-1$
7560
    case 706 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); }  //$NON-NLS-1$
6882
		    consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);  
7561
		    consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);  
6883
			break;
7562
			break;
6884
 
7563
 
6885
    case 657 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
7564
    case 707 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); }  //$NON-NLS-1$
6886
		    consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
7565
		    consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
6887
			break;
7566
			break;
6888
 
7567
 
6889
    case 658 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); }  //$NON-NLS-1$
7568
    case 708 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); }  //$NON-NLS-1$
6890
		    consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
7569
		    consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);  
6891
			break;
7570
			break;
6892
 
7571
 
6893
    case 660 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); }  //$NON-NLS-1$
7572
    case 710 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); }  //$NON-NLS-1$
6894
		    consumeBinaryExpression(OperatorIds.LESS);  
7573
		    consumeBinaryExpression(OperatorIds.LESS);  
6895
			break;
7574
			break;
6896
 
7575
 
6897
    case 661 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); }  //$NON-NLS-1$
7576
    case 711 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); }  //$NON-NLS-1$
6898
		    consumeBinaryExpressionWithName(OperatorIds.LESS);  
7577
		    consumeBinaryExpressionWithName(OperatorIds.LESS);  
6899
			break;
7578
			break;
6900
 
7579
 
6901
    case 662 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); }  //$NON-NLS-1$
7580
    case 712 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); }  //$NON-NLS-1$
6902
		    consumeBinaryExpression(OperatorIds.GREATER);  
7581
		    consumeBinaryExpression(OperatorIds.GREATER);  
6903
			break;
7582
			break;
6904
 
7583
 
6905
    case 663 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); }  //$NON-NLS-1$
7584
    case 713 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); }  //$NON-NLS-1$
6906
		    consumeBinaryExpressionWithName(OperatorIds.GREATER);  
7585
		    consumeBinaryExpressionWithName(OperatorIds.GREATER);  
6907
			break;
7586
			break;
6908
 
7587
 
6909
    case 664 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); }  //$NON-NLS-1$
7588
    case 714 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); }  //$NON-NLS-1$
6910
		    consumeBinaryExpression(OperatorIds.LESS_EQUAL);  
7589
		    consumeBinaryExpression(OperatorIds.LESS_EQUAL);  
6911
			break;
7590
			break;
6912
 
7591
 
6913
    case 665 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); }  //$NON-NLS-1$
7592
    case 715 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); }  //$NON-NLS-1$
6914
		    consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);  
7593
		    consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);  
6915
			break;
7594
			break;
6916
 
7595
 
6917
    case 666 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); }  //$NON-NLS-1$
7596
    case 716 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); }  //$NON-NLS-1$
6918
		    consumeBinaryExpression(OperatorIds.GREATER_EQUAL);  
7597
		    consumeBinaryExpression(OperatorIds.GREATER_EQUAL);  
6919
			break;
7598
			break;
6920
 
7599
 
6921
    case 667 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); }  //$NON-NLS-1$
7600
    case 717 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); }  //$NON-NLS-1$
6922
		    consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);  
7601
		    consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);  
6923
			break;
7602
			break;
6924
 
7603
 
6925
    case 669 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); }  //$NON-NLS-1$
7604
    case 719 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); }  //$NON-NLS-1$
6926
		    consumeInstanceOfExpressionWithName();  
7605
		    consumeInstanceOfExpressionWithName();  
6927
			break;
7606
			break;
6928
 
7607
 
6929
    case 670 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); }  //$NON-NLS-1$
7608
    case 720 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); }  //$NON-NLS-1$
6930
		    consumeInstanceOfExpression();  
7609
		    consumeInstanceOfExpression();  
6931
			break;
7610
			break;
6932
 
7611
 
6933
    case 672 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
7612
    case 722 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
6934
		    consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);  
7613
		    consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);  
6935
			break;
7614
			break;
6936
 
7615
 
6937
    case 673 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); }  //$NON-NLS-1$
7616
    case 723 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); }  //$NON-NLS-1$
6938
		    consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);  
7617
		    consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);  
6939
			break;
7618
			break;
6940
 
7619
 
6941
    case 674 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
7620
    case 724 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
6942
		    consumeEqualityExpression(OperatorIds.NOT_EQUAL);  
7621
		    consumeEqualityExpression(OperatorIds.NOT_EQUAL);  
6943
			break;
7622
			break;
6944
 
7623
 
6945
    case 675 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); }  //$NON-NLS-1$
7624
    case 725 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); }  //$NON-NLS-1$
6946
		    consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);  
7625
		    consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);  
6947
			break;
7626
			break;
6948
 
7627
 
6949
    case 677 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); }  //$NON-NLS-1$
7628
    case 727 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); }  //$NON-NLS-1$
6950
		    consumeBinaryExpression(OperatorIds.AND);  
7629
		    consumeBinaryExpression(OperatorIds.AND);  
6951
			break;
7630
			break;
6952
 
7631
 
6953
    case 678 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); }  //$NON-NLS-1$
7632
    case 728 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); }  //$NON-NLS-1$
6954
		    consumeBinaryExpressionWithName(OperatorIds.AND);  
7633
		    consumeBinaryExpressionWithName(OperatorIds.AND);  
6955
			break;
7634
			break;
6956
 
7635
 
6957
    case 680 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); }  //$NON-NLS-1$
7636
    case 730 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); }  //$NON-NLS-1$
6958
		    consumeBinaryExpression(OperatorIds.XOR);  
7637
		    consumeBinaryExpression(OperatorIds.XOR);  
6959
			break;
7638
			break;
6960
 
7639
 
6961
    case 681 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); }  //$NON-NLS-1$
7640
    case 731 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); }  //$NON-NLS-1$
6962
		    consumeBinaryExpressionWithName(OperatorIds.XOR);  
7641
		    consumeBinaryExpressionWithName(OperatorIds.XOR);  
6963
			break;
7642
			break;
6964
 
7643
 
6965
    case 683 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); }  //$NON-NLS-1$
7644
    case 733 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); }  //$NON-NLS-1$
6966
		    consumeBinaryExpression(OperatorIds.OR);  
7645
		    consumeBinaryExpression(OperatorIds.OR);  
6967
			break;
7646
			break;
6968
 
7647
 
6969
    case 684 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); }  //$NON-NLS-1$
7648
    case 734 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); }  //$NON-NLS-1$
6970
		    consumeBinaryExpressionWithName(OperatorIds.OR);  
7649
		    consumeBinaryExpressionWithName(OperatorIds.OR);  
6971
			break;
7650
			break;
6972
 
7651
 
6973
    case 686 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); }  //$NON-NLS-1$
7652
    case 736 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); }  //$NON-NLS-1$
6974
		    consumeBinaryExpression(OperatorIds.AND_AND);  
7653
		    consumeBinaryExpression(OperatorIds.AND_AND);  
6975
			break;
7654
			break;
6976
 
7655
 
6977
    case 687 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); }  //$NON-NLS-1$
7656
    case 737 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); }  //$NON-NLS-1$
6978
		    consumeBinaryExpressionWithName(OperatorIds.AND_AND);  
7657
		    consumeBinaryExpressionWithName(OperatorIds.AND_AND);  
6979
			break;
7658
			break;
6980
 
7659
 
6981
    case 689 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); }  //$NON-NLS-1$
7660
    case 739 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); }  //$NON-NLS-1$
6982
		    consumeBinaryExpression(OperatorIds.OR_OR);  
7661
		    consumeBinaryExpression(OperatorIds.OR_OR);  
6983
			break;
7662
			break;
6984
 
7663
 
6985
    case 690 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); }  //$NON-NLS-1$
7664
    case 740 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); }  //$NON-NLS-1$
6986
		    consumeBinaryExpressionWithName(OperatorIds.OR_OR);  
7665
		    consumeBinaryExpressionWithName(OperatorIds.OR_OR);  
6987
			break;
7666
			break;
6988
 
7667
 
6989
    case 692 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); }  //$NON-NLS-1$
7668
    case 742 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); }  //$NON-NLS-1$
6990
		    consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;  
7669
		    consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;  
6991
			break;
7670
			break;
6992
 
7671
 
6993
    case 693 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); }  //$NON-NLS-1$
7672
    case 743 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); }  //$NON-NLS-1$
6994
		    consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;  
7673
		    consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;  
6995
			break;
7674
			break;
6996
 
7675
 
6997
    case 697 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); }  //$NON-NLS-1$
7676
    case 747 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); }  //$NON-NLS-1$
6998
		    consumeAnnotationTypeDeclarationHeaderName() ;  
7677
		    consumeAnnotationTypeDeclarationHeaderName() ;  
6999
			break;
7678
			break;
7000
 
7679
 
7001
    case 698 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); }  //$NON-NLS-1$
7680
    case 748 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); }  //$NON-NLS-1$
7002
		    consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;  
7681
		    consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;  
7003
			break;
7682
			break;
7004
 
7683
 
7005
    case 699 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); }  //$NON-NLS-1$
7684
    case 749 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); }  //$NON-NLS-1$
7006
		    consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;  
7685
		    consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;  
7007
			break;
7686
			break;
7008
 
7687
 
7009
    case 700 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); }  //$NON-NLS-1$
7688
    case 750 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); }  //$NON-NLS-1$
7010
		    consumeAnnotationTypeDeclarationHeaderName() ;  
7689
		    consumeAnnotationTypeDeclarationHeaderName() ;  
7011
			break;
7690
			break;
7012
 
7691
 
7013
    case 701 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); }  //$NON-NLS-1$
7692
    case 751 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); }  //$NON-NLS-1$
7014
		    consumeAnnotationTypeDeclarationHeader() ;  
7693
		    consumeAnnotationTypeDeclarationHeader() ;  
7015
			break;
7694
			break;
7016
 
7695
 
7017
    case 702 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); }  //$NON-NLS-1$
7696
    case 752 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); }  //$NON-NLS-1$
7018
		    consumeAnnotationTypeDeclaration() ;  
7697
		    consumeAnnotationTypeDeclaration() ;  
7019
			break;
7698
			break;
7020
 
7699
 
7021
    case 704 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); }  //$NON-NLS-1$
7700
    case 754 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); }  //$NON-NLS-1$
7022
		    consumeEmptyAnnotationTypeMemberDeclarationsopt() ;  
7701
		    consumeEmptyAnnotationTypeMemberDeclarationsopt() ;  
7023
			break;
7702
			break;
7024
 
7703
 
7025
    case 705 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
7704
    case 755 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); }  //$NON-NLS-1$
7026
		    consumeAnnotationTypeMemberDeclarationsopt() ;  
7705
		    consumeAnnotationTypeMemberDeclarationsopt() ;  
7027
			break;
7706
			break;
7028
 
7707
 
7029
    case 707 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); }  //$NON-NLS-1$
7708
    case 757 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); }  //$NON-NLS-1$
7030
		    consumeAnnotationTypeMemberDeclarations() ;  
7709
		    consumeAnnotationTypeMemberDeclarations() ;  
7031
			break;
7710
			break;
7032
 
7711
 
7033
    case 708 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); }  //$NON-NLS-1$
7712
    case 758 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); }  //$NON-NLS-1$
7034
		    consumeMethodHeaderNameWithTypeParameters(true);  
7713
		    consumeMethodHeaderNameWithTypeParameters(true);  
7035
			break;
7714
			break;
7036
 
7715
 
7037
    case 709 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); }  //$NON-NLS-1$
7716
    case 759 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type0..."); }  //$NON-NLS-1$
7038
		    consumeMethodHeaderName(true);  
7717
		    consumeMethodHeaderName(true);  
7039
			break;
7718
			break;
7040
 
7719
 
7041
    case 710 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); }  //$NON-NLS-1$
7720
    case 760 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); }  //$NON-NLS-1$
7042
		    consumeEmptyMethodHeaderDefaultValue() ;  
7721
		    consumeEmptyMethodHeaderDefaultValue() ;  
7043
			break;
7722
			break;
7044
 
7723
 
7045
    case 711 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); }  //$NON-NLS-1$
7724
    case 761 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); }  //$NON-NLS-1$
7046
		    consumeMethodHeaderDefaultValue();  
7725
		    consumeMethodHeaderDefaultValue();  
7047
			break;
7726
			break;
7048
 
7727
 
7049
    case 712 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); }  //$NON-NLS-1$
7728
    case 762 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); }  //$NON-NLS-1$
7050
		    consumeMethodHeader();  
7729
		    consumeMethodHeader();  
7051
			break;
7730
			break;
7052
 
7731
 
7053
    case 713 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); }  //$NON-NLS-1$
7732
    case 763 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); }  //$NON-NLS-1$
7054
		    consumeAnnotationTypeMemberDeclaration() ;  
7733
		    consumeAnnotationTypeMemberDeclaration() ;  
7055
			break;
7734
			break;
7056
 
7735
 
7057
    case 721 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); }  //$NON-NLS-1$
7736
    case 771 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); }  //$NON-NLS-1$
7058
		    consumeAnnotationName() ;  
7737
		    consumeAnnotationName() ;  
7059
			break;
7738
			break;
7060
 
7739
 
7061
    case 722 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); }  //$NON-NLS-1$
7740
    case 772 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); }  //$NON-NLS-1$
7062
		    consumeNormalAnnotation() ;  
7741
		    consumeNormalAnnotation() ;  
7063
			break;
7742
			break;
7064
 
7743
 
7065
    case 723 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); }  //$NON-NLS-1$
7744
    case 773 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); }  //$NON-NLS-1$
7066
		    consumeEmptyMemberValuePairsopt() ;  
7745
		    consumeEmptyMemberValuePairsopt() ;  
7067
			break;
7746
			break;
7068
 
7747
 
7069
    case 726 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); }  //$NON-NLS-1$
7748
    case 776 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); }  //$NON-NLS-1$
7070
		    consumeMemberValuePairs() ;  
7749
		    consumeMemberValuePairs() ;  
7071
			break;
7750
			break;
7072
 
7751
 
7073
    case 727 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); }  //$NON-NLS-1$
7752
    case 777 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); }  //$NON-NLS-1$
7074
		    consumeMemberValuePair() ;  
7753
		    consumeMemberValuePair() ;  
7075
			break;
7754
			break;
7076
 
7755
 
7077
    case 728 : if (DEBUG) { System.out.println("EnterMemberValue ::="); }  //$NON-NLS-1$
7756
    case 778 : if (DEBUG) { System.out.println("EnterMemberValue ::="); }  //$NON-NLS-1$
7078
		    consumeEnterMemberValue() ;  
7757
		    consumeEnterMemberValue() ;  
7079
			break;
7758
			break;
7080
 
7759
 
7081
    case 729 : if (DEBUG) { System.out.println("ExitMemberValue ::="); }  //$NON-NLS-1$
7760
    case 779 : if (DEBUG) { System.out.println("ExitMemberValue ::="); }  //$NON-NLS-1$
7082
		    consumeExitMemberValue() ;  
7761
		    consumeExitMemberValue() ;  
7083
			break;
7762
			break;
7084
 
7763
 
7085
    case 731 : if (DEBUG) { System.out.println("MemberValue ::= Name"); }  //$NON-NLS-1$
7764
    case 781 : if (DEBUG) { System.out.println("MemberValue ::= Name"); }  //$NON-NLS-1$
7086
		    consumeMemberValueAsName() ;  
7765
		    consumeMemberValueAsName() ;  
7087
			break;
7766
			break;
7088
 
7767
 
7089
    case 734 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7768
    case 784 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7090
		    consumeMemberValueArrayInitializer() ;  
7769
		    consumeMemberValueArrayInitializer() ;  
7091
			break;
7770
			break;
7092
 
7771
 
7093
    case 735 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7772
    case 785 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7094
		    consumeMemberValueArrayInitializer() ;  
7773
		    consumeMemberValueArrayInitializer() ;  
7095
			break;
7774
			break;
7096
 
7775
 
7097
    case 736 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7776
    case 786 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7098
		    consumeEmptyMemberValueArrayInitializer() ;  
7777
		    consumeEmptyMemberValueArrayInitializer() ;  
7099
			break;
7778
			break;
7100
 
7779
 
7101
    case 737 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7780
    case 787 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); }  //$NON-NLS-1$
7102
		    consumeEmptyMemberValueArrayInitializer() ;  
7781
		    consumeEmptyMemberValueArrayInitializer() ;  
7103
			break;
7782
			break;
7104
 
7783
 
7105
    case 738 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); }  //$NON-NLS-1$
7784
    case 788 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); }  //$NON-NLS-1$
7106
		    consumeEnterMemberValueArrayInitializer() ;  
7785
		    consumeEnterMemberValueArrayInitializer() ;  
7107
			break;
7786
			break;
7108
 
7787
 
7109
    case 740 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); }  //$NON-NLS-1$
7788
    case 790 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); }  //$NON-NLS-1$
7110
		    consumeMemberValues() ;  
7789
		    consumeMemberValues() ;  
7111
			break;
7790
			break;
7112
 
7791
 
7113
    case 741 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); }  //$NON-NLS-1$
7792
    case 791 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); }  //$NON-NLS-1$
7114
		    consumeMarkerAnnotation() ;  
7793
		    consumeMarkerAnnotation() ;  
7115
			break;
7794
			break;
7116
 
7795
 
7117
    case 742 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); }  //$NON-NLS-1$
7796
    case 792 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); }  //$NON-NLS-1$
7118
		    consumeSingleMemberAnnotationMemberValue() ;  
7797
		    consumeSingleMemberAnnotationMemberValue() ;  
7119
			break;
7798
			break;
7120
 
7799
 
7121
    case 743 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); }  //$NON-NLS-1$
7800
    case 793 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); }  //$NON-NLS-1$
7122
		    consumeSingleMemberAnnotation() ;  
7801
		    consumeSingleMemberAnnotation() ;  
7123
			break;
7802
			break;
7124
 
7803
 
7125
    case 744 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); }  //$NON-NLS-1$
7804
    case 794 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); }  //$NON-NLS-1$
7126
		    consumeRecoveryMethodHeaderNameWithTypeParameters();  
7805
		    consumeRecoveryMethodHeaderNameWithTypeParameters();  
7127
			break;
7806
			break;
7128
 
7807
 
7129
    case 745 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); }  //$NON-NLS-1$
7808
    case 795 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type0..."); }  //$NON-NLS-1$
7130
		    consumeRecoveryMethodHeaderName();  
7809
		    consumeRecoveryMethodHeaderName();  
7131
			break;
7810
			break;
7132
 
7811
 
7133
    case 746 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); }  //$NON-NLS-1$
7812
    case 796 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); }  //$NON-NLS-1$
7134
		    consumeMethodHeader();  
7813
		    consumeMethodHeader();  
7135
			break;
7814
			break;
7136
 
7815
 
7137
    case 747 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); }  //$NON-NLS-1$
7816
    case 797 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); }  //$NON-NLS-1$
7138
		    consumeMethodHeader();  
7817
		    consumeMethodHeader();  
7139
			break;
7818
			break;
7140
 
7819
 
7141
	}
7820
	}
7821
}
7822
protected void consumeExplicitThisParameter() {
7823
	// VariableDeclaratorIdOrThis ::= 'this'
7824
7825
	int stackLength = this.identifierStack.length;
7826
	if (++this.identifierPtr >= stackLength) {
7827
		System.arraycopy(
7828
				this.identifierStack, 0,
7829
				this.identifierStack = new char[stackLength + 20][], 0,
7830
				stackLength);
7831
		System.arraycopy(
7832
				this.identifierPositionStack, 0,
7833
				this.identifierPositionStack = new long[stackLength + 20], 0,
7834
				stackLength);
7835
	}
7836
	this.identifierStack[this.identifierPtr] = ConstantPool.This;
7837
	int thisStart = this.intStack[this.intPtr--];
7838
	this.identifierPositionStack[this.identifierPtr] =
7839
			(((long) thisStart << 32)) + (thisStart + 3);
7840
7841
	stackLength = this.identifierLengthStack.length;
7842
	if (++this.identifierLengthPtr >= stackLength) {
7843
		System.arraycopy(
7844
				this.identifierLengthStack, 0,
7845
				this.identifierLengthStack = new int[stackLength + 10], 0,
7846
				stackLength);
7847
	}
7848
	this.identifierLengthStack[this.identifierLengthPtr] = 1;
7849
	pushOnIntStack(0);  // extended dimensions..	
7142
}
7850
}
7143
protected void consumeLambdaExpression() {
7851
protected void consumeLambdaExpression() {
7144
	
7852
	
Lines 8287-8296 Link Here
8287
	pushOnGenericsStack(getTypeReference(0));
8995
	pushOnGenericsStack(getTypeReference(0));
8288
	this.intPtr--;
8996
	this.intPtr--;
8289
}
8997
}
8998
protected void consumeTypeArgumentReferenceType1WithTypeAnnotations() {
8999
	concatGenericsLists();
9000
	TypeReference typeReference = getUnannotatedTypeReference(0);
9001
	// copy from expression stack to type annotation stack
9002
	int length;
9003
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
9004
		System.arraycopy(
9005
				this.expressionStack,
9006
				(this.expressionPtr -= length) + 1,
9007
				typeReference.annotations = new Annotation[length],
9008
				0,
9009
				length);
9010
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
9011
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
9012
			typeReferenceSourceStart = this.modifiersSourceStart;
9013
		}
9014
		typeReference.bits |= ASTNode.HasTypeAnnotations;
9015
		typeReference.sourceStart = typeReferenceSourceStart;
9016
	}
9017
	pushOnGenericsStack(typeReference);
9018
	// remove the 0 pushed by ZeroTypeAnnotation
9019
	this.typeAnnotationLengthPtr--;
9020
	this.intPtr--;
9021
	if (this.modifiers != ClassFileConstants.AccDefault) {
9022
		problemReporter().invalidLocationForModifiers(typeReference);
9023
	}
9024
	resetModifiers();
9025
}
8290
protected void consumeTypeArgumentReferenceType2() {
9026
protected void consumeTypeArgumentReferenceType2() {
8291
	concatGenericsLists();
9027
	concatGenericsLists();
8292
	pushOnGenericsStack(getTypeReference(0));
9028
	pushOnGenericsStack(getTypeReference(0));
8293
	this.intPtr--;
9029
	this.intPtr--;
9030
}
9031
protected void consumeTypeArgumentReferenceType2WithTypeAnnotations() {
9032
	concatGenericsLists();
9033
	TypeReference typeReference = getUnannotatedTypeReference(0);
9034
	// copy from expression stack to type annotation stack
9035
	int length;
9036
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
9037
		System.arraycopy(
9038
				this.expressionStack,
9039
				(this.expressionPtr -= length) + 1,
9040
				typeReference.annotations = new Annotation[length],
9041
				0,
9042
				length);
9043
		int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
9044
		if (this.modifiersSourceStart < typeReferenceSourceStart) {
9045
			typeReferenceSourceStart = this.modifiersSourceStart;
9046
		}
9047
		typeReference.bits |= ASTNode.HasTypeAnnotations;
9048
		typeReference.sourceStart = typeReferenceSourceStart;
9049
	}
9050
	pushOnGenericsStack(typeReference);
9051
	this.intPtr--;
9052
	if (this.modifiers != ClassFileConstants.AccDefault) {
9053
		problemReporter().invalidLocationForModifiers(typeReference);
9054
	}
9055
	resetModifiers();
8294
}
9056
}
8295
protected void consumeTypeArguments() {
9057
protected void consumeTypeArguments() {
8296
	concatGenericsLists();
9058
	concatGenericsLists();
Lines 8380-8385 Link Here
8380
	typeParameter.declarationSourceEnd = superType.sourceEnd;
9142
	typeParameter.declarationSourceEnd = superType.sourceEnd;
8381
	typeParameter.type = superType;
9143
	typeParameter.type = superType;
8382
	superType.bits |= ASTNode.IsSuperType;
9144
	superType.bits |= ASTNode.IsSuperType;
9145
	typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
8383
	this.genericsStack[this.genericsPtr] = typeParameter;
9146
	this.genericsStack[this.genericsPtr] = typeParameter;
8384
}
9147
}
8385
protected void consumeTypeParameter1WithExtendsAndBounds() {
9148
protected void consumeTypeParameter1WithExtendsAndBounds() {
Lines 8392-8406 Link Here
8392
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
9155
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
8393
	typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
9156
	typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
8394
	typeParameter.type = superType;
9157
	typeParameter.type = superType;
9158
	typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
8395
	superType.bits |= ASTNode.IsSuperType;
9159
	superType.bits |= ASTNode.IsSuperType;
8396
	typeParameter.bounds = bounds;
9160
	typeParameter.bounds = bounds;
8397
	for (int i = 0, max = bounds.length; i < max; i++) {
9161
	for (int i = 0, max = bounds.length; i < max; i++) {
8398
		bounds[i].bits |= ASTNode.IsSuperType;
9162
		TypeReference bound = bounds[i];
9163
		bound.bits |= ASTNode.IsSuperType;
9164
		typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations);
8399
	}
9165
	}
8400
}
9166
}
8401
protected void consumeTypeParameterHeader() {
9167
protected void consumeTypeParameterHeader() {
8402
	//TypeParameterHeader ::= Identifier
9168
	//TypeParameterHeader ::= Identifier
8403
	TypeParameter typeParameter = new TypeParameter();
9169
	TypeParameter typeParameter = new TypeParameter();
9170
	int length;
9171
	if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
9172
		System.arraycopy(
9173
				this.typeAnnotationStack,
9174
				(this.typeAnnotationPtr -= length) + 1,
9175
				typeParameter.annotations = new Annotation[length],
9176
				0,
9177
				length);
9178
		typeParameter.bits |= ASTNode.HasTypeAnnotations;
9179
	}
8404
	long pos = this.identifierPositionStack[this.identifierPtr];
9180
	long pos = this.identifierPositionStack[this.identifierPtr];
8405
	final int end = (int) pos;
9181
	final int end = (int) pos;
8406
	typeParameter.declarationSourceEnd = end;
9182
	typeParameter.declarationSourceEnd = end;
Lines 8452-8457 Link Here
8452
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
9228
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
8453
	typeParameter.declarationSourceEnd = superType.sourceEnd;
9229
	typeParameter.declarationSourceEnd = superType.sourceEnd;
8454
	typeParameter.type = superType;
9230
	typeParameter.type = superType;
9231
	typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
8455
	superType.bits |= ASTNode.IsSuperType;
9232
	superType.bits |= ASTNode.IsSuperType;
8456
}
9233
}
8457
protected void consumeTypeParameterWithExtendsAndBounds() {
9234
protected void consumeTypeParameterWithExtendsAndBounds() {
Lines 8463-8473 Link Here
8463
	TypeReference superType = getTypeReference(this.intStack[this.intPtr--]);
9240
	TypeReference superType = getTypeReference(this.intStack[this.intPtr--]);
8464
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
9241
	TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
8465
	typeParameter.type = superType;
9242
	typeParameter.type = superType;
9243
	typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
8466
	superType.bits |= ASTNode.IsSuperType;
9244
	superType.bits |= ASTNode.IsSuperType;
8467
	typeParameter.bounds = bounds;
9245
	typeParameter.bounds = bounds;
8468
	typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
9246
	typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
8469
	for (int i = 0, max = bounds.length; i < max; i++) {
9247
	for (int i = 0, max = bounds.length; i < max; i++) {
8470
		bounds[i].bits |= ASTNode.IsSuperType;
9248
		TypeReference bound = bounds[i];
9249
		bound.bits |= ASTNode.IsSuperType;
9250
		typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations);
8471
	}
9251
	}
8472
}
9252
}
8473
protected void consumeUnaryExpression(int op) {
9253
protected void consumeUnaryExpression(int op) {
Lines 8666-8671 Link Here
8666
	// Nothing to do
9446
	// Nothing to do
8667
	// The wildcard is created by the consumeWildcardBoundsExtends or by consumeWildcardBoundsSuper
9447
	// The wildcard is created by the consumeWildcardBoundsExtends or by consumeWildcardBoundsSuper
8668
}
9448
}
9449
8669
/**
9450
/**
8670
 * Given the current comment stack, answer whether some comment is available in a certain exclusive range
9451
 * Given the current comment stack, answer whether some comment is available in a certain exclusive range
8671
 *
9452
 *
Lines 8705-8716 Link Here
8705
	m.explicitDeclarations = c.explicitDeclarations;
9486
	m.explicitDeclarations = c.explicitDeclarations;
8706
	m.returnType = null;
9487
	m.returnType = null;
8707
	m.javadoc = c.javadoc;
9488
	m.javadoc = c.javadoc;
9489
	m.bits = c.bits;
8708
	return m;
9490
	return m;
8709
}
9491
}
8710
9492
8711
protected TypeReference copyDims(TypeReference typeRef, int dim) {
9493
protected TypeReference copyDims(TypeReference typeRef, int dim) {
8712
	return typeRef.copyDims(dim);
9494
	return typeRef.copyDims(dim);
8713
}
9495
}
9496
9497
protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation[][]annotationsOnDimensions) {
9498
	return typeRef.copyDims(dim, annotationsOnDimensions);
9499
}
9500
8714
protected FieldDeclaration createFieldDeclaration(char[] fieldDeclarationName, int sourceStart, int sourceEnd) {
9501
protected FieldDeclaration createFieldDeclaration(char[] fieldDeclarationName, int sourceStart, int sourceEnd) {
8715
	return new FieldDeclaration(fieldDeclarationName, sourceStart, sourceEnd);
9502
	return new FieldDeclaration(fieldDeclarationName, sourceStart, sourceEnd);
8716
}
9503
}
Lines 9192-9204 Link Here
9192
	return exp;
9979
	return exp;
9193
}
9980
}
9194
protected TypeReference getTypeReference(int dim) {
9981
protected TypeReference getTypeReference(int dim) {
9982
	TypeReference ref = getUnannotatedTypeReference(dim);
9983
	int length;
9984
	if (this.typeAnnotationLengthPtr >= 0
9985
			&& (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
9986
		//	if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
9987
9988
		System.arraycopy(
9989
				this.typeAnnotationStack,
9990
				(this.typeAnnotationPtr -= length) + 1,
9991
				ref.annotations = new Annotation[length],
9992
				0,
9993
				length);
9994
		ref.sourceStart = ref.annotations[0].sourceStart;
9995
		ref.bits |= ASTNode.HasTypeAnnotations;
9996
	}
9997
	return ref;
9998
	}
9999
protected TypeReference getUnannotatedTypeReference(int dim) {
9195
	/* build a Reference on a variable that may be qualified or not
10000
	/* build a Reference on a variable that may be qualified or not
9196
	 This variable is a type reference and dim will be its dimensions*/
10001
	 This variable is a type reference and dim will be its dimensions*/
9197
10002
9198
	TypeReference ref;
10003
	TypeReference ref;
10004
	Annotation [][] annotationsOnDimensions = null;
9199
	int length = this.identifierLengthStack[this.identifierLengthPtr--];
10005
	int length = this.identifierLengthStack[this.identifierLengthPtr--];
9200
	if (length < 0) { //flag for precompiled type reference on base types
10006
	if (length < 0) { //flag for precompiled type reference on base types
9201
		ref = TypeReference.baseTypeReference(-length, dim);
10007
		if (dim > 0) {
10008
			annotationsOnDimensions = getAnnotationsOnDimensions(dim);
10009
		}
10010
		ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions);
9202
		ref.sourceStart = this.intStack[this.intPtr--];
10011
		ref.sourceStart = this.intStack[this.intPtr--];
9203
		if (dim == 0) {
10012
		if (dim == 0) {
9204
			ref.sourceEnd = this.intStack[this.intPtr--];
10013
			ref.sourceEnd = this.intStack[this.intPtr--];
Lines 9220-9231 Link Here
9220
						this.identifierStack[this.identifierPtr],
10029
						this.identifierStack[this.identifierPtr],
9221
						this.identifierPositionStack[this.identifierPtr--]);
10030
						this.identifierPositionStack[this.identifierPtr--]);
9222
			} else {
10031
			} else {
10032
				annotationsOnDimensions = getAnnotationsOnDimensions(dim);
9223
				ref =
10033
				ref =
9224
					new ArrayTypeReference(
10034
					new ArrayTypeReference(
9225
						this.identifierStack[this.identifierPtr],
10035
						this.identifierStack[this.identifierPtr],
9226
						dim,
10036
						dim,
10037
						annotationsOnDimensions,
9227
						this.identifierPositionStack[this.identifierPtr--]);
10038
						this.identifierPositionStack[this.identifierPtr--]);
9228
				ref.sourceEnd = this.endPosition;
10039
				ref.sourceEnd = this.endPosition;
10040
				if (annotationsOnDimensions != null) {
10041
					ref.bits |= ASTNode.HasTypeAnnotations;
10042
				}
9229
			}
10043
			}
9230
		} else {
10044
		} else {
9231
			this.genericsLengthPtr--;
10045
			this.genericsLengthPtr--;
Lines 9243-9256 Link Here
9243
			if (dim == 0) {
10057
			if (dim == 0) {
9244
				ref = new QualifiedTypeReference(tokens, positions);
10058
				ref = new QualifiedTypeReference(tokens, positions);
9245
			} else {
10059
			} else {
9246
				ref = new ArrayQualifiedTypeReference(tokens, dim, positions);
10060
				annotationsOnDimensions = getAnnotationsOnDimensions(dim);
10061
				ref = new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions);
9247
				ref.sourceEnd = this.endPosition;
10062
				ref.sourceEnd = this.endPosition;
10063
				ref.bits |= ASTNode.HasTypeAnnotations;
9248
			}
10064
			}
9249
		}
10065
		}
9250
	}
10066
	}
9251
	return ref;
10067
	return ref;
9252
}
10068
}
9253
protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLength, int numberOfIdentifiers) {
10069
protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLength, int numberOfIdentifiers) {
10070
	Annotation[][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
9254
	if (identifierLength == 1 && numberOfIdentifiers == 1) {
10071
	if (identifierLength == 1 && numberOfIdentifiers == 1) {
9255
		int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
10072
		int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
9256
		TypeReference[] typeArguments = null;
10073
		TypeReference[] typeArguments = null;
Lines 9261-9267 Link Here
9261
			this.genericsPtr -= currentTypeArgumentsLength;
10078
			this.genericsPtr -= currentTypeArgumentsLength;
9262
			System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments, 0, currentTypeArgumentsLength);
10079
			System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments, 0, currentTypeArgumentsLength);
9263
		}
10080
		}
9264
		ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, this.identifierPositionStack[this.identifierPtr--]);
10081
		ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, annotationsOnDimensions, this.identifierPositionStack[this.identifierPtr--]);
9265
		if (dim != 0) {
10082
		if (dim != 0) {
9266
			parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition;
10083
			parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition;
9267
		}
10084
		}
Lines 9303-9309 Link Here
9303
				currentIdentifiersLength = this.identifierLengthStack[this.identifierLengthPtr--];
10120
				currentIdentifiersLength = this.identifierLengthStack[this.identifierLengthPtr--];
9304
			}
10121
			}
9305
		}
10122
		}
9306
		ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions);
10123
		ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions);
9307
		if (dim != 0) {
10124
		if (dim != 0) {
9308
			parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition;
10125
			parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition;
9309
		}
10126
		}
Lines 9535-9540 Link Here
9535
	this.astLengthPtr = -1;
10352
	this.astLengthPtr = -1;
9536
	this.expressionPtr = -1;
10353
	this.expressionPtr = -1;
9537
	this.expressionLengthPtr = -1;
10354
	this.expressionLengthPtr = -1;
10355
	this.unattachedAnnotationPtr = -1;
10356
	this.typeAnnotationLengthPtr = -1;
10357
	this.typeAnnotationPtr = -1;
9538
	this.identifierPtr = -1;
10358
	this.identifierPtr = -1;
9539
	this.identifierLengthPtr	= -1;
10359
	this.identifierLengthPtr	= -1;
9540
	this.intPtr = -1;
10360
	this.intPtr = -1;
Lines 10706-10711 Link Here
10706
	}
11526
	}
10707
	this.identifierLengthStack[this.identifierLengthPtr] = 1;
11527
	this.identifierLengthStack[this.identifierLengthPtr] = 1;
10708
}
11528
}
11529
10709
protected void pushIdentifier(int flag) {
11530
protected void pushIdentifier(int flag) {
10710
	/*push a special flag on the stack :
11531
	/*push a special flag on the stack :
10711
	-zero stands for optional Name
11532
	-zero stands for optional Name
Lines 10754-10759 Link Here
10754
			stackLength);
11575
			stackLength);
10755
	}
11576
	}
10756
	this.astLengthStack[this.astLengthPtr] = 1;
11577
	this.astLengthStack[this.astLengthPtr] = 1;
11578
}
11579
protected void pushOnTypeAnnotationStack(Annotation annotation) {
11580
11581
	int stackLength = this.typeAnnotationStack.length;
11582
	if (++this.typeAnnotationPtr >= stackLength) {
11583
		System.arraycopy(
11584
			this.typeAnnotationStack, 0,
11585
			this.typeAnnotationStack = new Annotation[stackLength + TypeAnnotationStackIncrement], 0,
11586
			stackLength);
11587
	}
11588
	this.typeAnnotationStack[this.typeAnnotationPtr] = annotation;
11589
11590
	stackLength = this.typeAnnotationLengthStack.length;
11591
	if (++this.typeAnnotationLengthPtr >= stackLength) {
11592
		System.arraycopy(
11593
			this.typeAnnotationLengthStack, 0,
11594
			this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0,
11595
			stackLength);
11596
	}
11597
	this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = 1;
11598
}
11599
protected void pushOnTypeAnnotationLengthStack(int pos) {
11600
11601
	int stackLength = this.typeAnnotationLengthStack.length;
11602
	if (++this.typeAnnotationLengthPtr >= stackLength) {
11603
		System.arraycopy(
11604
			this.typeAnnotationLengthStack, 0,
11605
			this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0,
11606
			stackLength);
11607
	}
11608
	this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = pos;
10757
}
11609
}
10758
protected void pushOnExpressionStack(Expression expr) {
11610
protected void pushOnExpressionStack(Expression expr) {
10759
11611
Lines 11178-11183 Link Here
11178
	this.astLengthPtr = -1;
12030
	this.astLengthPtr = -1;
11179
	this.expressionPtr = -1;
12031
	this.expressionPtr = -1;
11180
	this.expressionLengthPtr = -1;
12032
	this.expressionLengthPtr = -1;
12033
	this.unattachedAnnotationPtr = -1;
12034
	this.typeAnnotationLengthPtr = -1;
12035
	this.typeAnnotationPtr = -1;
11181
	this.identifierPtr = -1;
12036
	this.identifierPtr = -1;
11182
	this.identifierLengthPtr	= -1;
12037
	this.identifierLengthPtr	= -1;
11183
	this.intPtr = -1;
12038
	this.intPtr = -1;
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java (-11 / +15 lines)
Lines 9-14 Link Here
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
11
 * 
12
 * This is an implementation of an early-draft specification developed under the Java
13
 * Community Process (JCP) and is made available for testing and evaluation purposes
14
 * only. The code is not compatible with any specification of the JCP.
15
 * 
12
 * Contributors:
16
 * Contributors:
13
 *     IBM Corporation - initial API and implementation
17
 *     IBM Corporation - initial API and implementation
14
 *******************************************************************************/
18
 *******************************************************************************/
Lines 19-39 Link Here
19
public interface ParserBasicInformation {
23
public interface ParserBasicInformation {
20
24
21
	int ERROR_SYMBOL = 115,
25
	int ERROR_SYMBOL = 115,
22
		MAX_NAME_LENGTH = 41,
26
		MAX_NAME_LENGTH = 50,
23
		NUM_STATES = 1033,
27
		NUM_STATES = 1095,
24
28
25
		NT_OFFSET = 115,
29
		NT_OFFSET = 115,
26
		SCOPE_UBOUND = 144,
30
		SCOPE_UBOUND = 240,
27
		SCOPE_SIZE = 145,
31
		SCOPE_SIZE = 241,
28
		LA_STATE_OFFSET = 13788,
32
		LA_STATE_OFFSET = 16594,
29
		MAX_LA = 1,
33
		MAX_LA = 1,
30
		NUM_RULES = 747,
34
		NUM_RULES = 797,
31
		NUM_TERMINALS = 115,
35
		NUM_TERMINALS = 115,
32
		NUM_NON_TERMINALS = 335,
36
		NUM_NON_TERMINALS = 357,
33
		NUM_SYMBOLS = 450,
37
		NUM_SYMBOLS = 472,
34
		START_STATE = 939,
38
		START_STATE = 864,
35
		EOFT_SYMBOL = 67,
39
		EOFT_SYMBOL = 67,
36
		EOLT_SYMBOL = 67,
40
		EOLT_SYMBOL = 67,
37
		ACCEPT_ACTION = 13787,
41
		ACCEPT_ACTION = 16593,
38
		ERROR_ACTION = 13788;
42
		ERROR_ACTION = 16594;
39
}
43
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java (-88 / +92 lines)
Lines 10-15 Link Here
10
 * only. The code is not compatible with any specification of the JCP.
10
 * only. The code is not compatible with any specification of the JCP.
11
 *
11
 *
12
 *
12
 *
13
 * This is an implementation of an early-draft specification developed under the Java
14
 * Community Process (JCP) and is made available for testing and evaluation purposes
15
 * only. The code is not compatible with any specification of the JCP.
16
 * 
13
 * Contributors:
17
 * Contributors:
14
 *     IBM Corporation - initial API and implementation
18
 *     IBM Corporation - initial API and implementation
15
 *******************************************************************************/
19
 *******************************************************************************/
Lines 39-156 Link Here
39
		TokenNameCOMMENT_BLOCK = 1002,
43
		TokenNameCOMMENT_BLOCK = 1002,
40
		TokenNameCOMMENT_JAVADOC = 1003;
44
		TokenNameCOMMENT_JAVADOC = 1003;
41
45
42
	int TokenNameIdentifier = 22,
46
	int TokenNameIdentifier = 19,
43
		TokenNameabstract = 58,
47
		TokenNameabstract = 46,
44
		TokenNameassert = 89,
48
		TokenNameassert = 79,
45
		TokenNameboolean = 33,
49
		TokenNameboolean = 32,
46
		TokenNamebreak = 90,
50
		TokenNamebreak = 80,
47
		TokenNamebyte = 34,
51
		TokenNamebyte = 33,
48
		TokenNamecase = 106,
52
		TokenNamecase = 107,
49
		TokenNamecatch = 104,
53
		TokenNamecatch = 105,
50
		TokenNamechar = 35,
54
		TokenNamechar = 34,
51
		TokenNameclass = 76,
55
		TokenNameclass = 77,
52
		TokenNamecontinue = 91,
56
		TokenNamecontinue = 81,
53
		TokenNameconst = 113,
57
		TokenNameconst = 113,
54
		TokenNamedefault = 100,
58
		TokenNamedefault = 90,
55
		TokenNamedo = 92,
59
		TokenNamedo = 82,
56
		TokenNamedouble = 36,
60
		TokenNamedouble = 35,
57
		TokenNameelse = 108,
61
		TokenNameelse = 109,
58
		TokenNameenum = 102,
62
		TokenNameenum = 103,
59
		TokenNameextends = 103,
63
		TokenNameextends = 104,
60
		TokenNamefalse = 46,
64
		TokenNamefalse = 57,
61
		TokenNamefinal = 59,
65
		TokenNamefinal = 47,
62
		TokenNamefinally = 107,
66
		TokenNamefinally = 108,
63
		TokenNamefloat = 37,
67
		TokenNamefloat = 36,
64
		TokenNamefor = 93,
68
		TokenNamefor = 83,
65
		TokenNamegoto = 114,
69
		TokenNamegoto = 114,
66
		TokenNameif = 94,
70
		TokenNameif = 84,
67
		TokenNameimplements = 111,
71
		TokenNameimplements = 112,
68
		TokenNameimport = 105,
72
		TokenNameimport = 106,
69
		TokenNameinstanceof = 17,
73
		TokenNameinstanceof = 17,
70
		TokenNameint = 38,
74
		TokenNameint = 37,
71
		TokenNameinterface = 99,
75
		TokenNameinterface = 89,
72
		TokenNamelong = 39,
76
		TokenNamelong = 38,
73
		TokenNamenative = 60,
77
		TokenNamenative = 48,
74
		TokenNamenew = 44,
78
		TokenNamenew = 56,
75
		TokenNamenull = 47,
79
		TokenNamenull = 58,
76
		TokenNamepackage = 101,
80
		TokenNamepackage = 91,
77
		TokenNameprivate = 61,
81
		TokenNameprivate = 49,
78
		TokenNameprotected = 62,
82
		TokenNameprotected = 50,
79
		TokenNamepublic = 63,
83
		TokenNamepublic = 51,
80
		TokenNamereturn = 95,
84
		TokenNamereturn = 85,
81
		TokenNameshort = 40,
85
		TokenNameshort = 39,
82
		TokenNamestatic = 56,
86
		TokenNamestatic = 44,
83
		TokenNamestrictfp = 64,
87
		TokenNamestrictfp = 52,
84
		TokenNamesuper = 42,
88
		TokenNamesuper = 53,
85
		TokenNameswitch = 96,
89
		TokenNameswitch = 86,
86
		TokenNamesynchronized = 57,
90
		TokenNamesynchronized = 45,
87
		TokenNamethis = 43,
91
		TokenNamethis = 43,
88
		TokenNamethrow = 97,
92
		TokenNamethrow = 87,
89
		TokenNamethrows = 110,
93
		TokenNamethrows = 111,
90
		TokenNametransient = 65,
94
		TokenNametransient = 54,
91
		TokenNametrue = 48,
95
		TokenNametrue = 59,
92
		TokenNametry = 98,
96
		TokenNametry = 88,
93
		TokenNamevoid = 41,
97
		TokenNamevoid = 40,
94
		TokenNamevolatile = 66,
98
		TokenNamevolatile = 55,
95
		TokenNamewhile = 77,
99
		TokenNamewhile = 78,
96
		TokenNameIntegerLiteral = 49,
100
		TokenNameIntegerLiteral = 60,
97
		TokenNameLongLiteral = 50,
101
		TokenNameLongLiteral = 61,
98
		TokenNameFloatingPointLiteral = 51,
102
		TokenNameFloatingPointLiteral = 62,
99
		TokenNameDoubleLiteral = 52,
103
		TokenNameDoubleLiteral = 63,
100
		TokenNameCharacterLiteral = 53,
104
		TokenNameCharacterLiteral = 64,
101
		TokenNameStringLiteral = 54,
105
		TokenNameStringLiteral = 65,
102
		TokenNamePLUS_PLUS = 2,
106
		TokenNamePLUS_PLUS = 2,
103
		TokenNameMINUS_MINUS = 3,
107
		TokenNameMINUS_MINUS = 3,
104
		TokenNameEQUAL_EQUAL = 19,
108
		TokenNameEQUAL_EQUAL = 20,
105
		TokenNameLESS_EQUAL = 13,
109
		TokenNameLESS_EQUAL = 13,
106
		TokenNameGREATER_EQUAL = 14,
110
		TokenNameGREATER_EQUAL = 14,
107
		TokenNameNOT_EQUAL = 20,
111
		TokenNameNOT_EQUAL = 21,
108
		TokenNameLEFT_SHIFT = 18,
112
		TokenNameLEFT_SHIFT = 18,
109
		TokenNameRIGHT_SHIFT = 15,
113
		TokenNameRIGHT_SHIFT = 15,
110
		TokenNameUNSIGNED_RIGHT_SHIFT = 16,
114
		TokenNameUNSIGNED_RIGHT_SHIFT = 16,
111
		TokenNamePLUS_EQUAL = 78,
115
		TokenNamePLUS_EQUAL = 92,
112
		TokenNameMINUS_EQUAL = 79,
116
		TokenNameMINUS_EQUAL = 93,
113
		TokenNameMULTIPLY_EQUAL = 80,
117
		TokenNameMULTIPLY_EQUAL = 94,
114
		TokenNameDIVIDE_EQUAL = 81,
118
		TokenNameDIVIDE_EQUAL = 95,
115
		TokenNameAND_EQUAL = 82,
119
		TokenNameAND_EQUAL = 96,
116
		TokenNameOR_EQUAL = 83,
120
		TokenNameOR_EQUAL = 97,
117
		TokenNameXOR_EQUAL = 84,
121
		TokenNameXOR_EQUAL = 98,
118
		TokenNameREMAINDER_EQUAL = 85,
122
		TokenNameREMAINDER_EQUAL = 99,
119
		TokenNameLEFT_SHIFT_EQUAL = 86,
123
		TokenNameLEFT_SHIFT_EQUAL = 100,
120
		TokenNameRIGHT_SHIFT_EQUAL = 87,
124
		TokenNameRIGHT_SHIFT_EQUAL = 101,
121
		TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 88,
125
		TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 102,
122
		TokenNameOR_OR = 30,
126
		TokenNameOR_OR = 31,
123
		TokenNameAND_AND = 29,
127
		TokenNameAND_AND = 30,
124
		TokenNamePLUS = 4,
128
		TokenNamePLUS = 4,
125
		TokenNameMINUS = 5,
129
		TokenNameMINUS = 5,
126
		TokenNameNOT = 70,
130
		TokenNameNOT = 69,
127
		TokenNameREMAINDER = 8,
131
		TokenNameREMAINDER = 8,
128
		TokenNameXOR = 23,
132
		TokenNameXOR = 24,
129
		TokenNameAND = 21,
133
		TokenNameAND = 22,
130
		TokenNameMULTIPLY = 7,
134
		TokenNameMULTIPLY = 7,
131
		TokenNameOR = 25,
135
		TokenNameOR = 25,
132
		TokenNameTWIDDLE = 71,
136
		TokenNameTWIDDLE = 70,
133
		TokenNameDIVIDE = 9,
137
		TokenNameDIVIDE = 9,
134
		TokenNameGREATER = 12,
138
		TokenNameGREATER = 12,
135
		TokenNameLESS = 11,
139
		TokenNameLESS = 10,
136
		TokenNameLPAREN = 24,
140
		TokenNameLPAREN = 26,
137
		TokenNameRPAREN = 26,
141
		TokenNameRPAREN = 27,
138
		TokenNameLBRACE = 68,
142
		TokenNameLBRACE = 68,
139
		TokenNameRBRACE = 32,
143
		TokenNameRBRACE = 42,
140
		TokenNameLBRACKET = 6,
144
		TokenNameLBRACKET = 6,
141
		TokenNameRBRACKET = 72,
145
		TokenNameRBRACKET = 72,
142
		TokenNameSEMICOLON = 28,
146
		TokenNameSEMICOLON = 28,
143
		TokenNameQUESTION = 27,
147
		TokenNameQUESTION = 29,
144
		TokenNameCOLON = 69,
148
		TokenNameCOLON = 71,
145
		TokenNameCOMMA = 31,
149
		TokenNameCOMMA = 41,
146
		TokenNameDOT = 1,
150
		TokenNameDOT = 1,
147
		TokenNameEQUAL = 74,
151
		TokenNameEQUAL = 74,
148
		TokenNameAT = 45,
152
		TokenNameAT = 23,
149
		TokenNameELLIPSIS = 112,
153
		TokenNameELLIPSIS = 75,
150
		TokenNameARROW = 109,
154
		TokenNameARROW = 110,
151
		TokenNameCOLON_COLON = 10,
155
		TokenNameCOLON_COLON = 11,
152
		TokenNameBeginLambda = 55,
156
		TokenNameBeginLambda = 66,
153
		TokenNameBeginTypeArguments = 75,
157
		TokenNameBeginTypeArguments = 76,
154
		TokenNameElidedSemicolonAndRightBrace = 73,
158
		TokenNameElidedSemicolonAndRightBrace = 73,
155
		TokenNameEOF = 67,
159
		TokenNameEOF = 67,
156
		TokenNameERROR = 115;
160
		TokenNameERROR = 115;
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc (-1 / +8 lines)
Line 1 Link Here
1
ll   k  HHHDDk    EEE"  HIhE    jEMDYYD"DDfJJmc""L"Ef"d"""--"
1
mmJ**D*l+)KJ**HHHHHDl****+++GGG)KKK!++55**IiG****
2
3
!k!)!G!!NDOOD!DD!h))
4
)
5
)gJJnY!M!hGg!Z!
6
!!
7
!
8
5+!
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props (-14 / +20 lines)
Lines 1-17 Link Here
1
###############################################################################
2
# Copyright (c) 2012 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
#
8
# This is an implementation of an early-draft specification developed under the Java
9
# Community Process (JCP) and is made available for testing and evaluation purposes
10
# only. The code is not compatible with any specification of the JCP.
11
#
12
# Contributors:
13
#     IBM Corporation - initial API and implementation
14
###############################################################################
15
,opt=,
1
,opt=,
16
;opt=;
2
;opt=;
17
AbstractMethodDeclaration=MethodDeclaration
3
AbstractMethodDeclaration=MethodDeclaration
Lines 36-41 Link Here
36
AnnotationTypeMemberDeclaration=AnnotationTypeMemberDeclaration
22
AnnotationTypeMemberDeclaration=AnnotationTypeMemberDeclaration
37
AnnotationTypeMemberDeclarations=AnnotationTypeMemberDeclarations
23
AnnotationTypeMemberDeclarations=AnnotationTypeMemberDeclarations
38
AnnotationTypeMemberDeclarationsopt=AnnotationTypeMemberDeclarations
24
AnnotationTypeMemberDeclarationsopt=AnnotationTypeMemberDeclarations
25
Annotationsopt=Annotationsopt
39
ArgumentList=ArgumentList
26
ArgumentList=ArgumentList
40
ArgumentListopt=ArgumentList
27
ArgumentListopt=ArgumentList
41
Arguments=Arguments
28
Arguments=Arguments
Lines 80-86 Link Here
80
ClassInstanceCreationExpression=ClassInstanceCreationExpression
67
ClassInstanceCreationExpression=ClassInstanceCreationExpression
81
ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName
68
ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName
82
ClassMemberDeclaration=ClassMemberDeclaration
69
ClassMemberDeclaration=ClassMemberDeclaration
70
ClassOrInterface0=Type
83
ClassOrInterface=Type
71
ClassOrInterface=Type
72
ClassOrInterfaceType0=Type
84
ClassOrInterfaceType=Type
73
ClassOrInterfaceType=Type
85
ClassType=ClassType
74
ClassType=ClassType
86
ClassTypeElt=ClassType
75
ClassTypeElt=ClassType
Lines 104-111 Link Here
104
DimWithOrWithOutExpr=Dimension
93
DimWithOrWithOutExpr=Dimension
105
DimWithOrWithOutExprs=Dimensions
94
DimWithOrWithOutExprs=Dimensions
106
Dims=Dimensions
95
Dims=Dimensions
96
DimsAnnotLoop=DimsAnnotLoop
107
DimsLoop=Dimensions
97
DimsLoop=Dimensions
108
Dimsopt=Dimensions
98
Dimsopt=Dimensions
99
DimsoptAnnotsopt=AnnotationsDimensionsSequence
109
DoStatement=DoStatement
100
DoStatement=DoStatement
110
ElidedLeftBraceAndReturn=ElidedLeftBraceAndReturn
101
ElidedLeftBraceAndReturn=ElidedLeftBraceAndReturn
111
EmptyStatement=EmptyStatement
102
EmptyStatement=EmptyStatement
Lines 157-162 Link Here
157
FormalParameterListopt=FormalParameterList
148
FormalParameterListopt=FormalParameterList
158
GenericMethodDeclaration=GenericMethodDeclaration
149
GenericMethodDeclaration=GenericMethodDeclaration
159
GenericType=GenericType
150
GenericType=GenericType
151
GenericTypeDotName=GenericTypeDotName
160
Goal=Goal
152
Goal=Goal
161
Header1=Header1
153
Header1=Header1
162
Header2=Header2
154
Header2=Header2
Lines 172-177 Link Here
172
Initializer=Initializer
164
Initializer=Initializer
173
InsideCastExpression=InsideCastExpression
165
InsideCastExpression=InsideCastExpression
174
InsideCastExpressionLL1=InsideCastExpression
166
InsideCastExpressionLL1=InsideCastExpression
167
InsideCastExpressionWithAnnotatedQualifiedGenerics=InsideCastExpression
175
InsideCastExpressionWithQualifiedGenerics=InsideCastExpression
168
InsideCastExpressionWithQualifiedGenerics=InsideCastExpression
176
InstanceofExpression=Expression
169
InstanceofExpression=Expression
177
InstanceofExpression_NotName=Expression
170
InstanceofExpression_NotName=Expression
Lines 229-234 Link Here
229
NormalAnnotation=NormalAnnotation
222
NormalAnnotation=NormalAnnotation
230
NumericType=NumericType
223
NumericType=NumericType
231
OneDimLoop=Dimension
224
OneDimLoop=Dimension
225
OneDimOrAnnot=OneDimensionOrAnnotation
232
OnlySynchronized=OnlySynchronized
226
OnlySynchronized=OnlySynchronized
233
OnlyTypeArguments=TypeArguments
227
OnlyTypeArguments=TypeArguments
234
OnlyTypeArgumentsForCastExpression=TypeArguments
228
OnlyTypeArgumentsForCastExpression=TypeArguments
Lines 237-246 Link Here
237
PackageComment=PackageComment
231
PackageComment=PackageComment
238
PackageDeclaration=PackageDeclaration
232
PackageDeclaration=PackageDeclaration
239
PackageDeclarationName=PackageDeclarationName
233
PackageDeclarationName=PackageDeclarationName
234
PopZeroTypeAnnotations=PopZeroTypeAnnotations
240
PostDecrementExpression=PostDecrementExpression
235
PostDecrementExpression=PostDecrementExpression
241
PostIncrementExpression=PostIncrementExpression
236
PostIncrementExpression=PostIncrementExpression
242
PostfixExpression=Expression
237
PostfixExpression=Expression
243
PostfixExpression_NotName=Expression
238
PostfixExpression_NotName=Expression
239
PotentialNameArray=PotentialNameArray
244
PreDecrementExpression=PreDecrementExpression
240
PreDecrementExpression=PreDecrementExpression
245
PreIncrementExpression=PreIncrementExpression
241
PreIncrementExpression=PreIncrementExpression
246
Primary=Expression
242
Primary=Expression
Lines 253-259 Link Here
253
PushModifiersForHeader=PushModifiersForHeader
249
PushModifiersForHeader=PushModifiersForHeader
254
PushPosition=PushPosition
250
PushPosition=PushPosition
255
PushRPAREN=)
251
PushRPAREN=)
252
PushRPARENForAnnotatedTypeCast=)
253
PushRPARENForNameAndAnnotatedTypeCast=)
254
PushRPARENForNameUnannotatedTypeCast=)
255
PushRPARENForUnannotatedTypeCast=)
256
PushRealModifiers=PushRealModifiers
256
PushRealModifiers=PushRealModifiers
257
PushZeroTypeAnnotations=ZeroTypeAnnotations
257
QualifiedClassBodyopt=ClassBody
258
QualifiedClassBodyopt=ClassBody
258
QualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
259
QualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
259
QualifiedName=QualifiedName
260
QualifiedName=QualifiedName
Lines 261-266 Link Here
261
RecoveryMethodHeaderName=MethodHeaderName
262
RecoveryMethodHeaderName=MethodHeaderName
262
ReduceImports=ReduceImports
263
ReduceImports=ReduceImports
263
ReferenceExpression=ReferenceExpression
264
ReferenceExpression=ReferenceExpression
265
ReferenceType0=ReferenceType
264
ReferenceType1=ReferenceType1
266
ReferenceType1=ReferenceType1
265
ReferenceType2=ReferenceType2
267
ReferenceType2=ReferenceType2
266
ReferenceType3=ReferenceType3
268
ReferenceType3=ReferenceType3
Lines 302-308 Link Here
302
TryBlock=Block
304
TryBlock=Block
303
TryStatement=TryStatement
305
TryStatement=TryStatement
304
TryStatementWithResources=TryStatementWithResources
306
TryStatementWithResources=TryStatementWithResources
307
Type0=Type
305
Type=Type
308
Type=Type
309
TypeAnnotations=TypeAnnotations
306
TypeArgument1=TypeArgument1
310
TypeArgument1=TypeArgument1
307
TypeArgument2=TypeArgument2
311
TypeArgument2=TypeArgument2
308
TypeArgument3=TypeArgument3
312
TypeArgument3=TypeArgument3
Lines 318-323 Link Here
318
TypeElidedFormalParameterList=TypeElidedFormalParameterList
322
TypeElidedFormalParameterList=TypeElidedFormalParameterList
319
TypeImportOnDemandDeclaration=TypeImportOnDemandDeclaration
323
TypeImportOnDemandDeclaration=TypeImportOnDemandDeclaration
320
TypeImportOnDemandDeclarationName=TypeImportOnDemandDeclarationName
324
TypeImportOnDemandDeclarationName=TypeImportOnDemandDeclarationName
325
TypeInternal=Type
321
TypeParameter1=TypeParameter1
326
TypeParameter1=TypeParameter1
322
TypeParameter=TypeParameter
327
TypeParameter=TypeParameter
323
TypeParameterHeader=TypeParameter
328
TypeParameterHeader=TypeParameter
Lines 333-338 Link Here
333
UnqualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
338
UnqualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
334
VariableDeclarator=VariableDeclarator
339
VariableDeclarator=VariableDeclarator
335
VariableDeclaratorId=VariableDeclaratorId
340
VariableDeclaratorId=VariableDeclaratorId
341
VariableDeclaratorIdOrThis=VariableDeclaratorIdOrThis
336
VariableDeclarators=VariableDeclarators
342
VariableDeclarators=VariableDeclarators
337
VariableInitializer=VariableInitializer
343
VariableInitializer=VariableInitializer
338
VariableInitializers=VariableInitializers
344
VariableInitializers=VariableInitializers
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (+56 lines)
Lines 9-14 Link Here
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
10
 * only. The code is not compatible with any specification of the JCP.
11
 *
11
 *
12
 * This is an implementation of an early-draft specification developed under the Java
13
 * Community Process (JCP) and is made available for testing and evaluation purposes
14
 * only. The code is not compatible with any specification of the JCP.
15
 * 
12
 * Contributors:
16
 * Contributors:
13
 *     IBM Corporation - initial API and implementation
17
 *     IBM Corporation - initial API and implementation
14
 *     Benjamin Muskalla - Contribution for bug 239066
18
 *     Benjamin Muskalla - Contribution for bug 239066
Lines 2573-2578 Link Here
2573
		methodDecl.sourceStart,
2577
		methodDecl.sourceStart,
2574
		methodDecl.sourceEnd);
2578
		methodDecl.sourceEnd);
2575
}
2579
}
2580
public void invalidLocationForModifiers(ASTNode location) {
2581
	this.handle(
2582
			IProblem.InvalidLocationForModifiers,
2583
			NoArgument,
2584
			NoArgument,
2585
			location.sourceStart,
2586
			location.sourceEnd);
2587
}
2576
public void illegalModifierForVariable(LocalDeclaration localDecl, boolean complainAsArgument) {
2588
public void illegalModifierForVariable(LocalDeclaration localDecl, boolean complainAsArgument) {
2577
	String[] arguments = new String[] {new String(localDecl.name)};
2589
	String[] arguments = new String[] {new String(localDecl.name)};
2578
	this.handle(
2590
	this.handle(
Lines 2640-2645 Link Here
2640
		arguments,
2652
		arguments,
2641
		argType.sourceStart,
2653
		argType.sourceStart,
2642
		argType.sourceEnd);
2654
		argType.sourceEnd);
2655
}
2656
public void illegalThis(Argument argument, AbstractMethodDeclaration method, long sourceLevel) {
2657
	String[] arguments = NoArgument;
2658
	this.handle(
2659
		sourceLevel <= ClassFileConstants.JDK1_7 ?  IProblem.ExplicitThisParameterNotBelow18 : IProblem.IllegalDeclarationOfThisParameter,
2660
		arguments,
2661
		arguments,
2662
		argument.sourceStart,
2663
		argument.sourceEnd);
2643
}
2664
}
2644
public void illegalVisibilityModifierCombinationForField(ReferenceBinding type, FieldDeclaration fieldDecl) {
2665
public void illegalVisibilityModifierCombinationForField(ReferenceBinding type, FieldDeclaration fieldDecl) {
2645
	String[] arguments = new String[] {new String(fieldDecl.name)};
2666
	String[] arguments = new String[] {new String(fieldDecl.name)};
Lines 4148-4153 Link Here
4148
		argument.type.sourceStart,
4169
		argument.type.sourceStart,
4149
		argument.sourceEnd);
4170
		argument.sourceEnd);
4150
}
4171
}
4172
4173
public void invalidUsageOfTypeAnnotations(Annotation annotation) {
4174
	this.handle(
4175
			IProblem.InvalidUsageOfTypeAnnotations,
4176
			NoArgument,
4177
			NoArgument,
4178
			annotation.sourceStart,
4179
			annotation.sourceEnd);
4180
}
4181
4182
public void illegalReceiverAnnotations(Annotation first, Annotation last) {
4183
	this.handle(
4184
			IProblem.InvalidUsageOfReceiverAnnotations,
4185
			NoArgument,
4186
			NoArgument,
4187
			first.sourceStart,
4188
			last.sourceEnd);	
4189
}
4190
4191
public void misplacedTypeAnnotations(Annotation first, Annotation last) {
4192
	this.handle(
4193
			IProblem.MisplacedTypeAnnotations,
4194
			NoArgument,
4195
			NoArgument,
4196
			first.sourceStart,
4197
			last.sourceEnd);	
4198
}
4199
public void illegalUsageOfTypeAnnotations(Annotation annotation) {
4200
	this.handle(
4201
			IProblem.IllegalUsageOfTypeAnnotations,
4202
			NoArgument,
4203
			NoArgument,
4204
			annotation.sourceStart,
4205
			annotation.sourceEnd);	
4206
}
4151
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
4207
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
4152
	this.referenceContext = compUnitDecl;
4208
	this.referenceContext = compUnitDecl;
4153
	String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
4209
	String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-1 / +7 lines)
Lines 586-592 Link Here
586
634 = The method {0}({1}) of type {2} must override or implement a supertype method
586
634 = The method {0}({1}) of type {2} must override or implement a supertype method
587
635 = Unnecessary @SuppressWarnings("{0}")
587
635 = Unnecessary @SuppressWarnings("{0}")
588
636 = The method {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superinterface method
588
636 = The method {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superinterface method
589
589
637 = Syntax error, type annotations are available only when source level is at least 1.8
590
638 = Receiver annotations are illegal in a static method context
591
639 = Syntax error, type annotations are illegal here
592
640 = Syntax error, modifiers are illegal here
593
641 = Type annotation is illegal for a method that returns void
594
642 = Only the first formal parameter of an instance method may be declared explicitly as "this" 
595
643 = Explicit declaration of "this" parameter is allowed only at source level 1.8 or above 
590
### MORE GENERICS
596
### MORE GENERICS
591
660 = Unused type arguments for the non generic constructor {0}({1}) of type {2}; it should not be parameterized with arguments <{3}>
597
660 = Unused type arguments for the non generic constructor {0}({1}) of type {2}; it should not be parameterized with arguments <{3}>
592
598
(-)a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetParser.java (+7 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 792-797 Link Here
792
796
793
	// reset stacks in consistent state
797
	// reset stacks in consistent state
794
	this.expressionPtr = -1;
798
	this.expressionPtr = -1;
799
	this.unattachedAnnotationPtr = -1;
800
	this.typeAnnotationLengthPtr = -1;
801
	this.typeAnnotationPtr = -1;
795
	this.identifierPtr = -1;
802
	this.identifierPtr = -1;
796
	this.identifierLengthPtr = -1;
803
	this.identifierLengthPtr = -1;
797
804
(-)a/org.eclipse.jdt.core/grammar/java.g
Lines 182-190 Link Here
182
Goal ::= '>>' StaticInitializer
182
Goal ::= '>>' StaticInitializer
183
Goal ::= '>>' Initializer
183
Goal ::= '>>' Initializer
184
-- error recovery
184
-- error recovery
(-)Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method (-5 / +47 lines)
Lines 205-210 Link Here
205
Goal ::= '?' AnnotationTypeMemberDeclaration
204
Goal ::= '?' AnnotationTypeMemberDeclaration
206
/:$readableName Goal:/
205
/:$readableName Goal:/
207
206
207
RecoveryExitHeader ::= $empty
208
RecoveryExitHeader ::= '...'
209
208
Literal -> IntegerLiteral
210
Literal -> IntegerLiteral
209
Literal -> LongLiteral
211
Literal -> LongLiteral
210
Literal -> FloatingPointLiteral
212
Literal -> FloatingPointLiteral
Lines 218-226 Link Here
218
BooleanLiteral -> false
220
BooleanLiteral -> false
219
/:$readableName BooleanLiteral:/
221
/:$readableName BooleanLiteral:/
220
222
221
Type ::= PrimitiveType
223
-- Type is a wrapper that automatically allows for jsr308 style
224
-- annotations to prefix a (Java5/6) Type. If type annotations
225
-- are illegal in a certain place, use TypeInternal instead.
226
-- If type annotations are legal, but so are java5/6 style
227
-- declaration annotations, use Type0 instead.
228
229
Type ::= TypeInternal
230
-- consumeUnannotatedType inserts 0 at the suitable place in the type
231
-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right
232
-- length of the type annotations 0 or otherwise.
233
/.$putCase consumeUnannotatedType();  $break ./
234
Type ::= TypeAnnotations TypeInternal
235
/:$compliance 1.7:/
236
/:$readableName Type:/
237
238
-- Type0 is to be used in places where type annotations are legal
239
-- but are not consumed as TypeAnnotations, but as modifiers. This
240
-- is because from the parser's point of view there are places where
241
-- java5/6 style declarations annotations can occur in the same place
242
-- and it is too early to tell which is which.
243
Type0 ::= TypeInternal
244
-- consumeUnannotatedType inserts 0 at the suitable place in the type
245
-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right
246
-- length of the type annotations 0 or otherwise.
247
/.$putCase consumeUnannotatedType();  $break ./
248
/:$readableName Type:/
249
250
-- TypeInternal is the Java5/6 Type
251
TypeInternal ::= PrimitiveType
222
/.$putCase consumePrimitiveType(); $break ./
252
/.$putCase consumePrimitiveType(); $break ./
223
Type -> ReferenceType
253
TypeInternal -> ReferenceType0
224
/:$readableName Type:/
254
/:$readableName Type:/
225
255
226
PrimitiveType -> NumericType
256
PrimitiveType -> NumericType
Lines 241-267 Link Here
241
FloatingPointType -> 'double'
271
FloatingPointType -> 'double'
242
/:$readableName FloatingPointType:/
272
/:$readableName FloatingPointType:/
243
273
244
ReferenceType ::= ClassOrInterfaceType
274
---------------------------- JSR308-------------------------------------------
245
/.$putCase consumeReferenceType(); $break ./
275
-- ReferenceType has been wrapped now, so that it can be used by itself without
246
ReferenceType -> ArrayType
276
-- having to spell out the rule once with Modifiers & once without.
277
-- If type annotations are not legal prefixes to ReferenceType at some point, use 
278
-- ReferenceType0 instead. Otherwise reject the annotations in the parser.
279
280
ReferenceType ::= ReferenceType0
281
-- consumeUnannotatedType inserts 0 at the suitable place in the type
282
-- annotation stacks, so that the TOS(typeAnnotationsLengthStack) is the right
283
-- length of the type annotations 0 or otherwise.
284
/.$putCase consumeUnannotatedType();  $break ./
285
ReferenceType ::= Modifiers ReferenceType0
286
/.$putCase consumeAnnotatedType();  $break ./
287
/:$compliance 1.7:/
247
/:$readableName ReferenceType:/
288
/:$readableName ReferenceType:/
248
289
(-)------------------------------------------------------------- (-37 / +160 lines)
Lines 277-284 Link Here
277
-- ArrayType ::= ArrayType '[' ']'
352
-- ArrayType ::= ArrayType '[' ']'
278
--
353
--
279
354
280
ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name
355
ArrayTypeWithTypeArgumentsName ::= GenericTypeDotName
281
/.$putCase consumeArrayTypeWithTypeArgumentsName(); $break ./
282
/:$readableName ArrayTypeWithTypeArgumentsName:/
356
/:$readableName ArrayTypeWithTypeArgumentsName:/
283
357
284
ArrayType ::= PrimitiveType Dims
358
ArrayType ::= PrimitiveType Dims
Lines 357-364 Link Here
357
/:$readableName Header1:/
431
/:$readableName Header1:/
358
432
359
Header2 -> Header
433
Header2 -> Header
360
Header2 -> EnumConstantHeader
434
Header2 -> EnumConstantHeader RecoveryEnumConstantSeparatoropt
361
/:$readableName Header2:/
435
/:$readableName Header2:/
436
437
RecoveryEnumConstantSeparatoropt ::= $empty
438
RecoveryEnumConstantSeparatoropt ::= ','
439
RecoveryEnumConstantSeparatoropt ::= ';'
362
440
363
CatchHeader ::= 'catch' '(' CatchFormalParameter ')' '{'
441
CatchHeader ::= 'catch' '(' CatchFormalParameter ')' '{'
364
/.$putCase consumeCatchHeader(); $break ./
442
/.$putCase consumeCatchHeader(); $break ./
Lines 384-390 Link Here
384
/:$compliance 1.5:/
462
/:$compliance 1.5:/
385
463
386
PackageDeclarationName ::= PackageComment 'package' Name
464
PackageDeclarationName ::= PackageComment 'package' Name
387
/.$putCase consumePackageDeclarationName(); $break ./
465
/.$putCase  consumePackageDeclarationName(); $break ./
388
/:$readableName PackageDeclarationName:/
466
/:$readableName PackageDeclarationName:/
389
467
390
PackageComment ::= $empty
468
PackageComment ::= $empty
Lines 558-564 Link Here
558
--    | 'transient'
636
--    | 'transient'
559
--    | 'volatile'
637
--    | 'volatile'
560
638
561
FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
639
FieldDeclaration ::= Modifiersopt Type0 VariableDeclarators ';'
562
/.$putCase consumeFieldDeclaration(); $break ./
640
/.$putCase consumeFieldDeclaration(); $break ./
563
/:$readableName FieldDeclaration:/
641
/:$readableName FieldDeclaration:/
564
642
Lines 566-571 Link Here
566
VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
644
VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
567
/.$putCase consumeVariableDeclarators(); $break ./
645
/.$putCase consumeVariableDeclarators(); $break ./
568
/:$readableName VariableDeclarators:/
646
/:$readableName VariableDeclarators:/
647
/:$recovery_template Identifier:/
569
648
570
VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
649
VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
571
VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
650
VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
Lines 590-595 Link Here
590
RestoreDiet ::= $empty
669
RestoreDiet ::= $empty
591
/.$putCase consumeRestoreDiet(); $break ./
670
/.$putCase consumeRestoreDiet(); $break ./
592
/:$readableName RestoreDiet:/
671
/:$readableName RestoreDiet:/
672
673
VariableDeclaratorIdOrThis ::= 'this'
674
/.$putCase consumeExplicitThisParameter(); $break ./
675
VariableDeclaratorIdOrThis -> VariableDeclaratorId
676
/:$readableName VariableDeclaratorIdOrThis:/
677
/:$compliance 1.8:/
593
678
594
VariableDeclaratorId ::= 'Identifier' Dimsopt
679
VariableDeclaratorId ::= 'Identifier' Dimsopt
595
/:$readableName VariableDeclaratorId:/
680
/:$readableName VariableDeclaratorId:/
Lines 629-635 Link Here
629
714
630
MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
715
MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
631
/.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./
716
/.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./
632
MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
717
MethodHeaderName ::= Modifiersopt Type0 'Identifier' '('
633
/.$putCase consumeMethodHeaderName(false); $break ./
718
/.$putCase consumeMethodHeaderName(false); $break ./
634
/:$readableName MethodHeaderName:/
719
/:$readableName MethodHeaderName:/
635
720
Lines 661-670 Link Here
661
/.$putCase consumeFormalParameterList(); $break ./
746
/.$putCase consumeFormalParameterList(); $break ./
662
/:$readableName FormalParameterList:/
747
/:$readableName FormalParameterList:/
663
748
749
PotentialNameArray -> $empty
750
/.$putCase consumePotentialNameArrayType(); $break ./
751
/:$readableName PotentialNameArray:/
752
664
--1.1 feature
753
--1.1 feature
665
FormalParameter ::= Modifiersopt Type VariableDeclaratorId
754
--FormalParameter ::= Modifiersopt Type VariableDeclaratorId
755
--FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId
756
--The above rules have been rewritten by inlinng the type subgrammar
757
--to avoid the conflicts resulting from jsr308 changes.
758
FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt VariableDeclaratorIdOrThis
666
/.$putCase consumeFormalParameter(false); $break ./
759
/.$putCase consumeFormalParameter(false); $break ./
667
FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId
760
FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis
761
/.$putCase consumeFormalParameter(true); $break ./
762
/:$compliance 1.5:/
763
FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray VariableDeclaratorIdOrThis
764
/.$putCase consumeFormalParameter(false); $break ./
765
FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray '...' VariableDeclaratorIdOrThis
766
/.$putCase consumeFormalParameter(true); $break ./
767
/:$compliance 1.5:/
768
FormalParameter ::= Modifiersopt GenericType DimsoptAnnotsopt VariableDeclaratorIdOrThis
769
/.$putCase consumeFormalParameter(false); $break ./
770
FormalParameter ::= Modifiersopt GenericType DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis
771
/.$putCase consumeFormalParameter(true); $break ./
772
/:$compliance 1.5:/
773
FormalParameter ::= Modifiersopt GenericTypeDotName DimsoptAnnotsopt VariableDeclaratorIdOrThis
774
/.$putCase consumeFormalParameter(false); $break ./
775
FormalParameter ::= Modifiersopt GenericTypeDotName DimsoptAnnotsopt '...' VariableDeclaratorIdOrThis
668
/.$putCase consumeFormalParameter(true); $break ./
776
/.$putCase consumeFormalParameter(true); $break ./
669
/:$readableName FormalParameter:/
777
/:$readableName FormalParameter:/
670
/:$compliance 1.5:/
778
/:$compliance 1.5:/
Lines 679-685 Link Here
679
/.$putCase consumeCatchType(); $break ./
787
/.$putCase consumeCatchType(); $break ./
680
/:$readableName CatchType:/
788
/:$readableName CatchType:/
681
789
682
UnionType ::= Type
790
UnionType ::= TypeInternal
683
/.$putCase consumeUnionTypeAsClassType(); $break ./
791
/.$putCase consumeUnionTypeAsClassType(); $break ./
684
UnionType ::= UnionType '|' Type
792
UnionType ::= UnionType '|' Type
685
/.$putCase consumeUnionType(); $break ./
793
/.$putCase consumeUnionType(); $break ./
Lines 706-712 Link Here
706
814
707
--18.8.4 Productions from 8.5: Static Initializers
815
--18.8.4 Productions from 8.5: Static Initializers
708
816
709
StaticInitializer ::= StaticOnly Block
817
StaticInitializer ::=  StaticOnly Block
710
/.$putCase consumeStaticInitializer(); $break./
818
/.$putCase consumeStaticInitializer(); $break./
711
/:$readableName StaticInitializer:/
819
/:$readableName StaticInitializer:/
712
820
Lines 842-848 Link Here
842
InvalidInitializer -> Initializer
950
InvalidInitializer -> Initializer
843
/:$readableName InvalidInitializer:/
951
/:$readableName InvalidInitializer:/
844
952
845
846
InterfaceMemberDeclaration -> AbstractMethodDeclaration
953
InterfaceMemberDeclaration -> AbstractMethodDeclaration
847
InterfaceMemberDeclaration -> InvalidConstructorDeclaration
954
InterfaceMemberDeclaration -> InvalidConstructorDeclaration
848
InterfaceMemberDeclaration -> InvalidInitializer
955
InterfaceMemberDeclaration -> InvalidInitializer
Lines 906-918 Link Here
906
/.$putCase consumeLocalVariableDeclarationStatement(); $break ./
1013
/.$putCase consumeLocalVariableDeclarationStatement(); $break ./
907
/:$readableName LocalVariableDeclarationStatement:/
1014
/:$readableName LocalVariableDeclarationStatement:/
908
1015
909
LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators
1016
LocalVariableDeclaration ::= Type0 PushModifiers VariableDeclarators
910
/.$putCase consumeLocalVariableDeclaration(); $break ./
1017
/.$putCase consumeLocalVariableDeclaration(); $break ./
911
-- 1.1 feature
1018
-- 1.1 feature
912
-- The modifiers part of this rule makes the grammar more permissive. 
1019
-- The modifiers part of this rule makes the grammar more permissive. 
913
-- The only modifier here is final. We put Modifiers to allow multiple modifiers
1020
-- The only modifier here is final. We put Modifiers to allow multiple modifiers
914
-- This will require to check the validity of the modifier
1021
-- This will require to check the validity of the modifier
915
LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators
1022
LocalVariableDeclaration ::= Modifiers Type0 PushRealModifiers VariableDeclarators
916
/.$putCase consumeLocalVariableDeclaration(); $break ./
1023
/.$putCase consumeLocalVariableDeclaration(); $break ./
917
/:$readableName LocalVariableDeclaration:/
1024
/:$readableName LocalVariableDeclaration:/
918
1025
Lines 980-986 Link Here
980
/:$readableName LabeledStatement:/
1087
/:$readableName LabeledStatement:/
981
1088
982
Label ::= 'Identifier'
1089
Label ::= 'Identifier'
983
/.$putCase consumeLabel() ; $break ./
1090
/.$putCase consumeLabel(); $break ./
984
/:$readableName Label:/
1091
/:$readableName Label:/
985
1092
986
ExpressionStatement ::= StatementExpression ';'
1093
ExpressionStatement ::= StatementExpression ';'
Lines 1154-1165 Link Here
1154
/:$readableName ;:/
1261
/:$readableName ;:/
1155
/:$compliance 1.7:/
1262
/:$compliance 1.7:/
1156
1263
1157
Resource ::= Type PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
1264
Resource ::= TypeInternal PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
1158
/.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./
1265
/.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./
1159
/:$readableName Resource:/
1266
/:$readableName Resource:/
1160
/:$compliance 1.7:/
1267
/:$compliance 1.7:/
1161
1268
1162
Resource ::= Modifiers Type PushRealModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
1269
Resource ::= Modifiers TypeInternal PushRealModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
1163
/.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./
1270
/.$putCase consumeResourceAsLocalVariableDeclaration(); $break ./
1164
/:$readableName Resource:/
1271
/:$readableName Resource:/
1165
/:$compliance 1.7:/
1272
/:$compliance 1.7:/
Lines 1180-1186 Link Here
1180
/.$putCase consumeStatementCatch() ; $break ./
1287
/.$putCase consumeStatementCatch() ; $break ./
1181
/:$readableName CatchClause:/
1288
/:$readableName CatchClause:/
1182
1289
1183
Finally ::= 'finally' Block
1290
Finally ::= 'finally'    Block
1184
/:$readableName Finally:/
1291
/:$readableName Finally:/
1185
/:$recovery_template finally { }:/
1292
/:$recovery_template finally { }:/
1186
1293
Lines 1191-1198 Link Here
1191
/.$putCase consumeLeftParen(); $break ./
1298
/.$putCase consumeLeftParen(); $break ./
1192
/:$readableName (:/
1299
/:$readableName (:/
1193
/:$recovery_template (:/
1300
/:$recovery_template (:/
1301
PushRPARENForUnannotatedTypeCast ::= ')'
1302
/.$putCase consumeRightParenForUnannotatedTypeCast(); $break ./
1303
/:$readableName ):/
1304
/:$recovery_template ):/
1305
PushRPARENForNameUnannotatedTypeCast ::=  ')'
1306
/.$putCase consumeRightParenForNameUnannotatedTypeCast(); $break ./
1307
/:$readableName ):/
1308
/:$recovery_template ):/
1194
PushRPAREN ::= ')'
1309
PushRPAREN ::= ')'
1195
/.$putCase consumeRightParen(); $break ./
1310
/.$putCase consumeRightParen(); $break ./
1311
/:$readableName ):/
1312
/:$recovery_template ):/
1313
PushRPARENForAnnotatedTypeCast ::= ')'
1314
/.$putCase consumeRightParenForAnnotatedTypeCast(); $break ./
1315
/:$readableName ):/
1316
/:$recovery_template ):/
1317
1318
PushRPARENForNameAndAnnotatedTypeCast ::= ')'
1319
/.$putCase consumeRightParenForNameAndAnnotatedTypeCast(); $break ./
1196
/:$readableName ):/
1320
/:$readableName ):/
1197
/:$recovery_template ):/
1321
/:$recovery_template ):/
1198
1322
Lines 1214-1219 Link Here
1214
PrimaryNoNewArray -> ClassInstanceCreationExpression
1338
PrimaryNoNewArray -> ClassInstanceCreationExpression
1215
PrimaryNoNewArray -> FieldAccess
1339
PrimaryNoNewArray -> FieldAccess
1216
--1.1 feature
1340
--1.1 feature
1341
-- javac doesn't permit type annotations here.
1217
PrimaryNoNewArray ::= Name '.' 'this'
1342
PrimaryNoNewArray ::= Name '.' 'this'
1218
/.$putCase consumePrimaryNoNewArrayNameThis(); $break ./
1343
/.$putCase consumePrimaryNoNewArrayNameThis(); $break ./
1219
PrimaryNoNewArray ::= Name '.' 'super'
1344
PrimaryNoNewArray ::= Name '.' 'super'
Lines 1390-1407 Link Here
1390
/.$putCase consumeArgumentList(); $break ./
1515
/.$putCase consumeArgumentList(); $break ./
1391
/:$readableName ArgumentList:/
1516
/:$readableName ArgumentList:/
1392
1517
1393
ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs
1518
-- ArrayCreationHeader is used only in recovery and the consume* method is a NOP.
1519
ArrayCreationHeader ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs
1394
/.$putCase consumeArrayCreationHeader(); $break ./
1520
/.$putCase consumeArrayCreationHeader(); $break ./
1395
1396
ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1521
ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1397
/.$putCase consumeArrayCreationHeader(); $break ./
1522
/.$putCase consumeArrayCreationHeader(); $break ./
1398
/:$readableName ArrayCreationHeader:/
1523
/:$readableName ArrayCreationHeader:/
1399
1524
1400
ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
1525
ArrayCreationWithoutArrayInitializer ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs
1401
/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1526
/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1402
/:$readableName ArrayCreationWithoutArrayInitializer:/
1527
/:$readableName ArrayCreationWithoutArrayInitializer:/
1403
1528
1404
ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer
1529
ArrayCreationWithArrayInitializer ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs ArrayInitializer
1405
/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1530
/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1406
/:$readableName ArrayCreationWithArrayInitializer:/
1531
/:$readableName ArrayCreationWithArrayInitializer:/
1407
1532
Lines 1416-1426 Link Here
1416
/.$putCase consumeDimWithOrWithOutExprs(); $break ./
1541
/.$putCase consumeDimWithOrWithOutExprs(); $break ./
1417
/:$readableName Dimensions:/
1542
/:$readableName Dimensions:/
1418
1543
1419
DimWithOrWithOutExpr ::= '[' Expression ']'
1544
DimWithOrWithOutExpr ::= '[' PushZeroTypeAnnotations Expression ']'
1420
DimWithOrWithOutExpr ::= '[' ']'
1545
DimWithOrWithOutExpr ::= TypeAnnotations '[' Expression ']'
1546
/:$compliance 1.7:/
1547
DimWithOrWithOutExpr ::= '[' PushZeroTypeAnnotations ']'
1421
/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1548
/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1549
DimWithOrWithOutExpr ::= TypeAnnotations '[' ']'
1550
/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1551
/:$compliance 1.7:/
1422
/:$readableName Dimension:/
1552
/:$readableName Dimension:/
1423
-- -----------------------------------------------
1553
-- -----------------------------------------------
1554
1555
-- jsr 308
1556
1557
DimsoptAnnotsopt -> $empty
1558
/. $putCase consumeEmptyDimsoptAnnotsopt(); $break ./
1559
/:$readableName AnnotationsDimensionsSequence:/
1560
DimsoptAnnotsopt -> DimsAnnotLoop
1561
/. $putCase consumeDimsWithTrailingAnnotsopt(); $break ./
1562
/:$readableName Dimensionsoptannotsopt:/
1563
DimsAnnotLoop ::= OneDimOrAnnot
1564
DimsAnnotLoop ::= DimsAnnotLoop OneDimOrAnnot
1565
/:$readableName DimsAnnotLoop:/
1566
1567
OneDimOrAnnot ::= Annotation
1568
/. $putCase consumeTypeAnnotation(true); $break ./
1569
-- Complain if source level < 1.7
1570
/:$compliance 1.7:/
1571
OneDimOrAnnot -> '[' ']'
1572
/. $putCase consumeOneDimLoop(true); $break ./
1573
-- Bump up dimensions && mark zero annotations.
1574
/:$readableName OneDimensionOrAnnotation:/
1575
1576
TypeAnnotations ::= Annotation
1577
/. $putCase consumeTypeAnnotation(false); $break ./
1578
/:$compliance 1.7:/
1579
TypeAnnotations ::= TypeAnnotations Annotation
1580
/. $putCase consumeOneMoreTypeAnnotation(); $break ./
1581
/:$compliance 1.7:/
1582
/:$readableName TypeAnnotations:/
1424
1583
1425
Dims ::= DimsLoop
1584
Dims ::= DimsLoop
1426
/. $putCase consumeDims(); $break ./
1585
/. $putCase consumeDims(); $break ./
Lines 1429-1436 Link Here
1429
DimsLoop ::= DimsLoop OneDimLoop
1588
DimsLoop ::= DimsLoop OneDimLoop
1430
/:$readableName Dimensions:/
1589
/:$readableName Dimensions:/
1431
OneDimLoop ::= '[' ']'
1590
OneDimLoop ::= '[' ']'
1432
/. $putCase consumeOneDimLoop(); $break ./
1591
/. $putCase consumeOneDimLoop(false); $break ./
1592
-- Bump up dimensions && mark zero annotations.
1433
/:$readableName Dimension:/
1593
/:$readableName Dimension:/
1594
OneDimLoop ::= TypeAnnotations '[' ']'
1595
/:$compliance 1.7:/
1596
/. $putCase consumeOneDimLoopWithAnnotations(); $break ./
1597
-- Bump up dimensions
1598
/:$readableName DimensionWithAnnotations:/
1434
1599
1435
FieldAccess ::= Primary '.' 'Identifier'
1600
FieldAccess ::= Primary '.' 'Identifier'
1436
/.$putCase consumeFieldAccess(false); $break ./
1601
/.$putCase consumeFieldAccess(false); $break ./
Lines 1511-1526 Link Here
1511
UnaryExpressionNotPlusMinus -> CastExpression
1676
UnaryExpressionNotPlusMinus -> CastExpression
1512
/:$readableName Expression:/
1677
/:$readableName Expression:/
1513
1678
1514
CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
1679
CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpression
1515
/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./
1680
/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./
1516
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1681
CastExpression ::= PushLPAREN Modifiers PrimitiveType Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpression
1682
/:$compliance 1.7:/
1683
/.$putCase consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations(); $break ./
1684
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
1517
/.$putCase consumeCastExpressionWithGenericsArray(); $break ./
1685
/.$putCase consumeCastExpressionWithGenericsArray(); $break ./
1518
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
1686
CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
1687
/:$compliance 1.7:/
1688
/.$putCase consumeCastExpressionWithGenericsArrayWithTypeAnnotations(); $break ./
1689
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType0 Dimsopt PushRPARENForUnannotatedTypeCast InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
1519
/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./
1690
/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./
1520
CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1691
CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType0 Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpressionWithAnnotatedQualifiedGenerics UnaryExpressionNotPlusMinus
1692
/:$compliance 1.7:/
1693
/.$putCase consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations(); $break ./
1694
CastExpression ::= PushLPAREN Name PushRPARENForNameUnannotatedTypeCast InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1521
/.$putCase consumeCastExpressionLL1(); $break ./
1695
/.$putCase consumeCastExpressionLL1(); $break ./
1522
CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1696
CastExpression ::= PushLPAREN Modifiers Name PushRPARENForNameAndAnnotatedTypeCast InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1697
/:$compliance 1.7:/
1698
/.$putCase consumeCastExpressionLL1WithTypeAnnotations(); $break ./
1699
CastExpression ::= PushLPAREN Name Dims PushRPARENForUnannotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
1523
/.$putCase consumeCastExpressionWithNameArray(); $break ./
1700
/.$putCase consumeCastExpressionWithNameArray(); $break ./
1701
CastExpression ::= PushLPAREN Modifiers Name Dims PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
1702
/:$compliance 1.7:/
1703
/.$putCase consumeCastExpressionWithNameArrayWithTypeAnnotations(); $break ./
1524
/:$readableName CastExpression:/
1704
/:$readableName CastExpression:/
1525
1705
1526
OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
1706
OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
Lines 1535-1540 Link Here
1535
/:$readableName InsideCastExpression:/
1715
/:$readableName InsideCastExpression:/
1536
InsideCastExpressionWithQualifiedGenerics ::= $empty
1716
InsideCastExpressionWithQualifiedGenerics ::= $empty
1537
/.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./
1717
/.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./
1718
/:$readableName InsideCastExpression:/
1719
1720
InsideCastExpressionWithAnnotatedQualifiedGenerics ::= $empty
1721
/.$putCase consumeInsideCastExpressionWithAnnotatedQualifiedGenerics(); $break ./
1538
/:$readableName InsideCastExpression:/
1722
/:$readableName InsideCastExpression:/
1539
1723
1540
MultiplicativeExpression -> UnaryExpression
1724
MultiplicativeExpression -> UnaryExpression
Lines 1842-1852 Link Here
1842
/.$putCase consumeEnhancedForStatement(); $break ./
2026
/.$putCase consumeEnhancedForStatement(); $break ./
1843
/:$readableName EnhancedForStatementNoShortIf:/
2027
/:$readableName EnhancedForStatementNoShortIf:/
1844
2028
1845
EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt
2029
EnhancedForStatementHeaderInit ::= 'for' '(' Type0 PushModifiers Identifier Dimsopt
1846
/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
2030
/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
1847
/:$readableName EnhancedForStatementHeaderInit:/
2031
/:$readableName EnhancedForStatementHeaderInit:/
1848
2032
1849
EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt
2033
EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type0 PushRealModifiers Identifier Dimsopt
1850
/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
2034
/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
1851
/:$readableName EnhancedForStatementHeaderInit:/
2035
/:$readableName EnhancedForStatementHeaderInit:/
1852
2036
Lines 1921-1928 Link Here
1921
/:$compliance 1.5:/
2105
/:$compliance 1.5:/
1922
ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
2106
ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
1923
/.$putCase consumeTypeArgumentReferenceType1(); $break ./
2107
/.$putCase consumeTypeArgumentReferenceType1(); $break ./
1924
/:$readableName ReferenceType1:/
1925
/:$compliance 1.5:/
2108
/:$compliance 1.5:/
2109
ReferenceType1 ::= Modifiers ClassOrInterface '<' TypeArgumentList2
2110
/:$compliance 1.7:/
2111
/.$putCase consumeTypeArgumentReferenceType1WithTypeAnnotations(); $break ./
2112
/:$readableName ReferenceType1:/
1926
2113
1927
TypeArgumentList2 -> TypeArgument2
2114
TypeArgumentList2 -> TypeArgument2
1928
/:$compliance 1.5:/
2115
/:$compliance 1.5:/
Lines 1942-1949 Link Here
1942
/:$compliance 1.5:/
2129
/:$compliance 1.5:/
1943
ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
2130
ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
1944
/.$putCase consumeTypeArgumentReferenceType2(); $break ./
2131
/.$putCase consumeTypeArgumentReferenceType2(); $break ./
1945
/:$readableName ReferenceType2:/
1946
/:$compliance 1.5:/
2132
/:$compliance 1.5:/
2133
ReferenceType2 ::= Modifiers ClassOrInterface '<' TypeArgumentList3
2134
/:$compliance 1.7:/
2135
/.$putCase consumeTypeArgumentReferenceType2WithTypeAnnotations(); $break ./
2136
/:$readableName ReferenceType2:/
1947
2137
1948
TypeArgumentList3 -> TypeArgument3
2138
TypeArgumentList3 -> TypeArgument3
1949
TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
2139
TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
Lines 2025-2034 Link Here
2025
/:$readableName WildcardBound3:/
2215
/:$readableName WildcardBound3:/
2026
/:$compliance 1.5:/
2216
/:$compliance 1.5:/
2027
2217
2028
TypeParameterHeader ::= Identifier
2218
PushZeroTypeAnnotations ::= $empty
2219
/.$putCase consumeZeroTypeAnnotations(true); $break ./
2220
/:$readableName ZeroTypeAnnotations:/
2221
2222
TypeParameterHeader ::= PushZeroTypeAnnotations Identifier
2223
/.$putCase consumeTypeParameterHeader(); $break ./
2224
/:$compliance 1.5:/
2225
TypeParameterHeader ::= TypeAnnotations Identifier
2226
/:$compliance 1.7:/
2029
/.$putCase consumeTypeParameterHeader(); $break ./
2227
/.$putCase consumeTypeParameterHeader(); $break ./
2030
/:$readableName TypeParameter:/
2228
/:$readableName TypeParameter:/
2031
/:$compliance 1.5:/
2032
2229
2033
TypeParameters ::= '<' TypeParameterList1
2230
TypeParameters ::= '<' TypeParameterList1
2034
/.$putCase consumeTypeParameters(); $break ./
2231
/.$putCase consumeTypeParameters(); $break ./
Lines 2295-2301 Link Here
2295
2492
2296
AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2493
AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2297
/.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./
2494
/.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./
2298
AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
2495
AnnotationMethodHeaderName ::= Modifiersopt Type0 'Identifier' '('
2299
/.$putCase consumeMethodHeaderName(true); $break ./
2496
/.$putCase consumeMethodHeaderName(true); $break ./
2300
/:$readableName MethodHeaderName:/
2497
/:$readableName MethodHeaderName:/
2301
/:$compliance 1.5:/
2498
/:$compliance 1.5:/
Lines 2341-2346 Link Here
2341
/.$putCase consumeAnnotationName() ; $break ./
2538
/.$putCase consumeAnnotationName() ; $break ./
2342
/:$readableName AnnotationName:/
2539
/:$readableName AnnotationName:/
2343
/:$compliance 1.5:/
2540
/:$compliance 1.5:/
2541
/:$recovery_template @ Identifier:/
2344
2542
2345
NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'
2543
NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'
2346
/.$putCase consumeNormalAnnotation() ; $break ./
2544
/.$putCase consumeNormalAnnotation() ; $break ./
Lines 2438-2444 Link Here
2438
RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2636
RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2439
/.$putCase consumeRecoveryMethodHeaderNameWithTypeParameters(); $break ./
2637
/.$putCase consumeRecoveryMethodHeaderNameWithTypeParameters(); $break ./
2440
/:$compliance 1.5:/
2638
/:$compliance 1.5:/
2441
RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
2639
RecoveryMethodHeaderName ::= Modifiersopt Type0 'Identifier' '('
2442
/.$putCase consumeRecoveryMethodHeaderName(); $break ./
2640
/.$putCase consumeRecoveryMethodHeaderName(); $break ./
2443
/:$readableName MethodHeaderName:/
2641
/:$readableName MethodHeaderName:/
2444
2642
(-)a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/DocumentElementParser.java (-10 / +171 lines)
Lines 1-9 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
7
 * 
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
Lines 18-23 Link Here
18
import org.eclipse.jdt.internal.compiler.ast.*;
22
import org.eclipse.jdt.internal.compiler.ast.*;
19
import org.eclipse.jdt.internal.compiler.parser.*;
23
import org.eclipse.jdt.internal.compiler.parser.*;
20
import org.eclipse.jdt.internal.compiler.problem.*;
24
import org.eclipse.jdt.internal.compiler.problem.*;
25
import org.eclipse.jdt.internal.compiler.util.Util;
21
26
22
public class DocumentElementParser extends Parser {
27
public class DocumentElementParser extends Parser {
23
	IDocumentElementRequestor requestor;
28
	IDocumentElementRequestor requestor;
Lines 450-455 Link Here
450
	char[] varName = this.identifierStack[this.identifierPtr];
455
	char[] varName = this.identifierStack[this.identifierPtr];
451
	long namePosition = this.identifierPositionStack[this.identifierPtr--];
456
	long namePosition = this.identifierPositionStack[this.identifierPtr--];
452
	int extendedTypeDimension = this.intStack[this.intPtr--];
457
	int extendedTypeDimension = this.intStack[this.intPtr--];
458
	// pop any annotations on extended dimensions now, so they don't pollute the base dimensions.
459
	Annotation [][] annotationsOnExtendedDimensions = extendedTypeDimension == 0 ? null : getAnnotationsOnDimensions(extendedTypeDimension);
460
453
461
454
	AbstractVariableDeclaration declaration;
462
	AbstractVariableDeclaration declaration;
455
	if (this.nestedMethod[this.nestedType] != 0) {
463
	if (this.nestedMethod[this.nestedType] != 0) {
Lines 513-519 Link Here
513
		declaration.type = type;
521
		declaration.type = type;
514
	} else {
522
	} else {
515
		int dimension = typeDim + extendedTypeDimension;
523
		int dimension = typeDim + extendedTypeDimension;
516
		declaration.type = copyDims(type, dimension);
524
		Annotation [][] annotationsOnAllDimensions = null;
525
		Annotation[][] annotationsOnDimensions = type.getAnnotationsOnDimensions();
526
		if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
527
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(typeDim, annotationsOnDimensions, extendedTypeDimension, annotationsOnExtendedDimensions); 
528
		}
529
		declaration.type = copyDims(type, dimension, annotationsOnAllDimensions);
517
	}
530
	}
518
	this.variablesCounter[this.nestedType]++;
531
	this.variablesCounter[this.nestedType]++;
519
	this.nestedMethod[this.nestedType]++;
532
	this.nestedMethod[this.nestedType]++;
Lines 536-541 Link Here
536
				(int) namePosition,
549
				(int) namePosition,
537
				extendedTypeDimension,
550
				extendedTypeDimension,
538
				extendedTypeDimension == 0 ? -1 : this.endPosition);
551
				extendedTypeDimension == 0 ? -1 : this.endPosition);
552
	}
553
}
554
protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) {
555
	TypeReference type;
556
557
	char[] identifierName = this.identifierStack[this.identifierPtr];
558
	long namePosition = this.identifierPositionStack[this.identifierPtr];
559
560
	LocalDeclaration localDeclaration = createLocalDeclaration(identifierName, (int) (namePosition >>> 32), (int) namePosition);
561
	localDeclaration.declarationSourceEnd = localDeclaration.declarationEnd;
562
563
	int extraDims = this.intStack[this.intPtr--];
564
	this.identifierPtr--;
565
	this.identifierLengthPtr--;
566
	// remove fake modifiers/modifiers start
567
	int declarationSourceStart1 = 0;
568
	int modifiersSourceStart1 = 0;
569
	int modifiersValue  = 0;
570
	if (hasModifiers) {
571
		declarationSourceStart1 = this.intStack[this.intPtr--];
572
		modifiersSourceStart1 = this.intStack[this.intPtr--];
573
		modifiersValue = this.intStack[this.intPtr--];
574
	} else {
575
		this.intPtr-=3;
576
	}
577
578
	type = getTypeReference(this.intStack[this.intPtr--] + extraDims); // type dimension
579
580
	// consume annotations
581
	int length;
582
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--])!= 0) {
583
		System.arraycopy(
584
			this.expressionStack,
585
			(this.expressionPtr -= length) + 1,
586
			localDeclaration.annotations = new Annotation[length],
587
			0,
588
			length);
589
	}
590
	if (hasModifiers) {
591
		localDeclaration.declarationSourceStart = declarationSourceStart1;
592
		localDeclaration.modifiersSourceStart = modifiersSourceStart1;
593
		localDeclaration.modifiers = modifiersValue;
594
	} else {
595
		localDeclaration.declarationSourceStart = type.sourceStart;
596
	}
597
	localDeclaration.type = type;
598
599
	ForeachStatement iteratorForStatement =
600
		new ForeachStatement(
601
			localDeclaration,
602
			this.intStack[this.intPtr--]);
603
	pushOnAstStack(iteratorForStatement);
604
605
	iteratorForStatement.sourceEnd = localDeclaration.declarationSourceEnd;
606
}
607
protected void consumeMethodHeaderNameWithTypeParameters(boolean isAnnotationMethod) {
608
	// MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
609
	// AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
610
	// RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
611
	MethodDeclaration md = null;
612
	if(isAnnotationMethod) {
613
		md = new AnnotationMethodDeclaration(this.compilationUnit.compilationResult);
614
		this.recordStringLiterals = false;
615
	} else {
616
		md = new MethodDeclaration(this.compilationUnit.compilationResult);
617
	}
618
619
	//name
620
	md.selector = this.identifierStack[this.identifierPtr];
621
	long selectorSource = this.identifierPositionStack[this.identifierPtr--];
622
	this.identifierLengthPtr--;
623
	//type
624
	md.returnType = getTypeReference(this.intStack[this.intPtr--]);
625
626
	// consume type parameters
627
	int length = this.genericsLengthStack[this.genericsLengthPtr--];
628
	this.genericsPtr -= length;
629
	System.arraycopy(this.genericsStack, this.genericsPtr + 1, md.typeParameters = new TypeParameter[length], 0, length);
630
631
	//modifiers
632
	md.declarationSourceStart = this.intStack[this.intPtr--];
633
	md.modifiersSourceStart = this.intStack[this.intPtr--];
634
	md.modifiers = this.intStack[this.intPtr--];
635
	// consume annotations
636
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
637
		System.arraycopy(
638
			this.expressionStack,
639
			(this.expressionPtr -= length) + 1,
640
			md.annotations = new Annotation[length],
641
			0,
642
			length);
643
	}
644
	// javadoc
645
	md.javadoc = this.javadoc;
646
	this.javadoc = null;
647
648
	//highlight starts at selector start
649
	md.sourceStart = (int) (selectorSource >>> 32);
650
	pushOnAstStack(md);
651
	md.sourceEnd = this.lParenPos;
652
	md.bodyStart = this.lParenPos+1;
653
	this.listLength = 0; // initialize this.listLength before reading parameters/throws
654
655
	// recovery
656
	if (this.currentElement != null){
657
		boolean isType;
658
		if ((isType = this.currentElement instanceof RecoveredType)
659
			//|| md.modifiers != 0
660
			|| (Util.getLineNumber(md.returnType.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr)
661
					== Util.getLineNumber(md.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr))){
662
			if(isType) {
663
				((RecoveredType) this.currentElement).pendingTypeParameters = null;
664
			}
665
			this.lastCheckPoint = md.bodyStart;
666
			this.currentElement = this.currentElement.add(md, 0);
667
			this.lastIgnoredToken = -1;
668
		} else {
669
			this.lastCheckPoint = md.sourceStart;
670
			this.restartRecovery = true;
671
		}
539
	}
672
	}
540
}
673
}
541
/*
674
/*
Lines 598-607 Link Here
598
		endOfEllipsis = this.intStack[this.intPtr--];
731
		endOfEllipsis = this.intStack[this.intPtr--];
599
	}
732
	}
600
	int firstDimensions = this.intStack[this.intPtr--];
733
	int firstDimensions = this.intStack[this.intPtr--];
601
	final int typeDimensions = firstDimensions + extendedDimensions;
734
	TypeReference type = getUnannotatedTypeReference(extendedDimensions);
602
	TypeReference type = getTypeReference(typeDimensions);
735
	Annotation [] varArgsAnnotations = null;
736
	int length;
737
	if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
738
		System.arraycopy(
739
			this.typeAnnotationStack,
740
			(this.typeAnnotationPtr -= length) + 1,
741
			varArgsAnnotations = new Annotation[length],
742
			0,
743
			length);
744
	} 
745
	final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0);
746
	if (typeDimensions != extendedDimensions) {
747
		// jsr308 type annotations management
748
		Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions);
749
		Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions();
750
		Annotation [][] annotationsOnAllDimensions = null;
751
		if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) {
752
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions); 
753
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null);
754
		}
755
		type = copyDims(type, typeDimensions, annotationsOnAllDimensions);
756
		type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition;
757
	}
603
	if (isVarArgs) {
758
	if (isVarArgs) {
604
		type = copyDims(type, typeDimensions + 1);
605
		if (extendedDimensions == 0) {
759
		if (extendedDimensions == 0) {
606
			type.sourceEnd = endOfEllipsis;
760
			type.sourceEnd = endOfEllipsis;
607
		}
761
		}
Lines 615-621 Link Here
615
			type,
769
			type,
616
			this.intStack[this.intPtr + 1]);// modifiers
770
			this.intStack[this.intPtr + 1]);// modifiers
617
	// consume annotations
771
	// consume annotations
618
	int length;
619
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
772
	if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
620
		System.arraycopy(
773
		System.arraycopy(
621
			this.expressionStack,
774
			this.expressionStack,
Lines 878-884 Link Here
878
		TypeReference returnType = md.returnType;
1031
		TypeReference returnType = md.returnType;
879
		md.sourceEnd = this.endPosition;
1032
		md.sourceEnd = this.endPosition;
880
		int dims = returnType.dimensions() + extendedDims;
1033
		int dims = returnType.dimensions() + extendedDims;
881
		md.returnType = copyDims(returnType, dims);
1034
		Annotation [][] annotationsOnDimensions = returnType.getAnnotationsOnDimensions();
1035
		Annotation [][] annotationsOnExtendedDimensions = getAnnotationsOnDimensions(extendedDims);
1036
		Annotation [][] annotationsOnAllDimensions = null;
1037
		if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
1038
			annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(returnType.dimensions(), annotationsOnDimensions, extendedDims, annotationsOnExtendedDimensions);
1039
		}	
1040
		md.returnType = copyDims(returnType, dims, annotationsOnAllDimensions);
1041
882
		if (this.currentToken == TokenNameLBRACE) {
1042
		if (this.currentToken == TokenNameLBRACE) {
883
			md.bodyStart = this.endPosition + 1;
1043
			md.bodyStart = this.endPosition + 1;
884
		}
1044
		}
Lines 1399-1405 Link Here
1399
	 * This variable is a type reference and dim will be its dimensions.
1559
	 * This variable is a type reference and dim will be its dimensions.
1400
	 * We don't have any side effect on the stacks' pointers.
1560
	 * We don't have any side effect on the stacks' pointers.
1401
	 */
1561
	 */
1402
1562
	Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
1403
	int length;
1563
	int length;
1404
	TypeReference ref;
1564
	TypeReference ref;
1405
	if ((length = this.identifierLengthStack[localIdentifierLengthPtr]) == 1) {
1565
	if ((length = this.identifierLengthStack[localIdentifierLengthPtr]) == 1) {
Lines 1414-1425 Link Here
1414
				new ArrayTypeReference(
1574
				new ArrayTypeReference(
1415
					this.identifierStack[localIdentifierPtr],
1575
					this.identifierStack[localIdentifierPtr],
1416
					dim,
1576
					dim,
1577
					annotationsOnDimensions,
1417
					this.identifierPositionStack[localIdentifierPtr--]);
1578
					this.identifierPositionStack[localIdentifierPtr--]);
1418
			ref.sourceEnd = this.endPosition;
1579
			ref.sourceEnd = this.endPosition;
1419
		}
1580
		}
1420
	} else {
1581
	} else {
1421
		if (length < 0) { //flag for precompiled type reference on base types
1582
		if (length < 0) { //flag for precompiled type reference on base types
1422
			ref = TypeReference.baseTypeReference(-length, dim);
1583
			ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions);
1423
			ref.sourceStart = this.intStack[this.localIntPtr--];
1584
			ref.sourceStart = this.intStack[this.localIntPtr--];
1424
			if (dim == 0) {
1585
			if (dim == 0) {
1425
				ref.sourceEnd = this.intStack[this.localIntPtr--];
1586
				ref.sourceEnd = this.intStack[this.localIntPtr--];
Lines 1441-1447 Link Here
1441
			if (dim == 0)
1602
			if (dim == 0)
1442
				ref = new QualifiedTypeReference(tokens, positions);
1603
				ref = new QualifiedTypeReference(tokens, positions);
1443
			else
1604
			else
1444
				ref = new ArrayQualifiedTypeReference(tokens, dim, positions);
1605
				ref = new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions);
1445
		}
1606
		}
1446
	}
1607
	}
1447
	return ref;
1608
	return ref;
(-)a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java (-18 / +23 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 730-742 Link Here
730
		return null;
734
		return null;
731
	}
735
	}
732
}
736
}
733
public TypeReference getTypeReference(int dim) {
737
public TypeReference getUnannotatedTypeReference(int dim) {
734
	/* build a Reference on a variable that may be qualified or not
738
	/* build a Reference on a variable that may be qualified or not
735
	 * This variable is a type reference and dim will be its dimensions
739
	 * This variable is a type reference and dim will be its dimensions
736
	 */
740
	 */
741
	Annotation [][] annotationsOnDimensions = null;
742
	TypeReference ref;
737
	int length = this.identifierLengthStack[this.identifierLengthPtr--];
743
	int length = this.identifierLengthStack[this.identifierLengthPtr--];
738
	if (length < 0) { //flag for precompiled type reference on base types
744
	if (length < 0) { //flag for precompiled type reference on base types
739
		TypeReference ref = TypeReference.baseTypeReference(-length, dim);
745
		annotationsOnDimensions = getAnnotationsOnDimensions(dim);
746
		ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions);
740
		ref.sourceStart = this.intStack[this.intPtr--];
747
		ref.sourceStart = this.intStack[this.intPtr--];
741
		if (dim == 0) {
748
		if (dim == 0) {
742
			ref.sourceEnd = this.intStack[this.intPtr--];
749
			ref.sourceEnd = this.intStack[this.intPtr--];
Lines 747-758 Link Here
747
		if (this.reportReferenceInfo){
754
		if (this.reportReferenceInfo){
748
				this.requestor.acceptTypeReference(ref.getParameterizedTypeName(), ref.sourceStart, ref.sourceEnd);
755
				this.requestor.acceptTypeReference(ref.getParameterizedTypeName(), ref.sourceStart, ref.sourceEnd);
749
		}
756
		}
750
		return ref;
751
	} else {
757
	} else {
752
		int numberOfIdentifiers = this.genericsIdentifiersLengthStack[this.genericsIdentifiersLengthPtr--];
758
		int numberOfIdentifiers = this.genericsIdentifiersLengthStack[this.genericsIdentifiersLengthPtr--];
753
		if (length != numberOfIdentifiers || this.genericsLengthStack[this.genericsLengthPtr] != 0) {
759
		if (length != numberOfIdentifiers || this.genericsLengthStack[this.genericsLengthPtr] != 0) {
754
			// generic type
760
			// generic type
755
			TypeReference ref = getTypeReferenceForGenericType(dim, length, numberOfIdentifiers);
761
			ref = getTypeReferenceForGenericType(dim, length, numberOfIdentifiers);
756
			if (this.reportReferenceInfo) {
762
			if (this.reportReferenceInfo) {
757
				if (length == 1 && numberOfIdentifiers == 1) {
763
				if (length == 1 && numberOfIdentifiers == 1) {
758
					ParameterizedSingleTypeReference parameterizedSingleTypeReference = (ParameterizedSingleTypeReference) ref;
764
					ParameterizedSingleTypeReference parameterizedSingleTypeReference = (ParameterizedSingleTypeReference) ref;
Lines 762-791 Link Here
762
					this.requestor.acceptTypeReference(parameterizedQualifiedTypeReference.tokens, parameterizedQualifiedTypeReference.sourceStart, parameterizedQualifiedTypeReference.sourceEnd);
768
					this.requestor.acceptTypeReference(parameterizedQualifiedTypeReference.tokens, parameterizedQualifiedTypeReference.sourceStart, parameterizedQualifiedTypeReference.sourceEnd);
763
				}
769
				}
764
			}
770
			}
765
			return ref;
766
		} else if (length == 1) {
771
		} else if (length == 1) {
767
			// single variable reference
772
			// single variable reference
768
			this.genericsLengthPtr--; // pop the 0
773
			this.genericsLengthPtr--; // pop the 0
769
			if (dim == 0) {
774
			if (dim == 0) {
770
				SingleTypeReference ref =
775
				ref =
771
					new SingleTypeReference(
776
					new SingleTypeReference(
772
						this.identifierStack[this.identifierPtr],
777
						this.identifierStack[this.identifierPtr],
773
						this.identifierPositionStack[this.identifierPtr--]);
778
						this.identifierPositionStack[this.identifierPtr--]);
774
				if (this.reportReferenceInfo) {
779
				if (this.reportReferenceInfo) {
775
					this.requestor.acceptTypeReference(ref.token, ref.sourceStart);
780
					this.requestor.acceptTypeReference(((SingleTypeReference)ref).token, ref.sourceStart);
776
				}
781
				}
777
				return ref;
778
			} else {
782
			} else {
779
				ArrayTypeReference ref =
783
				annotationsOnDimensions = getAnnotationsOnDimensions(dim);
784
				ref =
780
					new ArrayTypeReference(
785
					new ArrayTypeReference(
781
						this.identifierStack[this.identifierPtr],
786
						this.identifierStack[this.identifierPtr],
782
						dim,
787
						dim,
788
						annotationsOnDimensions,
783
						this.identifierPositionStack[this.identifierPtr--]);
789
						this.identifierPositionStack[this.identifierPtr--]);
784
				ref.sourceEnd = this.endPosition;
790
				ref.sourceEnd = this.endPosition;
785
				if (this.reportReferenceInfo) {
791
				if (this.reportReferenceInfo) {
786
					this.requestor.acceptTypeReference(ref.token, ref.sourceStart);
792
					this.requestor.acceptTypeReference(((ArrayTypeReference)ref).token, ref.sourceStart);
787
				}
793
				}
788
				return ref;
789
			}
794
			}
790
		} else {//Qualified variable reference
795
		} else {//Qualified variable reference
791
			this.genericsLengthPtr--;
796
			this.genericsLengthPtr--;
Lines 800-821 Link Here
800
				0,
805
				0,
801
				length);
806
				length);
802
			if (dim == 0) {
807
			if (dim == 0) {
803
				QualifiedTypeReference ref = new QualifiedTypeReference(tokens, positions);
808
				ref = new QualifiedTypeReference(tokens, positions);
804
				if (this.reportReferenceInfo) {
809
				if (this.reportReferenceInfo) {
805
					this.requestor.acceptTypeReference(ref.tokens, ref.sourceStart, ref.sourceEnd);
810
					this.requestor.acceptTypeReference(((QualifiedTypeReference)ref).tokens, ref.sourceStart, ref.sourceEnd);
806
				}
811
				}
807
				return ref;
808
			} else {
812
			} else {
809
				ArrayQualifiedTypeReference ref =
813
				annotationsOnDimensions = getAnnotationsOnDimensions(dim);
810
					new ArrayQualifiedTypeReference(tokens, dim, positions);
814
				ref =
815
					new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions);
811
				ref.sourceEnd = this.endPosition;
816
				ref.sourceEnd = this.endPosition;
812
				if (this.reportReferenceInfo) {
817
				if (this.reportReferenceInfo) {
813
					this.requestor.acceptTypeReference(ref.tokens, ref.sourceStart, ref.sourceEnd);
818
					this.requestor.acceptTypeReference(((ArrayQualifiedTypeReference)ref).tokens, ref.sourceStart, ref.sourceEnd);
814
				}
819
				}
815
				return ref;
816
			}
820
			}
817
		}
821
		}
818
	}
822
	}
823
	return ref;
819
}
824
}
820
public NameReference getUnspecifiedReference() {
825
public NameReference getUnspecifiedReference() {
821
	/* build a (unspecified) NameReference which may be qualified*/
826
	/* build a (unspecified) NameReference which may be qualified*/
(-)a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java (-2 / +14 lines)
Lines 5-10 Link Here
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
7
 * 
8
 * This is an implementation of an early-draft specification developed under the Java
9
 * Community Process (JCP) and is made available for testing and evaluation purposes
10
 * only. The code is not compatible with any specification of the JCP.
11
 * 
8
 * Contributors:
12
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
13
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
14
 *******************************************************************************/
Lines 740-747 Link Here
740
		this.nodeSet.addTrustedMatch(result, true);
744
		this.nodeSet.addTrustedMatch(result, true);
741
	return result;
745
	return result;
742
}
746
}
743
protected TypeReference getTypeReference(int dim) {
747
protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation [][] annotationsOnDimensions) {
744
	TypeReference typeRef = super.getTypeReference(dim);
748
	TypeReference result = super.copyDims(typeRef, dim, annotationsOnDimensions);
749
	 if (this.nodeSet.removePossibleMatch(typeRef) != null)
750
		this.nodeSet.addPossibleMatch(result);
751
	 else if (this.nodeSet.removeTrustedMatch(typeRef) != null)
752
		this.nodeSet.addTrustedMatch(result, true);
753
	return result;
754
}
755
protected TypeReference getUnannotatedTypeReference(int dim) {
756
	TypeReference typeRef = super.getUnannotatedTypeReference(dim);
745
	if (this.patternFineGrain == 0) {
757
	if (this.patternFineGrain == 0) {
746
		this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere
758
		this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere
747
	}
759
	}

Return to bug 287648