Fix null superclass in inheritance map
Object has no superclass, so don't add it to the list. Also allow InheritanceMap setParents null as a shorthand for none.
This commit is contained in:
parent
d33223562d
commit
29104f24d2
@ -128,7 +128,11 @@ public class InheritanceMap implements InheritanceProvider {
|
||||
}
|
||||
|
||||
public void setParents(String className, Collection<String> parents) {
|
||||
inheritanceMap.put(className, new ArrayList<String>(parents));
|
||||
if (parents == null) {
|
||||
inheritanceMap.put(className, new ArrayList<String>());
|
||||
} else {
|
||||
inheritanceMap.put(className, new ArrayList<String>(parents));
|
||||
}
|
||||
}
|
||||
|
||||
public int size() {
|
||||
|
@ -65,7 +65,9 @@ public class ClassLoaderProvider implements InheritanceProvider {
|
||||
for (String iface : (List<String>) node.interfaces) {
|
||||
parents.add(iface);
|
||||
}
|
||||
parents.add(node.superName);
|
||||
if (node.superName != null) {
|
||||
parents.add(node.superName);
|
||||
}
|
||||
|
||||
return parents;
|
||||
} catch (IOException ex) {
|
||||
|
@ -58,7 +58,9 @@ public class JarProvider implements InheritanceProvider {
|
||||
for (String iface : (List<String>) node.interfaces) {
|
||||
parents.add(iface);
|
||||
}
|
||||
parents.add(node.superName);
|
||||
if (node.superName != null) {
|
||||
parents.add(node.superName);
|
||||
}
|
||||
|
||||
return parents;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user