Program: 12413
Project: 12413
Buggy source:
@TxMain private void postSaveAfterSent(final Payload payload){
  try {
    mainJdbc.update(new PreparedStatementCreator(){
      @Override public PreparedStatement createPreparedStatement(      Connection connection) throws SQLException {
        PreparedStatement ps=connection.prepareStatement(SQL_PAYLOAD_INSERT,Statement.RETURN_GENERATED_KEYS);
        ps.setObject(1,payload.getId());
        ps.setObject(2,payload.getTitle());
        ps.setObject(3,payload.getBadge());
        ps.setObject(4,payload.getExtras());
        ps.setObject(5,payload.getSound());
        ps.setObject(6,payload.getProductId());
        ps.setObject(7,payload.getTotalUsers());
        ps.setObject(8,payload.getCreateAt());
        ps.setObject(9,payload.getStatusId());
        ps.setObject(10,payload.getBroadcast());
        ps.setObject(11,payload.getSentDate());
        ps.setObject(12,payload.getOfflineMode());
        ps.setObject(13,payload.getToMode());
        ps.setObject(14,payload.getApnsMode());
        return ps;
      }
    }
);
  }
 catch (  DataAccessException e) {
    logger.error("String_Node_Str",e);
  }
  MetricBuilder.jdbcUpdateMeter.mark(1);
  if (payload.getClients() != null) {
    try {
      mainJdbc.batchUpdate(SQL_PAYLOAD_CLIENT_INSERT,new BatchPreparedStatementSetter(){
        @Override public void setValues(        PreparedStatement preparedStatement,        int i) throws SQLException {
          String userId=payload.getClients().get(i);
          PushStatus error=payload.getStatus().get(userId);
          int statusId=error.getPayloadStatus();
          int onlineMode=error.getOnlineMode(payload.getOfflineMode().intValue());
          preparedStatement.setObject(1,payload.getId());
          preparedStatement.setObject(2,userId);
          preparedStatement.setObject(3,payload.getProductId());
          preparedStatement.setObject(4,statusId);
          preparedStatement.setObject(5,new Date().getTime() / 1000);
          preparedStatement.setObject(6,onlineMode);
          preparedStatement.setObject(7,error != null ? error.getCode() : null);
          preparedStatement.setObject(8,error != null ? error.getMsg() : null);
        }
        @Override public int getBatchSize(){
          return payload.getClients().size();
        }
      }
);
    }
 catch (    DataAccessException e) {
      logger.error("String_Node_Str",e);
    }
    MetricBuilder.jdbcUpdateMeter.mark(1);
  }
}

Fixed version (ground truth):
@TxMain private void postSaveAfterSent(final Payload payload){
  try {
    mainJdbc.update(new PreparedStatementCreator(){
      @Override public PreparedStatement createPreparedStatement(      Connection connection) throws SQLException {
        PreparedStatement ps=connection.prepareStatement(SQL_PAYLOAD_INSERT,Statement.RETURN_GENERATED_KEYS);
        ps.setObject(1,payload.getId());
        ps.setObject(2,payload.getTitle());
        ps.setObject(3,payload.getBadge());
        ps.setObject(4,payload.getExtras());
        ps.setObject(5,payload.getSound());
        ps.setObject(6,payload.getProductId());
        ps.setObject(7,payload.getTotalUsers());
        ps.setObject(8,payload.getCreateAt());
        ps.setObject(9,payload.getStatusId());
        ps.setObject(10,payload.getBroadcast());
        ps.setObject(11,payload.getSentDate());
        ps.setObject(12,payload.getOfflineMode());
        ps.setObject(13,payload.getToMode());
        ps.setObject(14,payload.getApnsMode());
        return ps;
      }
    }
);
  }
 catch (  DataAccessException e) {
    logger.error("String_Node_Str",e);
  }
  MetricBuilder.jdbcUpdateMeter.mark(1);
  if (payload.getClients() != null) {
    try {
      mainJdbc.batchUpdate(SQL_PAYLOAD_CLIENT_INSERT,new BatchPreparedStatementSetter(){
        @Override public void setValues(        PreparedStatement preparedStatement,        int i) throws SQLException {
          String userId=payload.getClients().get(i);
          PushStatus error=payload.getStatus().get(userId);
          int statusId=error.getPayloadStatus();
          int onlineMode=error.getOnlineMode(payload.getOfflineMode().intValue());
          preparedStatement.setObject(1,payload.getId());
          preparedStatement.setObject(2,userId);
          preparedStatement.setObject(3,payload.getProductId());
          preparedStatement.setObject(4,statusId);
          preparedStatement.setObject(5,System.currentTimeMillis() / 1000);
          preparedStatement.setObject(6,onlineMode);
          preparedStatement.setObject(7,error != null ? error.getCode() : null);
          preparedStatement.setObject(8,error != null ? error.getMsg() : null);
        }
        @Override public int getBatchSize(){
          return payload.getClients().size();
        }
      }
);
    }
 catch (    DataAccessException e) {
      logger.error("String_Node_Str",e);
    }
    MetricBuilder.jdbcUpdateMeter.mark(1);
  }
}