Merge pull request #2362 from eclipse/jetty-9.4.x-issue-2361-cachingwebappclassloader-fix
Issue #2361 - CachingWebAppClassLoader is not using cache properly
This commit is contained in:
commit
50ca9d87d8
|
@ -64,23 +64,26 @@ public class CachingWebAppClassLoader extends WebAppClassLoader
|
|||
}
|
||||
|
||||
URL url = _cache.get(name);
|
||||
|
||||
if (name==null)
|
||||
|
||||
if (url == null)
|
||||
{
|
||||
// Not found in cache, try parent
|
||||
url = super.getResource(name);
|
||||
|
||||
if (url==null)
|
||||
{
|
||||
// Still not found, cache the not-found result
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Caching not found resource {}",name);
|
||||
_notFound.add(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cache the new result
|
||||
_cache.putIfAbsent(name,url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue