diff -r b35973e2d42e -r 5ffe0d8a5e24 langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Oct 10 13:55:41 2013 -0400 +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Oct 10 20:12:08 2013 -0400 @@ -104,6 +104,8 @@ */ private LVTRanges lvtRanges; + private final boolean typeAnnoAsserts; + protected Gen(Context context) { context.put(genKey, this); @@ -140,6 +142,7 @@ debugCode = options.isSet("debugcode"); allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic"); pool = new Pool(types); + typeAnnoAsserts = options.isSet("TypeAnnotationAsserts"); generateIproxies = target.requiresIproxy() || @@ -562,9 +565,13 @@ ListBuffer fieldTAs = new ListBuffer(); ListBuffer nonfieldTAs = new ListBuffer(); for (TypeCompound ta : tas) { - if (ta.position.type == TargetType.FIELD) { + 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); } }