Enforce anonymous class metadata has final modifier, per JLS 15.9.5.
Change on 2017/06/02 by tball
@@ -467,6 +467,8 @@ public class MetadataWriter extends UnitTreeVisitor {
if (ElementUtil.isAnonymous(type)) {
// Anonymous classes are always static, though their closure may include an instance.
modifiers |= ElementUtil.ACC_ANONYMOUS | java.lang.reflect.Modifier.STATIC;
+ // Anonymous classes are always implicitly final (JLS 15.9.5.).
+ modifiers |= java.lang.reflect.Modifier.FINAL;
}
return modifiers;
}
