8032980: Silent failure in Attr.annotateType
authoremc
Tue, 28 Jan 2014 17:51:28 -0500
changeset 22696 0a916fd27b8b
parent 22695 a290c74925d7
child 22697 2a39af0e7d34
8032980: Silent failure in Attr.annotateType Summary: Turn silent discard of annotations in Attr.annotateType if conversion to TypeCompound fails into an assertion failure. Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Jan 28 14:31:29 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Jan 28 17:51:28 2014 -0500
@@ -4078,11 +4078,9 @@
             @Override
             public void run() {
                 List<Attribute.TypeCompound> compounds = fromAnnotations(annotations);
-                if (annotations.size() == compounds.size()) {
-                    // All annotations were successfully converted into compounds
+                Assert.check(annotations.size() == compounds.size());
                     tree.type = tree.type.unannotatedType().annotatedType(compounds);
                 }
-            }
         });
     }