Cache negative hits in InheritanceMap
This commit is contained in:
parent
3d40eca480
commit
5b02d05ed2
@ -119,6 +119,10 @@ public class InheritanceMap implements IInheritanceProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasParents(String className) {
|
||||
return inheritanceMap.containsKey(className);
|
||||
}
|
||||
|
||||
public List<String> getParents(String className) {
|
||||
return inheritanceMap.get(className);
|
||||
}
|
||||
|
@ -69,14 +69,14 @@ public class JarMapping {
|
||||
|
||||
String mapped = map.get(key);
|
||||
if (mapped == null) {
|
||||
List<String> parents = inheritanceMap.getParents(owner);
|
||||
if (parents == null && fallbackInheritanceProvider != null) {
|
||||
List<String> parents = null;
|
||||
|
||||
if (inheritanceMap.hasParents(owner)) {
|
||||
parents = inheritanceMap.getParents(owner);
|
||||
} else if (fallbackInheritanceProvider != null) {
|
||||
parents = fallbackInheritanceProvider.getParents(owner);
|
||||
if (parents != null) {
|
||||
// cache
|
||||
inheritanceMap.setParents(owner, (ArrayList<String>) parents);
|
||||
}
|
||||
}
|
||||
|
||||
if (parents != null) {
|
||||
// climb the inheritance tree
|
||||
|
Loading…
Reference in New Issue
Block a user