Merge pull request #5957 from eclipse/jetty-9.4.x-5950-remove-logging-during-classloading

Issue #5950 - remove WebAppClassLoader logging during loadClass
This commit is contained in:
Joakim Erdfelt 2021-02-15 12:22:11 -06:00 committed by GitHub
commit 64c7fe076a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 27 deletions

View File

@ -43,8 +43,6 @@ import org.eclipse.jetty.util.IncludeExcludeSet;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.Resource;
/** /**
@ -69,8 +67,6 @@ import org.eclipse.jetty.util.resource.Resource;
public class ClasspathPattern extends AbstractSet<String> public class ClasspathPattern extends AbstractSet<String>
{ {
private static final Logger LOG = Log.getLogger(ClasspathPattern.class);
static class Entry static class Entry
{ {
private final String _pattern; private final String _pattern;
@ -697,9 +693,8 @@ public class ClasspathPattern extends AbstractSet<String>
{ {
return combine(_packageOrNamePatterns, clazz.getName(), _locations, () -> TypeUtil.getLocationOfClass(clazz)); return combine(_packageOrNamePatterns, clazz.getName(), _locations, () -> TypeUtil.getLocationOfClass(clazz));
} }
catch (Exception e) catch (Exception ignored)
{ {
LOG.warn(e);
} }
return false; return false;
} }
@ -719,9 +714,8 @@ public class ClasspathPattern extends AbstractSet<String>
{ {
return URIUtil.getJarSource(url.toURI()); return URIUtil.getJarSource(url.toURI());
} }
catch (URISyntaxException e) catch (URISyntaxException ignored)
{ {
LOG.ignore(e);
return null; return null;
} }
}); });

View File

@ -475,8 +475,6 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility
webappClass = findLoadedClass(name); webappClass = findLoadedClass(name);
if (webappClass != null) if (webappClass != null)
{ {
if (LOG.isDebugEnabled())
LOG.debug("found webapp loaded {}", webappClass);
return webappClass; return webappClass;
} }
@ -493,8 +491,6 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility
// If the webapp is allowed to see this class // If the webapp is allowed to see this class
if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass)) if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass))
{ {
if (LOG.isDebugEnabled())
LOG.debug("PLP parent loaded {}", parentClass);
return parentClass; return parentClass;
} }
} }
@ -515,8 +511,6 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility
webappClass = this.findClass(name); webappClass = this.findClass(name);
if (resolve) if (resolve)
resolveClass(webappClass); resolveClass(webappClass);
if (LOG.isDebugEnabled())
LOG.debug("PLP webapp loaded {}", webappClass);
return webappClass; return webappClass;
} }
catch (ClassNotFoundException e) catch (ClassNotFoundException e)
@ -545,8 +539,6 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility
// If the webapp is allowed to see this class // If the webapp is allowed to see this class
if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass)) if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass))
{ {
if (LOG.isDebugEnabled())
LOG.debug("WAP parent loaded {}", parentClass);
return parentClass; return parentClass;
} }
} }
@ -655,9 +647,6 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility
content = url.openStream(); content = url.openStream();
byte[] bytes = IO.readBytes(content); byte[] bytes = IO.readBytes(content);
if (LOG.isDebugEnabled())
LOG.debug("foundClass({}) url={} cl={}", name, url, this);
for (ClassFileTransformer transformer : _transformers) for (ClassFileTransformer transformer : _transformers)
{ {
byte[] tmp = transformer.transform(this, name, null, null, bytes); byte[] tmp = transformer.transform(this, name, null, null, bytes);

View File

@ -790,8 +790,6 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
loadServerClasses(); loadServerClasses();
boolean result = _serverClasses.match(clazz); boolean result = _serverClasses.match(clazz);
if (LOG.isDebugEnabled())
LOG.debug("isServerClass=={} {}", result, clazz);
return result; return result;
} }
@ -802,8 +800,6 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
loadSystemClasses(); loadSystemClasses();
boolean result = _systemClasses.match(clazz); boolean result = _systemClasses.match(clazz);
if (LOG.isDebugEnabled())
LOG.debug("isSystemClass=={} {}", result, clazz);
return result; return result;
} }
@ -814,8 +810,6 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
loadServerClasses(); loadServerClasses();
boolean result = _serverClasses.match(name, parentUrl); boolean result = _serverClasses.match(name, parentUrl);
if (LOG.isDebugEnabled())
LOG.debug("isServerResource=={} {} {}", result, name, parentUrl);
return result; return result;
} }
@ -826,8 +820,6 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
loadSystemClasses(); loadSystemClasses();
boolean result = _systemClasses.match(name, webappUrl); boolean result = _systemClasses.match(name, webappUrl);
if (LOG.isDebugEnabled())
LOG.debug("isSystemResource=={} {} {}", result, name, webappUrl);
return result; return result;
} }