Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5950 - remove WebAppClassLoader logging during loadClass #5957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should be e.printStackTrace() to replace warnings

}
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);
gregw marked this conversation as resolved.
Show resolved Hide resolved
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