Program: 85538
Project: 85538
Buggy source:
@Override public void anonymize(String databasePropertyFile,String anonymizerPropertyFile) throws DatabaseAnonymizerException {
  log.info("String_Node_Str");
  Properties dbProperties=null;
  dbProperties=loadPropertiesFromClassPath(databasePropertyFile);
  if (dbProperties == null) {
    throw new DatabaseAnonymizerException("String_Node_Str");
  }
  IDBConnection dbConnection=DBConnectionFactory.createDBConnection(dbProperties);
  Connection connection=dbConnection.connect(dbProperties);
  Properties props=null;
  try {
    props=loadProperties(anonymizerPropertyFile);
  }
 catch (  IOException uex) {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    log.error(uex.toString());
  }
  if (props == null) {
    throw new DatabaseAnonymizerException("String_Node_Str");
  }
  String requirementFile=props.getProperty("String_Node_Str");
  int batchSize=parseInt(props.getProperty("String_Node_Str"));
  Requirement requirement=null;
  try {
    JAXBContext jc=newInstance(Requirement.class);
    Unmarshaller unmarshaller=jc.createUnmarshaller();
    requirement=(Requirement)unmarshaller.unmarshal(new File(requirementFile));
  }
 catch (  JAXBException je) {
    log.error(je.toString());
    throw new DatabaseAnonymizerException(je.toString(),je);
  }
  init();
  log.info("String_Node_Str" + requirement.getClient() + "String_Node_Str"+ requirement.getVersion());
  for (  Table table : requirement.getTables()) {
    log.info("String_Node_Str" + table.getName() + "String_Node_Str");
    PreparedStatement pstmt=null;
    Statement stmt=null;
    ResultSet rs=null;
    StringBuilder sql=new StringBuilder("String_Node_Str" + table.getName() + "String_Node_Str");
    int batchCounter=0;
    for (    Column column : table.getColumns()) {
      sql.append(column.getName()).append("String_Node_Str");
    }
    if (sql.length() > 0) {
      sql.setLength(sql.length() - 1);
    }
    sql.append("String_Node_Str").append(table.getPKey()).append("String_Node_Str");
    final String updateString=sql.toString();
    try {
      stmt=connection.createStatement();
      rs=stmt.executeQuery(String.format("String_Node_Str",table.getName()));
      pstmt=connection.prepareStatement(updateString);
      while (rs.next()) {
        int id=rs.getInt("String_Node_Str");
        int index=0;
        for (        Column column : table.getColumns()) {
          String function=column.getFunction();
          if (function == null || function.equals("String_Node_Str")) {
            log.warn("String_Node_Str" + column + "String_Node_Str");
          }
 else {
            try {
              Class clazz=Functions.class;
              if (column.getParameters() == null) {
                Method method=clazz.getMethod(function,null);
                pstmt.setString(++index,method.invoke(null).toString());
              }
 else {
                for (                Parameter parameter : column.getParameters()) {
                  Method method=clazz.getMethod(function,String.class);
                  String result=method.invoke(null,parameter.getValue()).toString();
                  pstmt.setString(++index,result);
                }
              }
            }
 catch (            NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
              log.error(ex.toString());
              try {
                stmt.close();
                if (pstmt != null) {
                  pstmt.close();
                }
                rs.close();
              }
 catch (              SQLException sqlex) {
                log.error(sqlex.toString());
              }
            }
          }
        }
        pstmt.setInt(++index,id);
        pstmt.addBatch();
        batchCounter++;
        if (batchCounter == batchSize) {
          pstmt.executeBatch();
          connection.commit();
          batchCounter=0;
        }
      }
      pstmt.executeBatch();
      connection.commit();
      stmt.close();
      pstmt.close();
      rs.close();
    }
 catch (    SQLException sqle) {
      log.error(sqle.toString());
      try {
        if (stmt != null) {
          stmt.close();
        }
        if (pstmt != null) {
          pstmt.close();
        }
        if (rs != null) {
          rs.close();
        }
      }
 catch (      SQLException sqlex) {
        log.error(sqlex.toString());
      }
    }
    log.info("String_Node_Str" + table.getName() + "String_Node_Str");
    log.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void anonymize(Properties databaseProperties,Properties anonymizerProperties) throws DatabaseAnonymizerException {
  log.info("String_Node_Str");
  IDBConnection dbConnection=DBConnectionFactory.createDBConnection(databaseProperties);
  Connection connection=dbConnection.connect(databaseProperties);
  String requirementFile=anonymizerProperties.getProperty("String_Node_Str");
  int batchSize=parseInt(anonymizerProperties.getProperty("String_Node_Str"));
  Requirement requirement=null;
  try {
    JAXBContext jc=newInstance(Requirement.class);
    Unmarshaller unmarshaller=jc.createUnmarshaller();
    requirement=(Requirement)unmarshaller.unmarshal(new File(requirementFile));
  }
 catch (  JAXBException je) {
    log.error(je.toString());
    throw new DatabaseAnonymizerException(je.toString(),je);
  }
  init();
  log.info("String_Node_Str" + requirement.getClient() + "String_Node_Str"+ requirement.getVersion());
  for (  Table table : requirement.getTables()) {
    log.info("String_Node_Str" + table.getName() + "String_Node_Str");
    PreparedStatement pstmt=null;
    Statement stmt=null;
    ResultSet rs=null;
    StringBuilder sql=new StringBuilder("String_Node_Str" + table.getName() + "String_Node_Str");
    int batchCounter=0;
    for (    Column column : table.getColumns()) {
      sql.append(column.getName()).append("String_Node_Str");
    }
    if (sql.length() > 0) {
      sql.setLength(sql.length() - 1);
    }
    sql.append("String_Node_Str").append(table.getPKey()).append("String_Node_Str");
    final String updateString=sql.toString();
    try {
      stmt=connection.createStatement();
      rs=stmt.executeQuery(String.format("String_Node_Str",table.getName()));
      pstmt=connection.prepareStatement(updateString);
      while (rs.next()) {
        int id=rs.getInt("String_Node_Str");
        int index=0;
        for (        Column column : table.getColumns()) {
          String function=column.getFunction();
          if (function == null || function.equals("String_Node_Str")) {
            log.warn("String_Node_Str" + column + "String_Node_Str");
          }
 else {
            try {
              Class clazz=Functions.class;
              if (column.getParameters() == null) {
                Method method=clazz.getMethod(function,null);
                pstmt.setString(++index,method.invoke(null).toString());
              }
 else {
                for (                Parameter parameter : column.getParameters()) {
                  Method method=clazz.getMethod(function,String.class);
                  String result=method.invoke(null,parameter.getValue()).toString();
                  pstmt.setString(++index,result);
                }
              }
            }
 catch (            NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException ex) {
              log.error(ex.toString());
              try {
                stmt.close();
                if (pstmt != null) {
                  pstmt.close();
                }
                rs.close();
              }
 catch (              SQLException sqlex) {
                log.error(sqlex.toString());
              }
            }
          }
        }
        pstmt.setInt(++index,id);
        pstmt.addBatch();
        batchCounter++;
        if (batchCounter == batchSize) {
          pstmt.executeBatch();
          connection.commit();
          batchCounter=0;
        }
      }
      pstmt.executeBatch();
      connection.commit();
      stmt.close();
      pstmt.close();
      rs.close();
    }
 catch (    SQLException sqle) {
      log.error(sqle.toString());
      try {
        if (stmt != null) {
          stmt.close();
        }
        if (pstmt != null) {
          pstmt.close();
        }
        if (rs != null) {
          rs.close();
        }
      }
 catch (      SQLException sqlex) {
        log.error(sqlex.toString());
      }
    }
    log.info("String_Node_Str" + table.getName() + "String_Node_Str");
    log.info("String_Node_Str");
  }
}