nus-yam/ex-repair huggingface dataset:
Program: 85525
Project: 85525
Buggy source:
/** 
 * Calls the anonymization function for the given Column, and returns its anonymized value.
 * @param dbConn
 * @param row
 * @param column
 * @return
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private Object callAnonymizingFunctionWithoutParameters(Connection dbConn,ResultSet row,Column column) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  String columnValue=row.getString(column.getName());
  String function=column.getFunction();
  if (function == null || function.equals("String_Node_Str")) {
    log.warn("String_Node_Str" + column + "String_Node_Str");
    return "String_Node_Str";
  }
  try {
    String className=Utils.getClassName(function);
    String methodName=Utils.getMethodName(function);
    Class<?> clazz=Class.forName(className);
    CoreFunctions instance=(CoreFunctions)Class.forName(className).newInstance();
    instance.setDatabaseConnection(dbConn);
    Method[] methods=clazz.getMethods();
    Method selectedMethod=null;
    Object returnType=null;
    methodLoop:     for (    Method m : methods) {
      if (m.getName().equals(methodName)) {
        log.debug("String_Node_Str" + m.getName());
        selectedMethod=m;
        returnType=m.getReturnType();
        break;
      }
    }
    if (selectedMethod == null) {
      StringBuilder s=new StringBuilder("String_Node_Str");
      s.append(methodName).append("String_Node_Str").append(className);
      throw new NoSuchMethodException(s.toString());
    }
    log.debug("String_Node_Str" + methodName);
    Object anonymizedValue=selectedMethod.invoke(instance);
    if (anonymizedValue == null) {
      return null;
    }
    if (returnType == String.class) {
      return anonymizedValue.toString();
    }
 else     if (returnType == java.sql.Date.class) {
      return anonymizedValue;
    }
  }
 catch (  InstantiationException|ClassNotFoundException ex) {
    log.error(ex.toString());
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Calls the anonymization function for the given Column, and returns its anonymized value.
 * @param dbConn
 * @param row
 * @param column
 * @return
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private Object callAnonymizingFunctionWithoutParameters(Connection dbConn,ResultSet row,Column column) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
}
Program: 85527
Project: 85527
Buggy source:
/** 
 * Calls the anonymization function for the given Column, and returns its anonymized value.
 * @param dbConn
 * @param row
 * @param column
 * @return
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private Object callAnonymizingFunctionWithoutParameters(Connection dbConn,ResultSet row,Column column) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
}

Fixed version (ground truth):
/** 
 * Calls the anonymization function for the given Column, and returns its anonymized value.
 * @param dbConn
 * @param row
 * @param column
 * @return
 * @throws NoSuchMethodException
 * @throws SecurityException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException 
 */
private Object callAnonymizingFunctionWithoutParameters(Connection dbConn,ResultSet row,Column column) throws SQLException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  String function=column.getFunction();
  if (function == null || function.equals("String_Node_Str")) {
    log.warn("String_Node_Str" + column + "String_Node_Str");
    return "String_Node_Str";
  }
  try {
    String className=Utils.getClassName(function);
    String methodName=Utils.getMethodName(function);
    Class<?> clazz=Class.forName(className);
    CoreFunctions instance=(CoreFunctions)Class.forName(className).newInstance();
    instance.setDatabaseConnection(dbConn);
    Method[] methods=clazz.getMethods();
    Method selectedMethod=null;
    Object returnType=null;
    methodLoop:     for (    Method m : methods) {
      if (m.getName().equals(methodName)) {
        log.debug("String_Node_Str" + m.getName());
        selectedMethod=m;
        returnType=m.getReturnType();
        break;
      }
    }
    if (selectedMethod == null) {
      StringBuilder s=new StringBuilder("String_Node_Str");
      s.append(methodName).append("String_Node_Str").append(className);
      throw new NoSuchMethodException(s.toString());
    }
    log.debug("String_Node_Str" + methodName);
    Object anonymizedValue=selectedMethod.invoke(instance);
    if (anonymizedValue == null) {
      return null;
    }
    if (returnType == String.class) {
      return anonymizedValue.toString();
    }
 else     if (returnType == java.sql.Date.class) {
      return anonymizedValue;
    }
  }
 catch (  InstantiationException|ClassNotFoundException ex) {
    log.error(ex.toString());
  }
  return "String_Node_Str";
}
Program: 85529
Project: 85529
Buggy source:
@Override public List<MatchMetaData> discover(IDBFactory factory,Properties dataDiscoveryProperties,Set<String> tables) throws AnonymizerException {
  log.info("String_Node_Str");
  double probabilityThreshold=parseDouble(dataDiscoveryProperties.getProperty("String_Node_Str"));
  log.info("String_Node_Str" + probabilityThreshold);
  List<MatchMetaData> finalList=new ArrayList<>();
  for (  String model : modelList) {
    log.info("String_Node_Str" + model);
    Model modelPerson=createModel(dataDiscoveryProperties,model);
    matches=discoverAgainstSingleModel(factory,dataDiscoveryProperties,tables,modelPerson,probabilityThreshold);
    finalList.removeAll(matches);
    finalList.addAll(matches);
  }
  DecimalFormat decimalFormat=new DecimalFormat("String_Node_Str");
  for (  MatchMetaData data : finalList) {
    String probability=decimalFormat.format(data.getAverageProbability());
    String result=String.format("String_Node_Str",data.getTableName(),data.getColumnName(),probability,data.getModel());
    log.info(result);
  }
  return matches;
}

Fixed version (ground truth):
@Override public List<MatchMetaData> discover(IDBFactory factory,Properties dataDiscoveryProperties,Set<String> tables) throws AnonymizerException {
  log.info("String_Node_Str");
  double probabilityThreshold=parseDouble(dataDiscoveryProperties.getProperty("String_Node_Str"));
  log.info("String_Node_Str" + probabilityThreshold);
  List<MatchMetaData> finalList=new ArrayList<>();
  for (  String model : modelList) {
    log.info("String_Node_Str");
    log.info("String_Node_Str" + model);
    log.info("String_Node_Str");
    Model modelPerson=createModel(dataDiscoveryProperties,model);
    matches=discoverAgainstSingleModel(factory,dataDiscoveryProperties,tables,modelPerson,probabilityThreshold);
    finalList=ListUtils.union(finalList,matches);
  }
  DecimalFormat decimalFormat=new DecimalFormat("String_Node_Str");
  log.info("String_Node_Str");
  log.info(String.format("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  MatchMetaData data : finalList) {
    String probability=decimalFormat.format(data.getAverageProbability());
    String result=String.format("String_Node_Str",data.getTableName(),data.getColumnName(),probability,data.getModel());
    log.info(result);
  }
  return matches;
}
Program: 85532
Project: 85532
Buggy source:
public static boolean isString(final String type){
  return STRING.equals(JAVA_TYPES.get(type.toUpperCase()));
}

Fixed version (ground truth):
public static boolean isString(final String type){
  return STRING.equals(JAVA_TYPES.get(type.toUpperCase())) || CHAR.equals(JAVA_TYPES.get(type.toUpperCase()));
}
Program: 85533
Project: 85533
Buggy source:
@Override public void discover(Properties databaseProperties,Properties columnProperties,Collection<String> tables) throws DatabaseAnonymizerException {
  log.info("String_Node_Str");
  IMetaData metaData=MetaDataFactory.fetchMetaData(databaseProperties);
  List<ColumnMetaData> map=metaData.getMetaData();
  List<String> suspList=new ArrayList(columnProperties.keySet());
  ArrayList<String> matches=new ArrayList<>();
  for (  String s : suspList) {
    Pattern p=compile(s);
    for (    ColumnMetaData pair : map) {
      String tableName=pair.getTableName();
      String columnName=pair.getColumnName();
      if (!tables.isEmpty() && !tables.contains(tableName.toLowerCase())) {
        continue;
      }
      if (p.matcher(columnName).matches()) {
        matches.add(tableName + "String_Node_Str" + columnName);
      }
    }
  }
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  Collections.sort(matches);
  for (  String entry : matches) {
    log.info(entry);
  }
}

Fixed version (ground truth):
@Override public void discover(Properties databaseProperties,Properties columnProperties,Collection<String> tables) throws DatabaseAnonymizerException {
  log.info("String_Node_Str");
  IMetaData metaData=MetaDataFactory.fetchMetaData(databaseProperties);
  List<ColumnMetaData> map=metaData.getMetaData();
  List<String> suspList=new ArrayList(columnProperties.keySet());
  ArrayList<String> matches=new ArrayList<>();
  for (  String s : suspList) {
    Pattern p=compile(s);
    for (    ColumnMetaData pair : map) {
      String tableName=pair.getTableName();
      String columnName=pair.getColumnName();
      if (!tables.isEmpty() && !tables.contains(tableName.toLowerCase())) {
        continue;
      }
      if (p.matcher(columnName.toLowerCase()).matches()) {
        matches.add(tableName + "String_Node_Str" + columnName);
      }
    }
  }
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  Collections.sort(matches);
  for (  String entry : matches) {
    log.info(entry);
  }
}
Program: 85536
Project: 85536
Buggy source:
public static void main(String[] args) throws ParseException, AnonymizerException {
  if (args.length == 0) {
    log.info("String_Node_Str");
    log.info("String_Node_Str");
    return;
  }
  final Options options=createOptions();
  final CommandLine line=getCommandLine(options,args);
  if (line.hasOption("String_Node_Str")) {
    help(options);
    return;
  }
  String databasePropertyFile="String_Node_Str";
  Properties props=null;
  if (line.hasOption("String_Node_Str")) {
    databasePropertyFile=line.getOptionValues("String_Node_Str")[0];
    try {
      props=loadProperties(databasePropertyFile);
    }
 catch (    IOException ioe) {
      throw new AnonymizerException("String_Node_Str" + databasePropertyFile,ioe);
    }
  }
  if (props == null) {
    throw new AnonymizerException("String_Node_Str");
  }
  String anonymizePropertyFile="String_Node_Str";
  if (line.hasOption("String_Node_Str")) {
    anonymizePropertyFile=line.getOptionValue("String_Node_Str");
  }
  Properties anonymizerProperties=null;
  try {
    anonymizerProperties=loadProperties(anonymizePropertyFile);
  }
 catch (  IOException ioe) {
    throw new AnonymizerException("String_Node_Str" + databasePropertyFile,ioe);
  }
  if (anonymizerProperties == null) {
    throw new AnonymizerException("String_Node_Str");
  }
  if (line.hasOption("String_Node_Str")) {
    IAnonymizer anonymizer=new DatabaseAnonymizer();
    anonymizer.anonymize(databasePropertyFile,anonymizePropertyFile);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws ParseException, AnonymizerException {
  if (args.length == 0) {
    log.info("String_Node_Str");
    log.info("String_Node_Str");
    return;
  }
  final Options options=createOptions();
  final CommandLine line=getCommandLine(options,args);
  if (line.hasOption("String_Node_Str")) {
    help(options);
    return;
  }
  String databasePropertyFile="String_Node_Str";
  Properties props=null;
  if (line.hasOption("String_Node_Str")) {
    databasePropertyFile=line.getOptionValues("String_Node_Str")[0];
    try {
      props=loadProperties(databasePropertyFile);
    }
 catch (    IOException ioe) {
      throw new AnonymizerException("String_Node_Str" + databasePropertyFile,ioe);
    }
  }
  if (props == null) {
    throw new AnonymizerException("String_Node_Str");
  }
  String anonymizerPropertyFile="String_Node_Str";
  if (line.hasOption("String_Node_Str")) {
    anonymizerPropertyFile=line.getOptionValue("String_Node_Str");
  }
  Properties anonymizerProperties=null;
  try {
    anonymizerProperties=loadProperties(anonymizerPropertyFile);
  }
 catch (  IOException ioe) {
    throw new AnonymizerException("String_Node_Str" + anonymizerPropertyFile,ioe);
  }
  if (anonymizerProperties == null) {
    throw new AnonymizerException("String_Node_Str");
  }
  if (line.hasOption("String_Node_Str")) {
    IAnonymizer anonymizer=new DatabaseAnonymizer();
    anonymizer.anonymize(props,anonymizerProperties);
  }
}
Program: 85537
Project: 85537
Buggy source:
/** 
 * Creates options for the command line
 * @return Options
 */
@SuppressWarnings("String_Node_Str") private static Options createOptions(){
  final Options options=new Options();
  options.addOption("String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  return options;
}

Fixed version (ground truth):
/** 
 * Creates options for the command line
 * @return Options
 */
@SuppressWarnings("String_Node_Str") private static Options createOptions(){
  final Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  return options;
}
Program: 85539
Project: 85539
Buggy source:
/** 
 * Anonymizes data.
 * @param propertyFile
 * @param String propertyFile
 * @throws com.strider.dataanonymizer.database.DatabaseAnonymizerException
 */
void anonymize(String propertyFile,String anonymizerPropertFile) throws DatabaseAnonymizerException ;

Fixed version (ground truth):
/** 
 * Anonymizes data.
 * @param propertyFile
 * @param String propertyFile
 * @throws com.strider.dataanonymizer.database.DatabaseAnonymizerException
 */
void anonymize(Properties databaseProperties,Properties anonymizerProperties) throws DatabaseAnonymizerException ;
Program: 85540
Project: 85540
Buggy source:
/** 
 * Establishes database connection
 * @param propertyFile
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String database=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + database);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  Connection conn=null;
  try {
    conn=getConnection(url,userName,password);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Establishes database connection
 * @param properties
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String database=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + database);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  Connection conn=null;
  try {
    conn=getConnection(url,userName,password);
    conn.setAutoCommit(false);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}
Program: 85541
Project: 85541
Buggy source:
public static String randomStringFromFile(String fileName) throws IOException {
  if (STRING_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        STRING_LIST.add(line);
      }
    }
   }
  int rand=nextIntInRange(0,STRING_LIST.size() - 1);
  return STRING_LIST.get(rand);
}

Fixed version (ground truth):
public static String randomStringFromFile(String fileName) throws IOException {
  log.info(fileName);
  if (STRING_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        STRING_LIST.add(line);
      }
    }
   }
  int rand=nextIntInRange(0,STRING_LIST.size() - 1);
  return STRING_LIST.get(rand);
}
Program: 85542
Project: 85542
Buggy source:
public void discover(String databasePropertyFile) throws DatabaseAnonymizerException {
  this.discover(databasePropertyFile,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void discover(Properties databaseProperties,Properties columnProperties) throws DatabaseAnonymizerException {
  log.info("String_Node_Str");
  IDBConnection dbConnection=DBConnectionFactory.createDBConnection(databaseProperties);
  Connection connection=dbConnection.connect(databaseProperties);
  ResultSet rs=null;
  List<ColumnMetaData> map=new ArrayList<>();
  try {
    DatabaseMetaData md=connection.getMetaData();
    rs=md.getTables(null,null,"String_Node_Str",null);
    while (rs.next()) {
      String tableName=rs.getString(3);
      ResultSet resultSet=md.getColumns(null,null,tableName,null);
      while (resultSet.next()) {
        String columnName=resultSet.getString("String_Node_Str");
        String columnType=resultSet.getString("String_Node_Str");
        map.add(new ColumnMetaData(tableName,columnName,columnType));
      }
    }
    rs.close();
    connection.close();
  }
 catch (  SQLException e) {
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      SQLException sqle) {
        log.error(sqle.toString());
      }
    }
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    log.error(e.toString());
  }
  Configuration columnsConfiguration=null;
  try {
    columnsConfiguration=new PropertiesConfiguration("String_Node_Str");
  }
 catch (  ConfigurationException ex) {
    log.error(ColumnDiscoverer.class);
  }
  Iterator<String> iterator=columnsConfiguration.getKeys();
  List<String> suspList=toList(iterator);
  ArrayList<String> matches=new ArrayList<>();
  for (  String s : suspList) {
    Pattern p=compile(s);
    for (    ColumnMetaData pair : map) {
      String tableName=pair.getTableName();
      String columnName=pair.getColumnName();
      if (p.matcher(columnName).matches()) {
        matches.add(tableName + "String_Node_Str" + columnName);
      }
    }
  }
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  log.info("String_Node_Str");
  for (  String entry : matches) {
    log.info(entry);
  }
}
Program: 85546
Project: 85546
Buggy source:
private static Options createOptions(){
  final Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  return options;
}

Fixed version (ground truth):
private static Options createOptions(){
  final Options options=new Options();
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",false,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  options.addOption("String_Node_Str","String_Node_Str",true,"String_Node_Str");
  return options;
}
Program: 85547
Project: 85547
Buggy source:
/** 
 * Discovers data or data containers with data which can be be the subject  for data anonymization.
 * @param databasePropertyFile
 * @param columnPropertyFile
 * @throws com.strider.dataanonymizer.AnonymizerException
 */
void discover(String databasePropertyFile,String columnPropertyFile) throws AnonymizerException ;

Fixed version (ground truth):
/** 
 * Discovers data or data containers with data which can be be the subject  for data anonymization.
 * @param databaseProperties
 * @param properties
 * @throws com.strider.dataanonymizer.AnonymizerException
 */
void discover(Properties databaseProperties,Properties properties) throws AnonymizerException ;
Program: 85548
Project: 85548
Buggy source:
public static IDBConnection createDBConnection(final String databasePropertyFile) throws DatabaseAnonymizerException {
  if ((databasePropertyFile == null) || databasePropertyFile.isEmpty()) {
    log.error("String_Node_Str");
    throw new IllegalArgumentException("String_Node_Str");
  }
  Properties props=new Properties();
  InputStream is=null;
  try {
    is=new FileInputStream(databasePropertyFile);
    props.load(is);
    is.close();
  }
 catch (  IOException ex) {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException ioe) {
        log.error(ioe.toString());
      }
    }
    log.error(ex.toString());
  }
  String database=props.getProperty("String_Node_Str");
  if (database.equalsIgnoreCase("String_Node_Str")) {
    return new MySQLDBConnection();
  }
  throw new IllegalArgumentException("String_Node_Str" + database + "String_Node_Str");
}

Fixed version (ground truth):
public static IDBConnection createDBConnection(final Properties databaseProperties) throws DatabaseAnonymizerException {
  String database=databaseProperties.getProperty("String_Node_Str");
  if (database.equalsIgnoreCase("String_Node_Str")) {
    return new MySQLDBConnection();
  }
  throw new IllegalArgumentException("String_Node_Str" + database + "String_Node_Str");
}
Program: 85549
Project: 85549
Buggy source:
Connection connect(final String propertyFile) throws DatabaseAnonymizerException ;

Fixed version (ground truth):
Connection connect(final Properties properties) throws DatabaseAnonymizerException ;
Program: 85550
Project: 85550
Buggy source:
/** 
 * Establishes database connection
 * @param propertyFile
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(String propertyFile) throws DatabaseAnonymizerException {
  Configuration configuration=null;
  try {
    configuration=new PropertiesConfiguration(propertyFile);
  }
 catch (  ConfigurationException ex) {
    log.error(ColumnDiscoverer.class);
  }
  String driver=configuration.getString("String_Node_Str");
  String database=configuration.getString("String_Node_Str");
  String url=configuration.getString("String_Node_Str");
  String userName=configuration.getString("String_Node_Str");
  String password=configuration.getString("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + database);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  Connection conn=null;
  try {
    conn=getConnection(url,userName,password);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Establishes database connection
 * @param propertyFile
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String database=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + database);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  Connection conn=null;
  try {
    conn=getConnection(url,userName,password);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}
Program: 85552
Project: 85552
Buggy source:
public static String randomFirstName(String fileName) throws IOException {
  if (FIRST_NAME_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        FIRST_NAME_LIST.add(line);
      }
    }
   }
  int rand=nextIntInRange(0,FIRST_NAME_LIST.size() - 1);
  return FIRST_NAME_LIST.get(rand);
}

Fixed version (ground truth):
public static String randomFirstName(String fileName){
  if (FIRST_NAME_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        FIRST_NAME_LIST.add(line);
      }
    }
 catch (    FileNotFoundException ex) {
      log.error(ex.toString());
    }
catch (    IOException ex) {
      log.error(ex.toString());
    }
  }
  int rand=nextIntInRange(0,FIRST_NAME_LIST.size() - 1);
  return FIRST_NAME_LIST.get(rand);
}
Program: 85553
Project: 85553
Buggy source:
public static String randomStringFromFile(String fileName) throws IOException {
  log.info(fileName);
  if (STRING_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        STRING_LIST.add(line);
      }
    }
   }
  int rand=nextIntInRange(0,STRING_LIST.size() - 1);
  return STRING_LIST.get(rand);
}

Fixed version (ground truth):
public static String randomStringFromFile(String fileName) throws IOException {
  if (STRING_LIST.isEmpty()) {
    try (BufferedReader br=new BufferedReader(new FileReader(fileName))){
      for (String line; (line=br.readLine()) != null; ) {
        STRING_LIST.add(line);
      }
    }
   }
  int rand=nextIntInRange(0,STRING_LIST.size() - 1);
  return STRING_LIST.get(rand);
}
Program: 85556
Project: 85556
Buggy source:
/** 
 * Establishes database connection
 * @param properties
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String vendor=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + vendor);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  StringBuilder sqlServerURL=new StringBuilder(url);
  sqlServerURL.append("String_Node_Str").append(userName).append("String_Node_Str").append(password);
  Connection conn=null;
  try {
    log.info("String_Node_Str" + sqlServerURL.toString());
    conn=getConnection(sqlServerURL.toString());
    conn.setAutoCommit(false);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Establishes database connection
 * @param properties
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String vendor=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + vendor);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  StringBuilder sqlServerURL=new StringBuilder(url);
  sqlServerURL.append("String_Node_Str").append(userName).append("String_Node_Str").append(password);
  Connection conn=null;
  try {
    log.info("String_Node_Str" + url);
    conn=getConnection(sqlServerURL.toString());
    conn.setAutoCommit(false);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}
Program: 85557
Project: 85557
Buggy source:
public static IDBConnection createDBConnection(final Properties databaseProperties) throws DatabaseAnonymizerException {
  String database=databaseProperties.getProperty("String_Node_Str");
  if (database.equalsIgnoreCase("String_Node_Str")) {
    return new MySQLDBConnection();
  }
 else   if (database.equalsIgnoreCase("String_Node_Str")) {
    return new MSSQLDBConnection();
  }
 else   if (database.equalsIgnoreCase("String_Node_Str")) {
    return new OracleDBConnection();
  }
  throw new IllegalArgumentException("String_Node_Str" + database + "String_Node_Str");
}

Fixed version (ground truth):
public static IDBConnection createDBConnection(final Properties databaseProperties) throws DatabaseAnonymizerException {
  String vendor=databaseProperties.getProperty("String_Node_Str");
  if (vendor.equalsIgnoreCase("String_Node_Str")) {
    return new MySQLDBConnection();
  }
 else   if (vendor.equalsIgnoreCase("String_Node_Str")) {
    return new MSSQLDBConnection();
  }
 else   if (vendor.equalsIgnoreCase("String_Node_Str")) {
    return new OracleDBConnection();
  }
  throw new IllegalArgumentException("String_Node_Str" + vendor + "String_Node_Str");
}
Program: 85558
Project: 85558
Buggy source:
/** 
 * Establishes database connection
 * @param properties
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String database=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + database);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  Connection conn=null;
  try {
    conn=getConnection(url,userName,password);
    conn.setAutoCommit(false);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Establishes database connection
 * @param properties
 * @return Connection
 * @throws DatabaseAnonymizerException 
 */
@Override public Connection connect(Properties properties) throws DatabaseAnonymizerException {
  String driver=properties.getProperty("String_Node_Str");
  String vendor=properties.getProperty("String_Node_Str");
  String url=properties.getProperty("String_Node_Str");
  String userName=properties.getProperty("String_Node_Str");
  String password=properties.getProperty("String_Node_Str");
  log.debug("String_Node_Str" + driver);
  log.debug("String_Node_Str" + vendor);
  log.debug("String_Node_Str" + url);
  log.debug("String_Node_Str" + userName);
  try {
    forName(driver);
  }
 catch (  ClassNotFoundException cnfe) {
    log.error(cnfe.toString());
    throw new DatabaseAnonymizerException(cnfe.toString(),cnfe);
  }
  StringBuilder sqlServerURL=new StringBuilder(url);
  sqlServerURL.append("String_Node_Str").append(userName).append("String_Node_Str").append(password);
  Connection conn=null;
  try {
    log.info("String_Node_Str" + sqlServerURL.toString());
    conn=getConnection(sqlServerURL.toString());
    conn.setAutoCommit(false);
  }
 catch (  SQLException sqle) {
    log.error(sqle.toString());
    if (conn != null) {
      try {
        conn.close();
      }
 catch (      SQLException sql) {
        log.error(sql.toString());
      }
    }
    throw new DatabaseAnonymizerException(sqle.toString(),sqle);
  }
  return conn;
}
Program: 85559
Project: 85559
Buggy source:
public void discover(String databasePropertyFile){
  discover("String_Node_Str");
}

Fixed version (ground truth):
public void discover(String databasePropertyFile){
  this.discover("String_Node_Str");
}
Program: 85561
Project: 85561
Buggy source:
/** 
 * Discovers data or data containers with data which can be be the subject  for data anonymization.
 * @param databasePropertyFile
 * @param columnPropertyFile
 */
public void discover(String databasePropertyFile,String columnPropertyFile);

Fixed version (ground truth):
/** 
 * Discovers data or data containers with data which can be be the subject  for data anonymization.
 * @param databasePropertyFile
 * @param columnPropertyFile
 */
public void discover(String databasePropertyFile,String columnPropertyFile) throws AnonymizerException ;
Program: 85563
Project: 85563
Buggy source:
public List<Parameter> getParameters(){
  return Collections.unmodifiableList(this.paramters);
}

Fixed version (ground truth):
public List<Parameter> getParameters(){
  if (this.paramters != null) {
    return Collections.unmodifiableList(this.paramters);
  }
  return null;
}
Program: 85564
Project: 85564
Buggy source:
public String getName(){
  return this.name;
}

Fixed version (ground truth):
/** 
 * Getter method for name attribute
 * @return String
 */
public String getName(){
  return this.name;
}
Program: 85565
Project: 85565
Buggy source:
public String getReturnType(){
  return this.returnType;
}

Fixed version (ground truth):
/** 
 * Getter method for returnType attribute
 * @return String
 */
public String getReturnType(){
  return this.returnType;
}
Program: 85566
Project: 85566
Buggy source:
public String getFunction(){
  return this.function;
}

Fixed version (ground truth):
/** 
 * Getter method for function attribute
 * @return String
 */
public String getFunction(){
  return this.function;
}
Program: 85567
Project: 85567
Buggy source:
public List<Parameter> getParameters(){
  if (this.paramters != null) {
    return Collections.unmodifiableList(this.paramters);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Getter method for Parameters attribute
 * @return List
 */
public List<Parameter> getParameters(){
  if (this.paramters != null) {
    return Collections.unmodifiableList(this.paramters);
  }
  return null;
}
Program: 85568
Project: 85568
Buggy source:
public String getValue(){
  return this.value;
}

Fixed version (ground truth):
/** 
 * Getter method for value attribute
 * @return String
 */
public String getValue(){
  return this.value;
}
Program: 85569
Project: 85569
Buggy source:
public String getName(){
  return this.name;
}

Fixed version (ground truth):
/** 
 * Getter method for name attribute
 * @return String
 */
public String getName(){
  return this.name;
}
Program: 85570
Project: 85570
Buggy source:
public String getType(){
  return this.type;
}

Fixed version (ground truth):
/** 
 * Getter method for type attribute
 * @return String
 */
public String getType(){
  return this.type;
}
Program: 85571
Project: 85571
Buggy source:
public String getVersion(){
  return this.version;
}

Fixed version (ground truth):
/** 
 * Getter method for version attribute
 * @return String
 */
public String getVersion(){
  return this.version;
}
Program: 85572
Project: 85572
Buggy source:
public List<Table> getTables(){
  return Collections.unmodifiableList(this.tables);
}

Fixed version (ground truth):
/** 
 * Getter method for tables attribute
 * @return List
 */
public List<Table> getTables(){
  if (this.tables != null) {
    return Collections.unmodifiableList(this.tables);
  }
  return null;
}
Program: 85573
Project: 85573
Buggy source:
public String getClient(){
  return this.client;
}

Fixed version (ground truth):
/** 
 * Getter method for client attribute
 * @return String
 */
public String getClient(){
  return this.client;
}
Program: 85574
Project: 85574
Buggy source:
public String getName(){
  return this.name;
}

Fixed version (ground truth):
/** 
 * Getter method for name attribute
 * @return String
 */
public String getName(){
  return this.name;
}
Program: 85575
Project: 85575
Buggy source:
public String getPKey(){
  return this.pkey;
}

Fixed version (ground truth):
/** 
 * Getter method for PKey attribute
 * @return String
 */
public String getPKey(){
  return this.pkey;
}
Program: 85576
Project: 85576
Buggy source:
public List<Column> getColumns(){
  return Collections.unmodifiableList(this.columns);
}

Fixed version (ground truth):
/** 
 * Getter method for columns attribute
 * @return 
 */
public List<Column> getColumns(){
  if (this.columns != null) {
    return Collections.unmodifiableList(this.columns);
  }
  return null;
}
Program: 85577
Project: 85577
Buggy source:
boolean updateFromNewBroadcast(MasternodeBroadcast mnb){
  if (mnb.sigTime > sigTime) {
    pubkey2=mnb.pubkey2;
    sigTime=mnb.sigTime;
    sig=mnb.sig;
    protocolVersion=mnb.protocolVersion;
    address=mnb.address.duplicate();
    lastTimeChecked=0;
    int nDoS=0;
    if (mnb.lastPing == new MasternodePing(params) || (!mnb.lastPing.equals(new MasternodePing(params)) && mnb.lastPing.checkAndUpdate(false))) {
      lastPing=mnb.lastPing;
      params.masternodeManager.mapSeenMasternodePing.put(lastPing.getHash(),lastPing);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean updateFromNewBroadcast(MasternodeBroadcast mnb){
  if (mnb.sigTime > sigTime) {
    pubkey2=mnb.pubkey2;
    sigTime=mnb.sigTime;
    sig=mnb.sig;
    protocolVersion=mnb.protocolVersion;
    address=mnb.address.duplicate();
    lastTimeChecked=0;
    int nDoS=0;
    if (mnb.lastPing == new MasternodePing(params) || (!mnb.lastPing.equals(new MasternodePing(params)) && mnb.lastPing.checkAndUpdate(false))) {
      lastPing=mnb.lastPing;
      params.masternodeManager.updateMasternodePing(lastPing);
    }
    return true;
  }
  return false;
}
Program: 85578
Project: 85578
Buggy source:
void processMasternodePing(Peer peer,MasternodePing mnp){
  if (mapSeenMasternodePing.containsKey(mnp.getHash()))   return;
  mapSeenMasternodePing.put(mnp.getHash(),mnp);
  int nDoS=0;
  if (mnp.checkAndUpdate())   return;
  if (nDoS > 0) {
  }
 else {
    Masternode pmn=find(mnp.vin);
    if (pmn != null)     return;
  }
  askForMN(peer,mnp.vin);
}

Fixed version (ground truth):
void processMasternodePing(Peer peer,MasternodePing mnp){
  if (mapSeenMasternodePing.containsKey(mnp.getHash()))   return;
  lock.lock();
  try {
    mapSeenMasternodePing.put(mnp.getHash(),mnp);
  }
  finally {
    lock.unlock();
  }
  int nDoS=0;
  if (mnp.checkAndUpdate())   return;
  if (nDoS > 0) {
  }
 else {
    Masternode pmn=find(mnp.vin);
    if (pmn != null)     return;
  }
  askForMN(peer,mnp.vin);
}
Program: 85579
Project: 85579
Buggy source:
public int calculateMessageSizeInBytes(){
  int size=0;
  size+=VarInt.sizeOf(vMasternodes.size());
  for (  Masternode mn : vMasternodes) {
    size+=mn.calculateMessageSizeInBytes();
  }
  size+=VarInt.sizeOf(mAskedUsForMasternodeList.size());
  for (  NetAddress na : mAskedUsForMasternodeList.keySet()) {
    size+=na.MESSAGE_SIZE;
    size+=8;
  }
  return size;
}

Fixed version (ground truth):
public int calculateMessageSizeInBytes(){
  int size=0;
  lock.lock();
  try {
    size+=VarInt.sizeOf(vMasternodes.size());
    for (    Masternode mn : vMasternodes) {
      size+=mn.calculateMessageSizeInBytes();
    }
    size+=VarInt.sizeOf(mAskedUsForMasternodeList.size());
    for (    NetAddress na : mAskedUsForMasternodeList.keySet()) {
      size+=na.MESSAGE_SIZE;
      size+=8;
    }
    return size;
  }
  finally {
    lock.unlock();
  }
}
Program: 85580
Project: 85580
Buggy source:
void processMasternodeBroadcast(MasternodeBroadcast mnb){
  if (mapSeenMasternodeBroadcast.containsKey(mnb.getHash())) {
    params.masternodeSync.addedMasternodeList(mnb.getHash());
    return;
  }
  mapSeenMasternodeBroadcast.put(mnb.getHash(),mnb);
  int nDoS=0;
  if (!mnb.checkAndUpdate()) {
    return;
  }
  if (!DarkSendSigner.isVinAssociatedWithPubkey(params,mnb.vin,mnb.pubkey)) {
    log.info("String_Node_Str");
    return;
  }
  if (mnb.checkInputsAndAdd()) {
  }
 else {
    log.info("String_Node_Str" + mnb.address.toString());
  }
}

Fixed version (ground truth):
void processMasternodeBroadcast(MasternodeBroadcast mnb){
  lock.lock();
  try {
    if (mapSeenMasternodeBroadcast.containsKey(mnb.getHash())) {
      params.masternodeSync.addedMasternodeList(mnb.getHash());
      return;
    }
    mapSeenMasternodeBroadcast.put(mnb.getHash(),mnb);
  }
  finally {
    lock.unlock();
  }
  int nDoS=0;
  if (!mnb.checkAndUpdate()) {
    return;
  }
  if (!DarkSendSigner.isVinAssociatedWithPubkey(params,mnb.vin,mnb.pubkey)) {
    log.info("String_Node_Str");
    return;
  }
  if (mnb.checkInputsAndAdd()) {
  }
 else {
    log.info("String_Node_Str" + mnb.address.toString());
  }
}
Program: 85581
Project: 85581
Buggy source:
void processSyncStatusCount(SyncStatusCount ssc){
  if (RequestedMasternodeAssets >= MASTERNODE_SYNC_FINISHED)   return;
switch (ssc.itemId) {
case (MASTERNODE_SYNC_LIST):
    if (ssc.itemId != RequestedMasternodeAssets)     return;
  sumMasternodeList+=ssc.count;
countMasternodeList++;
break;
case (MASTERNODE_SYNC_MNW):
if (ssc.itemId != RequestedMasternodeAssets) return;
sumMasternodeWinner+=ssc.count;
countMasternodeWinner++;
break;
case (MASTERNODE_SYNC_BUDGET_PROP):
if (RequestedMasternodeAssets != MASTERNODE_SYNC_BUDGET) return;
sumBudgetItemProp+=ssc.count;
countBudgetItemProp++;
break;
case (MASTERNODE_SYNC_BUDGET_FIN):
if (RequestedMasternodeAssets != MASTERNODE_SYNC_BUDGET) return;
sumBudgetItemFin+=ssc.count;
countBudgetItemFin++;
break;
}
log.info("String_Node_Str",ssc.itemId,ssc.count);
}

Fixed version (ground truth):
void processSyncStatusCount(Peer peer,SyncStatusCount ssc){
  if (RequestedMasternodeAssets >= MASTERNODE_SYNC_FINISHED)   return;
switch (ssc.itemId) {
case (MASTERNODE_SYNC_LIST):
    if (ssc.itemId != RequestedMasternodeAssets)     return;
  sumMasternodeList+=ssc.count;
countMasternodeList++;
peer.setMasternodeListCount(ssc.count);
break;
case (MASTERNODE_SYNC_MNW):
if (ssc.itemId != RequestedMasternodeAssets) return;
sumMasternodeWinner+=ssc.count;
countMasternodeWinner++;
break;
case (MASTERNODE_SYNC_BUDGET_PROP):
if (RequestedMasternodeAssets != MASTERNODE_SYNC_BUDGET) return;
sumBudgetItemProp+=ssc.count;
countBudgetItemProp++;
break;
case (MASTERNODE_SYNC_BUDGET_FIN):
if (RequestedMasternodeAssets != MASTERNODE_SYNC_BUDGET) return;
sumBudgetItemFin+=ssc.count;
countBudgetItemFin++;
break;
}
log.info("String_Node_Str",ssc.itemId,ssc.count);
}