do not cache negative lookup results

This commit is contained in:
Maxim.Mossienko
2013-01-10 15:33:37 +01:00
parent e9dd10476a
commit ae5825f3f3
@@ -32,7 +32,6 @@ import java.util.*;
public class UrlClassLoader extends ClassLoader {
private final ClassPath myClassPath;
private final List<URL> myURLs;
private final Set<String> myNotFound = new THashSet<String>();
@NonNls static final String CLASS_EXTENSION = ".class";
protected static final boolean myDebugTime = false;
protected static final long NS_THRESHOLD = 10000000;
@@ -70,12 +69,8 @@ public class UrlClassLoader extends ClassLoader {
}
protected Class findClass(final String name) throws ClassNotFoundException {
if (myNotFound.contains(name)) {
throw new ClassNotFoundException(name);
}
Resource res = myClassPath.getResource(name.replace('.', '/').concat(CLASS_EXTENSION), false);
if (res == null) {
myNotFound.add(name);
throw new ClassNotFoundException(name);
}