### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java,v retrieving revision 1.11 diff -u -r1.11 AnnotationDietRecoveryTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java 16 Mar 2007 18:31:23 -0000 1.11 +++ src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java 30 Apr 2007 16:30:15 -0000 @@ -251,11 +251,7 @@ String expectedDietUnitToString = "package a;\n" + - "public @interface X {\n" + - " {\n" + - " }\n" + - " () {\n" + - " }\n" + + "public @interface X {\n" + "}\n"; String expectedDietPlusBodyUnitToString = #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/compiler/SourceElementParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java,v retrieving revision 1.73 diff -u -r1.73 SourceElementParser.java --- model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 27 Apr 2007 15:51:39 -0000 1.73 +++ model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 30 Apr 2007 16:30:18 -0000 @@ -295,6 +295,12 @@ if (this.astPtr > currentAstPtr) // if ast node was pushed on the ast stack rememberCategories(); } +protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() { + int currentAstPtr = this.astPtr; + super.consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters(); + if (this.astPtr > currentAstPtr) // if ast node was pushed on the ast stack + rememberCategories(); +} protected void consumeClassHeaderName1() { int currentAstPtr = this.astPtr; super.consumeClassHeaderName1(); Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v retrieving revision 1.371 diff -u -r1.371 Parser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 25 Apr 2007 16:59:23 -0000 1.371 +++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 30 Apr 2007 16:30:17 -0000 @@ -1366,6 +1366,90 @@ this.lastIgnoredToken = -1; } } +protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() { + // consumeAnnotationTypeDeclarationHeader ::= Modifiers '@' PushModifiers interface Identifier TypeParameters + // consumeAnnotationTypeDeclarationHeader ::= '@' PushModifiers interface Identifier TypeParameters + TypeDeclaration annotationTypeDeclaration = new TypeDeclaration(this.compilationUnit.compilationResult); + // consume type parameters + int length = this.genericsLengthStack[this.genericsLengthPtr--]; + this.genericsPtr -= length; + System.arraycopy(this.genericsStack, this.genericsPtr + 1, annotationTypeDeclaration.typeParameters = new TypeParameter[length], 0, length); + + this.problemReporter().invalidUsageOfTypeParametersForAnnotationDeclaration(annotationTypeDeclaration); + + annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.typeParameters[length-1].declarationSourceEnd + 1; + + this.listTypeParameterLength = 0; + + if (this.nestedMethod[this.nestedType] == 0) { + if (this.nestedType != 0) { + annotationTypeDeclaration.bits |= ASTNode.IsMemberType; + } + } else { + // Record that the block has a declaration for local types + annotationTypeDeclaration.bits |= ASTNode.IsLocalType; + markEnclosingMemberWithLocalType(); + blockReal(); + } + + //highlight the name of the type + long pos = this.identifierPositionStack[this.identifierPtr]; + annotationTypeDeclaration.sourceEnd = (int) pos; + annotationTypeDeclaration.sourceStart = (int) (pos >>> 32); + annotationTypeDeclaration.name = this.identifierStack[this.identifierPtr--]; + this.identifierLengthPtr--; + + //compute the declaration source too + // 'interface' push two int positions: the beginning of the class token and its end. + // we want to keep the beginning position but get rid of the end position + // it is only used for the ClassLiteralAccess positions. + this.intPtr--; // remove the start position of the interface token + this.intPtr--; // remove the end position of the interface token + + annotationTypeDeclaration.modifiersSourceStart = this.intStack[this.intPtr--]; + annotationTypeDeclaration.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccAnnotation | ClassFileConstants.AccInterface; + if (annotationTypeDeclaration.modifiersSourceStart >= 0) { + annotationTypeDeclaration.declarationSourceStart = annotationTypeDeclaration.modifiersSourceStart; + this.intPtr--; // remove the position of the '@' token as we have modifiers + } else { + int atPosition = this.intStack[this.intPtr--]; + // remove the position of the '@' token as we don't have modifiers + annotationTypeDeclaration.declarationSourceStart = atPosition; + } + + // Store secondary info + if ((annotationTypeDeclaration.bits & ASTNode.IsMemberType) == 0 && (annotationTypeDeclaration.bits & ASTNode.IsLocalType) == 0) { + if (this.compilationUnit != null && !CharOperation.equals(annotationTypeDeclaration.name, this.compilationUnit.getMainTypeName())) { + annotationTypeDeclaration.bits |= ASTNode.IsSecondaryType; + } + } + + // consume annotations + if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) { + System.arraycopy( + this.expressionStack, + (this.expressionPtr -= length) + 1, + annotationTypeDeclaration.annotations = new Annotation[length], + 0, + length); + } + // javadoc + annotationTypeDeclaration.javadoc = this.javadoc; + this.javadoc = null; + pushOnAstStack(annotationTypeDeclaration); + if(!this.statementRecoveryActivated && + options.sourceLevel < ClassFileConstants.JDK1_5 && + this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { + this.problemReporter().invalidUsageOfAnnotationDeclarations(annotationTypeDeclaration); + } + + // recovery + if (this.currentElement != null){ + this.lastCheckPoint = annotationTypeDeclaration.bodyStart; + this.currentElement = this.currentElement.add(annotationTypeDeclaration, 0); + this.lastIgnoredToken = -1; + } +} protected void consumeAnnotationTypeMemberDeclaration() { // AnnotationTypeMemberDeclaration ::= AnnotationTypeMemberDeclarationHeader AnnotationTypeMemberHeaderExtendedDims DefaultValueopt ';' AnnotationMethodDeclaration annotationTypeMemberDeclaration = (AnnotationMethodDeclaration) this.astStack[this.astPtr]; @@ -6448,131 +6532,139 @@ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 649 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + case 649 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ + consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; + break; + + case 650 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; + break; + + case 651 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 650 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ + case 652 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeader() ; break; - case 651 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ + case 653 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclaration() ; break; - case 653 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ + case 655 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyAnnotationTypeMemberDeclarationsopt() ; break; - case 654 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 656 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarationsopt() ; break; - case 656 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ + case 658 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarations() ; break; - case 657 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ + case 659 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ consumeMethodHeaderNameWithTypeParameters(true); break; - case 658 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 660 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeMethodHeaderName(true); break; - case 659 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ + case 661 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ consumeEmptyMethodHeaderDefaultValue() ; break; - case 660 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ + case 662 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ consumeMethodHeaderDefaultValue(); break; - case 661 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ + case 663 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 662 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ + case 664 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclaration() ; break; - case 670 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$ + case 672 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$ consumeAnnotationName() ; break; - case 671 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 673 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeNormalAnnotation() ; break; - case 672 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ + case 674 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ consumeEmptyMemberValuePairsopt() ; break; - case 675 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ + case 677 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ consumeMemberValuePairs() ; break; - case 676 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ + case 678 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ consumeMemberValuePair() ; break; - case 677 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ + case 679 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ consumeEnterMemberValue() ; break; - case 678 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ + case 680 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ consumeExitMemberValue() ; break; - case 680 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ + case 682 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ consumeMemberValueAsName() ; break; - case 683 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 685 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 684 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 686 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 685 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 687 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 686 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 688 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 687 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ + case 689 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ consumeEnterMemberValueArrayInitializer() ; break; - case 689 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ + case 691 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ consumeMemberValues() ; break; - case 690 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ + case 692 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ consumeMarkerAnnotation() ; break; - case 691 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 693 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeSingleMemberAnnotation() ; break; - case 692 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ + case 694 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ consumeRecoveryMethodHeaderNameWithTypeParameters(); break; - case 693 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 695 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecoveryMethodHeaderName(); break; - case 694 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 696 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 695 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 697 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; Index: compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java,v retrieving revision 1.57 diff -u -r1.57 ParserBasicInformation.java --- compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java 16 Mar 2007 18:28:59 -0000 1.57 +++ compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java 30 Apr 2007 16:30:17 -0000 @@ -16,20 +16,20 @@ int ERROR_SYMBOL = 110, MAX_NAME_LENGTH = 41, - NUM_STATES = 956, + NUM_STATES = 958, NT_OFFSET = 110, - SCOPE_UBOUND = 131, - SCOPE_SIZE = 132, - LA_STATE_OFFSET = 12794, + SCOPE_UBOUND = 132, + SCOPE_SIZE = 133, + LA_STATE_OFFSET = 12789, MAX_LA = 1, - NUM_RULES = 695, + NUM_RULES = 697, NUM_TERMINALS = 110, NUM_NON_TERMINALS = 309, NUM_SYMBOLS = 419, - START_STATE = 767, + START_STATE = 769, EOFT_SYMBOL = 68, EOLT_SYMBOL = 68, - ACCEPT_ACTION = 12793, - ERROR_ACTION = 12794; + ACCEPT_ACTION = 12788, + ERROR_ACTION = 12789; } Index: compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.properties,v retrieving revision 1.21 diff -u -r1.21 readableNames.properties --- compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.properties 16 Mar 2007 15:40:20 -0000 1.21 +++ compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.properties 30 Apr 2007 16:30:17 -0000 @@ -1,13 +1,3 @@ -############################################################################### -# Copyright (c) 2005, 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### ,opt=, AbstractMethodDeclaration=MethodDeclaration AdditionalBound1=AdditionalBound1 Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v retrieving revision 1.220 diff -u -r1.220 messages.properties --- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 26 Mar 2007 17:16:24 -0000 1.220 +++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 30 Apr 2007 16:30:18 -0000 @@ -504,6 +504,7 @@ 595 = Syntax error, varargs are only available if source level is 5.0 596 = Syntax error, annotations are only available if source level is 5.0 597 = Syntax error, annotation declarations are only available if source level is 5.0 +598 = Syntax error, annotation declaration cannot have type parameters ### ANNOTATIONS 600 = Illegal modifier for the annotation attribute {0}.{1}; only public & abstract are permitted Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.348 diff -u -r1.348 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 19 Apr 2007 17:16:24 -0000 1.348 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 30 Apr 2007 16:30:18 -0000 @@ -3489,6 +3489,16 @@ firstTypeParameter.declarationSourceStart, lastTypeParameter.declarationSourceEnd); } +public void invalidUsageOfTypeParametersForAnnotationDeclaration(TypeDeclaration annotationTypeDeclaration) { + TypeParameter[] parameters = annotationTypeDeclaration.typeParameters; + int length = parameters.length; + this.handle( + IProblem.InvalidUsageOfTypeParametersForAnnotationDeclaration, + NoArgument, + NoArgument, + parameters[0].declarationSourceStart, + parameters[length - 1].declarationSourceEnd); +} public void invalidUsageOfVarargs(Argument argument) { this.handle( IProblem.InvalidUsageOfVarargs, Index: grammar/java.g =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/grammar/java.g,v retrieving revision 1.3 diff -u -r1.3 java.g --- grammar/java.g 16 Mar 2007 11:08:20 -0000 1.3 +++ grammar/java.g 30 Apr 2007 16:30:18 -0000 @@ -2060,6 +2060,11 @@ AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier /.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./ /:$compliance 1.5:/ +AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier TypeParameters +/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./ +/:$compliance 1.5:/ +AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier TypeParameters +/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./ AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier /.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./ /:$readableName AnnotationTypeDeclarationHeaderName:/ Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v retrieving revision 1.178 diff -u -r1.178 CompletionParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 26 Apr 2007 11:27:48 -0000 1.178 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 30 Apr 2007 16:30:16 -0000 @@ -2662,6 +2662,13 @@ this.pendingAnnotation = null; } } +protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() { + super.consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters(); + if (this.pendingAnnotation != null) { + this.pendingAnnotation.potentialAnnotatedNode = this.astStack[this.astPtr]; + this.pendingAnnotation = null; + } +} protected void consumeLabel() { super.consumeLabel(); this.pushOnLabelStack(this.identifierStack[this.identifierPtr]); Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v retrieving revision 1.188 diff -u -r1.188 IProblem.java --- compiler/org/eclipse/jdt/core/compiler/IProblem.java 2 Mar 2007 10:46:03 -0000 1.188 +++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 30 Apr 2007 16:30:16 -0000 @@ -1095,7 +1095,8 @@ int InvalidUsageOfAnnotations = Syntax + Internal + 596; /** @since 3.1 */ int InvalidUsageOfAnnotationDeclarations = Syntax + Internal + 597; - + /** @since 3.3 */ + int InvalidUsageOfTypeParametersForAnnotationDeclaration = Syntax + Internal + 598; /** * Annotation */