Merge pull request #49 from kno10/patch-3

Strip generics from parent classes properly, fixes #20
This commit is contained in:
Diomidis Spinellis 2018-03-28 17:24:36 +03:00 committed by GitHub
commit 7cc92e6fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -1013,8 +1013,17 @@ class ClassGraph {
int openIdx = name.indexOf('<');
if(openIdx == -1)
return name;
else
return name.substring(0, openIdx);
StringBuilder buf = new StringBuilder(name.length());
for (int i = 0, depth = 0; i < name.length(); i++) {
char c = name.charAt(i);
if (c == '<')
depth++;
else if (c == '>')
depth--;
else if (depth == 0)
buf.append(c);
}
return buf.toString();
}
/** Convert the class name into a corresponding URL */