Skip to content

Commit

Permalink
enforce final class for annotation alias, let the code remove super c…
Browse files Browse the repository at this point in the history
…lasses, interfaces and modifiers for enum, annotation, abstract and itnerface
  • Loading branch information
blackdrag committed Dec 17, 2012
1 parent e030ca7 commit 8697c9b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ public void transformClass(ClassNode cn) {
}
if (collector==null) return;

// force final class
cn.setModifiers((ACC_FINAL+cn.getModifiers()) & ~(ACC_INTERFACE|ACC_ANNOTATION));
// force final class, remove interface, annotation, enum and abstract modifiers
cn.setModifiers((ACC_FINAL+cn.getModifiers()) & ~(ACC_ENUM|ACC_INTERFACE|ACC_ANNOTATION|ACC_ABSTRACT));
// force Object super class
cn.setSuperClass(ClassHelper.OBJECT_TYPE);
// force no interfaces implemented
cn.setInterfaces(ClassNode.EMPTY_ARRAY);

// add static value():Object[][] method
List<AnnotationNode> meta = getMeta(cn);
Expand Down

0 comments on commit 8697c9b

Please sign in to comment.