Program: 85518
Project: 85518
Buggy source:
/** 
 * Anonymizes a row of columns. Sets query parameters on the passed updateStmt - this includes the key values - and calls anonymization functions for the columns.
 * @param updateStmt
 * @param tableColumns
 * @param keyNames
 * @param db
 * @param row
 * @param columnMetaData
 * @throws SQLException
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private void anonymizeRow(final PreparedStatement updateStmt,final Collection<Column> tableColumns,final Collection<String> keyNames,final Connection db,final ResultSet row,final List<MatchMetaData> columnMetaData) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, AnonymizerException {
  int fieldIndex=0;
  final Map<String,Integer> columnIndexes=new HashMap<>(tableColumns.size());
  final Set<String> anonymized=new HashSet<>(tableColumns.size());
  for (  final Column column : tableColumns) {
    final String columnName=column.getName();
    if (anonymized.contains(columnName)) {
      continue;
    }
    if (!columnIndexes.containsKey(columnName)) {
      final int columnIndex=++fieldIndex;
      columnIndexes.put(columnName,columnIndex);
    }
    if (isExcludedColumn(row,column)) {
      final String columnValue=row.getString(columnName);
      updateStmt.setString(columnIndexes.get(columnName),columnValue);
      log.debug("String_Node_Str" + columnName + "String_Node_Str"+ columnValue);
      continue;
    }
    anonymized.add(columnName);
    final Object colValue=callAnonymizingFunctionFor(db,row,column);
    if (colValue == null) {
      updateStmt.setNull(columnIndexes.get(columnName),Types.NULL);
    }
 else     if (colValue.getClass() == java.sql.Date.class) {
      updateStmt.setDate(columnIndexes.get(columnName),CommonUtils.stringToDate(colValue.toString(),"String_Node_Str"));
    }
 else {
      updateStmt.setString(columnIndexes.get(columnName),getTruncatedColumnValue((String)colValue,columnIndexes.get(columnName),columnMetaData));
    }
  }
  int whereIndex=fieldIndex;
  for (  final String key : keyNames) {
    updateStmt.setString(++whereIndex,row.getString(key));
  }
  updateStmt.addBatch();
}

Fixed version (ground truth):
/** 
 * Anonymizes a row of columns. Sets query parameters on the passed updateStmt - this includes the key values - and calls anonymization functions for the columns.
 * @param updateStmt
 * @param tableColumns
 * @param keyNames
 * @param db
 * @param row
 * @param columnMetaData
 * @throws SQLException
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private void anonymizeRow(final PreparedStatement updateStmt,final Collection<Column> tableColumns,final Collection<String> keyNames,final Connection db,final ResultSet row,final List<MatchMetaData> columnMetaData) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, AnonymizerException {
  int fieldIndex=0;
  final Map<String,Integer> columnIndexes=new HashMap<>(tableColumns.size());
  final Set<String> anonymized=new HashSet<>(tableColumns.size());
  for (  final Column column : tableColumns) {
    final String columnName=column.getName();
    if (anonymized.contains(columnName)) {
      continue;
    }
    if (!columnIndexes.containsKey(columnName)) {
      final int columnIndex=++fieldIndex;
      columnIndexes.put(columnName,columnIndex);
    }
    if (isExcludedColumn(row,column)) {
      final String columnValue=row.getString(columnName);
      updateStmt.setString(columnIndexes.get(columnName),columnValue);
      log.debug("String_Node_Str" + columnName + "String_Node_Str"+ columnValue);
      continue;
    }
    anonymized.add(columnName);
    final Object colValue=callAnonymizingFunctionFor(db,row,column);
    log.info("String_Node_Str" + colValue);
    log.info("String_Node_Str" + colValue.getClass());
    if (colValue == null) {
      updateStmt.setNull(columnIndexes.get(columnName),Types.NULL);
    }
 else     if (colValue.getClass() == java.sql.Date.class) {
      updateStmt.setDate(columnIndexes.get(columnName),CommonUtils.stringToDate(colValue.toString(),"String_Node_Str"));
    }
 else     if (colValue.getClass() == java.lang.Integer.class) {
      updateStmt.setInt(columnIndexes.get(columnName),(int)colValue);
    }
 else {
      updateStmt.setString(columnIndexes.get(columnName),getTruncatedColumnValue((String)colValue,columnIndexes.get(columnName),columnMetaData));
    }
  }
  int whereIndex=fieldIndex;
  for (  final String key : keyNames) {
    updateStmt.setString(++whereIndex,row.getString(key));
  }
  updateStmt.addBatch();
}