nus-yam/ex-repair huggingface dataset:
Program: 52027
Project: 52027
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);
    String dbtype=DatabaseManager.findDbKeyword(connection.getMetaData());
    String sequenceSQL=null;
switch (dbtype) {
case DatabaseManager.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 DatabaseManager.DBMS_ORACLE:
sequenceSQL="String_Node_Str";
break;
case DatabaseManager.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,StringUtils.upperCase(sequenceName));
if (schemaFilter) {
statement.setString(2,StringUtils.upperCase(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=DatabaseManager.findDbKeyword(connection.getMetaData());
    String sequenceSQL=null;
switch (dbtype) {
case DatabaseManager.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 DatabaseManager.DBMS_ORACLE:
sequenceSQL="String_Node_Str";
break;
case DatabaseManager.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: 52028
Project: 52028
Buggy source:
/** 
 * Setup/Initialize the Flyway API to run against our DSpace database and point at our migration scripts.
 * @param datasource DataSource object initialized by DatabaseManager
 * @return initialized Flyway object
 */
private static Flyway setupFlyway(DataSource datasource){
  if (flywaydb == null) {
    try (Connection connection=datasource.getConnection()){
      flywaydb=new Flyway();
      flywaydb.setDataSource(datasource);
      flywaydb.setEncoding("String_Node_Str");
      DatabaseMetaData meta=connection.getMetaData();
      String dbType=DatabaseManager.findDbKeyword(meta);
      connection.close();
      ArrayList<String> scriptLocations=new ArrayList<String>();
      scriptLocations.add("String_Node_Str" + ConfigurationManager.getProperty("String_Node_Str") + "String_Node_Str"+ dbType);
      scriptLocations.add("String_Node_Str" + dbType);
      scriptLocations.add("String_Node_Str");
      if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
        scriptLocations.add("String_Node_Str");
      }
      log.info("String_Node_Str" + StringUtils.join(scriptLocations,"String_Node_Str"));
      flywaydb.setLocations(scriptLocations.toArray(new String[scriptLocations.size()]));
      flywaydb.setCallbacks(new DatabaseRegistryUpdater(),new DatabaseLegacyReindexer());
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
  return flywaydb;
}

Fixed version (ground truth):
/** 
 * Setup/Initialize the Flyway API to run against our DSpace database and point at our migration scripts.
 * @param datasource DataSource object initialized by DatabaseManager
 * @return initialized Flyway object
 */
private static Flyway setupFlyway(DataSource datasource){
  if (flywaydb == null) {
    try (Connection connection=datasource.getConnection()){
      flywaydb=new Flyway();
      flywaydb.setDataSource(datasource);
      flywaydb.setEncoding("String_Node_Str");
      DatabaseMetaData meta=connection.getMetaData();
      String dbType=DatabaseManager.findDbKeyword(meta);
      connection.close();
      ArrayList<String> scriptLocations=new ArrayList<String>();
      if (!dbType.equals(DatabaseManager.DBMS_H2)) {
        scriptLocations.add("String_Node_Str" + ConfigurationManager.getProperty("String_Node_Str") + "String_Node_Str"+ dbType);
      }
      scriptLocations.add("String_Node_Str" + dbType);
      scriptLocations.add("String_Node_Str");
      if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
        scriptLocations.add("String_Node_Str");
      }
      log.info("String_Node_Str" + StringUtils.join(scriptLocations,"String_Node_Str"));
      flywaydb.setLocations(scriptLocations.toArray(new String[scriptLocations.size()]));
      flywaydb.setCallbacks(new DatabaseRegistryUpdater(),new DatabaseLegacyReindexer());
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
  return flywaydb;
}
Program: 52029
Project: 52029
Buggy source:
/** 
 * Ensures the current database is up-to-date with regards to the latest DSpace DB schema. If the scheme is not up-to-date, then any necessary database migrations are performed. <P> FlywayDB (http://flywaydb.org/) is used to perform database migrations. If a Flyway DB migration fails it will be rolled back to the last successful migration, and any errors will be logged.
 * @param datasource DataSource object (retrieved from DatabaseManager())
 * @param connection Database connection
 * @throws SQLException If database cannot be upgraded.
 */
protected static synchronized void updateDatabase(DataSource datasource,Connection connection) throws SQLException {
  Flyway flyway=setupFlyway(datasource);
  if (!tableExists(connection,flyway.getTable())) {
    String dbVersion=determineDBVersion(connection);
    if (dbVersion == null) {
      flyway.init();
    }
 else {
      flyway.setInitVersion(dbVersion);
      flyway.setInitDescription("String_Node_Str" + dbVersion + "String_Node_Str");
      flyway.init();
    }
  }
  MigrationInfo[] pending=flyway.info().pending();
  if (pending != null && pending.length > 0) {
    log.info("String_Node_Str");
    for (    MigrationInfo info : pending) {
      log.info("String_Node_Str" + info.getVersion() + "String_Node_Str"+ info.getDescription()+ "String_Node_Str"+ info.getType()+ "String_Node_Str"+ info.getState());
    }
    flyway.migrate();
    setReindexDiscovery(true);
  }
 else   log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Ensures the current database is up-to-date with regards to the latest DSpace DB schema. If the scheme is not up-to-date, then any necessary database migrations are performed. <P> FlywayDB (http://flywaydb.org/) is used to perform database migrations. If a Flyway DB migration fails it will be rolled back to the last successful migration, and any errors will be logged.
 * @param datasource DataSource object (retrieved from DatabaseManager())
 * @param connection Database connection
 * @throws SQLException If database cannot be upgraded.
 */
protected static synchronized void updateDatabase(DataSource datasource,Connection connection) throws SQLException {
  Flyway flyway=setupFlyway(datasource);
  if (!tableExists(connection,flyway.getTable(),true)) {
    String dbVersion=determineDBVersion(connection);
    if (dbVersion == null) {
      flyway.init();
    }
 else {
      flyway.setInitVersion(dbVersion);
      flyway.setInitDescription("String_Node_Str" + dbVersion + "String_Node_Str");
      flyway.init();
    }
  }
  MigrationInfo[] pending=flyway.info().pending();
  if (pending != null && pending.length > 0) {
    log.info("String_Node_Str");
    for (    MigrationInfo info : pending) {
      log.info("String_Node_Str" + info.getVersion() + "String_Node_Str"+ info.getDescription()+ "String_Node_Str"+ info.getType()+ "String_Node_Str"+ info.getState());
    }
    flyway.migrate();
    setReindexDiscovery(true);
  }
 else   log.info("String_Node_Str");
}
Program: 52031
Project: 52031
Buggy source:
/** 
 * Determine if a particular database table exists in our database
 * @param connection Current Database Connection
 * @param tableName The name of the table
 * @return true if table of that name exists, false otherwise
 */
public static boolean tableExists(Connection connection,String tableName){
  String schema=ConfigurationManager.getProperty("String_Node_Str");
  if (StringUtils.isBlank(schema)) {
    schema=null;
  }
  boolean exists=false;
  ResultSet results=null;
  try {
    DatabaseMetaData meta=connection.getMetaData();
    if (meta.storesLowerCaseIdentifiers()) {
      schema=(schema == null) ? null : StringUtils.lowerCase(schema);
      tableName=StringUtils.lowerCase(tableName);
    }
 else     if (meta.storesUpperCaseIdentifiers()) {
      schema=(schema == null) ? null : StringUtils.upperCase(schema);
      tableName=StringUtils.upperCase(tableName);
    }
    results=meta.getTables(null,schema,tableName,null);
    if (results != null && results.next()) {
      exists=true;
    }
  }
 catch (  SQLException e) {
    log.error("String_Node_Str" + tableName + "String_Node_Str",e);
  }
 finally {
    try {
      if (results != null && !results.isClosed())       results.close();
    }
 catch (    SQLException e) {
    }
  }
  return exists;
}

Fixed version (ground truth):
/** 
 * Determine if a particular database table exists in our database
 * @param connection Current Database Connection
 * @param tableName The name of the table
 * @param caseSensitive When "true", the case of the tableName will not be changed. When "false, the name may be uppercased or lowercased based on DB type.
 * @return true if table of that name exists, false otherwise
 */
public static boolean tableExists(Connection connection,String tableName,boolean caseSensitive){
  String schema=ConfigurationManager.getProperty("String_Node_Str");
  if (StringUtils.isBlank(schema)) {
    schema=null;
  }
  boolean exists=false;
  ResultSet results=null;
  try {
    DatabaseMetaData meta=connection.getMetaData();
    if (!caseSensitive) {
      if (meta.storesLowerCaseIdentifiers()) {
        schema=(schema == null) ? null : StringUtils.lowerCase(schema);
        tableName=StringUtils.lowerCase(tableName);
      }
 else       if (meta.storesUpperCaseIdentifiers()) {
        schema=(schema == null) ? null : StringUtils.upperCase(schema);
        tableName=StringUtils.upperCase(tableName);
      }
    }
    results=meta.getTables(null,schema,tableName,null);
    if (results != null && results.next()) {
      exists=true;
    }
  }
 catch (  SQLException e) {
    log.error("String_Node_Str" + tableName + "String_Node_Str",e);
  }
 finally {
    try {
      if (results != null && !results.isClosed())       results.close();
    }
 catch (    SQLException e) {
    }
  }
  return exists;
}
Program: 52032
Project: 52032
Buggy source:
/** 
 * Process a node in the bitstream format registry XML file. The node must be a "bitstream-type" node
 * @param context DSpace context object
 * @param node the node in the DOM tree
 */
private static void loadFormat(Context context,Node node) throws SQLException, IOException, TransformerException, AuthorizeException {
  String mimeType=getElementData(node,"String_Node_Str");
  String shortDesc=getElementData(node,"String_Node_Str");
  String desc=getElementData(node,"String_Node_Str");
  String supportLevelString=getElementData(node,"String_Node_Str");
  int supportLevel=Integer.parseInt(supportLevelString);
  String internalString=getElementData(node,"String_Node_Str");
  boolean internal=Boolean.valueOf(internalString).booleanValue();
  String[] extensions=getRepeatedElementData(node,"String_Node_Str");
  BitstreamFormat exists=BitstreamFormat.findByMIMEType(context,mimeType);
  if (exists == null) {
    BitstreamFormat format=BitstreamFormat.create(context);
    format.setMIMEType(mimeType);
    format.setShortDescription(shortDesc);
    format.setDescription(desc);
    format.setSupportLevel(supportLevel);
    format.setInternal(internal);
    format.setExtensions(extensions);
    format.update();
  }
}

Fixed version (ground truth):
/** 
 * Process a node in the bitstream format registry XML file. The node must be a "bitstream-type" node
 * @param context DSpace context object
 * @param node the node in the DOM tree
 */
private static void loadFormat(Context context,Node node) throws SQLException, IOException, TransformerException, AuthorizeException {
  String mimeType=getElementData(node,"String_Node_Str");
  String shortDesc=getElementData(node,"String_Node_Str");
  String desc=getElementData(node,"String_Node_Str");
  String supportLevelString=getElementData(node,"String_Node_Str");
  int supportLevel=Integer.parseInt(supportLevelString);
  String internalString=getElementData(node,"String_Node_Str");
  boolean internal=Boolean.valueOf(internalString).booleanValue();
  String[] extensions=getRepeatedElementData(node,"String_Node_Str");
  BitstreamFormat exists=BitstreamFormat.findByMIMEType(context,mimeType);
  if (exists == null) {
    exists=BitstreamFormat.findByShortDescription(context,shortDesc);
  }
  if (exists == null) {
    BitstreamFormat format=BitstreamFormat.create(context);
    format.setMIMEType(mimeType);
    format.setShortDescription(shortDesc);
    format.setDescription(desc);
    format.setSupportLevel(supportLevel);
    format.setInternal(internal);
    format.setExtensions(extensions);
    format.update();
  }
}
Program: 52033
Project: 52033
Buggy source:
@Override public void afterMigrate(Connection connection){
  if (freshInstall) {
    updateRegistries();
    freshInstall=false;
  }
}

Fixed version (ground truth):
@Override public void afterMigrate(Connection connection){
  if (freshInstall) {
    updateRegistries();
    freshInstall=false;
  }
  Context context=null;
  try {
    context=new Context();
    context.turnOffAuthorisationSystem();
    Group.initDefaultGroupNames(context);
    context.restoreAuthSystemState();
    context.complete();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    if (context != null && context.isValid())     context.abort();
  }
}
Program: 52034
Project: 52034
Buggy source:
/** 
 * Method to actually update our registries from latest configs
 */
private void updateRegistries(){
  Context context=null;
  try {
    context=new Context();
    context.turnOffAuthorisationSystem();
    String base=ConfigurationManager.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
    log.info("String_Node_Str" + base + "String_Node_Str");
    RegistryLoader.loadBitstreamFormats(context,base + "String_Node_Str");
    log.info("String_Node_Str" + base);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
      MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    }
    Group.initDefaultGroupNames(context);
    context.restoreAuthSystemState();
    context.complete();
    log.info("String_Node_Str");
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    if (context != null && context.isValid())     context.abort();
  }
}

Fixed version (ground truth):
/** 
 * Method to actually update our registries from latest configs
 */
private void updateRegistries(){
  Context context=null;
  try {
    context=new Context();
    context.turnOffAuthorisationSystem();
    String base=ConfigurationManager.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
    log.info("String_Node_Str" + base + "String_Node_Str");
    RegistryLoader.loadBitstreamFormats(context,base + "String_Node_Str");
    log.info("String_Node_Str" + base);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    if (ConfigurationManager.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
      MetadataImporter.loadRegistry(base + "String_Node_Str",true);
    }
    context.restoreAuthSystemState();
    context.complete();
    log.info("String_Node_Str");
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    if (context != null && context.isValid())     context.abort();
  }
}
Program: 52035
Project: 52035
Buggy source:
@Override public ItemMarkingInfo getItemMarkingInfo(Context context,Item item) throws SQLException {
  Bundle[] bundles=item.getBundles("String_Node_Str");
  if (bundles.length == 0) {
    ItemMarkingInfo markInfo=new ItemMarkingInfo();
    markInfo.setImageName(nonAvailableImageName);
    return markInfo;
  }
 else {
    Bundle originalBundle=bundles[0];
    if (originalBundle.getBitstreams().length == 0) {
      ItemMarkingInfo markInfo=new ItemMarkingInfo();
      markInfo.setImageName(nonAvailableImageName);
      return markInfo;
    }
 else {
      Bitstream bitstream=originalBundle.getBitstreams()[0];
      ItemMarkingInfo signInfo=new ItemMarkingInfo();
      signInfo.setImageName(availableImageName);
      signInfo.setTooltip(bitstream.getName());
      String bsLink="String_Node_Str";
      bsLink=bsLink + "String_Node_Str" + item.getHandle()+ "String_Node_Str"+ bitstream.getSequenceID()+ "String_Node_Str";
      try {
        bsLink=bsLink + encodeBitstreamName(bitstream.getName(),Constants.DEFAULT_ENCODING);
      }
 catch (      UnsupportedEncodingException e) {
        e.printStackTrace();
      }
      signInfo.setLink(bsLink);
      return signInfo;
    }
  }
}

Fixed version (ground truth):
@Override public ItemMarkingInfo getItemMarkingInfo(Context context,Item item) throws SQLException {
  Bundle[] bundles=item.getBundles("String_Node_Str");
  if (bundles.length == 0) {
    ItemMarkingInfo markInfo=new ItemMarkingInfo();
    markInfo.setImageName(nonAvailableImageName);
    return markInfo;
  }
 else {
    Bundle originalBundle=bundles[0];
    if (originalBundle.getBitstreams().length == 0) {
      ItemMarkingInfo markInfo=new ItemMarkingInfo();
      markInfo.setImageName(nonAvailableImageName);
      return markInfo;
    }
 else {
      Bitstream bitstream=originalBundle.getBitstreams()[0];
      ItemMarkingInfo signInfo=new ItemMarkingInfo();
      signInfo.setImageName(availableImageName);
      signInfo.setTooltip(bitstream.getName());
      String bsLink="String_Node_Str";
      bsLink=bsLink + "String_Node_Str" + item.getHandle()+ "String_Node_Str"+ bitstream.getSequenceID()+ "String_Node_Str";
      try {
        bsLink=bsLink + Util.encodeBitstreamName(bitstream.getName(),Constants.DEFAULT_ENCODING);
      }
 catch (      UnsupportedEncodingException e) {
        e.printStackTrace();
      }
      signInfo.setLink(bsLink);
      return signInfo;
    }
  }
}
Program: 52038
Project: 52038
Buggy source:
@Override public ItemMarkingInfo getItemMarkingInfo(Context context,Item item) throws SQLException {
  if (metadataField != null && mapping != null) {
    DCValue[] vals=item.getMetadata(metadataField);
    if (vals.length > 0) {
      for (      DCValue value : vals) {
        String type=value.value;
        if (mapping.containsKey(type)) {
          return mapping.get(type);
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public ItemMarkingInfo getItemMarkingInfo(Context context,Item item) throws SQLException {
  if (metadataField != null && mapping != null) {
    DCValue[] vals=item.getMetadataByMetadataString(metadataField);
    if (vals.length > 0) {
      for (      DCValue value : vals) {
        String type=value.value;
        if (mapping.containsKey(type)) {
          return mapping.get(type);
        }
      }
    }
  }
  return null;
}
Program: 52064
Project: 52064
Buggy source:
public DCValue[] queryMetadata(int itemId,String schema,String element,String qualifier,String lang) throws SQLException {
  List<DCValue> values=new ArrayList<DCValue>();
  TableRowIterator tri=null;
  try {
    if (qualifier == null) {
      Object[] params={Integer.valueOf(itemId),element,schema};
      tri=DatabaseManager.query(context,getByMetadataElement,params,Constants.ITEM);
    }
 else     if (Item.ANY.equals(qualifier)) {
      Object[] params={Integer.valueOf(itemId),element,schema};
      tri=DatabaseManager.query(context,getByMetadataAnyQualifier,params,Constants.ITEM);
    }
 else {
      Object[] params={Integer.valueOf(itemId),element,qualifier,schema,Constants.ITEM};
      tri=DatabaseManager.query(context,getByMetadata,params);
    }
    if (!tri.hasNext()) {
      return new DCValue[0];
    }
    while (tri.hasNext()) {
      TableRow tr=tri.next();
      DCValue dcv=new DCValue();
      dcv.schema=schema;
      dcv.element=tr.getStringColumn("String_Node_Str");
      dcv.qualifier=tr.getStringColumn("String_Node_Str");
      dcv.language=tr.getStringColumn("String_Node_Str");
      dcv.value=tr.getStringColumn("String_Node_Str");
      dcv.authority=tr.getStringColumn("String_Node_Str");
      dcv.confidence=tr.getIntColumn("String_Node_Str");
      values.add(dcv);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  DCValue[] dcvs=new DCValue[values.size()];
  return values.toArray(dcvs);
}

Fixed version (ground truth):
public DCValue[] queryMetadata(int itemId,String schema,String element,String qualifier,String lang) throws SQLException {
  List<DCValue> values=new ArrayList<DCValue>();
  TableRowIterator tri=null;
  try {
    if (qualifier == null) {
      Object[] params={Integer.valueOf(itemId),element,schema,Constants.ITEM};
      tri=DatabaseManager.query(context,getByMetadataElement,params);
    }
 else     if (Item.ANY.equals(qualifier)) {
      Object[] params={Integer.valueOf(itemId),element,schema,Constants.ITEM};
      tri=DatabaseManager.query(context,getByMetadataAnyQualifier,params);
    }
 else {
      Object[] params={Integer.valueOf(itemId),element,qualifier,schema,Constants.ITEM};
      tri=DatabaseManager.query(context,getByMetadata,params);
    }
    if (!tri.hasNext()) {
      return new DCValue[0];
    }
    while (tri.hasNext()) {
      TableRow tr=tri.next();
      DCValue dcv=new DCValue();
      dcv.schema=schema;
      dcv.element=tr.getStringColumn("String_Node_Str");
      dcv.qualifier=tr.getStringColumn("String_Node_Str");
      dcv.language=tr.getStringColumn("String_Node_Str");
      dcv.value=tr.getStringColumn("String_Node_Str");
      dcv.authority=tr.getStringColumn("String_Node_Str");
      dcv.confidence=tr.getIntColumn("String_Node_Str");
      values.add(dcv);
    }
  }
  finally {
    if (tri != null) {
      tri.close();
    }
  }
  DCValue[] dcvs=new DCValue[values.size()];
  return values.toArray(dcvs);
}
Program: 52070
Project: 52070
Buggy source:
/** 
 * Add authenticated users to the group defined in authentication-password.cfg by the login.specialgroup key.
 */
public int[] getSpecialGroups(Context context,HttpServletRequest request){
  try {
    if (!context.getCurrentUser().getMetadata("String_Node_Str").equals("String_Node_Str")) {
      String groupName=ConfigurationManager.getProperty("String_Node_Str","String_Node_Str");
      if ((groupName != null) && (!groupName.trim().equals("String_Node_Str"))) {
        Group specialGroup=Group.findByName(context,groupName);
        if (specialGroup == null) {
          log.warn(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
          return new int[0];
        }
 else {
          return new int[]{specialGroup.getID()};
        }
      }
    }
  }
 catch (  Exception e) {
  }
  return new int[0];
}

Fixed version (ground truth):
/** 
 * Add authenticated users to the group defined in authentication-password.cfg by the login.specialgroup key.
 */
public int[] getSpecialGroups(Context context,HttpServletRequest request){
  try {
    if (context.getCurrentUser().getPasswordHash() != null && !context.getCurrentUser().getPasswordHash().toString().equals("String_Node_Str")) {
      String groupName=ConfigurationManager.getProperty("String_Node_Str","String_Node_Str");
      if ((groupName != null) && (!groupName.trim().equals("String_Node_Str"))) {
        Group specialGroup=Group.findByName(context,groupName);
        if (specialGroup == null) {
          log.warn(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
          return new int[0];
        }
 else {
          return new int[]{specialGroup.getID()};
        }
      }
    }
  }
 catch (  Exception e) {
  }
  return new int[0];
}
Program: 52071
Project: 52071
Buggy source:
protected void doDSPost(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String netid=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,netid,password,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    Locale epersonLocale=I18nUtil.getEPersonLocale(context.getCurrentUser());
    context.setCurrentLocale(epersonLocale);
    Config.set(request.getSession(),Config.FMT_LOCALE,epersonLocale);
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + netid + "String_Node_Str"+ String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
}

Fixed version (ground truth):
protected void doDSPost(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String netid=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,netid,password,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    try {
      context.commit();
    }
 catch (    SQLException ex) {
      log.error("String_Node_Str" + "String_Node_Str",ex);
    }
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    Locale epersonLocale=I18nUtil.getEPersonLocale(context.getCurrentUser());
    context.setCurrentLocale(epersonLocale);
    Config.set(request.getSession(),Config.FMT_LOCALE,epersonLocale);
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + netid + "String_Node_Str"+ String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
}
Program: 52072
Project: 52072
Buggy source:
protected void doDSPost(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String email=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,email,password,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    Locale epersonLocale=I18nUtil.getEPersonLocale(context.getCurrentUser());
    context.setCurrentLocale(epersonLocale);
    Config.set(request.getSession(),Config.FMT_LOCALE,epersonLocale);
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + email + "String_Node_Str"+ String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
}

Fixed version (ground truth):
protected void doDSPost(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String email=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,email,password,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    try {
      context.commit();
    }
 catch (    SQLException ex) {
      log.error("String_Node_Str" + "String_Node_Str",ex);
    }
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    Locale epersonLocale=I18nUtil.getEPersonLocale(context.getCurrentUser());
    context.setCurrentLocale(epersonLocale);
    Config.set(request.getSession(),Config.FMT_LOCALE,epersonLocale);
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + email + "String_Node_Str"+ String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
}
Program: 52073
Project: 52073
Buggy source:
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  java.util.Enumeration names=request.getHeaderNames();
  String name;
  while (names.hasMoreElements()) {
    name=names.nextElement().toString();
    log.info("String_Node_Str" + name + "String_Node_Str"+ request.getHeader(name));
  }
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,null,null,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else   if (status == AuthenticationMethod.NO_SUCH_USER) {
    jsp="String_Node_Str";
  }
 else   if (status == AuthenticationMethod.BAD_ARGS) {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
  return;
}

Fixed version (ground truth):
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  java.util.Enumeration names=request.getHeaderNames();
  String name;
  while (names.hasMoreElements()) {
    name=names.nextElement().toString();
    log.info("String_Node_Str" + name + "String_Node_Str"+ request.getHeader(name));
  }
  String jsp=null;
  int status=AuthenticationManager.authenticate(context,null,null,null,request);
  if (status == AuthenticationMethod.SUCCESS) {
    try {
      context.commit();
    }
 catch (    SQLException ex) {
      log.error("String_Node_Str" + "String_Node_Str",ex);
    }
    Authenticate.loggedIn(context,request,context.getCurrentUser());
    log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
    Authenticate.resumeInterruptedRequest(request,response);
    return;
  }
 else   if (status == AuthenticationMethod.CERT_REQUIRED) {
    jsp="String_Node_Str";
  }
 else   if (status == AuthenticationMethod.NO_SUCH_USER) {
    jsp="String_Node_Str";
  }
 else   if (status == AuthenticationMethod.BAD_ARGS) {
    jsp="String_Node_Str";
  }
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + String.valueOf(status)));
  JSPManager.showJSP(request,response,jsp);
  return;
}
Program: 52076
Project: 52076
Buggy source:
/** 
 * Setup the basic query arguments: the main query and all the filters (default + user). Return the list of user filter
 * @param context
 * @param request
 * @param queryArgs the query object to populate
 * @return the list of user filer (as filter query)
 */
private static List<String> setupBasicQuery(Context context,DiscoveryConfiguration discoveryConfiguration,HttpServletRequest request,DiscoverQuery queryArgs){
  String query=request.getParameter("String_Node_Str");
  if (StringUtils.isNotBlank(query)) {
    queryArgs.setQuery(query);
  }
  List<String> defaultFilterQueries=discoveryConfiguration.getDefaultFilterQueries();
  if (defaultFilterQueries != null) {
    for (    String f : defaultFilterQueries) {
      queryArgs.addFacetQuery(f);
    }
  }
  List<String[]> filters=getFilters(request);
  List<String> userFilters=new ArrayList<String>();
  for (  String[] f : filters) {
    try {
      String newFilterQuery=SearchUtils.getSearchService().toFilterQuery(context,f[0],f[1],f[2]).getFilterQuery();
      if (newFilterQuery != null) {
        queryArgs.addFilterQueries(newFilterQuery);
        userFilters.add(newFilterQuery);
      }
    }
 catch (    SQLException e) {
      log.error(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + f[0] + "String_Node_Str"+ f[1]+ "String_Node_Str"+ f[2]),e);
    }
  }
  return userFilters;
}

Fixed version (ground truth):
/** 
 * Setup the basic query arguments: the main query and all the filters (default + user). Return the list of user filter
 * @param context
 * @param request
 * @param queryArgs the query object to populate
 * @return the list of user filer (as filter query)
 */
private static List<String> setupBasicQuery(Context context,DiscoveryConfiguration discoveryConfiguration,HttpServletRequest request,DiscoverQuery queryArgs){
  String query=request.getParameter("String_Node_Str");
  if (StringUtils.isNotBlank(query)) {
    queryArgs.setQuery(query);
  }
  List<String> defaultFilterQueries=discoveryConfiguration.getDefaultFilterQueries();
  if (defaultFilterQueries != null) {
    for (    String f : defaultFilterQueries) {
      queryArgs.addFilterQueries(f);
    }
  }
  List<String[]> filters=getFilters(request);
  List<String> userFilters=new ArrayList<String>();
  for (  String[] f : filters) {
    try {
      String newFilterQuery=SearchUtils.getSearchService().toFilterQuery(context,f[0],f[1],f[2]).getFilterQuery();
      if (newFilterQuery != null) {
        queryArgs.addFilterQueries(newFilterQuery);
        userFilters.add(newFilterQuery);
      }
    }
 catch (    SQLException e) {
      log.error(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + f[0] + "String_Node_Str"+ f[1]+ "String_Node_Str"+ f[2]),e);
    }
  }
  return userFilters;
}
Program: 52078
Project: 52078
Buggy source:
private void replaceItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    System.out.println("String_Node_Str" + sourceDir);
    System.exit(1);
  }
  Map<String,String> myHash=readMapFile(mapFile);
  for (  Map.Entry<String,String> mapEntry : myHash.entrySet()) {
    String newItemName=mapEntry.getKey();
    String oldHandle=mapEntry.getValue();
    Item oldItem=null;
    if (oldHandle.indexOf('/') != -1) {
      System.out.println("String_Node_Str" + oldHandle);
      oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    }
 else {
      oldItem=Item.find(c,Integer.parseInt(oldHandle));
    }
    File handleFile=new File(sourceDir + File.separatorChar + newItemName+ File.separatorChar+ "String_Node_Str");
    PrintWriter handleOut=new PrintWriter(new FileWriter(handleFile,true));
    if (handleOut == null) {
      throw new Exception("String_Node_Str" + handleFile.getCanonicalPath());
    }
    handleOut.println(oldHandle);
    handleOut.close();
    deleteItem(c,oldItem);
    addItem(c,mycollections,sourceDir,newItemName,null,template);
    c.clearCache();
  }
}

Fixed version (ground truth):
private void replaceItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    throw new Exception("String_Node_Str" + sourceDir);
  }
  Map<String,String> myHash=readMapFile(mapFile);
  for (  Map.Entry<String,String> mapEntry : myHash.entrySet()) {
    String newItemName=mapEntry.getKey();
    String oldHandle=mapEntry.getValue();
    Item oldItem=null;
    if (oldHandle.indexOf('/') != -1) {
      System.out.println("String_Node_Str" + oldHandle);
      oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    }
 else {
      oldItem=Item.find(c,Integer.parseInt(oldHandle));
    }
    File handleFile=new File(sourceDir + File.separatorChar + newItemName+ File.separatorChar+ "String_Node_Str");
    PrintWriter handleOut=new PrintWriter(new FileWriter(handleFile,true));
    if (handleOut == null) {
      throw new Exception("String_Node_Str" + handleFile.getCanonicalPath());
    }
    handleOut.println(oldHandle);
    handleOut.close();
    deleteItem(c,oldItem);
    addItem(c,mycollections,sourceDir,newItemName,null,template);
    c.clearCache();
  }
}
Program: 52079
Project: 52079
Buggy source:
private void addItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  Map<String,String> skipItems=new HashMap<String,String>();
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=null;
  if (!isTest) {
    if (isResume) {
      skipItems=readMapFile(mapFile);
    }
    outFile=new File(mapFile);
    mapOut=new PrintWriter(new FileWriter(outFile,isResume));
    if (mapOut == null) {
      throw new Exception("String_Node_Str" + mapFile);
    }
  }
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    System.out.println("String_Node_Str" + sourceDir);
    System.exit(1);
  }
  String[] dircontents=d.list(directoryFilter);
  Arrays.sort(dircontents);
  for (int i=0; i < dircontents.length; i++) {
    if (skipItems.containsKey(dircontents[i])) {
      System.out.println("String_Node_Str" + dircontents[i]);
    }
 else {
      addItem(c,mycollections,sourceDir,dircontents[i],mapOut,template);
      System.out.println(i + "String_Node_Str" + dircontents[i]);
      c.clearCache();
    }
  }
}

Fixed version (ground truth):
private void addItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  Map<String,String> skipItems=new HashMap<String,String>();
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=null;
  if (!isTest) {
    if (isResume) {
      skipItems=readMapFile(mapFile);
    }
    outFile=new File(mapFile);
    mapOut=new PrintWriter(new FileWriter(outFile,isResume));
    if (mapOut == null) {
      throw new Exception("String_Node_Str" + mapFile);
    }
  }
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    throw new Exception("String_Node_Str" + sourceDir);
  }
  String[] dircontents=d.list(directoryFilter);
  Arrays.sort(dircontents);
  for (int i=0; i < dircontents.length; i++) {
    if (skipItems.containsKey(dircontents[i])) {
      System.out.println("String_Node_Str" + dircontents[i]);
    }
 else {
      addItem(c,mycollections,sourceDir,dircontents[i],mapOut,template);
      System.out.println(i + "String_Node_Str" + dircontents[i]);
      c.clearCache();
    }
  }
}
Program: 52081
Project: 52081
Buggy source:
private void replaceItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    System.out.println("String_Node_Str" + sourceDir);
    System.exit(1);
  }
  Map<String,String> myHash=readMapFile(mapFile);
  for (  Map.Entry<String,String> mapEntry : myHash.entrySet()) {
    String newItemName=mapEntry.getKey();
    String oldHandle=mapEntry.getValue();
    Item oldItem=null;
    if (oldHandle.indexOf('/') != -1) {
      System.out.println("String_Node_Str" + oldHandle);
      oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    }
 else {
      oldItem=Item.find(c,Integer.parseInt(oldHandle));
    }
    File handleFile=new File(sourceDir + File.separatorChar + newItemName+ File.separatorChar+ "String_Node_Str");
    PrintWriter handleOut=new PrintWriter(new FileWriter(handleFile,true));
    if (handleOut == null) {
      throw new Exception("String_Node_Str" + handleFile.getCanonicalPath());
    }
    handleOut.println(oldHandle);
    handleOut.close();
    deleteItem(c,oldItem);
    addItem(c,mycollections,sourceDir,newItemName,null,template);
    c.clearCache();
  }
}

Fixed version (ground truth):
private void replaceItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    throw new Exception("String_Node_Str" + sourceDir);
  }
  Map<String,String> myHash=readMapFile(mapFile);
  for (  Map.Entry<String,String> mapEntry : myHash.entrySet()) {
    String newItemName=mapEntry.getKey();
    String oldHandle=mapEntry.getValue();
    Item oldItem=null;
    if (oldHandle.indexOf('/') != -1) {
      System.out.println("String_Node_Str" + oldHandle);
      oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    }
 else {
      oldItem=Item.find(c,Integer.parseInt(oldHandle));
    }
    File handleFile=new File(sourceDir + File.separatorChar + newItemName+ File.separatorChar+ "String_Node_Str");
    PrintWriter handleOut=new PrintWriter(new FileWriter(handleFile,true));
    if (handleOut == null) {
      throw new Exception("String_Node_Str" + handleFile.getCanonicalPath());
    }
    handleOut.println(oldHandle);
    handleOut.close();
    deleteItem(c,oldItem);
    addItem(c,mycollections,sourceDir,newItemName,null,template);
    c.clearCache();
  }
}
Program: 52082
Project: 52082
Buggy source:
private void addItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  Map<String,String> skipItems=new HashMap<String,String>();
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=null;
  if (!isTest) {
    if (isResume) {
      skipItems=readMapFile(mapFile);
    }
    outFile=new File(mapFile);
    mapOut=new PrintWriter(new FileWriter(outFile,isResume));
    if (mapOut == null) {
      throw new Exception("String_Node_Str" + mapFile);
    }
  }
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    System.out.println("String_Node_Str" + sourceDir);
    System.exit(1);
  }
  String[] dircontents=d.list(directoryFilter);
  Arrays.sort(dircontents);
  for (int i=0; i < dircontents.length; i++) {
    if (skipItems.containsKey(dircontents[i])) {
      System.out.println("String_Node_Str" + dircontents[i]);
    }
 else {
      addItem(c,mycollections,sourceDir,dircontents[i],mapOut,template);
      System.out.println(i + "String_Node_Str" + dircontents[i]);
      c.clearCache();
    }
  }
}

Fixed version (ground truth):
private void addItems(Context c,Collection[] mycollections,String sourceDir,String mapFile,boolean template) throws Exception {
  Map<String,String> skipItems=new HashMap<String,String>();
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=null;
  if (!isTest) {
    if (isResume) {
      skipItems=readMapFile(mapFile);
    }
    outFile=new File(mapFile);
    mapOut=new PrintWriter(new FileWriter(outFile,isResume));
    if (mapOut == null) {
      throw new Exception("String_Node_Str" + mapFile);
    }
  }
  File d=new java.io.File(sourceDir);
  if (d == null || !d.isDirectory()) {
    throw new Exception("String_Node_Str" + sourceDir);
  }
  String[] dircontents=d.list(directoryFilter);
  Arrays.sort(dircontents);
  for (int i=0; i < dircontents.length; i++) {
    if (skipItems.containsKey(dircontents[i])) {
      System.out.println("String_Node_Str" + dircontents[i]);
    }
 else {
      addItem(c,mycollections,sourceDir,dircontents[i],mapOut,template);
      System.out.println(i + "String_Node_Str" + dircontents[i]);
      c.clearCache();
    }
  }
}
Program: 52084
Project: 52084
Buggy source:
private void prepareXwalk(){
  if (null != this.xwalk)   return;
  this.xwalk=(DisseminationCrosswalk)PluginManager.getNamedPlugin(DisseminationCrosswalk.class,this.CROSSWALK_NAME);
  if (this.xwalk == null) {
    throw new RuntimeException("String_Node_Str" + CROSSWALK_NAME + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void prepareXwalk(){
  if (null != this.xwalk)   return;
  this.xwalk=(DisseminationCrosswalk)PluginManager.getNamedPlugin(DisseminationCrosswalk.class,this.CROSSWALK_NAME);
  if (this.xwalk == null) {
    throw new RuntimeException("String_Node_Str" + CROSSWALK_NAME + "String_Node_Str");
  }
}
Program: 52085
Project: 52085
Buggy source:
private DataCiteResponse sendDOIGetRequest(String doi) throws DOIIdentifierException {
  return sendGetRequest(doi,DOI_PATH);
}

Fixed version (ground truth):
protected DataCiteResponse sendDOIGetRequest(String doi) throws DOIIdentifierException {
  return sendGetRequest(doi,DOI_PATH);
}
Program: 52086
Project: 52086
Buggy source:
private DataCiteResponse sendMetadataDeleteRequest(String doi) throws DOIIdentifierException {
  URIBuilder uribuilder=new URIBuilder();
  uribuilder.setScheme(SCHEME).setHost(HOST).setPath(METADATA_PATH + doi.substring(DOI.SCHEME.length()));
  HttpDelete httpdelete=null;
  try {
    httpdelete=new HttpDelete(uribuilder.build());
  }
 catch (  URISyntaxException e) {
    log.error("String_Node_Str" + "String_Node_Str");
    log.error("String_Node_Str",SCHEME + "String_Node_Str" + HOST+ DOI_PATH+ "String_Node_Str"+ doi.substring(DOI.SCHEME.length()));
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
  return sendHttpRequest(httpdelete,doi);
}

Fixed version (ground truth):
protected DataCiteResponse sendMetadataDeleteRequest(String doi) throws DOIIdentifierException {
  URIBuilder uribuilder=new URIBuilder();
  uribuilder.setScheme(SCHEME).setHost(HOST).setPath(METADATA_PATH + doi.substring(DOI.SCHEME.length()));
  HttpDelete httpdelete=null;
  try {
    httpdelete=new HttpDelete(uribuilder.build());
  }
 catch (  URISyntaxException e) {
    log.error("String_Node_Str" + "String_Node_Str");
    log.error("String_Node_Str",SCHEME + "String_Node_Str" + HOST+ DOI_PATH+ "String_Node_Str"+ doi.substring(DOI.SCHEME.length()));
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
  return sendHttpRequest(httpdelete,doi);
}