From 53e3990b7cc0d50b201d2d34b0d1b090fabc81ab Mon Sep 17 00:00:00 2001 From: Eric McCorkle Date: Fri, 14 Mar 2014 15:35:13 -0400 Subject: [PATCH] 8037420: Silent failures in Annotate.actualEnterTypeAnnotations Remove two silent failures Reviewed-by: jjg --- .../classes/com/sun/tools/javac/comp/Annotate.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java index cd1383b3b0a..1a9e0626b1c 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java @@ -808,9 +808,7 @@ public class Annotate { Attribute.TypeCompound tc = enterTypeAnnotation(a, syms.annotationType, env); - if (tc == null) { - continue; - } + Assert.checkNonNull(tc, "Failed to create type annotation"); if (annotated.containsKey(a.type.tsym)) { if (!allowRepeatedAnnos) { @@ -827,10 +825,9 @@ public class Annotate { } } - if (s != null) { - s.appendTypeAttributesWithCompletion( - new AnnotateRepeatedContext<>(env, annotated, pos, log, true)); - } + Assert.checkNonNull(s, "Symbol argument to actualEnterTypeAnnotations is null"); + s.appendTypeAttributesWithCompletion( + new AnnotateRepeatedContext<>(env, annotated, pos, log, true)); } finally { if (prevLintPos != null) deferredLintHandler.setPos(prevLintPos);