Use safeHasSuperType instead of isSubTypeOf
MODIFY
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/ConnectionInstrumentation.java
dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/ConnectionInstrumentation.java
@@ -2,7 +2,6 @@ package datadog.trace.instrumentation.jdbc;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.isSubTypeOf;
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.not;
@@ -38,7 +37,7 @@ public final class ConnectionInstrumentation extends Instrumenter.Default {
nameStartsWith("prepare")
.and(takesArgument(0, String.class))
// Also include CallableStatement, which is a sub type of PreparedStatement
- .and(returns(isSubTypeOf(PreparedStatement.class))),
+ .and(returns(safeHasSuperType(named(PreparedStatement.class.getName())))),
ConnectionPrepareAdvice.class.getName());
return transformers;
}

Use safeHasSuperType instead of isSubTypeOf