Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CONJ-716] correcting possible NPE when logging information
  • Loading branch information
rusher committed Jul 9, 2019
1 parent 0c29431 commit 612c2fe
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -69,8 +69,8 @@

public class ProtocolLoggingProxy implements InvocationHandler {

private static final NumberFormat numberFormat = DecimalFormat.getInstance();
private static final Logger logger = LoggerFactory.getLogger(ProtocolLoggingProxy.class);
private final NumberFormat numberFormat;
private final boolean profileSql;
private final Long slowQueryThresholdNanos;
private final int maxQuerySizeToLog;
Expand All @@ -89,11 +89,11 @@ public ProtocolLoggingProxy(Protocol protocol, Options options) {
this.slowQueryThresholdNanos = options.slowQueryThresholdNanos;
this.maxQuerySizeToLog = options.maxQuerySizeToLog;
this.logQuery = new LogQueryTool(options);
this.numberFormat = DecimalFormat.getInstance();
}

@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
long startTime = System.nanoTime();
try {

switch (method.getName()) {
Expand All @@ -104,6 +104,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
case "executeBatchClient":
case "executeBatchServer":

final long startTime = System.nanoTime();
Object returnObj = method.invoke(protocol, args);
if (logger.isInfoEnabled() && (profileSql
|| (slowQueryThresholdNanos != null
Expand Down

0 comments on commit 612c2fe

Please sign in to comment.