Skip to content

Commit

Permalink
Add generic-aware type names on fields and class base types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Atsushi Eno committed Oct 17, 2011
1 parent 24240ee commit 51c08b0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions JavaClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ void appendField (Field field, FieldNode asmField, Document doc, Element parent)

Element e = doc.createElement ("field");
e.setAttribute ("name", field.getName ());
// FIXME: at some stage we'd like to use generic name.
//e.setAttribute ("type", getGenericTypeName (field.getGenericType ()));
e.setAttribute ("type-generic-aware", getGenericTypeName (field.getGenericType ()));
e.setAttribute ("type", getClassName (field.getType (), true));
e.setAttribute ("final", Modifier.isFinal (mods) ? "true" : "false");
e.setAttribute ("static", Modifier.isStatic (mods) ? "true" : "false");
Expand Down Expand Up @@ -400,13 +399,11 @@ public void appendToDocument (Document doc, Element parent)

Element e = doc.createElement (jclass.isInterface () && !jclass.isAnnotation () ? "interface" : "class");
if (!jclass.isInterface () || jclass.isAnnotation ()) {
// FIXME: at some stage we'd like to use generic name.
//Type t = jclass.getGenericSuperclass ();
//if (t != null)
// e.setAttribute ("extends", getGenericTypeName (t));
Class t = jclass.getSuperclass ();
Type t = jclass.getGenericSuperclass ();
if (t != null)
e.setAttribute ("extends", getClassName (t, true));
e.setAttribute ("extends-generic-aware", getGenericTypeName (t));
if (t instanceof Class)
e.setAttribute ("extends", getClassName ((Class) t, true));
}

e.setAttribute ("name", getClassName (jclass, false));
Expand Down

0 comments on commit 51c08b0

Please sign in to comment.