nus-yam/ex-repair huggingface dataset:
Program: 89666
Project: 89666
Buggy source:
public static void resetDAOs(){
  DomainDAOTester.resetDomainDAO();
  TemplateDAOTester.resetTemplateDAO();
  HarvestDefinitionDAOTester.resetDAO();
  ScheduleDAOTester.resetDAO();
  JobDAOTester.resetDAO();
  GlobalCrawlerTrapListDBDAO.reset();
}

Fixed version (ground truth):
public static void resetDAOs(){
  ExtendedFieldDBDAO.reset();
  DomainDAOTester.resetDomainDAO();
  TemplateDAOTester.resetTemplateDAO();
  HarvestDefinitionDAOTester.resetDAO();
  ScheduleDAOTester.resetDAO();
  JobDAOTester.resetDAO();
  GlobalCrawlerTrapListDBDAO.reset();
}
Program: 89667
Project: 89667
Buggy source:
/** 
 * Set the seedlist from a seedlist, where the individual seeds are separated by a '\n' character. Duplicate seeds are removed.
 * @param seedList List of seeds as one String
 */
public void setSeedList(String seedList){
  ArgumentNotValid.checkNotNull(seedList,"String_Node_Str");
  seedListSet=new HashSet<String>();
  BufferedReader reader=new BufferedReader(new StringReader(seedList));
  String seed;
  try {
    while ((seed=reader.readLine()) != null) {
      seedListSet.add(seed);
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str" + seedListSet.size() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Set the seedlist from a seedlist, where the individual seeds are separated by a '\n' character. Duplicate seeds are removed.
 * @param seedList List of seeds as one String
 */
public void setSeedList(String seedList){
  ArgumentNotValid.checkNotNullOrEmpty(seedList,"String_Node_Str");
  seedListSet=new HashSet<String>();
  BufferedReader reader=new BufferedReader(new StringReader(seedList));
  String seed;
  try {
    while ((seed=reader.readLine()) != null) {
      seedListSet.add(seed);
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str" + seedListSet.size() + "String_Node_Str");
  }
}
Program: 89668
Project: 89668
Buggy source:
/** 
 * Set the name of a Named object into the given field.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param o the Named object
 * @throws SQLException
 * @throws PermissionDenied If length of o.getName() is larger thanConstants.MAX_NAME_SIZE
 */
public static void setName(PreparedStatement s,int fieldNum,Named o,int maxFieldSize) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(o,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(maxFieldSize,"String_Node_Str");
  if (o.getName().length() > maxFieldSize) {
    throw new PermissionDenied("String_Node_Str" + o.getName().length() + "String_Node_Str"+ maxFieldSize);
  }
  setStringMaxLength(s,fieldNum,o.getName(),maxFieldSize,o,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set the name of a Named object into the given field.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param o the Named object
 * @param maxFieldSize max size of the name field
 * @throws SQLException  If any trouble accessing the database during the operation
 * @throws PermissionDenied If length of o.getName() is larger thanConstants.MAX_NAME_SIZE
 */
public static void setName(PreparedStatement s,int fieldNum,Named o,int maxFieldSize) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(o,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(maxFieldSize,"String_Node_Str");
  if (o.getName().length() > maxFieldSize) {
    throw new PermissionDenied("String_Node_Str" + o.getName().length() + "String_Node_Str"+ maxFieldSize);
  }
  setStringMaxLength(s,fieldNum,o.getName(),maxFieldSize,o,"String_Node_Str");
}
Program: 89669
Project: 89669
Buggy source:
/** 
 * Set the Date into the given field of a statement.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param date the date (may be null)
 * @throws SQLException
 */
public static void setDateMaybeNull(PreparedStatement s,int fieldNum,Date date) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  if (date != null) {
    s.setTimestamp(fieldNum,new Timestamp(date.getTime()));
  }
 else {
    s.setNull(fieldNum,Types.DATE);
  }
}

Fixed version (ground truth):
/** 
 * Set the Date into the given field of a statement.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param date the date (may be null)
 * @throws SQLException  If any trouble accessing the database during the operation
 */
public static void setDateMaybeNull(PreparedStatement s,int fieldNum,Date date) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  if (date != null) {
    s.setTimestamp(fieldNum,new Timestamp(date.getTime()));
  }
 else {
    s.setNull(fieldNum,Types.DATE);
  }
}
Program: 89670
Project: 89670
Buggy source:
/** 
 * Set the comments of a Named object into the given field of statement.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param o the Named object
 * @param maxFieldSize max size of the comments field
 * @throws SQLException
 * @throws PermissionDenied If length of o.getComments() is larger thanConstants.MAX_COMMENT_SIZE
 */
public static void setComments(PreparedStatement s,int fieldNum,Named o,int maxFieldSize) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(o,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(maxFieldSize,"String_Node_Str");
  if (o.getComments().length() > maxFieldSize) {
    throw new PermissionDenied("String_Node_Str" + o.getComments().length() + "String_Node_Str"+ maxFieldSize);
  }
  setStringMaxLength(s,fieldNum,o.getComments(),maxFieldSize,o,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set the comments of a Named object into the given field of statement.
 * @param s a prepared statement
 * @param fieldNum the index of the given field to be set
 * @param o the Named object
 * @param maxFieldSize max size of the comments field
 * @throws SQLException If any trouble accessing the database during the operation
 * @throws PermissionDenied If length of o.getComments() is larger thanConstants.MAX_COMMENT_SIZE
 */
public static void setComments(PreparedStatement s,int fieldNum,Named o,int maxFieldSize) throws SQLException {
  ArgumentNotValid.checkNotNull(s,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(fieldNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(o,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(maxFieldSize,"String_Node_Str");
  if (o.getComments().length() > maxFieldSize) {
    throw new PermissionDenied("String_Node_Str" + o.getComments().length() + "String_Node_Str"+ maxFieldSize);
  }
  setStringMaxLength(s,fieldNum,o.getComments(),maxFieldSize,o,"String_Node_Str");
}
Program: 89671
Project: 89671
Buggy source:
/** 
 * Returns the version of a table according to schemaversions, or 0 for the initial, unnumbered version. NB: the provided connection is not closed
 * @param connection connection to the database.
 * @param tablename The name of a table in the database.
 * @return Version of the given table.
 * @throws IOFailure if DB table schemaversions does not exist
 */
public static int getTableVersion(Connection connection,String tablename) throws IOFailure {
  ArgumentNotValid.checkNotNull(connection,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(tablename,"String_Node_Str");
  PreparedStatement s=null;
  int version=0;
  try {
    s=connection.prepareStatement("String_Node_Str" + "String_Node_Str");
    s.setString(1,tablename);
    ResultSet res=s.executeQuery();
    if (!res.next()) {
      log.warn("String_Node_Str" + tablename + "String_Node_Str");
    }
 else {
      version=res.getInt(1);
      if (res.wasNull()) {
        log.warn("String_Node_Str" + tablename + "String_Node_Str");
      }
    }
    return version;
  }
 catch (  SQLException e) {
    String msg="String_Node_Str" + tablename + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(msg,e);
    throw new IOFailure(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the version of a table according to schemaversions, or 0 for the initial, unnumbered version. NB: the provided connection is not closed
 * @param connection connection to the database.
 * @param tablename The name of a table in the database.
 * @return Version of the given table.
 * @throws IOFailure if DB table schemaversions does not exist
 */
public static int getTableVersion(Connection connection,String tablename) throws IOFailure {
  ArgumentNotValid.checkNotNull(connection,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(tablename,"String_Node_Str");
  PreparedStatement s=null;
  int version=0;
  try {
    s=connection.prepareStatement("String_Node_Str" + "String_Node_Str");
    s.setString(1,tablename);
    ResultSet res=s.executeQuery();
    if (!res.next()) {
      log.warn("String_Node_Str" + tablename + "String_Node_Str"+ "String_Node_Str");
    }
 else {
      version=res.getInt(1);
      if (res.wasNull()) {
        log.warn("String_Node_Str" + tablename + "String_Node_Str");
      }
    }
    return version;
  }
 catch (  SQLException e) {
    String msg="String_Node_Str" + tablename + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(msg,e);
    throw new IOFailure(msg,e);
  }
}
Program: 89673
Project: 89673
Buggy source:
/** 
 * Get a list of all domains in snapshot harvest order. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomainsInSnapshotHarvestOrder()
 */
public Iterator<Domain> getAllDomainsInSnapshotHarvestOrder(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    List<Domain> orderedDomains=new LinkedList<Domain>();
    for (    String domainName : domainNames) {
      orderedDomains.add(read(c,domainName));
    }
    return orderedDomains.iterator();
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a list of all domains in snapshot harvest order. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomainsInSnapshotHarvestOrder()
 */
public Iterator<Domain> getAllDomainsInSnapshotHarvestOrder(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    return new FilterIterator<String,Domain>(domainNames.iterator()){
      public Domain filter(      String s){
        return read(s);
      }
    }
;
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89674
Project: 89674
Buggy source:
/** 
 * Read a domain from the persistent storage.
 * @param connection a connection to the harvest definition database.
 * @param domainName the name of the domain to retrieve
 * @return the retrieved Domain
 */
protected abstract Domain read(Connection c,String domainName);

Fixed version (ground truth):
/** 
 * Read a domain from the persistent storage.
 * @param connection a connection to the harvest definition database.
 * @param domainName the name of the domain to retrieve
 * @return the retrieved Domain
 */
protected abstract Domain read(Connection connection,String domainName);
Program: 89675
Project: 89675
Buggy source:
/** 
 * @see DomainDAO#getAliases(String)
 */
public List<AliasInfo> getAliases(String domain){
  ArgumentNotValid.checkNotNullOrEmpty(domain,"String_Node_Str");
  List<AliasInfo> resultSet=new ArrayList<AliasInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  if (!exists(c,domain)) {
    log.debug("String_Node_Str" + domain + "String_Node_Str");
    return resultSet;
  }
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,domain);
    ResultSet res=s.executeQuery();
    while (res.next()) {
      AliasInfo ai=new AliasInfo(res.getString(1),domain,DBUtils.getDateMaybeNull(res,2));
      resultSet.add(ai);
    }
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * @see DomainDAO#getAliases(String)
 */
@Override public List<AliasInfo> getAliases(String domain){
  ArgumentNotValid.checkNotNullOrEmpty(domain,"String_Node_Str");
  List<AliasInfo> resultSet=new ArrayList<AliasInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  if (!exists(c,domain)) {
    log.debug("String_Node_Str" + domain + "String_Node_Str");
    return resultSet;
  }
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,domain);
    ResultSet res=s.executeQuery();
    while (res.next()) {
      AliasInfo ai=new AliasInfo(res.getString(1),domain,DBUtils.getDateMaybeNull(res,2));
      resultSet.add(ai);
    }
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89677
Project: 89677
Buggy source:
/** 
 * Get a list of all domains in snapshot harvest order. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomainsInSnapshotHarvestOrder()
 */
public Iterator<Domain> getAllDomainsInSnapshotHarvestOrder(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    return new FilterIterator<String,Domain>(domainNames.iterator()){
      public Domain filter(      String s){
        return read(s);
      }
    }
;
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a list of all domains in snapshot harvest order. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomainsInSnapshotHarvestOrder()
 */
@Override public Iterator<Domain> getAllDomainsInSnapshotHarvestOrder(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    return new FilterIterator<String,Domain>(domainNames.iterator()){
      public Domain filter(      String s){
        return read(s);
      }
    }
;
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89679
Project: 89679
Buggy source:
/** 
 * Get the total number of domains in the database.
 * @see DomainDAO#getCountDomains()
 */
public synchronized int getCountDomains(){
  Connection c=HarvestDBConnection.get();
  try {
    return DBUtils.selectIntValue(c,"String_Node_Str");
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get the total number of domains in the database.
 * @see DomainDAO#getCountDomains()
 */
@Override public synchronized int getCountDomains(){
  Connection c=HarvestDBConnection.get();
  try {
    return DBUtils.selectIntValue(c,"String_Node_Str");
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89680
Project: 89680
Buggy source:
/** 
 * @see DomainDAO#mayDelete(DomainConfiguration)
 */
public boolean mayDelete(DomainConfiguration config){
  ArgumentNotValid.checkNotNull(config,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  try {
    return config != config.getDomain().getDefaultConfiguration() && !DBUtils.selectAny(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",config.getID());
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * @see DomainDAO#mayDelete(DomainConfiguration)
 */
@Override public boolean mayDelete(DomainConfiguration config){
  ArgumentNotValid.checkNotNull(config,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  try {
    return config != config.getDomain().getDefaultConfiguration() && !DBUtils.selectAny(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",config.getID());
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89682
Project: 89682
Buggy source:
/** 
 * @see DomainDAO#getDomains(String)
 */
public List<String> getDomains(String glob){
  ArgumentNotValid.checkNotNullOrEmpty(glob,"String_Node_Str");
  String sqlGlob=DBUtils.makeSQLGlob(glob);
  Connection c=HarvestDBConnection.get();
  try {
    return DBUtils.selectStringList(c,"String_Node_Str",sqlGlob);
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * @see DomainDAO#getDomains(String)
 */
@Override public List<String> getDomains(String glob){
  ArgumentNotValid.checkNotNullOrEmpty(glob,"String_Node_Str");
  String sqlGlob=DBUtils.makeSQLGlob(glob);
  Connection c=HarvestDBConnection.get();
  try {
    return DBUtils.selectStringList(c,"String_Node_Str",sqlGlob);
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89683
Project: 89683
Buggy source:
/** 
 * @see DomainDAO#getDomainJobInfo(Job,String,String)
 */
public HarvestInfo getDomainJobInfo(Job j,String domainName,String configName){
  ArgumentNotValid.checkNotNull(j,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(domainName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(configName,"String_Node_Str");
  HarvestInfo resultInfo=null;
  Connection connection=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    long domainId=DBUtils.selectLongValue(connection,"String_Node_Str",domainName);
    s=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setLong(1,j.getJobID());
    s.setLong(2,DBUtils.selectLongValue(connection,"String_Node_Str" + "String_Node_Str",configName,domainId));
    s.setLong(3,j.getOrigHarvestDefinitionID());
    ResultSet res=s.executeQuery();
    if (res.next()) {
      StopReason reason=StopReason.getStopReason(res.getInt(1));
      long objectCount=res.getLong(2);
      long byteCount=res.getLong(3);
      Date harvestTime=res.getDate(4);
      resultInfo=new HarvestInfo(j.getOrigHarvestDefinitionID(),j.getJobID(),domainName,configName,harvestTime,byteCount,objectCount,reason);
    }
    return resultInfo;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(connection);
  }
}

Fixed version (ground truth):
/** 
 * @see DomainDAO#getDomainJobInfo(Job,String,String)
 */
@Override public HarvestInfo getDomainJobInfo(Job j,String domainName,String configName){
  ArgumentNotValid.checkNotNull(j,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(domainName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(configName,"String_Node_Str");
  HarvestInfo resultInfo=null;
  Connection connection=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    long domainId=DBUtils.selectLongValue(connection,"String_Node_Str",domainName);
    s=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setLong(1,j.getJobID());
    s.setLong(2,DBUtils.selectLongValue(connection,"String_Node_Str" + "String_Node_Str",configName,domainId));
    s.setLong(3,j.getOrigHarvestDefinitionID());
    ResultSet res=s.executeQuery();
    if (res.next()) {
      StopReason reason=StopReason.getStopReason(res.getInt(1));
      long objectCount=res.getLong(2);
      long byteCount=res.getLong(3);
      Date harvestTime=res.getDate(4);
      resultInfo=new HarvestInfo(j.getOrigHarvestDefinitionID(),j.getJobID(),domainName,configName,harvestTime,byteCount,objectCount,reason);
    }
    return resultInfo;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(connection);
  }
}
Program: 89684
Project: 89684
Buggy source:
/** 
 * Get a list of all domains. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomains()
 */
public synchronized Iterator<Domain> getAllDomains(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str");
    List<Domain> orderedDomains=new LinkedList<Domain>();
    for (    String name : domainNames) {
      orderedDomains.add(read(c,name));
    }
    return orderedDomains.iterator();
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a list of all domains. Warning: This will build a string list of the domains, which will be rather long in a full system.
 * @see DomainDAO#getAllDomains()
 */
@Override public synchronized Iterator<Domain> getAllDomains(){
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainNames=DBUtils.selectStringList(c,"String_Node_Str");
    List<Domain> orderedDomains=new LinkedList<Domain>();
    for (    String name : domainNames) {
      orderedDomains.add(read(c,name));
    }
    return orderedDomains.iterator();
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89685
Project: 89685
Buggy source:
/** 
 * Return all TLDs represented by the domains in the domains table. it was asked that a level X TLD belong appear in TLD list where the level is <=X for example bidule.bnf.fr belong to .bnf.fr and to .fr it appear in the level 1 list of TLD and in the level 2 list
 * @param level maximum level of TLD
 * @return a list of TLDs
 * @see DomainDAO#getTLDs()
 */
public List<TLDInfo> getTLDs(int level){
  Map<String,TLDInfo> resultMap=new HashMap<String,TLDInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str");
    ResultSet res=s.executeQuery();
    while (res.next()) {
      String domain=res.getString(1);
      int domainTLDLevel=TLDInfo.getTLDLevel(domain);
      if (domainTLDLevel > level) {
        domainTLDLevel=level;
      }
      for (int currentLevel=1; currentLevel <= domainTLDLevel; currentLevel++) {
        String tld=TLDInfo.getMultiLevelTLD(domain,currentLevel);
        TLDInfo i=resultMap.get(tld);
        if (i == null) {
          i=new TLDInfo(tld);
          resultMap.put(tld,i);
        }
        i.addSubdomain(domain);
      }
    }
    List<TLDInfo> resultSet=new ArrayList<TLDInfo>(resultMap.values());
    Collections.sort(resultSet);
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Return all TLDs represented by the domains in the domains table. it was asked that a level X TLD belong appear in TLD list where the level is <=X for example bidule.bnf.fr belong to .bnf.fr and to .fr it appear in the level 1 list of TLD and in the level 2 list
 * @param level maximum level of TLD
 * @return a list of TLDs
 * @see DomainDAO#getTLDs(int)
 */
@Override public List<TLDInfo> getTLDs(int level){
  Map<String,TLDInfo> resultMap=new HashMap<String,TLDInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str");
    ResultSet res=s.executeQuery();
    while (res.next()) {
      String domain=res.getString(1);
      int domainTLDLevel=TLDInfo.getTLDLevel(domain);
      if (domainTLDLevel > level) {
        domainTLDLevel=level;
      }
      for (int currentLevel=1; currentLevel <= domainTLDLevel; currentLevel++) {
        String tld=TLDInfo.getMultiLevelTLD(domain,currentLevel);
        TLDInfo i=resultMap.get(tld);
        if (i == null) {
          i=new TLDInfo(tld);
          resultMap.put(tld,i);
        }
        i.addSubdomain(domain);
      }
    }
    List<TLDInfo> resultSet=new ArrayList<TLDInfo>(resultMap.values());
    Collections.sort(resultSet);
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89686
Project: 89686
Buggy source:
/** 
 * Read a Domain from Database, and return the domain information as a SparseDomain object. We only read information relevant for the GUI listing.
 * @param domainName a given domain
 * @return a SparseDomain.
 * @throws ArgumentNotValid if domainName is null or empty.
 * @throws UnknownID if domain does not exist
 */
public synchronized SparseDomain readSparse(String domainName){
  ArgumentNotValid.checkNotNullOrEmpty(domainName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainConfigurationNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",domainName);
    if (domainConfigurationNames.size() == 0) {
      throw new UnknownID("String_Node_Str" + domainName + "String_Node_Str");
    }
    return new SparseDomain(domainName,domainConfigurationNames);
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Read a Domain from Database, and return the domain information as a SparseDomain object. We only read information relevant for the GUI listing.
 * @param domainName a given domain
 * @return a SparseDomain.
 * @throws ArgumentNotValid if domainName is null or empty.
 * @throws UnknownID if domain does not exist
 */
@Override public synchronized SparseDomain readSparse(String domainName){
  ArgumentNotValid.checkNotNullOrEmpty(domainName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  try {
    List<String> domainConfigurationNames=DBUtils.selectStringList(c,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",domainName);
    if (domainConfigurationNames.size() == 0) {
      throw new UnknownID("String_Node_Str" + domainName + "String_Node_Str");
    }
    return new SparseDomain(domainName,domainConfigurationNames);
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89687
Project: 89687
Buggy source:
/** 
 * @see DomainDAO#getAllAliases()
 */
public List<AliasInfo> getAllAliases(){
  List<AliasInfo> resultSet=new ArrayList<AliasInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    ResultSet res=s.executeQuery();
    while (res.next()) {
      String domainName=res.getString(1);
      String aliasOf=res.getString(2);
      Date lastchanged=DBUtils.getDateMaybeNull(res,3);
      AliasInfo ai=new AliasInfo(domainName,aliasOf,lastchanged);
      resultSet.add(ai);
    }
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * @see DomainDAO#getAllAliases()
 */
@Override public List<AliasInfo> getAllAliases(){
  List<AliasInfo> resultSet=new ArrayList<AliasInfo>();
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    ResultSet res=s.executeQuery();
    while (res.next()) {
      String domainName=res.getString(1);
      String aliasOf=res.getString(2);
      Date lastchanged=DBUtils.getDateMaybeNull(res,3);
      AliasInfo ai=new AliasInfo(domainName,aliasOf,lastchanged);
      resultSet.add(ai);
    }
    return resultSet;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89688
Project: 89688
Buggy source:
/** 
 * Get the harvest definition that has the given name, if any.
 * @param name The name of a harvest definition.
 * @return The HarvestDefinition object with that name, or null if nonehas that name.
 */
public synchronized HarvestDefinition getHarvestDefinition(String name){
  ArgumentNotValid.checkNotNullOrEmpty(name,"String_Node_Str");
  log.debug("String_Node_Str" + name + "String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str");
    s.setString(1,name);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      long harvestDefinitionID=res.getLong(1);
      s.close();
      return read(c,harvestDefinitionID);
    }
    return null;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get the harvest definition that has the given name, if any.
 * @param name The name of a harvest definition.
 * @return The HarvestDefinition object with that name, or null if nonehas that name.
 */
@Override public synchronized HarvestDefinition getHarvestDefinition(String name){
  ArgumentNotValid.checkNotNullOrEmpty(name,"String_Node_Str");
  log.debug("String_Node_Str" + name + "String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str");
    s.setString(1,name);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      long harvestDefinitionID=res.getLong(1);
      s.close();
      return read(c,harvestDefinitionID);
    }
    return null;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89689
Project: 89689
Buggy source:
/** 
 * Gets default configurations for all domains that are not aliases. This method currently gives an iterator that reads in all domains, although only on demand, that is: when calling "hasNext".
 * @return Iterator containing the default DomainConfiguration for alldomains that are not aliases
 */
public synchronized Iterator<DomainConfiguration> getSnapShotConfigurations(){
  return new FilterIterator<Domain,DomainConfiguration>(DomainDAO.getInstance().getAllDomainsInSnapshotHarvestOrder()){
    public DomainConfiguration filter(    Domain domain){
      if (domain.getAliasInfo() == null || domain.getAliasInfo().isExpired()) {
        return domain.getDefaultConfiguration();
      }
 else {
        return null;
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Gets default configurations for all domains that are not aliases. This method currently gives an iterator that reads in all domains, although only on demand, that is: when calling "hasNext".
 * @return Iterator containing the default DomainConfiguration for alldomains that are not aliases
 */
@Override public synchronized Iterator<DomainConfiguration> getSnapShotConfigurations(){
  return new FilterIterator<Domain,DomainConfiguration>(DomainDAO.getInstance().getAllDomainsInSnapshotHarvestOrder()){
    public DomainConfiguration filter(    Domain domain){
      if (domain.getAliasInfo() == null || domain.getAliasInfo().isExpired()) {
        return domain.getDefaultConfiguration();
      }
 else {
        return null;
      }
    }
  }
;
}
Program: 89690
Project: 89690
Buggy source:
/** 
 * Get a list of all existing harvest definitions ordered by name.
 * @return An iterator that give the existing harvest definitions in turn
 */
public synchronized Iterator<HarvestDefinition> getAllHarvestDefinitions(){
  Connection c=HarvestDBConnection.get();
  try {
    List<Long> hds=DBUtils.selectLongList(c,"String_Node_Str" + "String_Node_Str");
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + "String_Node_Str");
    }
    List<HarvestDefinition> orderedList=new LinkedList<HarvestDefinition>();
    for (    Long id : hds) {
      orderedList.add(read(c,id));
    }
    return orderedList.iterator();
  }
  finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a list of all existing harvest definitions ordered by name.
 * @return An iterator that give the existing harvest definitions in turn
 */
@Override public synchronized Iterator<HarvestDefinition> getAllHarvestDefinitions(){
  Connection c=HarvestDBConnection.get();
  try {
    List<Long> hds=DBUtils.selectLongList(c,"String_Node_Str" + "String_Node_Str");
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + "String_Node_Str");
    }
    List<HarvestDefinition> orderedList=new LinkedList<HarvestDefinition>();
    for (    Long id : hds) {
      orderedList.add(read(c,id));
    }
    return orderedList.iterator();
  }
  finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89691
Project: 89691
Buggy source:
/** 
 * Returns a list of IDs of harvest definitions that are ready to be scheduled.
 * @param now The current date
 * @return List of ready harvest definitions.   No check is performed forwhether these are already in the middle of being scheduled.
 */
public Iterable<Long> getReadyHarvestDefinitions(Date now){
  ArgumentNotValid.checkNotNull(now,"String_Node_Str");
  Connection connection=HarvestDBConnection.get();
  try {
    List<Long> ids=DBUtils.selectLongList(connection,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true);
    ids.addAll(DBUtils.selectLongList(connection,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true,now));
    return ids;
  }
  finally {
    HarvestDBConnection.release(connection);
  }
}

Fixed version (ground truth):
/** 
 * Returns a list of IDs of harvest definitions that are ready to be scheduled.
 * @param now The current date
 * @return List of ready harvest definitions.   No check is performed forwhether these are already in the middle of being scheduled.
 */
@Override public Iterable<Long> getReadyHarvestDefinitions(Date now){
  ArgumentNotValid.checkNotNull(now,"String_Node_Str");
  Connection connection=HarvestDBConnection.get();
  try {
    List<Long> ids=DBUtils.selectLongList(connection,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true);
    ids.addAll(DBUtils.selectLongList(connection,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true,now));
    return ids;
  }
  finally {
    HarvestDBConnection.release(connection);
  }
}
Program: 89692
Project: 89692
Buggy source:
/** 
 * Get a sparse version of a full harvest for GUI purposes.
 * @param harvestName Name of harvest definition.
 * @return Sparse version of full harvest or null for none.
 * @throws ArgumentNotValid on null or empty name.
 * @throws UnknownID        if no harvest has the given ID.
 * @throws IOFailure        on any other error talking to the database
 */
public SparseFullHarvest getSparseFullHarvest(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      return new SparseFullHarvest(res.getLong(1),harvestName,res.getString(2),res.getInt(3),res.getBoolean(4),res.getLong(5),res.getLong(6),res.getLong(7),res.getLong(8),DBUtils.getLongMaybeNull(res,9));
    }
 else {
      return null;
    }
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a sparse version of a full harvest for GUI purposes.
 * @param harvestName Name of harvest definition.
 * @return Sparse version of full harvest or null for none.
 * @throws ArgumentNotValid on null or empty name.
 * @throws UnknownID        if no harvest has the given ID.
 * @throws IOFailure        on any other error talking to the database
 */
@Override public SparseFullHarvest getSparseFullHarvest(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      return new SparseFullHarvest(res.getLong(1),harvestName,res.getString(2),res.getInt(3),res.getBoolean(4),res.getLong(5),res.getLong(6),res.getLong(7),res.getLong(8),DBUtils.getLongMaybeNull(res,9));
    }
 else {
      return null;
    }
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89694
Project: 89694
Buggy source:
/** 
 * Get a sparse version of a partial harvest for GUI purposes.
 * @param harvestName Name of harvest definition.
 * @return Sparse version of partial harvest or null for none.
 * @throws ArgumentNotValid on null or empty name.
 */
public SparsePartialHarvest getSparsePartialHarvest(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      return new SparsePartialHarvest(res.getLong(1),harvestName,res.getString(2),res.getInt(3),new Date(res.getTimestamp(4).getTime()),res.getBoolean(5),res.getLong(6),res.getString(7),DBUtils.getDateMaybeNull(res,8));
    }
 else {
      return null;
    }
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a sparse version of a partial harvest for GUI purposes.
 * @param harvestName Name of harvest definition.
 * @return Sparse version of partial harvest or null for none.
 * @throws ArgumentNotValid on null or empty name.
 */
@Override public SparsePartialHarvest getSparsePartialHarvest(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    if (res.next()) {
      return new SparsePartialHarvest(res.getLong(1),harvestName,res.getString(2),res.getInt(3),new Date(res.getTimestamp(4).getTime()),res.getBoolean(5),res.getLong(6),res.getString(7),DBUtils.getDateMaybeNull(res,8));
    }
 else {
      return null;
    }
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89699
Project: 89699
Buggy source:
/** 
 * Get the name of a harvest given its ID.
 * @param harvestDefinitionID The ID of a harvest
 * @return The name of the given harvest.
 * @throws ArgumentNotValid on null argument
 * @throws UnknownID        if no harvest has the given ID.
 * @throws IOFailure        on any other error talking to the database
 */
public String getHarvestName(Long harvestDefinitionID){
  ArgumentNotValid.checkNotNull(harvestDefinitionID,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str");
    s.setLong(1,harvestDefinitionID);
    ResultSet res=s.executeQuery();
    String name=null;
    while (res.next()) {
      if (name != null) {
        throw new IOFailure("String_Node_Str" + "String_Node_Str" + harvestDefinitionID + "String_Node_Str"+ name+ "String_Node_Str"+ res.getString(1)+ "String_Node_Str");
      }
      name=res.getString(1);
    }
    if (name == null) {
      throw new UnknownID("String_Node_Str" + harvestDefinitionID);
    }
    return name;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + harvestDefinitionID + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get the name of a harvest given its ID.
 * @param harvestDefinitionID The ID of a harvest
 * @return The name of the given harvest.
 * @throws ArgumentNotValid on null argument
 * @throws UnknownID        if no harvest has the given ID.
 * @throws IOFailure        on any other error talking to the database
 */
@Override public String getHarvestName(Long harvestDefinitionID){
  ArgumentNotValid.checkNotNull(harvestDefinitionID,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str");
    s.setLong(1,harvestDefinitionID);
    ResultSet res=s.executeQuery();
    String name=null;
    while (res.next()) {
      if (name != null) {
        throw new IOFailure("String_Node_Str" + "String_Node_Str" + harvestDefinitionID + "String_Node_Str"+ name+ "String_Node_Str"+ res.getString(1)+ "String_Node_Str");
      }
      name=res.getString(1);
    }
    if (name == null) {
      throw new UnknownID("String_Node_Str" + harvestDefinitionID);
    }
    return name;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + harvestDefinitionID + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89700
Project: 89700
Buggy source:
/** 
 * Get a sorted list of all domain names of a HarvestDefinition.
 * @param harvestName of HarvestDefinition
 * @return List of all domains of the HarvestDefinition.
 */
public List<String> getListOfDomainsOfHarvestDefinition(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    List<String> domains=new ArrayList<String>();
    while (res.next()) {
      domains.add(res.getString(1));
    }
    return domains;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}

Fixed version (ground truth):
/** 
 * Get a sorted list of all domain names of a HarvestDefinition.
 * @param harvestName of HarvestDefinition
 * @return List of all domains of the HarvestDefinition.
 */
@Override public List<String> getListOfDomainsOfHarvestDefinition(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=HarvestDBConnection.get();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    List<String> domains=new ArrayList<String>();
    while (res.next()) {
      domains.add(res.getString(1));
    }
    return domains;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    HarvestDBConnection.release(c);
  }
}
Program: 89701
Project: 89701
Buggy source:
/** 
 * Get whether a given harvest is a snapshot or selective harvest.
 * @param harvestDefinitionID ID of a harvest
 * @return True if the given harvest is a snapshot harvest, falseotherwise.
 * @throws ArgumentNotValid on null argument
 * @throws UnknownID        if no harvest has the given ID.
 */
public boolean isSnapshot(Long harvestDefinitionID){
  ArgumentNotValid.checkNotNull(harvestDefinitionID,"String_Node_Str");
  Connection connection=HarvestDBConnection.get();
  try {
    boolean isSnapshot=DBUtils.selectAny(connection,"String_Node_Str",harvestDefinitionID);
    if (isSnapshot) {
      return true;
    }
    boolean isSelective=DBUtils.selectAny(connection,"String_Node_Str" + "String_Node_Str",harvestDefinitionID);
    if (isSelective) {
      return false;
    }
    throw new UnknownID("String_Node_Str" + harvestDefinitionID);
  }
  finally {
    HarvestDBConnection.release(connection);
  }
}

Fixed version (ground truth):
/** 
 * Get whether a given harvest is a snapshot or selective harvest.
 * @param harvestDefinitionID ID of a harvest
 * @return True if the given harvest is a snapshot harvest, falseotherwise.
 * @throws ArgumentNotValid on null argument
 * @throws UnknownID        if no harvest has the given ID.
 */
@Override public boolean isSnapshot(Long harvestDefinitionID){
  ArgumentNotValid.checkNotNull(harvestDefinitionID,"String_Node_Str");
  Connection connection=HarvestDBConnection.get();
  try {
    boolean isSnapshot=DBUtils.selectAny(connection,"String_Node_Str",harvestDefinitionID);
    if (isSnapshot) {
      return true;
    }
    boolean isSelective=DBUtils.selectAny(connection,"String_Node_Str" + "String_Node_Str",harvestDefinitionID);
    if (isSelective) {
      return false;
    }
    throw new UnknownID("String_Node_Str" + harvestDefinitionID);
  }
  finally {
    HarvestDBConnection.release(connection);
  }
}