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.
@@ -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;
}
