Program: 167529
Project: 167529
Buggy source:
@Override public void handle(String executionId,final Message inputMessage,final IMessageTarget messageTarget){
  componentStatistics.incrementInboundMessages();
  if (resource == null) {
    throw new RuntimeException("String_Node_Str");
  }
  ArrayList<EntityData> inputRows=inputMessage.getPayload();
  if (inputRows == null) {
    return;
  }
  ISqlTransaction transaction=platform.getSqlTemplate().startSqlTransaction();
  for (  EntityData inputRow : inputRows) {
    for (    TargetTable modelTable : targetTables) {
      ArrayList<Object> data=new ArrayList<Object>();
      for (      TargetColumn modelColumn : modelTable.getTargetColumns()) {
        Object value=inputRow.get(modelColumn.getModelAttribute().getId());
        if (fitToColumn && value != null && value instanceof String) {
          value=fitToColumn(modelTable.getTable(),modelColumn.getModelAttribute().getName(),(String)value);
        }
        data.add(value);
      }
      if (updateFirst) {
        for (        TargetColumn modelColumn : modelTable.getKeyTargetColumns()) {
          data.add(inputRow.get(modelColumn.getModelAttribute().getId()));
        }
        int count=execute(transaction,modelTable.getUpdateStatement(),new Object(),data);
        if (insertFallback && count == 0) {
          log.debug("String_Node_Str");
          int endIndex=data.size() - modelTable.getKeyTargetColumns().size();
          count=execute(transaction,modelTable.getInsertStatement(),new Object(),data.subList(0,endIndex));
        }
      }
 else {
        try {
          execute(transaction,modelTable.getInsertStatement(),new Object(),data);
        }
 catch (        UniqueKeyException e) {
          if (replaceRows) {
            log.debug("String_Node_Str");
            for (            TargetColumn modelColumn : modelTable.getKeyTargetColumns()) {
              data.add(inputRow.get(modelColumn.getModelAttribute().getId()));
            }
            execute(transaction,modelTable.getUpdateStatement(),new Object(),data);
          }
 else {
            throw e;
          }
        }
      }
    }
  }
  transaction.commit();
  transaction.close();
}

Fixed version (ground truth):
@Override public void handle(String executionId,final Message inputMessage,final IMessageTarget messageTarget){
  componentStatistics.incrementInboundMessages();
  if (resource == null) {
    throw new RuntimeException("String_Node_Str");
  }
  ArrayList<EntityData> inputRows=inputMessage.getPayload();
  if (inputRows == null) {
    return;
  }
  ISqlTransaction transaction=platform.getSqlTemplate().startSqlTransaction();
  try {
    for (    EntityData inputRow : inputRows) {
      for (      TargetTable modelTable : targetTables) {
        if (modelTable.shouldProcess(inputRow)) {
          ArrayList<Object> data=new ArrayList<Object>();
          for (          TargetColumn modelColumn : modelTable.getTargetColumns()) {
            Object value=inputRow.get(modelColumn.getModelAttribute().getId());
            if (fitToColumn && value != null && value instanceof String) {
              value=fitToColumn(modelTable.getTable(),modelColumn.getModelAttribute().getName(),(String)value);
            }
            data.add(value);
          }
          if (updateFirst) {
            for (            TargetColumn modelColumn : modelTable.getKeyTargetColumns()) {
              data.add(inputRow.get(modelColumn.getModelAttribute().getId()));
            }
            int count=execute(transaction,modelTable.getUpdateStatement(),new Object(),data);
            if (insertFallback && count == 0) {
              log.debug("String_Node_Str");
              int endIndex=data.size() - modelTable.getKeyTargetColumns().size();
              count=execute(transaction,modelTable.getInsertStatement(),new Object(),data.subList(0,endIndex));
            }
          }
 else {
            try {
              execute(transaction,modelTable.getInsertStatement(),new Object(),data);
            }
 catch (            UniqueKeyException e) {
              if (replaceRows) {
                log.debug("String_Node_Str");
                for (                TargetColumn modelColumn : modelTable.getKeyTargetColumns()) {
                  data.add(inputRow.get(modelColumn.getModelAttribute().getId()));
                }
                execute(transaction,modelTable.getUpdateStatement(),new Object(),data);
              }
 else {
                throw e;
              }
            }
          }
        }
      }
    }
    transaction.commit();
  }
 catch (  Throwable ex) {
    transaction.rollback();
    if (ex instanceof RuntimeException) {
      throw (RuntimeException)ex;
    }
 else {
      throw new RuntimeException(ex);
    }
  }
 finally {
    transaction.close();
  }
}