Skip to content

Commit 880e591

Browse files
committed
Remove leading and trailing angle brackets from type names.
Only applies to method parameters and return types.
1 parent 0f81328 commit 880e591

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed
72 Bytes
Binary file not shown.

java_generate/ReferenceGenerator/src/writers/BaseWriter.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,17 @@ protected static ArrayList<HashMap<String, String>> getSyntax(MethodDoc doc, Str
479479
return ret;
480480
}
481481

482-
protected static String importedName(String fullName){
483-
if(fullName.contains("."))
484-
{
485-
return fullName.substring( fullName.lastIndexOf(".") + 1 );
486-
}
482+
protected static String importedName(String fullName)
483+
{
484+
// keep everything after the last dot
485+
// note that this doesn't properly handle generic types
486+
if( fullName.contains(".") )
487+
{ fullName = fullName.substring( fullName.lastIndexOf(".") + 1 ); }
488+
// for the moment, just strip angle brackets from names
489+
if( fullName.charAt(0) == '<' )
490+
{ fullName = fullName.substring( 1 ); }
491+
if( fullName.endsWith(">") )
492+
{ fullName = fullName.substring( 0, fullName.length() - 1 ); }
487493
return fullName;
488494
}
489495

0 commit comments

Comments
 (0)