diff -r 4788eb38cac5 -r f3ca12d680f3 src/share/classes/com/sun/tools/javac/comp/Annotate.java --- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java Mon Nov 11 09:47:46 2013 -0500 +++ b/src/share/classes/com/sun/tools/javac/comp/Annotate.java Mon Nov 11 17:26:09 2013 +0100 @@ -255,6 +255,9 @@ : attr.attribType(a.annotationType, env)); a.type = chk.checkType(a.annotationType.pos(), at, expected); if (a.type.isErroneous()) { + // Need to make sure nested (anno)trees does not have null as .type + attr.postAttr(a); + if (typeAnnotation) { return new Attribute.TypeCompound(a.type, List.>nil(), new TypeAnnotationPosition()); @@ -265,6 +268,10 @@ if ((a.type.tsym.flags() & Flags.ANNOTATION) == 0) { log.error(a.annotationType.pos(), "not.annotation.type", a.type.toString()); + + // Need to make sure nested (anno)trees does not have null as .type + attr.postAttr(a); + if (typeAnnotation) { return new Attribute.TypeCompound(a.type, List.>nil(), null); } else { @@ -278,7 +285,7 @@ Assign(make.Ident(names.value), args.head); } ListBuffer> buf = - new ListBuffer>(); + new ListBuffer<>(); for (List tl = args; tl.nonEmpty(); tl = tl.tail) { JCExpression t = tl.head; if (!t.hasTag(ASSIGN)) { @@ -304,8 +311,7 @@ Type result = method.type.getReturnType(); Attribute value = enterAttributeValue(result, assign.rhs, env); if (!method.type.isErroneous()) - buf.append(new Pair - ((MethodSymbol)method, value)); + buf.append(new Pair<>((MethodSymbol)method, value)); t.type = result; } if (typeAnnotation) {