nus-yam/ex-repair huggingface dataset:
Program: 17166
Project: 17166
Buggy source:
public PDBFileParser(){
  structure=null;
  current_model=new ArrayList<Chain>();
  current_chain=null;
  current_group=null;
  header=init_header();
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  parseSecStruc=false;
  alignSeqRes=true;
  helixList=new ArrayList<Map<String,String>>();
  strandList=new ArrayList<Map<String,String>>();
  turnList=new ArrayList<Map<String,String>>();
  current_compound=new Compound();
  dbrefs=new ArrayList<DBRef>();
  dateFormat=new SimpleDateFormat("String_Node_Str");
  atomCount=0;
  atomOverflow=false;
  parseCAOnly=false;
}

Fixed version (ground truth):
public PDBFileParser(){
  structure=null;
  current_model=new ArrayList<Chain>();
  current_chain=null;
  current_group=null;
  header=init_header();
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  parseSecStruc=false;
  alignSeqRes=true;
  helixList=new ArrayList<Map<String,String>>();
  strandList=new ArrayList<Map<String,String>>();
  turnList=new ArrayList<Map<String,String>>();
  current_compound=new Compound();
  dbrefs=new ArrayList<DBRef>();
  dateFormat=new SimpleDateFormat("String_Node_Str",java.util.Locale.ENGLISH);
  atomCount=0;
  atomOverflow=false;
  parseCAOnly=false;
}
Program: 17171
Project: 17171
Buggy source:
public static StructureAlignment[] getAllAlgorithms(){
  StructureAlignment[] algorithms=new StructureAlignment[5];
  algorithms[0]=new CeMain();
  algorithms[1]=new CeSideChainMain();
  algorithms[2]=new SmithWaterman3Daligner();
  return algorithms;
}

Fixed version (ground truth):
public static StructureAlignment[] getAllAlgorithms(){
  StructureAlignment[] algorithms=new StructureAlignment[3];
  algorithms[0]=new CeMain();
  algorithms[1]=new CeSideChainMain();
  algorithms[2]=new SmithWaterman3Daligner();
  return algorithms;
}
Program: 17172
Project: 17172
Buggy source:
public File downloadPDB(String pdbId){
  if ((path == null) || (path.equals("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    path="String_Node_Str";
  }
  File tempFile;
  if (pdbDirectorySplit) {
    String middle=pdbId.substring(1,3).toLowerCase();
    String dir=path + lineSplit + middle;
    File directoryCheck=new File(dir);
    if (!directoryCheck.exists()) {
      directoryCheck.mkdir();
    }
    tempFile=new File(dir + lineSplit + pdbId.toLowerCase()+ "String_Node_Str");
  }
 else {
    tempFile=new File(path + lineSplit + pdbId.toLowerCase()+ "String_Node_Str");
  }
  File pdbHome=new File(path);
  if (!pdbHome.canWrite()) {
    System.err.println("String_Node_Str" + pdbHome);
    return null;
  }
  String ftp=String.format("String_Node_Str",pdbId.toLowerCase());
  System.out.println("String_Node_Str" + ftp);
  try {
    URL url=new URL(ftp);
    InputStream conn=url.openStream();
    System.out.println("String_Node_Str" + tempFile);
    FileOutputStream outPut=new FileOutputStream(tempFile);
    GZIPOutputStream gzOutPut=new GZIPOutputStream(outPut);
    PrintWriter pw=new PrintWriter(gzOutPut);
    BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(new GZIPInputStream(conn)));
    String line;
    while ((line=fileBuffer.readLine()) != null) {
      pw.println(line);
    }
    pw.flush();
    pw.close();
    outPut.close();
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return tempFile;
}

Fixed version (ground truth):
public File downloadPDB(String pdbId){
  if ((path == null) || (path.equals("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    path="String_Node_Str";
  }
  File tempFile;
  if (pdbDirectorySplit) {
    String middle=pdbId.substring(1,3).toLowerCase();
    String dir=path + lineSplit + middle;
    File directoryCheck=new File(dir);
    if (!directoryCheck.exists()) {
      directoryCheck.mkdir();
    }
    tempFile=new File(dir + lineSplit + pdbId.toLowerCase()+ "String_Node_Str");
  }
 else {
    tempFile=new File(path + lineSplit + pdbId.toLowerCase()+ "String_Node_Str");
  }
  String ftp=String.format("String_Node_Str",pdbId.toLowerCase());
  System.out.println("String_Node_Str" + ftp);
  try {
    URL url=new URL(ftp);
    InputStream conn=url.openStream();
    System.out.println("String_Node_Str" + tempFile);
    FileOutputStream outPut=new FileOutputStream(tempFile);
    GZIPOutputStream gzOutPut=new GZIPOutputStream(outPut);
    PrintWriter pw=new PrintWriter(gzOutPut);
    BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(new GZIPInputStream(conn)));
    String line;
    while ((line=fileBuffer.readLine()) != null) {
      pw.println(line);
    }
    pw.flush();
    pw.close();
    outPut.close();
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return tempFile;
}
Program: 17173
Project: 17173
Buggy source:
public static void main(String[] args){
  String filename="String_Node_Str";
  StructureIOFile reader=new MMCIFFileReader();
  reader.setAutoFetch(true);
  try {
    Structure struc=reader.getStructure(filename);
    System.out.println(struc);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  StructureIOFile reader=new MMCIFFileReader();
  reader.setPath("String_Node_Str");
  reader.setAutoFetch(true);
  try {
    Structure struc=reader.getStructureById("String_Node_Str");
    System.out.println(struc);
    System.out.println(struc.toPDB());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17174
Project: 17174
Buggy source:
private File downloadPDB(String pdbId){
  if ((path == null) || (path.equals("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    path="String_Node_Str";
  }
  File tempFile;
  if (pdbDirectorySplit) {
    String middle=pdbId.substring(1,3).toLowerCase();
    String dir=path + lineSplit + middle;
    File directoryCheck=new File(dir);
    if (!directoryCheck.exists()) {
      directoryCheck.mkdir();
    }
    tempFile=new File(dir + lineSplit + "String_Node_Str"+ pdbId.toLowerCase()+ "String_Node_Str");
  }
 else {
    tempFile=new File(path + lineSplit + "String_Node_Str"+ pdbId.toLowerCase()+ "String_Node_Str");
  }
  File pdbHome=new File(path);
  if (!pdbHome.canWrite()) {
    System.err.println("String_Node_Str" + pdbHome);
    return null;
  }
  String ftp=String.format("String_Node_Str",pdbId.toLowerCase());
  System.out.println("String_Node_Str" + ftp);
  try {
    URL url=new URL(ftp);
    InputStream conn=new GZIPInputStream(url.openStream());
    System.out.println("String_Node_Str" + tempFile);
    FileOutputStream outPut=new FileOutputStream(tempFile);
    GZIPOutputStream gzOutPut=new GZIPOutputStream(outPut);
    PrintWriter pw=new PrintWriter(gzOutPut);
    BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(conn));
    String line;
    while ((line=fileBuffer.readLine()) != null) {
      pw.println(line);
    }
    pw.flush();
    pw.close();
    outPut.close();
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return tempFile;
}

Fixed version (ground truth):
private File downloadPDB(String pdbId){
  if ((path == null) || (path.equals("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    path="String_Node_Str";
  }
  File tempFile;
  if (pdbDirectorySplit) {
    String middle=pdbId.substring(1,3).toLowerCase();
    String dir=path + lineSplit + middle;
    File directoryCheck=new File(dir);
    if (!directoryCheck.exists()) {
      directoryCheck.mkdir();
    }
    tempFile=new File(dir + lineSplit + "String_Node_Str"+ pdbId.toLowerCase()+ "String_Node_Str");
  }
 else {
    tempFile=new File(path + lineSplit + "String_Node_Str"+ pdbId.toLowerCase()+ "String_Node_Str");
  }
  String ftp=String.format("String_Node_Str",pdbId.toLowerCase());
  System.out.println("String_Node_Str" + ftp);
  System.out.println("String_Node_Str" + tempFile);
  try {
    URL url=new URL(ftp);
    InputStream conn=new GZIPInputStream(url.openStream());
    FileOutputStream outPut=new FileOutputStream(tempFile);
    GZIPOutputStream gzOutPut=new GZIPOutputStream(outPut);
    PrintWriter pw=new PrintWriter(gzOutPut);
    BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(conn));
    String line;
    while ((line=fileBuffer.readLine()) != null) {
      pw.println(line);
    }
    pw.flush();
    pw.close();
    outPut.close();
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return tempFile;
}
Program: 17175
Project: 17175
Buggy source:
/** 
 * Takes a set of locations and returns the set of all members. If any members are compound, it flattens them too.
 * @param members the locations to flatten
 * @return the flattened collection of members.
 */
public static Collection<Location> flatten(Collection<Location> members){
  List<Location> flattened=new ArrayList<Location>(members);
  for (int i=0; i < flattened.size(); i++) {
    RichLocation member=(RichLocation)flattened.get(i);
    if (!member.isContiguous()) {
      flattened.remove(i);
      int insertPos=i;
      for (Iterator<Location> j=member.blockIterator(); j.hasNext(); )       flattened.add(insertPos++,j.next());
      i--;
    }
  }
  return flattened;
}

Fixed version (ground truth):
/** 
 * Takes a set of locations and returns the set of all members. If any members are compound, it flattens them too.
 * @param members the locations to flatten
 * @return the flattened collection of members.
 */
public static Collection<Location> flatten(Collection<Location> members){
  List<Location> flattened=new ArrayList<Location>(members);
  for (int i=0; i < flattened.size(); i++) {
    Location member=flattened.get(i);
    if (!member.isContiguous()) {
      flattened.remove(i);
      int insertPos=i;
      for (Iterator<Location> j=member.blockIterator(); j.hasNext(); )       flattened.add(insertPos++,j.next());
      i--;
    }
  }
  return flattened;
}
Program: 17176
Project: 17176
Buggy source:
/** 
 * Takes a set of locations and tries to merge all pairs where the union operation results in a simple rich location, not a compound one.
 * @param members the members to merge
 * @return the resulting merged set, which may have only one location init.
 */
public static Collection<Location> merge(Collection<Location> members){
  List<Location> membersList=new ArrayList<Location>(flatten(members));
  if (membersList.size() > 1) {
    for (int p=0; p < (membersList.size() - 1); p++) {
      RichLocation parent=(RichLocation)membersList.get(p);
      for (int c=p + 1; c < membersList.size(); c++) {
        RichLocation child=(RichLocation)membersList.get(c);
        RichLocation union=(RichLocation)parent.union(child);
        if (union.isContiguous()) {
          membersList.set(p,union);
          membersList.remove(c);
          c=p + 1;
        }
      }
    }
  }
  return membersList;
}

Fixed version (ground truth):
/** 
 * Takes a set of locations and tries to merge all pairs where the union operation results in a simple rich location, not a compound one.
 * @param members the members to merge
 * @return the resulting merged set, which may have only one location init.
 */
public static Collection<Location> merge(Collection<Location> members){
  List<Location> membersList=new ArrayList<Location>(flatten(members));
  if (membersList.size() > 1) {
    for (int p=0; p < (membersList.size() - 1); p++) {
      Location parent=membersList.get(p);
      for (int c=p + 1; c < membersList.size(); c++) {
        Location child=membersList.get(c);
        Location union=parent.union(child);
        if (union.isContiguous()) {
          membersList.set(p,union);
          membersList.remove(c);
          p--;
          break;
        }
      }
    }
  }
  return membersList;
}
Program: 17178
Project: 17178
Buggy source:
/** 
 * The EntityPolySeq object provide the amino acid sequence objects for the Entities. Later on the entities are mapped to the BioJava Chain and Compound objects.
 * @param epolseq the EntityPolySeq record for one amino acid
 */
public void newEntityPolySeq(EntityPolySeq epolseq){
  Entity e=getEntity(epolseq.getEntity_id());
  if (e == null) {
    System.err.println("String_Node_Str" + epolseq.getEntity_id() + "String_Node_Str");
    return;
  }
  Chain entityChain=getEntityChain(epolseq.getEntity_id());
  AminoAcid g=new AminoAcidImpl();
  g.setRecordType(AminoAcid.SEQRESRECORD);
  try {
    g.setPDBName(epolseq.getMon_id());
    Character code1=StructureTools.convert_3code_1code(epolseq.getMon_id());
    g.setAminoType(code1);
    g.setPDBCode(epolseq.getNum());
    entityChain.addGroup(g);
  }
 catch (  PDBParseException ex) {
    if (StructureTools.isNucleotide(epolseq.getMon_id())) {
      NucleotideImpl n=new NucleotideImpl();
      n.setPDBCode(epolseq.getNum());
      entityChain.addGroup(n);
    }
 else {
      logger.warning(ex.getMessage());
    }
  }
catch (  IllegalSymbolException ex) {
    logger.warning(ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * The EntityPolySeq object provide the amino acid sequence objects for the Entities. Later on the entities are mapped to the BioJava Chain and Compound objects.
 * @param epolseq the EntityPolySeq record for one amino acid
 */
public void newEntityPolySeq(EntityPolySeq epolseq){
  if (DEBUG)   System.out.println("String_Node_Str" + epolseq);
  Entity e=getEntity(epolseq.getEntity_id());
  if (e == null) {
    System.err.println("String_Node_Str" + epolseq.getEntity_id() + "String_Node_Str");
    return;
  }
  Chain entityChain=getEntityChain(epolseq.getEntity_id());
  AminoAcid g=new AminoAcidImpl();
  g.setRecordType(AminoAcid.SEQRESRECORD);
  try {
    g.setPDBName(epolseq.getMon_id());
    Character code1=StructureTools.convert_3code_1code(epolseq.getMon_id());
    g.setAminoType(code1);
    g.setPDBCode(epolseq.getNum());
    entityChain.addGroup(g);
  }
 catch (  PDBParseException ex) {
    if (StructureTools.isNucleotide(epolseq.getMon_id())) {
      NucleotideImpl n=new NucleotideImpl();
      n.setPDBCode(epolseq.getNum());
      entityChain.addGroup(n);
    }
 else {
      logger.warning(ex.getMessage() + "String_Node_Str");
      HetatomImpl h=new HetatomImpl();
      try {
        h.setPDBName(epolseq.getMon_id());
        h.setPDBCode(epolseq.getNum());
        entityChain.addGroup(h);
      }
 catch (      PDBParseException exc) {
        System.err.println("String_Node_Str" + epolseq.getMon_id());
      }
    }
  }
catch (  IllegalSymbolException ex) {
    HetatomImpl h=new HetatomImpl();
    try {
      h.setPDBName(epolseq.getMon_id());
      h.setPDBCode(epolseq.getNum());
      entityChain.addGroup(h);
    }
 catch (    PDBParseException exc) {
      System.err.println("String_Node_Str" + epolseq.getMon_id() + "String_Node_Str"+ ex.getMessage());
    }
  }
}
Program: 17180
Project: 17180
Buggy source:
public void documentEnd(){
  if (current_chain != null) {
    current_chain.addGroup(current_group);
    if (isKnownChain(current_chain.getName(),current_model) == null) {
      current_model.add(current_chain);
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
  }
  structure.addModel(current_model);
  for (  StructAsym asym : structAsyms) {
    if (DEBUG)     System.out.println("String_Node_Str" + asym.getEntity_id() + "String_Node_Str"+ asym.getId());
    Chain s=getEntityChain(asym.getEntity_id());
    Chain seqres=(Chain)s.clone();
    seqres.setName(asym.getId());
    seqResChains.add(seqres);
  }
  if (alignSeqRes) {
    SeqRes2AtomAligner aligner=new SeqRes2AtomAligner();
    aligner.align(structure,seqResChains);
  }
  Set<String> asymIds=asymStrandId.keySet();
  for (int i=0; i < structure.nrModels(); i++) {
    List<Chain> model=structure.getModel(i);
    for (    Chain chain : model) {
      for (      String asym : asymIds) {
        if (chain.getName().equals(asym)) {
          if (DEBUG)           System.out.println("String_Node_Str" + asym + "String_Node_Str"+ asymStrandId.get(asym));
          chain.setName(asymStrandId.get(asym));
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
public void documentEnd(){
  if (current_chain != null) {
    current_chain.addGroup(current_group);
    if (isKnownChain(current_chain.getName(),current_model) == null) {
      current_model.add(current_chain);
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
  }
  structure.addModel(current_model);
  for (  StructAsym asym : structAsyms) {
    if (DEBUG)     System.out.println("String_Node_Str" + asym.getEntity_id() + "String_Node_Str"+ asym.getId());
    Chain s=getEntityChain(asym.getEntity_id());
    Chain seqres=(Chain)s.clone();
    seqres.setName(asym.getId());
    seqResChains.add(seqres);
    if (DEBUG)     System.out.println("String_Node_Str" + asym.getId() + "String_Node_Str"+ seqres+ "String_Node_Str");
  }
  if (alignSeqRes) {
    SeqRes2AtomAligner aligner=new SeqRes2AtomAligner();
    aligner.align(structure,seqResChains);
  }
  Set<String> asymIds=asymStrandId.keySet();
  for (int i=0; i < structure.nrModels(); i++) {
    List<Chain> model=structure.getModel(i);
    List<Chain> pdbChains=new ArrayList<Chain>();
    for (    Chain chain : model) {
      for (      String asym : asymIds) {
        if (chain.getName().equals(asym)) {
          if (DEBUG)           System.out.println("String_Node_Str" + asym + "String_Node_Str"+ asymStrandId.get(asym));
          chain.setName(asymStrandId.get(asym));
          Chain known=isKnownChain(chain.getName(),pdbChains);
          if (known == null) {
            pdbChains.add(chain);
          }
 else {
            for (            Group g : chain.getAtomGroups()) {
              known.addGroup(g);
            }
          }
          break;
        }
      }
    }
    structure.setModel(i,pdbChains);
  }
}
Program: 17181
Project: 17181
Buggy source:
private static Connection createPostConnection(HttpURLConnection connection) throws IOException {
  final OutputStream outputStream;
  String contentEncoding=connection.getRequestProperty("String_Node_Str");
  if (TextUtils.equals("String_Node_Str",contentEncoding)) {
    outputStream=new GZIPOutputStream(connection.getOutputStream());
  }
 else {
    outputStream=connection.getOutputStream();
  }
  return new Connection(connection,null,outputStream){
    @Override public void close() throws IOException {
      try {
        int responseCode=connection.getResponseCode();
        if (responseCode >= 300) {
          String responseBody;
          try {
            responseBody=readFully(connection.getInputStream());
          }
 catch (          IOException e) {
            responseBody="String_Node_Str" + e.toString();
          }
          throw new HTTPException(responseCode,connection.getResponseMessage(),responseBody);
        }
      }
  finally {
        super.close();
        os.close();
      }
    }
  }
;
}

Fixed version (ground truth):
private static Connection createPostConnection(HttpURLConnection connection) throws IOException {
  final OutputStream outputStream;
  String contentEncoding=connection.getRequestProperty("String_Node_Str");
  if (TextUtils.equals("String_Node_Str",contentEncoding)) {
    outputStream=new GZIPOutputStream(connection.getOutputStream());
  }
 else {
    outputStream=connection.getOutputStream();
  }
  return new Connection(connection,null,outputStream){
    @Override public void close() throws IOException {
      try {
        int responseCode=connection.getResponseCode();
        if (responseCode >= 300) {
          String responseBody;
          try {
            responseBody=readFully(getInputStream(connection));
          }
 catch (          IOException e) {
            responseBody="String_Node_Str" + e.toString();
          }
          throw new HTTPException(responseCode,connection.getResponseMessage(),responseBody);
        }
      }
  finally {
        super.close();
        os.close();
      }
    }
  }
;
}
Program: 17182
Project: 17182
Buggy source:
private static Connection createGetConnection(HttpURLConnection connection) throws IOException {
  return new Connection(connection,connection.getInputStream(),null){
    @Override public void close() throws IOException {
      super.close();
      is.close();
    }
  }
;
}

Fixed version (ground truth):
private static Connection createGetConnection(HttpURLConnection connection) throws IOException {
  return new Connection(connection,getInputStream(connection),null){
    @Override public void close() throws IOException {
      super.close();
      is.close();
    }
  }
;
}
Program: 17183
Project: 17183
Buggy source:
private static Connection createPostConnection(HttpURLConnection connection) throws IOException {
  final OutputStream outputStream;
  String contentEncoding=connection.getRequestProperty("String_Node_Str");
  if (TextUtils.equals("String_Node_Str",contentEncoding)) {
    outputStream=new GZIPOutputStream(connection.getOutputStream());
  }
 else {
    outputStream=connection.getOutputStream();
  }
  return new Connection(connection,null,outputStream){
    @Override public void close() throws IOException {
      try {
        int responseCode=connection.getResponseCode();
        if (responseCode >= 300) {
          String responseBody;
          try {
            responseBody=readFully(connection.getInputStream());
          }
 catch (          IOException e) {
            responseBody="String_Node_Str" + e.toString();
          }
          throw new HTTPException(responseCode,connection.getResponseMessage(),responseBody);
        }
      }
  finally {
        super.close();
        os.close();
      }
    }
  }
;
}

Fixed version (ground truth):
private static Connection createPostConnection(HttpURLConnection connection) throws IOException {
  final OutputStream outputStream;
  String contentEncoding=connection.getRequestProperty("String_Node_Str");
  if (TextUtils.equals("String_Node_Str",contentEncoding)) {
    outputStream=new GZIPOutputStream(connection.getOutputStream());
  }
 else {
    outputStream=connection.getOutputStream();
  }
  return new Connection(connection,null,outputStream){
    @Override public void close() throws IOException {
      try {
        int responseCode=connection.getResponseCode();
        if (responseCode >= 300) {
          String responseBody;
          try {
            responseBody=readFully(getInputStream(connection));
          }
 catch (          IOException e) {
            responseBody="String_Node_Str" + e.toString();
          }
          throw new HTTPException(responseCode,connection.getResponseMessage(),responseBody);
        }
      }
  finally {
        super.close();
        os.close();
      }
    }
  }
;
}
Program: 17184
Project: 17184
Buggy source:
private static Connection createGetConnection(HttpURLConnection connection) throws IOException {
  return new Connection(connection,connection.getInputStream(),null){
    @Override public void close() throws IOException {
      super.close();
      is.close();
    }
  }
;
}

Fixed version (ground truth):
private static Connection createGetConnection(HttpURLConnection connection) throws IOException {
  return new Connection(connection,getInputStream(connection),null){
    @Override public void close() throws IOException {
      super.close();
      is.close();
    }
  }
;
}
Program: 17185
Project: 17185
Buggy source:
@Test public void testDebugLogWithFormat() throws Exception {
  Logger logger=new Logger(true);
  logger.debug("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).hasSize(1);
  assertThat(logs.get(0).msg).isEqualTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDebugLogWithFormat() throws Exception {
  Logger logger=new Logger(true);
  logger.debug(TEST_OWNER,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).hasSize(1);
  assertThat(logs.get(0).msg).isEqualTo("String_Node_Str");
}
Program: 17186
Project: 17186
Buggy source:
@Test public void disabledLogger() throws Exception {
  Logger logger=new Logger(false);
  logger.debug("String_Node_Str","String_Node_Str","String_Node_Str",null);
  logger.error("String_Node_Str","String_Node_Str","String_Node_Str",null,null,null);
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).isEmpty();
}

Fixed version (ground truth):
@Test public void disabledLogger() throws Exception {
  Logger logger=new Logger(false);
  logger.debug(TEST_OWNER,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  logger.error(TEST_OWNER,"String_Node_Str","String_Node_Str",new Throwable(),"String_Node_Str","String_Node_Str");
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).isEmpty();
}
Program: 17187
Project: 17187
Buggy source:
@Test public void testDebugLogWithNullFormat() throws Exception {
  Logger logger=new Logger(true);
  logger.debug("String_Node_Str","String_Node_Str","String_Node_Str",null);
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).hasSize(1);
  assertThat(logs.get(0).msg).isEqualTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDebugLogWithNullFormat() throws Exception {
  Logger logger=new Logger(true);
  logger.debug(TEST_OWNER,"String_Node_Str","String_Node_Str",null,"String_Node_Str");
  List<ShadowLog.LogItem> logs=ShadowLog.getLogs();
  assertThat(logs).hasSize(1);
  assertThat(logs.get(0).msg).isEqualTo("String_Node_Str");
}
Program: 17188
Project: 17188
Buggy source:
/** 
 * Calculates the next visited state. Each state contains the information of the partial path explored. To check if the state is the goal state, just check the corresponding node of the state with   {@code currentNode.transition().to().equals(myGoalState)}
 * @return next visited state.
 */
public N next(){
  N current=queue.poll();
  S currentState=current.state();
  open.remove(currentState);
  for (  N successorNode : expander.expand(current)) {
    N successorOpen=open.get(successorNode.state());
    if (successorOpen != null) {
      if (successorOpen.getScore().compareTo(successorNode.getScore()) <= 0) {
        continue;
      }
    }
    N successorClose=closed.get(successorNode.state());
    if (successorClose != null) {
      if (successorClose.getScore().compareTo(successorNode.getScore()) <= 0) {
        continue;
      }
    }
    open.put(successorNode.state(),successorNode);
    queue.add(successorNode);
  }
  closed.put(currentState,current);
  return current;
}

Fixed version (ground truth):
/** 
 * Calculates the next visited state. Each state contains the information of the partial path explored. To check if the state is the goal state, just check the corresponding node of the state with   {@code currentNode.transition().to().equals(myGoalState)}
 * @return next visited state.
 */
public N next(){
  N current=takePromising();
  S currentState=current.state();
  open.remove(currentState);
  for (  N successorNode : expander.expand(current)) {
    N successorOpen=open.get(successorNode.state());
    if (successorOpen != null) {
      if (successorOpen.getScore().compareTo(successorNode.getScore()) <= 0) {
        continue;
      }
    }
    N successorClose=closed.get(successorNode.state());
    if (successorClose != null) {
      if (successorClose.getScore().compareTo(successorNode.getScore()) <= 0) {
        continue;
      }
    }
    open.put(successorNode.state(),successorNode);
    queue.add(successorNode);
  }
  closed.put(currentState,current);
  return current;
}
Program: 17189
Project: 17189
Buggy source:
@Test public void RomanianProblemAStarTest(){
  final HipsterGraph<City,Double> graph=RomanianProblem.graph();
  Hipster.SearchProblem p=GraphSearchProblem.startingFrom(City.Arad).in(graph).takeCostsFromEdges().useHeuristicFunction(RomanianProblem.heuristicFunction()).build();
  AStar.Iterator it=Hipster.createAStar(p).iterator();
  List<Double> expectedScore=Arrays.asList(366d,393d,413d,415d,417d,418d);
  int i=0;
  while (it.hasNext()) {
    HeuristicNode node=it.next();
    assertEquals(expectedScore.get(i),node.getScore());
    i++;
    if (node.state().equals(City.Bucharest)) {
      break;
    }
  }
}

Fixed version (ground truth):
@Test public void RomanianProblemAStarTest(){
  final HipsterGraph<City,Double> graph=RomanianProblem.graph();
  SearchProblem p=GraphSearchProblem.startingFrom(City.Arad).in(graph).takeCostsFromEdges().useHeuristicFunction(RomanianProblem.heuristicFunction()).build();
  AStar.Iterator it=Hipster.createAStar(p).iterator();
  List<Double> expectedScore=Arrays.asList(366d,393d,413d,415d,417d,418d);
  int i=0;
  while (it.hasNext()) {
    HeuristicNode node=it.next();
    assertEquals(expectedScore.get(i),node.getScore());
    i++;
    if (node.state().equals(City.Bucharest)) {
      break;
    }
  }
}
Program: 17190
Project: 17190
Buggy source:
@Test public void testWeightedShortestPathSearch(){
  Vertex origin=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  Vertex dest=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  HipsterDirectedGraph<Vertex,Edge> adaptedGraph=new JUNGHipsterDirectedGraphAdapter<Vertex,Edge>(new GraphJung(graph));
  Hipster.SearchProblem<Edge,Vertex,WeightedNode<Edge,Vertex,Double>> p=GraphSearchProblem.startingFrom(origin).in(adaptedGraph).extractCostFromEdges(new Function<Edge,Double>(){
    @Override public Double apply(    @Nullable Edge edge){
      return edge.getProperty("String_Node_Str");
    }
  }
).build();
  List<String> expectedPath=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<Vertex> shortestPath=Hipster.createAStar(p).search(dest).getOptimalPaths().get(0);
  for (int i=0; i < shortestPath.size(); i++) {
    assertEquals(expectedPath.get(i),shortestPath.get(i).getProperty("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testWeightedShortestPathSearch(){
  Vertex origin=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  Vertex dest=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  HipsterDirectedGraph<Vertex,Edge> adaptedGraph=new JUNGHipsterDirectedGraphAdapter<Vertex,Edge>(new GraphJung(graph));
  SearchProblem<Edge,Vertex,WeightedNode<Edge,Vertex,Double>> p=GraphSearchProblem.startingFrom(origin).in(adaptedGraph).extractCostFromEdges(new Function<Edge,Double>(){
    @Override public Double apply(    @Nullable Edge edge){
      return edge.getProperty("String_Node_Str");
    }
  }
).build();
  List<String> expectedPath=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<Vertex> shortestPath=Hipster.createAStar(p).search(dest).getOptimalPaths().get(0);
  for (int i=0; i < shortestPath.size(); i++) {
    assertEquals(expectedPath.get(i),shortestPath.get(i).getProperty("String_Node_Str"));
  }
}
Program: 17191
Project: 17191
Buggy source:
@Test public void testUniformShortestPathSearch(){
  Vertex origin=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  Vertex dest=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  HipsterDirectedGraph<Vertex,Edge> adaptedGraph=new JUNGHipsterDirectedGraphAdapter<Vertex,Edge>(new GraphJung(graph));
  Hipster.SearchProblem<Edge,Vertex,WeightedNode<Edge,Vertex,Double>> p=GraphSearchProblem.startingFrom(origin).in(adaptedGraph).takeCostsFromEdges().build();
  List<String> expectedPath=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<Vertex> shortestPath=Hipster.createAStar(p).search(dest).getOptimalPaths().get(0);
  for (int i=0; i < shortestPath.size(); i++) {
    assertEquals(expectedPath.get(i),shortestPath.get(i).getProperty("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testUniformShortestPathSearch(){
  Vertex origin=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  Vertex dest=graph.query().has("String_Node_Str","String_Node_Str").vertices().iterator().next();
  HipsterDirectedGraph<Vertex,Edge> adaptedGraph=new JUNGHipsterDirectedGraphAdapter<Vertex,Edge>(new GraphJung(graph));
  SearchProblem<Edge,Vertex,WeightedNode<Edge,Vertex,Double>> p=GraphSearchProblem.startingFrom(origin).in(adaptedGraph).takeCostsFromEdges().build();
  List<String> expectedPath=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  List<Vertex> shortestPath=Hipster.createAStar(p).search(dest).getOptimalPaths().get(0);
  for (int i=0; i < shortestPath.size(); i++) {
    assertEquals(expectedPath.get(i),shortestPath.get(i).getProperty("String_Node_Str"));
  }
}
Program: 17192
Project: 17192
Buggy source:
@Override protected SearchResult search(Predicate<N> condition){
  int iteration=0;
  Iterator it=iterator();
  Stopwatch w=Stopwatch.createStarted();
  N currentNode=null;
  N goalNode=null;
  while (it.hasNext()) {
    iteration++;
    it.next();
    if (condition.apply(currentNode)) {
      goalNode=currentNode;
    }
  }
  w.stop();
  if (goalNode != null) {
    N goal=it.explored.get(goalNode.state());
    return new SearchResult(goal,iteration,w);
  }
  return new SearchResult(Collections.<N>emptyList(),iteration,w);
}

Fixed version (ground truth):
@Override public SearchResult search(Predicate<N> condition){
  int iteration=0;
  Iterator it=iterator();
  Stopwatch w=Stopwatch.createStarted();
  N currentNode=null;
  N goalNode=null;
  while (it.hasNext()) {
    iteration++;
    it.next();
    if (condition.apply(currentNode)) {
      goalNode=currentNode;
    }
  }
  w.stop();
  if (goalNode != null) {
    N goal=it.explored.get(goalNode.state());
    return new SearchResult(goal,iteration,w);
  }
  return new SearchResult(Collections.<N>emptyList(),iteration,w);
}
Program: 17193
Project: 17193
Buggy source:
@Override protected SearchResult search(Predicate<N> condition){
  int iteration=0;
  Iterator it=new Iterator();
  Stopwatch w=Stopwatch.createStarted();
  N currentNode;
  N goalNode=null;
  while (it.hasNext()) {
    iteration++;
    currentNode=it.next();
    if (condition.apply(currentNode)) {
      goalNode=currentNode;
    }
  }
  w.stop();
  if (goalNode != null) {
    Collection<N> solutions=it.nonDominated.get(goalNode.state());
    return new SearchResult(solutions,iteration,w);
  }
  return new SearchResult(Collections.<N>emptyList(),iteration,w);
}

Fixed version (ground truth):
@Override public SearchResult search(Predicate<N> condition){
  int iteration=0;
  Iterator it=new Iterator();
  Stopwatch w=Stopwatch.createStarted();
  N currentNode;
  N goalNode=null;
  while (it.hasNext()) {
    iteration++;
    currentNode=it.next();
    if (condition.apply(currentNode)) {
      goalNode=currentNode;
    }
  }
  w.stop();
  if (goalNode != null) {
    Collection<N> solutions=it.nonDominated.get(goalNode.state());
    return new SearchResult(solutions,iteration,w);
  }
  return new SearchResult(Collections.<N>emptyList(),iteration,w);
}
Program: 17194
Project: 17194
Buggy source:
public static void main(String[] args) throws InterruptedException {
  System.out.println(Hipster.createDijkstra(GraphSearchProblem.startingFrom(RomanianProblem.City.Arad).to(RomanianProblem.City.Bucharest).in(RomanianProblem.graph())).search());
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  System.out.println(Hipster.createAStar(GraphSearchProblem.startingFrom(RomanianProblem.City.Arad).in(RomanianProblem.graph()).takeCostsFromEdges().build()).search(RomanianProblem.City.Bucharest));
}
Program: 17197
Project: 17197
Buggy source:
public <E>GraphProblemBuilder<E> in(final HipsterGraph<V,E> graph){
  TransitionFunction<E,V> tf;
  if (graph instanceof HipsterDirectedGraph) {
    final HipsterDirectedGraph<V,E> dg=(HipsterDirectedGraph<V,E>)graph;
    tf=new TransitionFunction<E,V>(){
      @Override public Iterable<Transition<E,V>> transitionsFrom(      final V state){
        return Iterables.transform(dg.outgoingEdgesOf(state),new Function<GraphEdge<V,E>,Transition<E,V>>(){
          @Override public Transition<E,V> apply(          GraphEdge<V,E> edge){
            return Transition.create(state,edge.getEdgeValue(),edge.getVertex2());
          }
        }
);
      }
    }
;
  }
 else {
    tf=new TransitionFunction<E,V>(){
      @Override public Iterable<Transition<E,V>> transitionsFrom(      final V state){
        return Iterables.transform(graph.edgesOf(state),new Function<GraphEdge<V,E>,Transition<E,V>>(){
          @Override public Transition<E,V> apply(          GraphEdge<V,E> edge){
            V oppositeVertex=edge.getVertex1().equals(state) ? edge.getVertex2() : edge.getVertex1();
            return Transition.create(state,edge.getEdgeValue(),oppositeVertex);
          }
        }
);
      }
    }
;
  }
  return new GraphProblemBuilder<E>(tf,graph);
}

Fixed version (ground truth):
public <E>WeightType<E> in(final HipsterGraph<V,E> graph){
  TransitionFunction<E,V> tf;
  if (graph instanceof HipsterDirectedGraph) {
    final HipsterDirectedGraph<V,E> dg=(HipsterDirectedGraph<V,E>)graph;
    tf=new TransitionFunction<E,V>(){
      @Override public Iterable<Transition<E,V>> transitionsFrom(      final V state){
        return Iterables.transform(dg.outgoingEdgesOf(state),new Function<GraphEdge<V,E>,Transition<E,V>>(){
          @Override public Transition<E,V> apply(          GraphEdge<V,E> edge){
            return Transition.create(state,edge.getEdgeValue(),edge.getVertex2());
          }
        }
);
      }
    }
;
  }
 else {
    tf=new TransitionFunction<E,V>(){
      @Override public Iterable<Transition<E,V>> transitionsFrom(      final V state){
        return Iterables.transform(graph.edgesOf(state),new Function<GraphEdge<V,E>,Transition<E,V>>(){
          @Override public Transition<E,V> apply(          GraphEdge<V,E> edge){
            V oppositeVertex=edge.getVertex1().equals(state) ? edge.getVertex2() : edge.getVertex1();
            return Transition.create(state,edge.getEdgeValue(),oppositeVertex);
          }
        }
);
      }
    }
;
  }
  return new WeightType<E>(tf);
}
Program: 17199
Project: 17199
Buggy source:
@Override public Iterable<Transition<GraphEdge<City,Double>,City>> transitionsFrom(City fromCity){
  Set<Transition<GraphEdge<City,Double>,City>> successors=new HashSet<Transition<GraphEdge<City,Double>,City>>();
  for (  GraphEdge<City,Double> edge : graph.edgesOf(fromCity)) {
    City toCity=edge.getVertex1().equals(fromCity) ? edge.getVertex2() : fromCity;
    successors.add(Transition.create(fromCity,edge,toCity));
  }
  return successors;
}

Fixed version (ground truth):
@Override public Iterable<Transition<GraphEdge<City,Double>,City>> transitionsFrom(City fromCity){
  Set<Transition<GraphEdge<City,Double>,City>> successors=new HashSet<Transition<GraphEdge<City,Double>,City>>();
  for (  GraphEdge<City,Double> edge : graph.edgesOf(fromCity)) {
    City toCity=edge.getVertexAdjacentTo(fromCity);
    successors.add(Transition.create(fromCity,edge,toCity));
  }
  return successors;
}
Program: 17200
Project: 17200
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  testGraph=GraphBuilder.newGraph().connect("String_Node_Str").to("String_Node_Str").withEdge(4d).connect("String_Node_Str").to("String_Node_Str").withEdge(2d).connect("String_Node_Str").to("String_Node_Str").withEdge(5d).connect("String_Node_Str").to("String_Node_Str").withEdge(10d).connect("String_Node_Str").to("String_Node_Str").withEdge(3d).connect("String_Node_Str").to("String_Node_Str").withEdge(11d).connect("String_Node_Str").to("String_Node_Str").withEdge(4d).buildDirectedGraph();
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  testGraph=GraphBuilder.create().connect("String_Node_Str").to("String_Node_Str").withEdge(4d).connect("String_Node_Str").to("String_Node_Str").withEdge(2d).connect("String_Node_Str").to("String_Node_Str").withEdge(5d).connect("String_Node_Str").to("String_Node_Str").withEdge(10d).connect("String_Node_Str").to("String_Node_Str").withEdge(3d).connect("String_Node_Str").to("String_Node_Str").withEdge(11d).connect("String_Node_Str").to("String_Node_Str").withEdge(4d).buildDirectedGraph();
}
Program: 17201
Project: 17201
Buggy source:
@Test public void negativeCycleTest(){
  HipsterDirectedGraph<String,Double> graph=GraphBuilder.newGraph().connect("String_Node_Str").to("String_Node_Str").withEdge(1d).connect("String_Node_Str").to("String_Node_Str").withEdge(1d).connect("String_Node_Str").to("String_Node_Str").withEdge(-2d).connect("String_Node_Str").to("String_Node_Str").withEdge(1d).buildDirectedGraph();
}

Fixed version (ground truth):
@Test public void negativeCycleTest(){
  HipsterDirectedGraph<String,Double> graph=GraphBuilder.create().connect("String_Node_Str").to("String_Node_Str").withEdge(1d).connect("String_Node_Str").to("String_Node_Str").withEdge(1d).connect("String_Node_Str").to("String_Node_Str").withEdge(-2d).connect("String_Node_Str").to("String_Node_Str").withEdge(1d).buildDirectedGraph();
}
Program: 17202
Project: 17202
Buggy source:
@Test public void test(){
  HipsterDirectedGraph<String,String> graph=GraphBuilder.newGraph().connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").buildDirectedGraph();
  Hipster.createDepthFirstSearch(GraphSearchProblem.from("String_Node_Str").to("String_Node_Str").in(graph).withoutCosts()).search(new Algorithm.SearchListener<UnweightedNode<String,String>>(){
    @Override public void handle(    UnweightedNode<String,String> node){
      System.out.println(node);
    }
  }
);
}

Fixed version (ground truth):
@Test public void test(){
  HipsterDirectedGraph<String,String> graph=GraphBuilder.create().connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").connect("String_Node_Str").to("String_Node_Str").withEdge("String_Node_Str").buildDirectedGraph();
  Hipster.createDepthFirstSearch(GraphSearchProblem.from("String_Node_Str").to("String_Node_Str").in(graph).withoutCosts()).search(new Algorithm.SearchListener<UnweightedNode<String,String>>(){
    @Override public void handle(    UnweightedNode<String,String> node){
      System.out.println(node);
    }
  }
);
}
Program: 17203
Project: 17203
Buggy source:
@Test public void test(){
  final HipsterDirectedGraph<String,Cost> graph=GraphBuilder.newGraph().connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(7d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(1d,7d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(8d,4d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,2d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(1d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(6d,4d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,2d)).buildDirectedGraph();
  BinaryFunction<Cost> f=new BinaryFunction<Cost>(){
    @Override public Cost apply(    Cost a,    Cost b){
      return new Cost(a.c1 + b.c1,a.c2 + b.c2);
    }
  }
;
  Cost identity=new Cost(0d,0d);
  Cost max=new Cost(Double.POSITIVE_INFINITY,Double.POSITIVE_INFINITY);
  BinaryOperation<Cost> bf=new BinaryOperation<Cost>(f,identity,max);
  System.out.println(Hipster.createMultiobjectiveLS(GraphSearchProblem.from("String_Node_Str").to("String_Node_Str").in(graph).withGenericCosts(bf)).search());
}

Fixed version (ground truth):
@Test public void test(){
  final HipsterDirectedGraph<String,Cost> graph=GraphBuilder.create().connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(7d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(1d,7d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(8d,4d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,2d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(1d,1d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(6d,4d)).connect("String_Node_Str").to("String_Node_Str").withEdge(new Cost(2d,2d)).buildDirectedGraph();
  BinaryFunction<Cost> f=new BinaryFunction<Cost>(){
    @Override public Cost apply(    Cost a,    Cost b){
      return new Cost(a.c1 + b.c1,a.c2 + b.c2);
    }
  }
;
  Cost identity=new Cost(0d,0d);
  Cost max=new Cost(Double.POSITIVE_INFINITY,Double.POSITIVE_INFINITY);
  BinaryOperation<Cost> bf=new BinaryOperation<Cost>(f,identity,max);
  System.out.println(Hipster.createMultiobjectiveLS(GraphSearchProblem.from("String_Node_Str").to("String_Node_Str").in(graph).withGenericCosts(bf)).search());
}
Program: 17204
Project: 17204
Buggy source:
private EHCIter(){
  N initial=factory.makeNode(null,Transition.<A,S>create(null,initialState));
  bestHeuristic=heuristicFunction.estimate(initialState);
  queue.add(initial);
}

Fixed version (ground truth):
private EHCIter(){
  N initial=factory.makeNode(null,new Transition<A,S>(null,null,initialState));
  bestHeuristic=heuristicFunction.estimate(initialState);
  queue.add(initial);
}
Program: 17205
Project: 17205
Buggy source:
public Transition(S fromState,A action,S state){
  this.fromState=fromState;
  this.action=action;
  this.state=state;
}

Fixed version (ground truth):
public Transition(S fromState,A action,S toState){
  this.fromState=fromState;
  this.action=action;
  this.state=toState;
}
Program: 17206
Project: 17206
Buggy source:
public static <A,S>Transition<A,S> create(A action,S state){
  return new Transition<A,S>(action,state);
}

Fixed version (ground truth):
public static <S>Transition<Void,S> create(S fromState,S toState){
  return new Transition<Void,S>(fromState,null,toState);
}
Program: 17207
Project: 17207
Buggy source:
/** 
 * Define a cost function. This immediately defines an InformedSearchProblem
 * @param cf
 */
public <C extends Comparable<C>>InformedSearchProblemBuilder<C> useCostFunction(CostFunction<A,S,C> cf){
  return new InformedSearchProblemBuilder<C>(cf);
}

Fixed version (ground truth):
/** 
 * Define a cost function. This immediately defines an InformedSearchProblem
 * @param cf
 */
public InformedSearchProblemBuilder useCostFunction(CostFunction<A,S,Double> cf){
  return new InformedSearchProblemBuilder(cf);
}