changeset 3248:c2bdc8b3610b

8037420: Silent failures in Annotate.actualEnterTypeAnnotations Summary: Remove two silent failures Reviewed-by: jjg
author emc
date Fri, 14 Mar 2014 15:35:13 -0400
parents bd152504a538
children 663d51ec6576
files src/share/classes/com/sun/tools/javac/comp/Annotate.java
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Thu Mar 13 20:13:43 2014 +0000
+++ b/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);