### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java,v retrieving revision 1.65 diff -u -r1.65 Annotation.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 5 Sep 2008 10:24:43 -0000 1.65 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 19 Dec 2008 19:04:51 -0000 @@ -376,8 +376,12 @@ if (((ReferenceBinding)this.recipient).isAnnotationType()) { if ((metaTagBits & (TagBits.AnnotationForAnnotationType|TagBits.AnnotationForType)) != 0) break checkTargetCompatibility; - } else if ((metaTagBits & TagBits.AnnotationForType) != 0) + } else if ((metaTagBits & TagBits.AnnotationForType) != 0) { break checkTargetCompatibility; + } else if ((metaTagBits & TagBits.AnnotationForPackage) != 0) { + if (CharOperation.equals(((ReferenceBinding)this.recipient).sourceName, TypeConstants.PACKAGE_INFO_NAME)) + break checkTargetCompatibility; + } break; case Binding.METHOD : if (((MethodBinding)this.recipient).isConstructor()) { Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java,v retrieving revision 1.83 diff -u -r1.83 CompilationUnitDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 3 Dec 2008 12:55:10 -0000 1.83 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 19 Dec 2008 19:04:52 -0000 @@ -342,9 +342,6 @@ } return; } - if (isPackageInfo() && this.types != null && this.currentPackage!= null && this.currentPackage.annotations != null) { - this.types[0].annotations = this.currentPackage.annotations; - } try { if (this.types != null) { for (int i = 0, count = this.types.length; i < count; i++) Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java,v retrieving revision 1.123 diff -u -r1.123 CompilationUnitScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 27 Nov 2008 20:31:16 -0000 1.123 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 19 Dec 2008 19:04:52 -0000 @@ -100,6 +100,9 @@ declaration.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccInterface; firstIsSynthetic = true; } + // ensure the package annotations are copied over before resolution + if (this.referenceContext.currentPackage != null) + this.referenceContext.types[0].annotations = this.referenceContext.currentPackage.annotations; } recordQualifiedReference(this.currentPackageName); // always dependent on your own package }