Skip to content

Commit

Permalink
avoid "java.lang.Void" output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Atsushi Eno committed Jan 8, 2013
1 parent 0e670bb commit 963c647
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions JavaClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static String getClassName (Class jclass, boolean isFullname)

String qualname = jclass.getName ();
String basename = isFullname ? qualname : qualname.substring (jclass.getPackage ().getName ().length () + 1, qualname.length ());
return basename.replace ("$", ".");
return basename.replace ("$", ".").replace ("java.lang.Void", "void");
}

public void appendToDocument (Document doc, Element parent)
Expand Down Expand Up @@ -764,13 +764,13 @@ else if (name.equals ("S"))
else if (name.equals ("Z"))
return "boolean" + suffix;
else if (name.charAt (0) == 'L')
return name.substring (1, name.length () - 1).replace ('$', '.') + suffix;
return name.substring (1, name.length () - 1).replace ('$', '.').replace ("java.lang.Void", "void") + suffix;
else {
System.err.println ("warning J2XA008: unexpected array type name '" + name + "'");
return "";
}
}
return name.replace ('$', '.');
return name.replace ('$', '.').replace ("java.lang.Void", "void");
} else if (type instanceof ParameterizedType) {
// toString() does not work fine for ParameterizedType, so do it by ourselves.
ParameterizedType ptype = (ParameterizedType) type;
Expand All @@ -788,10 +788,10 @@ else if (name.charAt (0) == 'L')
}
if (occured)
sb.append ('>');
return sb.toString ();
return sb.toString ().replace ("java.lang.Void", "void");
} else {
try {
return type.toString ().replace ('$', '.');
return type.toString ().replace ('$', '.').replace ("java.lang.Void", "void");
} catch (TypeNotPresentException e) { // Oracle has buggy Type.toString() implementation that throws this error at this late.
System.err.println (e);
System.err.println ("warning J2XA009: Java failed to resolve type. See verbose output for details.");
Expand Down

0 comments on commit 963c647

Please sign in to comment.