changeset 22691:ea96f68e3d9a

8032587: Change silent failure in Attr.java to assertion Summary: Change silent failure in Attr.fromAttributes into a non-null assertion Reviewed-by: jfranck
author emc
date Fri, 24 Jan 2014 08:47:32 -0500
parents 86dd707d616a
children 51651a2a3443
files langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
diffstat 1 files changed, 2 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jan 27 12:45:03 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jan 24 08:47:32 2014 -0500
@@ -4093,18 +4093,8 @@
 
         ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
         for (JCAnnotation anno : annotations) {
-            if (anno.attribute != null) {
-                // TODO: this null-check is only needed for an obscure
-                // ordering issue, where annotate.flush is called when
-                // the attribute is not set yet. For an example failure
-                // try the referenceinfos/NestedTypes.java test.
-                // Any better solutions?
-                buf.append((Attribute.TypeCompound) anno.attribute);
-            }
-            // Eventually we will want to throw an exception here, but
-            // we can't do that just yet, because it gets triggered
-            // when attempting to attach an annotation that isn't
-            // defined.
+            Assert.checkNonNull(anno.attribute);
+            buf.append((Attribute.TypeCompound) anno.attribute);
         }
         return buf.toList();
     }