nus-yam/ex-repair huggingface dataset:
Program: 51979
Project: 51979
Buggy source:
@Override public Iterator<Item> findByLastModifiedSince(Context context,Date since) throws SQLException {
  Query query=createQuery(context,"String_Node_Str");
  query.setDate("String_Node_Str",since);
  return iterate(query);
}

Fixed version (ground truth):
@Override public Iterator<Item> findByLastModifiedSince(Context context,Date since) throws SQLException {
  Query query=createQuery(context,"String_Node_Str");
  query.setTimestamp("String_Node_Str",since);
  return iterate(query);
}
Program: 51980
Project: 51980
Buggy source:
@Override public Iterator<Item> findAll(Context context,boolean archived,boolean withdrawn,boolean discoverable,Date lastModified) throws SQLException {
  Query query=createQuery(context,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  query.setParameter("String_Node_Str",archived);
  query.setParameter("String_Node_Str",withdrawn);
  query.setParameter("String_Node_Str",discoverable);
  query.setDate("String_Node_Str",lastModified);
  return iterate(query);
}

Fixed version (ground truth):
@Override public Iterator<Item> findAll(Context context,boolean archived,boolean withdrawn,boolean discoverable,Date lastModified) throws SQLException {
  StringBuilder queryStr=new StringBuilder();
  queryStr.append("String_Node_Str");
  queryStr.append("String_Node_Str");
  queryStr.append("String_Node_Str");
  if (lastModified != null) {
    queryStr.append("String_Node_Str");
  }
  Query query=createQuery(context,queryStr.toString());
  query.setParameter("String_Node_Str",archived);
  query.setParameter("String_Node_Str",withdrawn);
  query.setParameter("String_Node_Str",discoverable);
  if (lastModified != null) {
    query.setTimestamp("String_Node_Str",lastModified);
  }
  return iterate(query);
}
Program: 51981
Project: 51981
Buggy source:
@Override public Iterator<Item> findByLastModifiedSince(Context context,Date since) throws SQLException {
  Query query=createQuery(context,"String_Node_Str");
  query.setParameter("String_Node_Str",since);
  return iterate(query);
}

Fixed version (ground truth):
@Override public Iterator<Item> findByLastModifiedSince(Context context,Date since) throws SQLException {
  Query query=createQuery(context,"String_Node_Str");
  query.setDate("String_Node_Str",since);
  return iterate(query);
}
Program: 51982
Project: 51982
Buggy source:
@Override public Iterator<Item> findAll(Context context,boolean archived,boolean withdrawn,boolean discoverable,Date lastModified) throws SQLException {
  Query query=createQuery(context,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  query.setParameter("String_Node_Str",archived);
  query.setParameter("String_Node_Str",withdrawn);
  query.setParameter("String_Node_Str",discoverable);
  query.setParameter("String_Node_Str",lastModified);
  return iterate(query);
}

Fixed version (ground truth):
@Override public Iterator<Item> findAll(Context context,boolean archived,boolean withdrawn,boolean discoverable,Date lastModified) throws SQLException {
  Query query=createQuery(context,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  query.setParameter("String_Node_Str",archived);
  query.setParameter("String_Node_Str",withdrawn);
  query.setParameter("String_Node_Str",discoverable);
  query.setDate("String_Node_Str",lastModified);
  return iterate(query);
}
Program: 51983
Project: 51983
Buggy source:
public MultiFormatDateParserTest(String testMessage,String toParseDate,String expectedFormat,boolean expectedResult){
  this.testMessage=testMessage;
  this.toParseDate=toParseDate;
  this.expectedFormat=expectedFormat;
  this.expectedResult=expectedResult;
}

Fixed version (ground truth):
/** 
 * Test a single date format. JUnit will instantiate this class repeatedly with data from   {@link #dateFormatsToTest}.
 */
public MultiFormatDateParserTest(String testMessage,String toParseDate,String expectedFormat,boolean expectedResult){
  this.testMessage=testMessage;
  this.toParseDate=toParseDate;
  this.expectedFormat=expectedFormat;
  this.expectedResult=expectedResult;
}
Program: 51984
Project: 51984
Buggy source:
@BeforeClass public static void setUpClass(){
}

Fixed version (ground truth):
@BeforeClass public static void setUpClass(){
  Map<String,String> formats=new HashMap<>(32);
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  formats.put("String_Node_Str","String_Node_Str");
  new MultiFormatDateParser().setPatterns(formats);
}
Program: 51985
Project: 51985
Buggy source:
@Parameterized.Parameters public static Collection dateFormatsToTest(){
  return Arrays.asList(new Object[][]{{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false}});
}

Fixed version (ground truth):
/** 
 * Date formats and samples to drive the parameterized test. 
 */
@Parameterized.Parameters public static Collection dateFormatsToTest(){
  return Arrays.asList(new Object[][]{{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false}});
}
Program: 51986
Project: 51986
Buggy source:
/** 
 * Test of parse method, of class MultiFormatDateParser.
 */
@Test public void testParse() throws ParseException {
  SimpleDateFormat simpleDateFormat=new SimpleDateFormat(expectedFormat);
  Date result=MultiFormatDateParser.parse(toParseDate);
  assertEquals(testMessage,expectedResult,simpleDateFormat.parse(toParseDate).equals(result));
}

Fixed version (ground truth):
/** 
 * Test of parse method, of class MultiFormatDateParser.
 */
@Test public void testParse() throws ParseException {
  SimpleDateFormat simpleDateFormat=new SimpleDateFormat(expectedFormat);
  simpleDateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  Date result=MultiFormatDateParser.parse(toParseDate);
  assertEquals(testMessage,expectedResult,simpleDateFormat.parse(toParseDate).equals(result));
}
Program: 51988
Project: 51988
Buggy source:
/** 
 * Get the Database Schema Name in use by this Connection, so that it can be used to limit queries in other methods (e.g. tableExists()).
 * @param connection Current Database Connection
 * @return Schema name as a string, or "null" if cannot be determined or unspecified
 */
public static String getSchemaName(Connection connection) throws SQLException {
  String schema=null;
  try {
    schema=connection.getSchema();
  }
 catch (  Exception|AbstractMethodError e) {
  }
  if (StringUtils.isBlank(schema)) {
    schema=canonicalize(connection,ConfigurationManager.getProperty("String_Node_Str"));
  }
  if (StringUtils.isBlank(schema)) {
    DatabaseMetaData meta=connection.getMetaData();
    String dbType=findDbKeyword(meta);
    if (dbType.equals(DBMS_POSTGRES)) {
      schema="String_Node_Str";
    }
 else     if (dbType.equals(DBMS_ORACLE)) {
      schema=meta.getUserName();
    }
 else     schema=null;
  }
  return schema;
}

Fixed version (ground truth):
/** 
 * Get the Database Schema Name in use by this Connection, so that it can be used to limit queries in other methods (e.g. tableExists()).
 * @param connection Current Database Connection
 * @return Schema name as a string, or "null" if cannot be determined or unspecified
 */
public static String getSchemaName(Connection connection) throws SQLException {
  String schema=null;
  try {
    schema=connection.getSchema();
  }
 catch (  Exception|AbstractMethodError e) {
  }
  if (StringUtils.isBlank(schema)) {
    schema=canonicalize(connection,ConfigurationManager.getProperty("String_Node_Str"));
  }
  if (StringUtils.isBlank(schema)) {
    String dbType=getDbType(connection);
    if (dbType.equals(DBMS_POSTGRES)) {
      schema="String_Node_Str";
    }
 else     if (dbType.equals(DBMS_ORACLE)) {
      DatabaseMetaData meta=connection.getMetaData();
      schema=meta.getUserName();
    }
 else     schema=null;
  }
  return schema;
}
Program: 51989
Project: 51989
Buggy source:
public static boolean sequenceExists(Connection connection,String sequenceName){
  boolean exists=false;
  PreparedStatement statement=null;
  ResultSet results=null;
  boolean schemaFilter=false;
  try {
    String schema=getSchemaName(connection);
    schema=canonicalize(connection,schema);
    sequenceName=canonicalize(connection,sequenceName);
    String dbtype=findDbKeyword(connection.getMetaData());
    String sequenceSQL=null;
switch (dbtype) {
case DBMS_POSTGRES:
      if (schema == null) {
        schema="String_Node_Str";
      }
    sequenceSQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  schemaFilter=true;
break;
case DBMS_ORACLE:
sequenceSQL="String_Node_Str";
break;
case DBMS_H2:
sequenceSQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
break;
default :
throw new SQLException("String_Node_Str" + dbtype + "String_Node_Str");
}
if (sequenceSQL != null) {
statement=connection.prepareStatement(sequenceSQL);
statement.setString(1,sequenceName);
if (schemaFilter) {
statement.setString(2,schema);
}
results=statement.executeQuery();
if (results != null && results.next() && results.getInt(1) > 0) {
exists=true;
}
}
}
 catch (SQLException e) {
log.error("String_Node_Str" + sequenceName + "String_Node_Str",e);
}
 finally {
try {
if (statement != null && !statement.isClosed()) statement.close();
if (results != null && !results.isClosed()) results.close();
}
 catch (SQLException e) {
}
}
return exists;
}

Fixed version (ground truth):
public static boolean sequenceExists(Connection connection,String sequenceName){
  boolean exists=false;
  PreparedStatement statement=null;
  ResultSet results=null;
  boolean schemaFilter=false;
  try {
    String schema=getSchemaName(connection);
    schema=canonicalize(connection,schema);
    sequenceName=canonicalize(connection,sequenceName);
    String dbtype=getDbType(connection);
    String sequenceSQL=null;
switch (dbtype) {
case DBMS_POSTGRES:
      if (schema == null) {
        schema="String_Node_Str";
      }
    sequenceSQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  schemaFilter=true;
break;
case DBMS_ORACLE:
sequenceSQL="String_Node_Str";
break;
case DBMS_H2:
sequenceSQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
break;
default :
throw new SQLException("String_Node_Str" + dbtype + "String_Node_Str");
}
if (sequenceSQL != null) {
statement=connection.prepareStatement(sequenceSQL);
statement.setString(1,sequenceName);
if (schemaFilter) {
statement.setString(2,schema);
}
results=statement.executeQuery();
if (results != null && results.next() && results.getInt(1) > 0) {
exists=true;
}
}
}
 catch (SQLException e) {
log.error("String_Node_Str" + sequenceName + "String_Node_Str",e);
}
 finally {
try {
if (statement != null && !statement.isClosed()) statement.close();
if (results != null && !results.isClosed()) results.close();
}
 catch (SQLException e) {
}
}
return exists;
}
Program: 51990
Project: 51990
Buggy source:
/** 
 * Clean the existing database, permanently removing all data and tables <P> FlywayDB (http://flywaydb.org/) is used to clean the database
 * @param flyway Initialized Flyway object
 * @param dataSource Initialized DataSource
 * @throws SQLException If database cannot be cleaned.
 */
private static synchronized void cleanDatabase(Flyway flyway,DataSource dataSource) throws SQLException {
  try {
    flyway.clean();
    Connection connection=null;
    try {
      connection=dataSource.getConnection();
      DatabaseMetaData meta=connection.getMetaData();
      String dbKeyword=findDbKeyword(meta);
      if (dbKeyword.equals(DBMS_ORACLE)) {
        PreparedStatement statement=null;
        try {
          statement=connection.prepareStatement("String_Node_Str");
          statement.executeQuery();
        }
  finally {
          if (statement != null && !statement.isClosed())           statement.close();
        }
      }
    }
  finally {
      if (connection != null && !connection.isClosed())       connection.close();
    }
  }
 catch (  FlywayException fe) {
    throw new SQLException("String_Node_Str",fe);
  }
}

Fixed version (ground truth):
/** 
 * Clean the existing database, permanently removing all data and tables <P> FlywayDB (http://flywaydb.org/) is used to clean the database
 * @param flyway Initialized Flyway object
 * @param dataSource Initialized DataSource
 * @throws SQLException If database cannot be cleaned.
 */
private static synchronized void cleanDatabase(Flyway flyway,DataSource dataSource) throws SQLException {
  try {
    flyway.clean();
    Connection connection=null;
    try {
      connection=dataSource.getConnection();
      DatabaseMetaData meta=connection.getMetaData();
      String dbKeyword=getDbType(connection);
      if (dbKeyword.equals(DBMS_ORACLE)) {
        PreparedStatement statement=null;
        try {
          statement=connection.prepareStatement("String_Node_Str");
          statement.executeQuery();
        }
  finally {
          if (statement != null && !statement.isClosed())           statement.close();
        }
      }
    }
  finally {
      if (connection != null && !connection.isClosed())       connection.close();
    }
  }
 catch (  FlywayException fe) {
    throw new SQLException("String_Node_Str",fe);
  }
}
Program: 51991
Project: 51991
Buggy source:
@Override public void migrate(Connection connection) throws Exception {
  String dbtype=connection.getMetaData().getDatabaseProductName();
  String dbFileLocation=null;
  if (dbtype.toLowerCase().contains("String_Node_Str")) {
    dbFileLocation="String_Node_Str";
  }
 else   if (dbtype.toLowerCase().contains("String_Node_Str")) {
    dbFileLocation="String_Node_Str";
  }
  String dataMigrateSQL;
  String sqlMigrationPath="String_Node_Str" + dbFileLocation + "String_Node_Str";
  if (DatabaseUtils.tableExists(connection,"String_Node_Str")) {
    dataMigrateSQL=new ClassPathResource(sqlMigrationPath + "String_Node_Str" + "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
  }
 else {
    dataMigrateSQL=new ClassPathResource(sqlMigrationPath + "String_Node_Str" + "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
  }
  DatabaseUtils.executeSql(connection,dataMigrateSQL);
  migration_file_size=dataMigrateSQL.length();
}

Fixed version (ground truth):
@Override public void migrate(Connection connection) throws Exception {
  String dbtype=DatabaseUtils.getDbType(connection);
  String dataMigrateSQL;
  String sqlMigrationPath="String_Node_Str" + dbtype + "String_Node_Str";
  if (DatabaseUtils.tableExists(connection,"String_Node_Str")) {
    dataMigrateSQL=new ClassPathResource(sqlMigrationPath + "String_Node_Str" + "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
  }
 else {
    dataMigrateSQL=new ClassPathResource(sqlMigrationPath + "String_Node_Str" + "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
  }
  DatabaseUtils.executeSql(connection,dataMigrateSQL);
  migration_file_size=dataMigrateSQL.length();
}
Program: 51998
Project: 51998
Buggy source:
public static File getImageFile(File f,int page) throws IOException, InterruptedException, IM4JavaException {
  File f2=new File(f.getParentFile(),f.getName() + "String_Node_Str");
  f2.deleteOnExit();
  ConvertCmd cmd=new ConvertCmd();
  IMOperation op=new IMOperation();
  String s="String_Node_Str" + page + "String_Node_Str";
  op.addImage(f.getAbsolutePath() + s);
  op.addImage(f2.getAbsolutePath());
  if (MediaFilterManager.isVerbose) {
    System.out.println("String_Node_Str" + op);
  }
  cmd.run(op);
  return f2;
}

Fixed version (ground truth):
public static File getImageFile(File f,int page) throws IOException, InterruptedException, IM4JavaException {
  File f2=new File(f.getParentFile(),f.getName() + "String_Node_Str");
  f2.deleteOnExit();
  ConvertCmd cmd=new ConvertCmd();
  IMOperation op=new IMOperation();
  String s="String_Node_Str" + page + "String_Node_Str";
  op.addImage(f.getAbsolutePath() + s);
  if (flatten) {
    op.flatten();
  }
  op.addImage(f2.getAbsolutePath());
  if (MediaFilterManager.isVerbose) {
    System.out.println("String_Node_Str" + op);
  }
  cmd.run(op);
  return f2;
}
Program: 51999
Project: 51999
Buggy source:
public String getLabel(String field,String key,String locale){
  init();
  return labels[Integer.parseInt(key)];
}

Fixed version (ground truth):
public String getLabel(String field,String key,String locale){
  init();
  int pos=-1;
  for (int i=0; i < values.length; i++) {
    if (values[i].equals(key)) {
      pos=i;
      break;
    }
  }
  if (pos != -1)   return labels[pos];
 else   return "String_Node_Str" + key;
}
Program: 52000
Project: 52000
Buggy source:
@Override public int doOffsetQuery(String column,String value,boolean isAscending) throws BrowseException {
  DiscoverQuery query=new DiscoverQuery();
  addLocationScopeFilter(query);
  addStatusFilter(query);
  query.setMaxResults(0);
  query.addFilterQueries("String_Node_Str" + Constants.ITEM);
  if (isAscending) {
    query.setQuery("String_Node_Str" + column + "String_Node_Str"+ "String_Node_Str"+ value+ "String_Node_Str");
  }
 else {
    query.setQuery("String_Node_Str" + column + "String_Node_Str"+ "String_Node_Str"+ value+ "String_Node_Str");
  }
  boolean includeUnDiscoverable=itemsWithdrawn || !itemsDiscoverable;
  DiscoverResult resp=null;
  try {
    resp=searcher.search(context,query,includeUnDiscoverable);
  }
 catch (  SearchServiceException e) {
    throw new BrowseException(e);
  }
  return (int)resp.getTotalSearchResults();
}

Fixed version (ground truth):
@Override public int doOffsetQuery(String column,String value,boolean isAscending) throws BrowseException {
  DiscoverQuery query=new DiscoverQuery();
  addLocationScopeFilter(query);
  addStatusFilter(query);
  query.setMaxResults(0);
  query.addFilterQueries("String_Node_Str" + Constants.ITEM);
  if (authority != null) {
    query.addFilterQueries("String_Node_Str" + facetField + "String_Node_Str"+ authority);
  }
 else   if (this.value != null && !valuePartial) {
    query.addFilterQueries("String_Node_Str" + facetField + "String_Node_Str"+ this.value);
  }
 else   if (valuePartial) {
    query.addFilterQueries("String_Node_Str" + facetField + "String_Node_Str"+ this.value);
  }
  if (isAscending) {
    query.setQuery("String_Node_Str" + column + "String_Node_Str"+ "String_Node_Str"+ value+ "String_Node_Str");
  }
 else {
    query.setQuery("String_Node_Str" + column + "String_Node_Str"+ "String_Node_Str"+ value+ "String_Node_Str");
  }
  boolean includeUnDiscoverable=itemsWithdrawn || !itemsDiscoverable;
  DiscoverResult resp=null;
  try {
    resp=searcher.search(context,query,includeUnDiscoverable);
  }
 catch (  SearchServiceException e) {
    throw new BrowseException(e);
  }
  return (int)resp.getTotalSearchResults();
}
Program: 52001
Project: 52001
Buggy source:
/** 
 * is the field is defined as authority controlled
 */
private static boolean isAuthorityControlledField(String md){
  int pos=md.indexOf("String_Node_Str");
  String mdf=(pos > -1 ? md.substring(0,pos) : md);
  pos=md.indexOf("String_Node_Str");
  mdf=(pos > -1 ? md.substring(pos + 1) : md);
  return authorityControlled.contains(mdf);
}

Fixed version (ground truth):
/** 
 * is the field is defined as authority controlled
 */
private static boolean isAuthorityControlledField(String md){
  String mdf=StringUtils.substringAfter(md,"String_Node_Str");
  mdf=StringUtils.substringBefore(mdf,"String_Node_Str");
  return authorityControlled.contains(mdf);
}
Program: 52002
Project: 52002
Buggy source:
public static Date parse(String date){
  SimpleDateFormat format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
  Date ret;
  try {
    ret=format.parse(date);
    return ret;
  }
 catch (  ParseException e) {
    format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
    try {
      return format.parse(date);
    }
 catch (    ParseException e1) {
      format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
      try {
        return format.parse(date);
      }
 catch (      ParseException e2) {
        format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
        try {
          return format.parse(date);
        }
 catch (        ParseException e3) {
          format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
          try {
            return format.parse(date);
          }
 catch (          ParseException e4) {
            log.error(e4.getMessage(),e);
          }
        }
      }
    }
  }
  return new Date();
}

Fixed version (ground truth):
public static Date parse(String date){
  SimpleDateFormat format=new SimpleDateFormat("String_Node_Str");
  format.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  Date ret;
  try {
    ret=format.parse(date);
    return ret;
  }
 catch (  ParseException ex) {
    format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
    try {
      return format.parse(date);
    }
 catch (    ParseException e) {
      format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
      try {
        return format.parse(date);
      }
 catch (      ParseException e1) {
        format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
        try {
          return format.parse(date);
        }
 catch (        ParseException e2) {
          format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
          try {
            return format.parse(date);
          }
 catch (          ParseException e3) {
            format=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
            try {
              return format.parse(date);
            }
 catch (            ParseException e4) {
              log.error(e4.getMessage(),e);
            }
          }
        }
      }
    }
  }
  return new Date();
}
Program: 52005
Project: 52005
Buggy source:
/** 
 * Do the usual DSpace GET method.  You will notice that browse does not currently respond to POST requests.
 */
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  BrowserScope scope=getBrowserScopeForRequest(context,request,response);
  if (scope.getBrowseIndex() == null) {
    String requestURL=request.getRequestURI();
    if (request.getQueryString() != null) {
      requestURL+="String_Node_Str" + request.getQueryString();
    }
    log.warn("String_Node_Str" + requestURL);
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  if ("String_Node_Str".equals(UIUtil.getSubmitButton(request,"String_Node_Str"))) {
    exportMetadata(context,request,response,scope);
  }
 else {
    processBrowse(context,scope,request,response);
  }
}

Fixed version (ground truth):
/** 
 * Do the usual DSpace GET method.  You will notice that browse does not currently respond to POST requests.
 */
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  BrowserScope scope=getBrowserScopeForRequest(context,request,response);
  if (scope == null || scope.getBrowseIndex() == null) {
    String requestURL=request.getRequestURI();
    if (request.getQueryString() != null) {
      requestURL+="String_Node_Str" + request.getQueryString();
    }
    log.warn("String_Node_Str" + requestURL);
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  if ("String_Node_Str".equals(UIUtil.getSubmitButton(request,"String_Node_Str"))) {
    exportMetadata(context,request,response,scope);
  }
 else {
    processBrowse(context,scope,request,response);
  }
}
Program: 52006
Project: 52006
Buggy source:
/** 
 * Do the usual DSpace GET method.  You will notice that browse does not currently respond to POST requests.
 */
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  BrowserScope scope=getBrowserScopeForRequest(context,request,response);
  if (scope.getBrowseIndex() == null) {
    throw new ServletException("String_Node_Str");
  }
  if ("String_Node_Str".equals(UIUtil.getSubmitButton(request,"String_Node_Str"))) {
    exportMetadata(context,request,response,scope);
  }
 else {
    processBrowse(context,scope,request,response);
  }
}

Fixed version (ground truth):
/** 
 * Do the usual DSpace GET method.  You will notice that browse does not currently respond to POST requests.
 */
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  BrowserScope scope=getBrowserScopeForRequest(context,request,response);
  if (scope.getBrowseIndex() == null) {
    String requestURL=request.getRequestURI();
    if (request.getQueryString() != null) {
      requestURL+="String_Node_Str" + request.getQueryString();
    }
    log.warn("String_Node_Str" + requestURL);
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
    return;
  }
  if ("String_Node_Str".equals(UIUtil.getSubmitButton(request,"String_Node_Str"))) {
    exportMetadata(context,request,response,scope);
  }
 else {
    processBrowse(context,scope,request,response);
  }
}
Program: 52007
Project: 52007
Buggy source:
/** 
 * Setup the reader. The resource is opened to get an <code>InputStream</code>, the length and the last modification date
 */
public void setup(SourceResolver resolver,Map objectModel,String src,Parameters par) throws ProcessingException, SAXException, IOException {
  this.key=src;
  this.setByteRanges(false);
  this.inputSources=new ArrayList<Source>();
  String path=src.substring(0,src.lastIndexOf('/'));
  String file=src.substring(src.lastIndexOf('/') + 1);
  String[] files=file.split("String_Node_Str");
  for (  String f : files) {
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    String fullPath=path + "String_Node_Str" + f;
    this.inputSources.add(resolver.resolveURI(fullPath));
  }
  super.setup(resolver,objectModel,path + "String_Node_Str" + files[files.length - 1],par);
  this.streamEnumeration=new StreamEnumeration();
  try {
    if ("String_Node_Str".equals(par.getParameter("String_Node_Str"))) {
      this.doMinify=false;
    }
 else {
      this.key+="String_Node_Str";
    }
  }
 catch (  ParameterException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Setup the reader. The resource is opened to get an <code>InputStream</code>, the length and the last modification date
 */
public void setup(SourceResolver resolver,Map objectModel,String src,Parameters par) throws ProcessingException, SAXException, IOException {
  this.key=src;
  this.setByteRanges(false);
  this.inputSources=new ArrayList<Source>();
  String path="String_Node_Str";
  if (src.contains("String_Node_Str")) {
    path=src.substring(0,src.lastIndexOf('/'));
  }
  String file=src.substring(src.lastIndexOf('/') + 1);
  String[] files=file.split("String_Node_Str");
  for (  String f : files) {
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    if (file.endsWith("String_Node_Str") && !f.endsWith("String_Node_Str")) {
      f+="String_Node_Str";
    }
    String fullPath;
    if (!path.isEmpty())     fullPath=path + "String_Node_Str" + f;
 else     fullPath=f;
    Source inSource=resolver.resolveURI(fullPath);
    if (inSource.exists()) {
      this.inputSources.add(inSource);
    }
 else     throw new ResourceNotFoundException("String_Node_Str" + fullPath + "String_Node_Str");
  }
  super.setup(resolver,objectModel,path + "String_Node_Str" + files[files.length - 1],par);
  this.streamEnumeration=new StreamEnumeration();
  try {
    if ("String_Node_Str".equals(par.getParameter("String_Node_Str"))) {
      this.doMinify=false;
    }
 else {
      this.key+="String_Node_Str";
    }
  }
 catch (  ParameterException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 52008
Project: 52008
Buggy source:
@RequestMapping(method={RequestMethod.GET,RequestMethod.HEAD},value={"String_Node_Str"}) public String processHandle(HttpServletRequest request,@PathVariable String prefix){
  try {
    Context context=ContextUtil.obtainContext(request);
    IdentifierService dis=new DSpace().getSingletonService(IdentifierService.class);
    if (dis == null)     throw new RuntimeException("String_Node_Str");
    DSpaceObject dso=dis.resolve(context,prefix);
    if (dso == null)     throw new RuntimeException("String_Node_Str");
    request.setAttribute(DSPACE_OBJECT,dso);
    return "String_Node_Str" + dso.getHandle();
  }
 catch (  SQLException e) {
    return "String_Node_Str";
  }
catch (  IdentifierNotResolvableException e) {
    return "String_Node_Str";
  }
catch (  IdentifierNotFoundException e) {
    request.setAttribute("String_Node_Str",prefix);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@RequestMapping(method={RequestMethod.GET,RequestMethod.HEAD},value={"String_Node_Str"}) public String processHandle(HttpServletRequest request,@PathVariable String prefix){
  try {
    Context context=ContextUtil.obtainContext(request);
    IdentifierService dis=new DSpace().getSingletonService(IdentifierService.class);
    if (dis == null)     throw new RuntimeException("String_Node_Str");
    DSpaceObject dso=dis.resolve(context,prefix);
    if (dso == null)     throw new IdentifierNotFoundException("String_Node_Str" + prefix + "String_Node_Str");
    request.setAttribute(DSPACE_OBJECT,dso);
    return "String_Node_Str" + dso.getHandle();
  }
 catch (  SQLException e) {
    return "String_Node_Str";
  }
catch (  IdentifierNotResolvableException e) {
    return "String_Node_Str";
  }
catch (  IdentifierNotFoundException e) {
    request.setAttribute("String_Node_Str",prefix);
    return "String_Node_Str";
  }
}
Program: 52012
Project: 52012
Buggy source:
/** 
 * Return List of all DSpaceObjects which have been ingested/replaced by this instance of the Ingester. <P> This list can be useful in reporting back to the user what content has been added or replaced.  It's used by ingestAll() and replaceAll() to return this list of everything that was ingested/replaced.
 * @return List of DSpaceObjects which have been added/replaced
 */
protected List<DSpaceObject> getIngestedList(){
  return dsoIngestedList;
}

Fixed version (ground truth):
/** 
 * Return List of all DSpaceObjects which have been ingested/replaced by this instance of the Ingester. <P> This list can be useful in reporting back to the user what content has been added or replaced.  It's used by ingestAll() and replaceAll() to return this list of everything that was ingested/replaced.
 * @return List of DSpaceObjects which have been added/replaced
 */
protected List<DSpaceObject> getIngestedList(){
  java.util.Collection<DSpaceObject> coll=pkgIngestedMap.values();
  if (coll instanceof List)   return (List)coll;
 else   return new ArrayList(coll);
}
Program: 52013
Project: 52013
Buggy source:
@Override public Bitstream getPrimaryBitstream(int itemId,String bundleName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,selectPrimaryBitstreamID,itemId,bundleName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Bitstream getPrimaryBitstream(int itemId,String bundleName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,SELECT_PRIMARY_BITSTREAM_ID,itemId,bundleName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}
Program: 52014
Project: 52014
Buggy source:
@Override public Bitstream getFirstBitstream(int itemId,String bundleName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,selectFirstBitstreamID,itemId,bundleName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Bitstream getFirstBitstream(int itemId,String bundleName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,SELECT_FIRST_BITSTREAM_ID,itemId,bundleName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}
Program: 52015
Project: 52015
Buggy source:
ItemDAOOracle(Context ctx){
  super(ctx);
  int MD_FIELD_ID_NAME=-1;
  try {
    MD_FIELD_ID_NAME=MetadataField.findByElement(context,MetadataSchema.DC_SCHEMA_ID,"String_Node_Str",null).getFieldID();
  }
 catch (  SQLException ex) {
  }
  if (null == selectPrimaryBitstreamID)   selectPrimaryBitstreamID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (null == selectFirstBitstreamID)   selectFirstBitstreamID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (null == selectNamedBitstreamID)   selectNamedBitstreamID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Constants.BITSTREAM+ "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
ItemDAOOracle(Context ctx){
  super(ctx);
  int MD_FIELD_ID_NAME=-1;
  try {
    MD_FIELD_ID_NAME=MetadataField.findByElement(context,MetadataSchema.DC_SCHEMA_ID,"String_Node_Str",null).getFieldID();
  }
 catch (  SQLException ex) {
  }
  if (null == SELECT_PRIMARY_BITSTREAM_ID)   SELECT_PRIMARY_BITSTREAM_ID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (null == SELECT_FIRST_BITSTREAM_ID)   SELECT_FIRST_BITSTREAM_ID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  if (null == SELECT_NAMED_BITSTREAM_ID)   SELECT_NAMED_BITSTREAM_ID="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + Constants.BUNDLE + "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Constants.BITSTREAM+ "String_Node_Str"+ "String_Node_Str"+ MD_FIELD_ID_NAME+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}
Program: 52016
Project: 52016
Buggy source:
@Override public Bitstream getNamedBitstream(int itemId,String bundleName,String fileName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,selectNamedBitstreamID,itemId,bundleName,fileName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Bitstream getNamedBitstream(int itemId,String bundleName,String fileName) throws SQLException {
  TableRowIterator tri=null;
  try {
    tri=DatabaseManager.query(context,SELECT_NAMED_BITSTREAM_ID,itemId,bundleName,fileName);
    if (tri.hasNext()) {
      TableRow row=tri.next();
      int bid=row.getIntColumn("String_Node_Str");
      return Bitstream.find(context,bid);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  return null;
}
Program: 52018
Project: 52018
Buggy source:
/** 
 * Get the CSV lines as an array of CSV formatted strings
 * @return the array of CSV formatted Strings
 */
public final String[] getCSVLinesAsStringArray(){
  String[] csvLines=new String[counter + 1];
  csvLines[0]="String_Node_Str" + fieldSeparator + "String_Node_Str";
  Collections.sort(headings);
  for (  String value : headings) {
    csvLines[0]=csvLines[0] + fieldSeparator + value;
  }
  Iterator<DSpaceCSVLine> i=lines.iterator();
  int c=1;
  while (i.hasNext()) {
    csvLines[c++]=i.next().toCSV(headings);
  }
  return csvLines;
}

Fixed version (ground truth):
/** 
 * Get the CSV lines as an array of CSV formatted strings
 * @return the array of CSV formatted Strings
 */
public final String[] getCSVLinesAsStringArray(){
  String[] csvLines=new String[counter + 1];
  csvLines[0]="String_Node_Str" + fieldSeparator + "String_Node_Str";
  List<String> headingsCopy=new ArrayList<String>(headings);
  Collections.sort(headingsCopy);
  for (  String value : headingsCopy) {
    csvLines[0]=csvLines[0] + fieldSeparator + value;
  }
  Iterator<DSpaceCSVLine> i=lines.iterator();
  int c=1;
  while (i.hasNext()) {
    csvLines[c++]=i.next().toCSV(headingsCopy);
  }
  return csvLines;
}
Program: 52019
Project: 52019
Buggy source:
/** 
 * Create a new CSV line for a new item
 */
public DSpaceCSVLine(){
  this.id=-1;
  this.items=new HashMap<String,ArrayList>();
}

Fixed version (ground truth):
/** 
 * Create a new CSV line for a new item
 */
public DSpaceCSVLine(){
  this.id=-1;
  this.items=new TreeMap<String,ArrayList>(headerComparator);
}
Program: 52021
Project: 52021
Buggy source:
/** 
 * is the field is defined as authority controlled
 */
private static boolean isAuthorityControlledField(String md){
  int pos=md.indexOf("String_Node_Str");
  String mdf=(pos > -1 ? md.substring(0,pos) : md);
  return authorityControlled.contains(mdf);
}

Fixed version (ground truth):
/** 
 * is the field is defined as authority controlled
 */
private static boolean isAuthorityControlledField(String md){
  int pos=md.indexOf("String_Node_Str");
  String mdf=(pos > -1 ? md.substring(0,pos) : md);
  pos=md.indexOf("String_Node_Str");
  mdf=(pos > -1 ? md.substring(pos + 1) : md);
  return authorityControlled.contains(mdf);
}
Program: 52022
Project: 52022
Buggy source:
private Metadatum getDcValueFromCSV(String language,String schema,String element,String qualifier,String value,AuthorityValue fromAuthority){
  Metadatum dcv=new Metadatum();
  dcv.schema=schema;
  dcv.element=element;
  dcv.qualifier=qualifier;
  dcv.language=language;
  if (fromAuthority != null) {
    if (value.indexOf(':') > 0) {
      value=value.substring(0,value.indexOf(':'));
    }
    List<AuthorityValue> byValue=authorityValueFinder.findByValue(c,schema,element,qualifier,value);
    AuthorityValue authorityValue=null;
    if (byValue.isEmpty()) {
      String toGenerate=fromAuthority.generateString() + value;
      String field=schema + "String_Node_Str" + element+ (StringUtils.isNotBlank(qualifier) ? "String_Node_Str" + qualifier : "String_Node_Str");
      authorityValue=AuthorityValueGenerator.generate(toGenerate,value,field);
      dcv.authority=toGenerate;
    }
 else {
      authorityValue=byValue.get(0);
      dcv.authority=authorityValue.getId();
    }
    dcv.value=authorityValue.getValue();
    dcv.confidence=Choices.CF_ACCEPTED;
  }
 else   if (value == null || !value.contains(DSpaceCSV.authoritySeparator)) {
    simplyCopyValue(value,dcv);
  }
 else {
    String[] parts=value.split(DSpaceCSV.escapedAuthoritySeparator);
    dcv.value=parts[0];
    dcv.authority=parts[1];
    dcv.confidence=(parts.length > 2 ? Integer.valueOf(parts[2]) : Choices.CF_ACCEPTED);
  }
  return dcv;
}

Fixed version (ground truth):
private Metadatum getDcValueFromCSV(String language,String schema,String element,String qualifier,String value,AuthorityValue fromAuthority){
  Metadatum dcv=new Metadatum();
  dcv.schema=schema;
  dcv.element=element;
  dcv.qualifier=qualifier;
  dcv.language=language;
  if (fromAuthority != null) {
    if (value.indexOf(':') > 0) {
      value=value.substring(0,value.indexOf(':'));
    }
    AuthorityValue example=fromAuthority.newInstance(value);
    List<AuthorityValue> byValue=authorityValueFinder.findByValue(c,schema,element,qualifier,example.getValue());
    AuthorityValue authorityValue=null;
    if (byValue.isEmpty()) {
      String toGenerate=fromAuthority.generateString() + value;
      String field=schema + "String_Node_Str" + element+ (StringUtils.isNotBlank(qualifier) ? "String_Node_Str" + qualifier : "String_Node_Str");
      authorityValue=AuthorityValueGenerator.generate(toGenerate,value,field);
      dcv.authority=toGenerate;
    }
 else {
      authorityValue=byValue.get(0);
      dcv.authority=authorityValue.getId();
    }
    dcv.value=authorityValue.getValue();
    dcv.confidence=Choices.CF_ACCEPTED;
  }
 else   if (value == null || !value.contains(DSpaceCSV.authoritySeparator)) {
    simplyCopyValue(value,dcv);
  }
 else {
    String[] parts=value.split(DSpaceCSV.escapedAuthoritySeparator);
    dcv.value=parts[0];
    dcv.authority=parts[1];
    dcv.confidence=(parts.length > 2 ? Integer.valueOf(parts[2]) : Choices.CF_ACCEPTED);
  }
  return dcv;
}
Program: 52026
Project: 52026
Buggy source:
/** 
 * Actually perform Reindexing in Discovery/Solr. This is synchronized so that only one thread can get in at a time.
 */
@Override public void run(){
synchronized (this.indexer) {
    if (DatabaseUtils.getReindexDiscovery()) {
      Context context=null;
      try {
        context=new Context();
        log.info("String_Node_Str");
        this.indexer.createIndex(context);
        this.indexer.buildSpellCheck();
        DatabaseUtils.setReindexDiscovery(false);
        log.info("String_Node_Str");
      }
 catch (      SearchServiceException sse) {
        log.warn("String_Node_Str",sse);
      }
catch (      SQLException|IOException e) {
        log.error("String_Node_Str",e);
      }
 finally {
        if (context != null && context.isValid())         context.abort();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Actually perform Reindexing in Discovery/Solr. This is synchronized so that only one thread can get in at a time.
 */
@Override public void run(){
synchronized (this.indexer) {
    if (DatabaseUtils.getReindexDiscovery()) {
      Context context=null;
      try {
        context=new Context();
        log.info("String_Node_Str");
        this.indexer.cleanIndex(true);
        this.indexer.createIndex(context);
        this.indexer.buildSpellCheck();
        log.info("String_Node_Str");
      }
 catch (      SearchServiceException sse) {
        log.warn("String_Node_Str",sse);
      }
catch (      SQLException|IOException e) {
        log.error("String_Node_Str",e);
      }
 finally {
        DatabaseUtils.setReindexDiscovery(false);
        if (context != null && context.isValid())         context.abort();
      }
    }
  }
}