return null;
}
private String getNameForType(final TypeReference type) {
TypeReference nameSource = type;
String name;
if (nameSource.isArray()) {
name = "array";
}
else if (StringUtilities.equals(nameSource.getInternalName(), "java/lang/Throwable")) {
name = "t";
}
else if (StringUtilities.endsWith(nameSource.getName(), "Exception")) {
name = "ex";
}
else if (StringUtilities.endsWith(nameSource.getName(), "List")) {
name = "list";
}
else if (StringUtilities.endsWith(nameSource.getName(), "Set")) {
name = "set";
}
else if (StringUtilities.endsWith(nameSource.getName(), "Collection")) {
name = "collection";
}
else {
name = BUILT_IN_TYPE_NAMES.get(nameSource.getInternalName());
if (name != null) {
return name;
}
if (!nameSource.isDefinition()) {
final TypeDefinition resolvedType = nameSource.resolve();
if (resolvedType != null) {
nameSource = resolvedType;
}
}
name = nameSource.getSimpleName();
//
// Remove leading 'I' for interfaces.
//
if (name.length() > 2 &&