Cache negative hits in InheritanceMap

This commit is contained in:
Agaricus 2013-02-18 19:07:08 -08:00
parent 3d40eca480
commit 5b02d05ed2
2 changed files with 10 additions and 6 deletions

View File

@ -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);
}

View File

@ -69,13 +69,13 @@ 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);
}
inheritanceMap.setParents(owner, (ArrayList<String>) parents);
}
if (parents != null) {