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:
Joakim Erdfelt 2018-03-20 16:40:57 -05:00 committed by GitHub
commit 50ca9d87d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -65,18 +65,21 @@ 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);
}
}