8037420: Silent failures in Annotate.actualEnterTypeAnnotations
authoremc
Fri, 14 Mar 2014 15:35:13 -0400
changeset 23397 825c76b83afe
parent 23396 06e3726c6b3f
child 23398 295a722619ad
8037420: Silent failures in Annotate.actualEnterTypeAnnotations Summary: Remove two silent failures Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Thu Mar 13 20:13:43 2014 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Fri Mar 14 15:35:13 2014 -0400
@@ -808,9 +808,7 @@
                 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 @@
                 }
             }
 
-            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);