Skip to content

Commit

Permalink
Merge pull request #5957 from eclipse/jetty-9.4.x-5950-remove-logging…
Browse files Browse the repository at this point in the history
…-during-classloading

Issue #5950 - remove WebAppClassLoader logging during loadClass
  • Loading branch information
joakime authored Feb 15, 2021
2 parents 75183e8 + 165aa1a commit 64c7fe0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil;
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;

/**
Expand All @@ -69,8 +67,6 @@

public class ClasspathPattern extends AbstractSet<String>
{
private static final Logger LOG = Log.getLogger(ClasspathPattern.class);

static class Entry
{
private final String _pattern;
Expand Down Expand Up @@ -697,9 +693,8 @@ public boolean match(Class<?> clazz)
{
return combine(_packageOrNamePatterns, clazz.getName(), _locations, () -> TypeUtil.getLocationOfClass(clazz));
}
catch (Exception e)
catch (Exception ignored)
{
LOG.warn(e);
}
return false;
}
Expand All @@ -719,9 +714,8 @@ public boolean match(String name, URL url)
{
return URIUtil.getJarSource(url.toURI());
}
catch (URISyntaxException e)
catch (URISyntaxException ignored)
{
LOG.ignore(e);
return null;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
webappClass = findLoadedClass(name);
if (webappClass != null)
{
if (LOG.isDebugEnabled())
LOG.debug("found webapp loaded {}", webappClass);
return webappClass;
}

Expand All @@ -493,8 +491,6 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
// If the webapp is allowed to see this class
if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass))
{
if (LOG.isDebugEnabled())
LOG.debug("PLP parent loaded {}", parentClass);
return parentClass;
}
}
Expand All @@ -515,8 +511,6 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
webappClass = this.findClass(name);
if (resolve)
resolveClass(webappClass);
if (LOG.isDebugEnabled())
LOG.debug("PLP webapp loaded {}", webappClass);
return webappClass;
}
catch (ClassNotFoundException e)
Expand Down Expand Up @@ -545,8 +539,6 @@ else if (e != ex)
// If the webapp is allowed to see this class
if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parentClass))
{
if (LOG.isDebugEnabled())
LOG.debug("WAP parent loaded {}", parentClass);
return parentClass;
}
}
Expand Down Expand Up @@ -655,9 +647,6 @@ protected Class<?> foundClass(final String name, URL url) throws ClassNotFoundEx
content = url.openStream();
byte[] bytes = IO.readBytes(content);

if (LOG.isDebugEnabled())
LOG.debug("foundClass({}) url={} cl={}", name, url, this);

for (ClassFileTransformer transformer : _transformers)
{
byte[] tmp = transformer.transform(this, name, null, null, bytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,6 @@ public boolean isServerClass(Class<?> clazz)
loadServerClasses();

boolean result = _serverClasses.match(clazz);
if (LOG.isDebugEnabled())
LOG.debug("isServerClass=={} {}", result, clazz);
return result;
}

Expand All @@ -802,8 +800,6 @@ public boolean isSystemClass(Class<?> clazz)
loadSystemClasses();

boolean result = _systemClasses.match(clazz);
if (LOG.isDebugEnabled())
LOG.debug("isSystemClass=={} {}", result, clazz);
return result;
}

Expand All @@ -814,8 +810,6 @@ public boolean isServerResource(String name, URL parentUrl)
loadServerClasses();

boolean result = _serverClasses.match(name, parentUrl);
if (LOG.isDebugEnabled())
LOG.debug("isServerResource=={} {} {}", result, name, parentUrl);
return result;
}

Expand All @@ -826,8 +820,6 @@ public boolean isSystemResource(String name, URL webappUrl)
loadSystemClasses();

boolean result = _systemClasses.match(name, webappUrl);
if (LOG.isDebugEnabled())
LOG.debug("isSystemResource=={} {} {}", result, name, webappUrl);
return result;
}

Expand Down

0 comments on commit 64c7fe0

Please sign in to comment.