--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Nov 01 19:08:56 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Nov 01 21:43:27 2013 +0100
@@ -2254,7 +2254,8 @@
// empty annotations, if only declaration annotations were given.
// This method will raise an error for such a type.
for (JCAnnotation ai : annotations) {
- if (typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
+ if (!ai.type.isErroneous() &&
+ typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
log.error(ai.pos(), "annotation.type.not.applicable");
}
}