### 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 30 Dec 2008 12:06:19 -0000 @@ -378,6 +378,15 @@ break checkTargetCompatibility; } else if ((metaTagBits & TagBits.AnnotationForType) != 0) break checkTargetCompatibility; + else { + // Annotations that target a package are kosher for the synthetic interface type + // package-info. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906 + char [] name = ((ReferenceBinding)this.recipient).sourceName(); + if (name != null && CharOperation.equals(name, TypeConstants.PACKAGE_INFO_NAME)) { + if ((metaTagBits & TagBits.AnnotationForPackage) != 0) + 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 30 Dec 2008 12:06:20 -0000 @@ -659,6 +659,10 @@ annotations[i].traverse(visitor, methodScope); } } + // Propagate any package level annotations to the synthetic interface that is the + // representative as well as place holder for the package level info. + // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906 + syntheticTypeDeclaration.annotations = annotations; } } if (this.currentPackage != null) {