Skip to content
Permalink
Browse files

[CONJ-636] correcting possible NPE thrown in place of exception

(cherry picked from commit 0fe442e)
  • Loading branch information...
rusher committed Aug 23, 2018
1 parent 364383a commit de8b053a6263b17fed2b7e1e78b78b4bab3fba69
@@ -282,8 +282,11 @@ public void clearBatch() {
return results.getCmdInformation().getUpdateCounts();

} catch (SQLException sqle) {
if (results != null) results.commandEnd();
throw executeBatchExceptionEpilogue(sqle, results.getCmdInformation(), size);
if (results != null) {
results.commandEnd();
throw executeBatchExceptionEpilogue(sqle, results.getCmdInformation(), size);
}
throw executeBatchExceptionEpilogue(sqle, null, size);
} finally {
executeBatchEpilogue();
lock.unlock();
@@ -323,8 +326,11 @@ public void clearBatch() {
return results.getCmdInformation().getLargeUpdateCounts();

} catch (SQLException sqle) {
results.commandEnd();
throw executeBatchExceptionEpilogue(sqle, results.getCmdInformation(), size);
if (results != null) {
results.commandEnd();
throw executeBatchExceptionEpilogue(sqle, results.getCmdInformation(), size);
}
throw executeBatchExceptionEpilogue(sqle, null, size);
} finally {
executeBatchEpilogue();
lock.unlock();
@@ -299,8 +299,11 @@ private void executeBatchInternal(int queryParameterSize) throws SQLException {

results.commandEnd();
} catch (SQLException initialSqlEx) {
results.commandEnd();
throw executeBatchExceptionEpilogue(initialSqlEx, results.getCmdInformation(), queryParameterSize);
if (results != null) {
results.commandEnd();
throw executeBatchExceptionEpilogue(initialSqlEx, results.getCmdInformation(), queryParameterSize);
}
throw executeBatchExceptionEpilogue(initialSqlEx, null, queryParameterSize);
} finally {
executeBatchEpilogue();
lock.unlock();
@@ -1225,8 +1225,11 @@ public void clearBatch() {
return results.getCmdInformation().getUpdateCounts();

} catch (SQLException initialSqlEx) {
if (results != null) results.commandEnd();
throw executeBatchExceptionEpilogue(initialSqlEx, results.getCmdInformation(), size);
if (results != null) {
results.commandEnd();
throw executeBatchExceptionEpilogue(initialSqlEx, results.getCmdInformation(), size);
}
throw executeBatchExceptionEpilogue(initialSqlEx, null, size);
} finally {
executeBatchEpilogue();
lock.unlock();

0 comments on commit de8b053

Please sign in to comment.
You can’t perform that action at this time.