From 5538021ea6a720d3d3b76e69c3c32d6b2dd25d0a Mon Sep 17 00:00:00 2001 From: Laplie Anderson Date: Fri, 6 Mar 2020 10:51:35 -0500 Subject: [PATCH] classLoaderHasNoResources -> hasClassesNamed --- .../commonshttpclient/CommonsHttpClientInstrumentation.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dd-java-agent/instrumentation/commons-httpclient-2/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java b/dd-java-agent/instrumentation/commons-httpclient-2/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java index f42a294ddf..43a99056dc 100644 --- a/dd-java-agent/instrumentation/commons-httpclient-2/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java +++ b/dd-java-agent/instrumentation/commons-httpclient-2/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java @@ -1,6 +1,6 @@ package datadog.trace.instrumentation.commonshttpclient; -import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasNoResources; +import static datadog.trace.agent.tooling.ClassLoaderMatcher.hasClassesNamed; import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate; @@ -10,7 +10,6 @@ import static datadog.trace.instrumentation.commonshttpclient.HttpHeadersInjectA import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.named; -import static net.bytebuddy.matcher.ElementMatchers.not; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import static net.bytebuddy.matcher.ElementMatchers.takesArguments; @@ -37,7 +36,7 @@ public class CommonsHttpClientInstrumentation extends Instrumenter.Default { @Override public ElementMatcher classLoaderMatcher() { // Optimization for expensive typeMatcher. - return not(classLoaderHasNoResources("org/apache/commons/httpclient/HttpClient.class")); + return hasClassesNamed("org.apache.commons.httpclient.HttpClient"); } @Override