changeset 22697:2a39af0e7d34

8032932: Add assertion to fix silent failure in Gen.getAndRemoveNonFieldTAs Summary: Turn silent failure if type annotation position type is UNKNOWN into assertion failure. Reviewed-by: jjg
author emc
date Tue, 28 Jan 2014 17:52:30 -0500
parents 0a916fd27b8b
children 818555741cd5
files langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Jan 28 17:51:28 2014 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Jan 28 17:52:30 2014 -0500
@@ -103,8 +103,6 @@
      */
     private LVTRanges lvtRanges;
 
-    private final boolean typeAnnoAsserts;
-
     protected Gen(Context context) {
         context.put(genKey, this);
 
@@ -141,7 +139,6 @@
         debugCode = options.isSet("debugcode");
         allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic");
         pool = new Pool(types);
-        typeAnnoAsserts = options.isSet("TypeAnnotationAsserts");
 
         generateIproxies =
             target.requiresIproxy() ||
@@ -564,13 +561,10 @@
         ListBuffer<Attribute.TypeCompound> fieldTAs = new ListBuffer<>();
         ListBuffer<Attribute.TypeCompound> nonfieldTAs = new ListBuffer<>();
         for (TypeCompound ta : tas) {
+            Assert.check(ta.getPosition().type != TargetType.UNKNOWN);
             if (ta.getPosition().type == TargetType.FIELD) {
                 fieldTAs.add(ta);
             } else {
-                if (typeAnnoAsserts) {
-                    Assert.error("Type annotation does not have a valid positior");
-                }
-
                 nonfieldTAs.add(ta);
             }
         }