Bugfix for illegal field in interface: added extra check that instrumented jdbc impl class is not an interface
This commit is contained in:
parent
a6f481fc43
commit
5a2ee4e7ec
1 changed files with 2 additions and 2 deletions
|
|
@ -189,7 +189,7 @@ public class JdbcInstrumentor extends Instrumentor {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isJdbcPreparedStatementImpl(String resource, CtClass ctClass) throws NotFoundException {
|
boolean isJdbcPreparedStatementImpl(String resource, CtClass ctClass) throws NotFoundException {
|
||||||
if (!resource.startsWith("java/sql")) {
|
if (!ctClass.isInterface() && !resource.startsWith("java/sql")) {
|
||||||
return stream(ctClass.getInterfaces())
|
return stream(ctClass.getInterfaces())
|
||||||
.anyMatch(i -> i.getName().equals("java.sql.PreparedStatement"));
|
.anyMatch(i -> i.getName().equals("java.sql.PreparedStatement"));
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@ public class JdbcInstrumentor extends Instrumentor {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isJdbcConnectionImpl(String resource, CtClass ctClass) throws NotFoundException {
|
boolean isJdbcConnectionImpl(String resource, CtClass ctClass) throws NotFoundException {
|
||||||
if (!resource.startsWith("java/sql")) {
|
if (!ctClass.isInterface() && !resource.startsWith("java/sql")) {
|
||||||
return stream(ctClass.getInterfaces())
|
return stream(ctClass.getInterfaces())
|
||||||
.anyMatch(i -> i.getName().equals("java.sql.Connection"));
|
.anyMatch(i -> i.getName().equals("java.sql.Connection"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue