Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java,v retrieving revision 1.43 diff -u -r1.43 CompilationUnitDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 10 Mar 2005 16:28:15 -0000 1.43 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 31 Mar 2005 04:08:07 -0000 @@ -280,13 +280,15 @@ if (this.currentPackage != null) { if (this.currentPackage.annotations != null) { if (CharOperation.equals(this.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { - // resolve annotations - final TypeDeclaration syntheticTypeDeclaration = types[0]; - syntheticTypeDeclaration.resolve(this.scope); - resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.fPackage); - // set the synthetic bit - syntheticTypeDeclaration.binding.modifiers |= AccSynthetic; - startingTypeIndex = 1; + if (this.types != null) { + // resolve annotations + final TypeDeclaration syntheticTypeDeclaration = types[0]; + syntheticTypeDeclaration.resolve(this.scope); + resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.fPackage); + // set the synthetic bit + syntheticTypeDeclaration.binding.modifiers |= AccSynthetic; + startingTypeIndex = 1; + } } else { scope.problemReporter().invalidFileNameForPackageAnnotations(this.currentPackage.annotations[0]); }