mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-31 13:38:47 +00:00
8032932: Add assertion to fix silent failure in Gen.getAndRemoveNonFieldTAs
Turn silent failure if type annotation position type is UNKNOWN into assertion failure. Reviewed-by: jjg
This commit is contained in:
parent
07998a6335
commit
77feb9302c
@ -103,8 +103,6 @@ public class Gen extends JCTree.Visitor {
|
||||
*/
|
||||
private LVTRanges lvtRanges;
|
||||
|
||||
private final boolean typeAnnoAsserts;
|
||||
|
||||
protected Gen(Context context) {
|
||||
context.put(genKey, this);
|
||||
|
||||
@ -141,7 +139,6 @@ public class Gen extends JCTree.Visitor {
|
||||
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 @@ public class Gen extends JCTree.Visitor {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user