Simplify TypePoolCacheKey equals
We have to check string equivalence regardless of classloader state
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/DDCachingPoolStrategy.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/DDCachingPoolStrategy.java
@@ -160,12 +160,13 @@ public class DDCachingPoolStrategy implements PoolStrategy {
return false;
}
+ if (className.equals(that.className)) {
// Fastpath loaderRef equivalence -- works because of WeakReference cache used
// Also covers the bootstrap null loaderRef case
if (loaderRef == that.loaderRef) {
- // still need to check name
- return className.equals(that.className);
- } else if (className.equals(that.className)) {
+ return true;
+ }
+
// need to perform a deeper loader check -- requires calling Reference.get
// which can strengthen the Reference, so deliberately done last

Simplify TypePoolCacheKey equals

We have to check string equivalence regardless of classloader state