Skip to content

Commit

Permalink
We don't need annotation hack anymore, and they rather harm exposing …
Browse files Browse the repository at this point in the history
…members.
  • Loading branch information
Atsushi Eno committed Nov 9, 2012
1 parent 72a6be6 commit 2663a25
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions JavaClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ boolean isInPublicInheritanceChain (Class cls)
void doAppendToDocument (Document doc, Element parent)
{
int mods = jclass.getModifiers ();
boolean is_annotation = false;

Element e = doc.createElement (jclass.isInterface () && !jclass.isAnnotation () ? "interface" : "class");
if (!jclass.isInterface () || jclass.isAnnotation ()) {
Expand Down Expand Up @@ -533,9 +532,6 @@ else if (iface instanceof ParameterizedType) {
iface_elem.setAttribute ("name-generic-aware", getGenericTypeName (iface));
iface_elem.appendChild (doc.createTextNode ("\n"));
e.appendChild (iface_elem);

if (iface_elem.getAttribute ("name").equals ("java.lang.annotation.Annotation"))
is_annotation = true;
}

for (Constructor ctor : jclass.getDeclaredConstructors ())
Expand Down Expand Up @@ -630,25 +626,6 @@ else if (hret != null && !mret.isAssignableFrom (hret)) {
for (Field field : fields)
appendField (field, asmFields.get (field.getName ()), doc, e);
parent.appendChild (e);

if (is_annotation)
parent.appendChild (createAnnotationMock (doc, className));
}

static Element createAnnotationMock (Document doc, String name)
{
Element e = doc.createElement ("class");
e.setAttribute ("abstract", "true");
e.setAttribute ("deprecated", "not deprecated");
e.setAttribute ("extends", "java.lang.Object");
e.setAttribute ("final", "false");
e.setAttribute ("name", name);
e.setAttribute ("static", "false");
e.setAttribute ("visibility", "public");
Element i = doc.createElement ("implements");
i.setAttribute ("name", "java.lang.annotation.Annotation");
e.appendChild (i);
return e;
}

static final Field [] empty_array = new Field [0];
Expand Down

0 comments on commit 2663a25

Please sign in to comment.