change the way classes are loaded so that classLoaderHasClasses would still work for the classes that are being instrumented and being matched at the same time.
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/ClassLoaderMatcher.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/ClassLoaderMatcher.java
@@ -142,17 +142,15 @@ public class ClassLoaderMatcher {
if (cache.containsKey(target)) {
return cache.get(target);
}
- try {
for (final String name : names) {
- Class.forName(name, false, target);
- }
- cache.put(target, true);
- return true;
- } catch (final ClassNotFoundException e) {
+ if (target.getResource(Utils.getResourceName(name)) == null) {
cache.put(target, false);
return false;
}
}
+ cache.put(target, true);
+ return true;
+ }
}
return false;
}

change the way classes are loaded so that classLoaderHasClasses would still work for the classes that are being instrumented and being matched at the same time.