Add null-conditional operators on these 3 files (#6007)
* add null conditional operators on these 3 files . To aviod some agent exception of Oracle jdbc. * Add a line in Java Agent section of CHANGES.md file Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
parent
08b31adf60
commit
1297d2e1d2
|
|
@ -13,6 +13,7 @@ Release Notes.
|
|||
* Fix jdk-http and okhttp-3.x plugin did not overwrite the old trace header.
|
||||
* Support collecting logs of log4j, log4j2, and logback in the tracing context with a new `logger-plugin`.
|
||||
* Fix the unexpected RunningContext recreation in the Tomcat plugin.
|
||||
* Fix the potential NPE when trace_sql_parameters is enabled.
|
||||
|
||||
#### OAP-Backend
|
||||
* Make meter receiver support MAL.
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@ public class JDBCPreparedStatementIgnorableSetterInterceptor implements Instance
|
|||
public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
|
||||
final StatementEnhanceInfos statementEnhanceInfos = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField();
|
||||
final int index = (Integer) allArguments[0];
|
||||
statementEnhanceInfos.setParameter(index, Constants.SQL_PARAMETER_PLACEHOLDER);
|
||||
if (statementEnhanceInfos != null) {
|
||||
final int index = (Integer) allArguments[0];
|
||||
statementEnhanceInfos.setParameter(index, Constants.SQL_PARAMETER_PLACEHOLDER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -30,8 +30,10 @@ public class JDBCPreparedStatementNullSetterInterceptor implements InstanceMetho
|
|||
public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
|
||||
final StatementEnhanceInfos statementEnhanceInfos = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField();
|
||||
final int index = (Integer) allArguments[0];
|
||||
statementEnhanceInfos.setParameter(index, "NULL");
|
||||
if (statementEnhanceInfos != null) {
|
||||
final int index = (Integer) allArguments[0];
|
||||
statementEnhanceInfos.setParameter(index, "NULL");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ public class JDBCPreparedStatementSetterInterceptor implements InstanceMethodsAr
|
|||
public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
|
||||
final StatementEnhanceInfos statementEnhanceInfos = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField();
|
||||
final int index = (Integer) allArguments[0];
|
||||
final Object parameter = allArguments[1];
|
||||
statementEnhanceInfos.setParameter(index, parameter);
|
||||
if (statementEnhanceInfos != null) {
|
||||
final int index = (Integer) allArguments[0];
|
||||
final Object parameter = allArguments[1];
|
||||
statementEnhanceInfos.setParameter(index, parameter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue