Permalink
Browse files

Add generic-aware type names on fields and class base types.

  • Loading branch information...
1 parent 24240ee commit 51c08b0ca1cb526cca9c368d8da964555f03122c @atsushieno atsushieno committed Oct 17, 2011
Showing with 5 additions and 8 deletions.
  1. +5 −8 JavaClass.java
View
@@ -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");
@@ -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));

0 comments on commit 51c08b0

Please sign in to comment.