nus-yam/ex-repair huggingface dataset:
Program: 161854
Project: 161854
Buggy source:
public String NIFGerbil(InputStream input,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document;
  String nifDocument="String_Node_Str";
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  try {
    document=parser.getDocumentFromNIFStream(input);
    log.info("String_Node_Str");
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    results=results(d,agdistis,"String_Node_Str");
    for (    NamedEntityInText namedEntity : results.keySet()) {
      String disambiguatedURL=results.get(namedEntity);
      if (disambiguatedURL == null) {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),new HashSet<String>()));
      }
 else {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),URLDecoder.decode(disambiguatedURL,"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
    log.debug(nifDocument);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}

Fixed version (ground truth):
public String NIFGerbil(InputStream input,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document;
  String nifDocument="String_Node_Str";
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  try {
    document=parser.getDocumentFromNIFStream(input);
    log.info("String_Node_Str");
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    agdistis.run(d,null);
    for (    NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
      String disambiguatedURL=namedEntity.getNamedEntityUri();
      if (disambiguatedURL == null) {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),new HashSet<String>()));
      }
 else {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),URLDecoder.decode(namedEntity.getNamedEntityUri(),"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
    log.debug(nifDocument);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}
Program: 161855
Project: 161855
Buggy source:
public String NIFType(String text,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document=null;
  String nifDocument="String_Node_Str";
  NIFParser nifParser=new NIFParser();
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  try {
    document=parser.getDocumentFromNIFString(text);
    log.debug("String_Node_Str" + document.toString());
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    results=results(d,agdistis,"String_Node_Str");
    for (    NamedEntityInText namedEntity : results.keySet()) {
      String disambiguatedURL=results.get(namedEntity);
      if (disambiguatedURL == null) {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),new HashSet<String>()));
      }
 else {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),URLDecoder.decode(disambiguatedURL,"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}

Fixed version (ground truth):
public String NIFType(String text,NEDAlgo_HITS agdistis) throws IOException {
  org.aksw.gerbil.transfer.nif.Document document=null;
  String nifDocument="String_Node_Str";
  NIFParser nifParser=new NIFParser();
  String textWithMentions="String_Node_Str";
  List<MeaningSpan> annotations=new ArrayList<>();
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  try {
    document=parser.getDocumentFromNIFString(text);
    log.debug("String_Node_Str" + document.toString());
    textWithMentions=nifParser.createTextWithMentions(document.getText(),document.getMarkings(Span.class));
    Document d=textToDocument(textWithMentions);
    agdistis.run(d,null);
    for (    NamedEntityInText namedEntity : d.getNamedEntitiesInText()) {
      String disambiguatedURL=namedEntity.getNamedEntityUri();
      if (disambiguatedURL == null) {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),new HashSet<String>()));
      }
 else {
        annotations.add(new NamedEntity((int)namedEntity.getStartPos(),(int)namedEntity.getLength(),URLDecoder.decode(disambiguatedURL,"String_Node_Str")));
      }
    }
    document.setMarkings(new ArrayList<Marking>(annotations));
    log.debug("String_Node_Str" + document.toString());
    nifDocument=creator.getDocumentAsNIFString(document);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return "String_Node_Str";
  }
  return nifDocument;
}
Program: 161856
Project: 161856
Buggy source:
/** 
 * Creates a root Restlet that will receive all incoming calls.
 */
@Override public Restlet createInboundRoot(){
  Router router=new Router(getContext());
  router.attachDefault(GetDisambiguation.class);
  System.gc();
  return router;
}

Fixed version (ground truth):
/** 
 * Creates a root Restlet that will receive all incoming calls.
 */
@Override public Restlet createInboundRoot(){
  final Router router=new Router(getContext());
  router.attach("String_Node_Str",GetDisambiguation.class);
  return router;
}
Program: 161858
Project: 161858
Buggy source:
public static Document textToDocument(String preAnnotatedText){
  Document document=new Document();
  ArrayList<NamedEntityInText> list=new ArrayList<NamedEntityInText>();
  log.info("String_Node_Str" + preAnnotatedText);
  int startpos=0, endpos=0;
  StringBuilder sb=new StringBuilder();
  startpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
  while (startpos >= 0) {
    sb.append(preAnnotatedText.substring(endpos,startpos));
    startpos+=8;
    endpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
    int newStartPos=sb.length();
    String entityLabel=preAnnotatedText.substring(startpos,endpos);
    list.add(new NamedEntityInText(newStartPos,entityLabel.length(),entityLabel));
    sb.append(entityLabel);
    endpos+=9;
    startpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
  }
  NamedEntitiesInText nes=new NamedEntitiesInText(list);
  DocumentText text=new DocumentText(preAnnotatedText.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
  document.addTest(text);
  document.addNamedEntitiesInText(nes);
  return document;
}

Fixed version (ground truth):
public static Document textToDocument(String preAnnotatedText){
  Document document=new Document();
  ArrayList<NamedEntityInText> list=new ArrayList<NamedEntityInText>();
  log.info("String_Node_Str" + preAnnotatedText);
  int startpos=0, endpos=0;
  StringBuilder sb=new StringBuilder();
  startpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
  while (startpos >= 0) {
    sb.append(preAnnotatedText.substring(endpos,startpos));
    startpos+=8;
    endpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
    int newStartPos=sb.length();
    String entityLabel=preAnnotatedText.substring(startpos,endpos);
    list.add(new NamedEntityInText(newStartPos,entityLabel.length(),entityLabel));
    sb.append(entityLabel);
    endpos+=9;
    startpos=preAnnotatedText.indexOf("String_Node_Str",startpos);
  }
  NamedEntitiesInText nes=new NamedEntitiesInText(list);
  DocumentText text=new DocumentText(preAnnotatedText.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str"));
  document.addText(text);
  document.addNamedEntitiesInText(nes);
  return document;
}
Program: 161861
Project: 161861
Buggy source:
public List<Triple> getLabelForURI(String subject){
  if (cache.containsKey(subject)) {
    return cache.get(subject);
  }
  parser=new QueryParser(Version.LUCENE_40,FIELD_NAME_URL,analyzer);
  parser.setDefaultOperator(QueryParser.Operator.AND);
  analyzer=new KeywordAnalyzer();
  List<Triple> triples=new ArrayList<Triple>();
  try {
    log.debug("String_Node_Str");
    TermQuery tq=new TermQuery(new Term(FIELD_NAME_URL,subject));
    BooleanQuery bq=new BooleanQuery();
    bq.add(tq,BooleanClause.Occur.SHOULD);
    TopScoreDocCollector collector=TopScoreDocCollector.create(numberOfDocsRetrievedFromIndex,true);
    isearcher.search(bq,collector);
    ScoreDoc[] hits=collector.topDocs().scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String object=java.net.URLDecoder.decode(hitDoc.get(FIELD_NAME_LABEL),"String_Node_Str");
      String predicate="String_Node_Str";
      triples.add(new Triple(subject,predicate,object));
    }
    log.debug("String_Node_Str");
  }
 catch (  Exception e) {
    log.warn(e.getLocalizedMessage() + "String_Node_Str" + subject);
  }
  cache.put(subject,triples);
  return triples;
}

Fixed version (ground truth):
public List<Triple> getLabelForURI(String subject){
  if (cache.containsKey(subject)) {
    return cache.get(subject);
  }
  analyzer=new KeywordAnalyzer();
  parser=new QueryParser(Version.LUCENE_40,FIELD_NAME_URL,analyzer);
  parser.setDefaultOperator(QueryParser.Operator.AND);
  List<Triple> triples=new ArrayList<Triple>();
  try {
    log.debug("String_Node_Str");
    int lastIndexOf="String_Node_Str".length();
    String substring=subject.substring(lastIndexOf);
    subject="String_Node_Str" + URLEncoder.encode(substring,"String_Node_Str");
    System.out.println(subject);
    TermQuery tq=new TermQuery(new Term(FIELD_NAME_URL,subject));
    BooleanQuery bq=new BooleanQuery();
    bq.add(tq,BooleanClause.Occur.SHOULD);
    TopScoreDocCollector collector=TopScoreDocCollector.create(numberOfDocsRetrievedFromIndex,true);
    isearcher.search(bq,collector);
    ScoreDoc[] hits=collector.topDocs().scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String object=java.net.URLDecoder.decode(hitDoc.get(FIELD_NAME_LABEL),"String_Node_Str");
      System.out.println(object);
      String predicate="String_Node_Str";
      triples.add(new Triple(subject,predicate,object));
    }
    log.debug("String_Node_Str");
  }
 catch (  Exception e) {
    log.warn(e.getLocalizedMessage() + "String_Node_Str" + subject);
  }
  cache.put(subject,triples);
  return triples;
}
Program: 161862
Project: 161862
Buggy source:
public List<Triple> searchInLabels(String object,boolean replaceObject){
  if (cacheSearch.containsKey(object)) {
    return cacheSearch.get(object);
  }
  List<Triple> triples=new ArrayList<Triple>();
  try {
    analyzer=new StandardAnalyzer(Version.LUCENE_40);
    parser=new QueryParser(Version.LUCENE_40,FIELD_NAME_LABEL,analyzer);
    parser.setDefaultOperator(QueryParser.Operator.OR);
    Query query=parser.parse(QueryParser.escape(object));
    ScoreDoc[] hits=isearcher.search(query,numberOfDocsRetrievedFromIndex).scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String subject=java.net.URLDecoder.decode(hitDoc.get(FIELD_NAME_URL),"String_Node_Str");
      String predicate="String_Node_Str";
      if (replaceObject)       object=hitDoc.get(FIELD_NAME_LABEL);
      triples.add(new Triple(subject,predicate,object));
    }
  }
 catch (  Exception e) {
    log.error(e.getLocalizedMessage() + "String_Node_Str" + object);
  }
  cache.put(object,triples);
  return triples;
}

Fixed version (ground truth):
public List<Triple> searchInLabels(String object,boolean replaceObject){
  if (cacheSearch.containsKey(object)) {
    return cacheSearch.get(object);
  }
  List<Triple> triples=new ArrayList<Triple>();
  try {
    analyzer=new StandardAnalyzer(Version.LUCENE_40);
    parser=new QueryParser(Version.LUCENE_40,FIELD_NAME_LABEL,analyzer);
    parser.setDefaultOperator(QueryParser.Operator.OR);
    Query query=parser.parse(QueryParser.escape(object));
    ScoreDoc[] hits=isearcher.search(query,numberOfDocsRetrievedFromIndex).scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String subject=java.net.URLDecoder.decode(hitDoc.get(FIELD_NAME_URL),"String_Node_Str");
      String predicate="String_Node_Str";
      String o=hitDoc.get(FIELD_NAME_LABEL);
      if (replaceObject)       object=hitDoc.get(FIELD_NAME_LABEL);
      triples.add(new Triple(subject,predicate,o));
    }
  }
 catch (  Exception e) {
    log.error(e.getLocalizedMessage() + "String_Node_Str" + object);
  }
  cache.put(object,triples);
  return triples;
}
Program: 161863
Project: 161863
Buggy source:
public HashMap<NamedEntityInText,String> runDisambiguation(String preAnnotatedText) throws IOException {
  double threshholdTrigram=0.825;
  int maxDepth=2;
  Document document=new Document();
  ArrayList<NamedEntityInText> list=new ArrayList<NamedEntityInText>();
  log.info("String_Node_Str" + preAnnotatedText);
  for (int c=0; c < preAnnotatedText.length(); c++) {
    if (preAnnotatedText.length() > c + 8) {
      if (preAnnotatedText.substring(c,c + 8).equals("String_Node_Str")) {
        c+=8;
        int beginIndex=c;
        int endIndex=preAnnotatedText.indexOf("String_Node_Str",c);
        String label=preAnnotatedText.substring(beginIndex,endIndex);
        log.info("String_Node_Str" + beginIndex + "String_Node_Str"+ endIndex+ "String_Node_Str"+ label);
        list.add(new NamedEntityInText(beginIndex,endIndex - beginIndex,label));
      }
    }
  }
  NamedEntitiesInText nes=new NamedEntitiesInText(list);
  DocumentText text=new DocumentText(preAnnotatedText);
  document.addProperty(text);
  document.addProperty(nes);
  algo.run(document,threshholdTrigram,maxDepth);
  NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  for (  NamedEntityInText namedEntity : namedEntities) {
    String disambiguatedURL=algo.findResult(namedEntity);
    results.put(namedEntity,disambiguatedURL);
  }
  return results;
}

Fixed version (ground truth):
public HashMap<NamedEntityInText,String> runDisambiguation(String preAnnotatedText) throws IOException {
  double threshholdTrigram=1;
  int maxDepth=2;
  Document document=new Document();
  ArrayList<NamedEntityInText> list=new ArrayList<NamedEntityInText>();
  log.info("String_Node_Str" + preAnnotatedText);
  for (int c=0; c < preAnnotatedText.length(); c++) {
    if (preAnnotatedText.length() > c + 8) {
      if (preAnnotatedText.substring(c,c + 8).equals("String_Node_Str")) {
        c+=8;
        int beginIndex=c;
        int endIndex=preAnnotatedText.indexOf("String_Node_Str",c);
        String label=preAnnotatedText.substring(beginIndex,endIndex);
        log.info("String_Node_Str" + beginIndex + "String_Node_Str"+ endIndex+ "String_Node_Str"+ label);
        list.add(new NamedEntityInText(beginIndex,endIndex - beginIndex,label));
      }
    }
  }
  NamedEntitiesInText nes=new NamedEntitiesInText(list);
  DocumentText text=new DocumentText(preAnnotatedText);
  document.addProperty(text);
  document.addProperty(nes);
  algo.run(document,threshholdTrigram,maxDepth);
  NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
  HashMap<NamedEntityInText,String> results=new HashMap<NamedEntityInText,String>();
  for (  NamedEntityInText namedEntity : namedEntities) {
    String disambiguatedURL=algo.findResult(namedEntity);
    results.put(namedEntity,disambiguatedURL);
  }
  return results;
}
Program: 161864
Project: 161864
Buggy source:
@Test public void testUmlaute() throws InterruptedException, IOException {
  String osumi="String_Node_Str";
  String movie="String_Node_Str";
  String preAnnotatedText="String_Node_Str" + osumi + "String_Node_Str"+ movie+ "String_Node_Str";
  String modelDirectory="String_Node_Str";
  AGDISTIS agdistis=new AGDISTIS(modelDirectory);
  HashMap<NamedEntityInText,String> results=agdistis.runDisambiguation(preAnnotatedText);
  for (  NamedEntityInText namedEntity : results.keySet()) {
    String disambiguatedURL=results.get(namedEntity);
    System.out.println(disambiguatedURL);
  }
}

Fixed version (ground truth):
@Test public void testUmlaute() throws InterruptedException, IOException {
  String osumi="String_Node_Str";
  String osumiURL="String_Node_Str";
  String movie="String_Node_Str";
  String movieURL="String_Node_Str";
  HashMap<String,String> correct=new HashMap<String,String>();
  correct.put(osumi,osumiURL);
  correct.put(movie,movieURL);
  String preAnnotatedText="String_Node_Str" + osumi + "String_Node_Str"+ movie+ "String_Node_Str";
  String modelDirectory="String_Node_Str";
  AGDISTIS agdistis=new AGDISTIS(modelDirectory);
  HashMap<NamedEntityInText,String> results=agdistis.runDisambiguation(preAnnotatedText);
  for (  NamedEntityInText namedEntity : results.keySet()) {
    String disambiguatedURL=results.get(namedEntity);
    System.out.println(namedEntity.getLabel() + "String_Node_Str" + disambiguatedURL);
    assertTrue(correct.get(namedEntity.getLabel()).equals(disambiguatedURL));
  }
}
Program: 161866
Project: 161866
Buggy source:
public String redirect(String candidateURL){
  List<Triple> redirect=index.search(candidateURL,"String_Node_Str",null);
  if (redirect.size() == 1) {
    return redirect.get(0).getObject();
  }
 else   if (redirect.size() > 1) {
    log.error("String_Node_Str" + candidateURL);
    return candidateURL;
  }
 else {
    return candidateURL;
  }
}

Fixed version (ground truth):
public String redirect(String candidateURL){
  List<Triple> redirect=index.search(candidateURL,"String_Node_Str",null);
  if (redirect.size() == 1) {
    return redirect.get(0).getObject();
  }
 else   if (redirect.size() > 1) {
    log.warn("String_Node_Str" + candidateURL);
    return candidateURL;
  }
 else {
    return candidateURL;
  }
}
Program: 161869
Project: 161869
Buggy source:
public static void main(String[] args) throws IOException {
  String languageTag="String_Node_Str";
  File dataDirectory=new File("String_Node_Str");
  String nodeType="String_Node_Str";
  String edgeType="String_Node_Str";
  for (  String TestFile : new String[]{"String_Node_Str"}) {
    CorpusXmlReader reader=new CorpusXmlReader(new File(TestFile));
    Corpus corpus=reader.getCorpus();
    log.info("String_Node_Str" + corpus.getNumberOfDocuments());
    DisambiguationAlgorithm algo=new NEDAlgo_HITS(dataDirectory,nodeType,edgeType);
    for (int maxDepth=2; maxDepth <= 2; ++maxDepth) {
      algo.setMaxDepth(maxDepth);
      for (double threshholdTrigram=1; threshholdTrigram > 0.994; threshholdTrigram-=0.01) {
        algo.setThreshholdTrigram(threshholdTrigram);
        Evaluator ev=new Evaluator(languageTag,corpus,algo);
        ev.setThreshholdTrigram(threshholdTrigram);
        ev.fmeasure();
        System.gc();
      }
    }
    algo.close();
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  String languageTag="String_Node_Str";
  File dataDirectory=new File("String_Node_Str");
  String nodeType="String_Node_Str";
  String edgeType="String_Node_Str";
  for (  String TestFile : new String[]{"String_Node_Str"}) {
    CorpusXmlReader reader=new CorpusXmlReader(new File(TestFile));
    Corpus corpus=reader.getCorpus();
    log.info("String_Node_Str" + corpus.getNumberOfDocuments());
    DisambiguationAlgorithm algo=new NEDAlgo_HITS(dataDirectory,nodeType,edgeType);
    for (int maxDepth=2; maxDepth <= 2; ++maxDepth) {
      algo.setMaxDepth(maxDepth);
      for (double threshholdTrigram=1; threshholdTrigram > 0.7; threshholdTrigram-=0.01) {
        algo.setThreshholdTrigram(threshholdTrigram);
        Evaluator ev=new Evaluator(languageTag,corpus,algo);
        ev.setThreshholdTrigram(threshholdTrigram);
        ev.fmeasure();
        System.gc();
      }
    }
    algo.close();
  }
}
Program: 161870
Project: 161870
Buggy source:
public TripleIndex(File indexDirectory){
  try {
    directory=new MMapDirectory(indexDirectory);
    ireader=DirectoryReader.open(directory);
    isearcher=new IndexSearcher(ireader);
    cache=new HashMap<String,List<Triple>>();
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public TripleIndex(File indexDirectory){
  try {
    directory=new MMapDirectory(indexDirectory);
    ireader=DirectoryReader.open(directory);
    isearcher=new IndexSearcher(ireader);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
}
Program: 161871
Project: 161871
Buggy source:
public List<Triple> search(String subject,String predicate,String object){
  List<Triple> triples=new ArrayList<Triple>();
  BooleanQuery bq=new BooleanQuery();
  try {
    if (cache.containsKey(subject + predicate + object)) {
      return cache.get(subject + predicate + object);
    }
    log.debug("String_Node_Str");
    if (subject != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_SUBJECT,subject));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    if (predicate != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_PREDICATE,predicate));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    if (object != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_OBJECT,object));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    TopScoreDocCollector collector=TopScoreDocCollector.create(numberOfDocsRetrievedFromIndex,true);
    isearcher.search(bq,collector);
    ScoreDoc[] hits=collector.topDocs().scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String s=hitDoc.get(FIELD_NAME_SUBJECT);
      String p=hitDoc.get(FIELD_NAME_PREDICATE);
      String o=hitDoc.get(FIELD_NAME_OBJECT);
      triples.add(new Triple(s,p,o));
    }
    log.debug("String_Node_Str");
    cache.put(subject + predicate + object,triples);
  }
 catch (  Exception e) {
    log.warn(e.getLocalizedMessage() + "String_Node_Str" + subject);
  }
  return triples;
}

Fixed version (ground truth):
public List<Triple> search(String subject,String predicate,String object){
  List<Triple> triples=new ArrayList<Triple>();
  BooleanQuery bq=new BooleanQuery();
  try {
    log.debug("String_Node_Str");
    if (subject != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_SUBJECT,subject));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    if (predicate != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_PREDICATE,predicate));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    if (object != null) {
      TermQuery tq=new TermQuery(new Term(FIELD_NAME_OBJECT,object));
      bq.add(tq,BooleanClause.Occur.MUST);
    }
    TopScoreDocCollector collector=TopScoreDocCollector.create(numberOfDocsRetrievedFromIndex,true);
    isearcher.search(bq,collector);
    ScoreDoc[] hits=collector.topDocs().scoreDocs;
    for (int i=0; i < hits.length; i++) {
      Document hitDoc=isearcher.doc(hits[i].doc);
      String s=hitDoc.get(FIELD_NAME_SUBJECT);
      String p=hitDoc.get(FIELD_NAME_PREDICATE);
      String o=hitDoc.get(FIELD_NAME_OBJECT);
      triples.add(new Triple(s,p,o));
    }
    log.debug("String_Node_Str");
  }
 catch (  Exception e) {
    log.warn(e.getLocalizedMessage() + "String_Node_Str" + subject);
  }
  return triples;
}
Program: 161873
Project: 161873
Buggy source:
public Node(String uri,double activation,int level){
  this.candidateURI=uri;
  this.activation=activation;
  this.level=level;
  this.HubWeight=1;
  this.AuthorityWeight=1;
  ids=new HashSet<Integer>();
  this.successors=new HashSet<Node>();
  this.predecessors=new HashSet<Node>();
}

Fixed version (ground truth):
public Node(String uri,double activation,int level){
  this.candidateURI=uri;
  this.activation=activation;
  this.level=level;
  this.hubWeight=1;
  this.authorityWeight=1;
  ids=new HashSet<Integer>();
  this.successors=new HashSet<Node>();
  this.predecessors=new HashSet<Node>();
}
Program: 161874
Project: 161874
Buggy source:
public double getAuthorityWeight(){
  return AuthorityWeight;
}

Fixed version (ground truth):
public double getAuthorityWeight(){
  return authorityWeight;
}
Program: 161875
Project: 161875
Buggy source:
public double getHubWeight(){
  return HubWeight;
}

Fixed version (ground truth):
public double getHubWeight(){
  return hubWeight;
}
Program: 161876
Project: 161876
Buggy source:
@Override public String toString(){
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  return candidateURI.replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + String.valueOf(df.format(activation))+ "String_Node_Str"+ String.valueOf(df.format(HubWeight))+ "String_Node_Str"+ String.valueOf(df.format(AuthorityWeight));
}

Fixed version (ground truth):
@Override public String toString(){
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  return candidateURI.replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + String.valueOf(df.format(activation))+ "String_Node_Str"+ String.valueOf(df.format(hubWeight))+ "String_Node_Str"+ String.valueOf(df.format(authorityWeight));
}
Program: 161877
Project: 161877
Buggy source:
public void setAuthorityWeight(double x){
  this.AuthorityWeight=x;
}

Fixed version (ground truth):
public void setAuthorityWeight(double x){
  this.authorityWeight=x;
}
Program: 161878
Project: 161878
Buggy source:
public void setHubWeight(double y){
  this.HubWeight=y;
}

Fixed version (ground truth):
public void setHubWeight(double y){
  this.hubWeight=y;
}
Program: 161880
Project: 161880
Buggy source:
private boolean checkSurfaceFormsCandidates(DirectedSparseGraph<MyNode,String> graph,HashMap<String,MyNode> nodes,double threshholdTrigram,NamedEntityInText entity,String label,String knowledgeBase){
  boolean addedCandidates=false;
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=surfaceFormIndex.searchInLabels(label,true);
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=surfaceFormIndex.searchInLabels(label,true);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=surfaceFormIndex.searchInLabels(label,true);
      log.info("String_Node_Str");
    }
  }
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    log.debug("String_Node_Str" + candidateURL);
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (disambiguates(candidateURL) != candidateURL) {
        continue;
      }
      if (trigramLabelLabel(c.getObject(),label,nodeType) < threshholdTrigram) {
        continue;
      }
      candidateURL=redirect(candidateURL);
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        addedCandidates=true;
      }
    }
  }
  return addedCandidates;
}

Fixed version (ground truth):
private boolean checkSurfaceFormsCandidates(DirectedSparseGraph<MyNode,String> graph,HashMap<String,MyNode> nodes,double threshholdTrigram,NamedEntityInText entity,String label,String knowledgeBase){
  boolean addedCandidates=false;
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=surfaceFormIndex.searchInLabels(label,true);
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=surfaceFormIndex.searchInLabels(label,true);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=surfaceFormIndex.searchInLabels(label,true);
      log.info("String_Node_Str");
    }
  }
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    log.debug("String_Node_Str" + candidateURL);
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (disambiguates(candidateURL) != candidateURL) {
        continue;
      }
      if (trigramLabelLabel(c.getObject(),label,nodeType) < threshholdTrigram) {
        continue;
      }
      if (!nodeType.equals("String_Node_Str")) {
        candidateURL=redirect(candidateURL);
      }
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        addedCandidates=true;
      }
    }
  }
  return addedCandidates;
}
Program: 161881
Project: 161881
Buggy source:
public void insertCandidatesIntoText(DirectedSparseGraph<MyNode,String> graph,Document document,double threshholdTrigram){
  NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
  String text=document.getProperty(DocumentText.class).getText();
  HashSet<String> heuristicExpansion=new HashSet<String>();
  Collections.sort(namedEntities.getNamedEntities(),new NamedEntityLengthComparator());
  Collections.reverse(namedEntities.getNamedEntities());
  HashMap<String,MyNode> nodes=new HashMap<String,MyNode>();
  for (  NamedEntityInText entity : namedEntities) {
    String label=text.substring(entity.getStartPos(),entity.getEndPos());
    log.info(label);
    String tmp=label;
    boolean expansion=false;
    for (    String key : heuristicExpansion) {
      if (key.contains(label)) {
        if (tmp.length() > key.length() && tmp != label) {
          tmp=key;
          expansion=true;
          log.debug("String_Node_Str" + label + "String_Node_Str"+ key);
        }
        if (tmp.length() < key.length() && tmp == label) {
          tmp=key;
          expansion=true;
          log.debug("String_Node_Str" + label + "String_Node_Str"+ key);
        }
      }
    }
    label=tmp;
    if (!expansion) {
      heuristicExpansion.add(label);
    }
    checkRdfsLabelCandidates(graph,threshholdTrigram,nodes,entity,label,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void insertCandidatesIntoText(DirectedSparseGraph<MyNode,String> graph,Document document,double threshholdTrigram){
  NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
  String text=document.getProperty(DocumentText.class).getText();
  HashSet<String> heuristicExpansion=new HashSet<String>();
  Collections.sort(namedEntities.getNamedEntities(),new NamedEntityLengthComparator());
  Collections.reverse(namedEntities.getNamedEntities());
  HashMap<String,MyNode> nodes=new HashMap<String,MyNode>();
  for (  NamedEntityInText entity : namedEntities) {
    String label=text.substring(entity.getStartPos(),entity.getEndPos());
    log.info(label);
    String tmp=label;
    boolean expansion=false;
    for (    String key : heuristicExpansion) {
      if (key.contains(label)) {
        if (tmp.length() > key.length() && tmp != label) {
          tmp=key;
          expansion=true;
          log.debug("String_Node_Str" + label + "String_Node_Str"+ key);
        }
        if (tmp.length() < key.length() && tmp == label) {
          tmp=key;
          expansion=true;
          log.debug("String_Node_Str" + label + "String_Node_Str"+ key);
        }
      }
    }
    label=tmp;
    if (!expansion) {
      heuristicExpansion.add(label);
    }
    if (nodeType.equals("String_Node_Str")) {
      checkRdfsLabelCandidates(graph,threshholdTrigram,nodes,entity,label,nodeType);
    }
 else {
      if (!checkRdfsLabelCandidates(graph,threshholdTrigram,nodes,entity,label,"String_Node_Str"))       checkSurfaceFormsCandidates(graph,nodes,threshholdTrigram,entity,label,"String_Node_Str");
    }
  }
}
Program: 161882
Project: 161882
Buggy source:
private boolean checkRdfsLabelCandidates(DirectedSparseGraph<MyNode,String> graph,double threshholdTrigram,HashMap<String,MyNode> nodes,NamedEntityInText entity,String label,String knowledgeBase){
  boolean addedCandidates=false;
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=rdfsLabelIndex.searchInLabels(label,false);
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=rdfsLabelIndex.searchInLabels(label,false);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=rdfsLabelIndex.searchInLabels(label,false);
      log.info("String_Node_Str");
    }
  }
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (disambiguates(candidateURL) != candidateURL) {
        continue;
      }
      if (trigramForURLLabel(candidateURL,label,nodeType) < threshholdTrigram) {
        continue;
      }
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        addedCandidates=true;
      }
    }
  }
  return addedCandidates;
}

Fixed version (ground truth):
private boolean checkRdfsLabelCandidates(DirectedSparseGraph<MyNode,String> graph,double threshholdTrigram,HashMap<String,MyNode> nodes,NamedEntityInText entity,String label,String knowledgeBase){
  boolean addedCandidates=false;
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=rdfsLabelIndex.searchInLabels(label,false);
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=rdfsLabelIndex.searchInLabels(label,false);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=rdfsLabelIndex.searchInLabels(label,false);
      log.info("String_Node_Str");
    }
  }
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (disambiguates(candidateURL) != candidateURL) {
        continue;
      }
      if (trigramForURLLabel(candidateURL,label,nodeType) < threshholdTrigram) {
        continue;
      }
      if (!nodeType.equals("String_Node_Str")) {
        candidateURL=redirect(candidateURL);
      }
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        addedCandidates=true;
      }
    }
  }
  return addedCandidates;
}
Program: 161885
Project: 161885
Buggy source:
private void indexTTLFile(String file,String baseURI){
  try {
    log.info("String_Node_Str" + file);
    RDFParser parser=new TurtleParser();
    OnlineStatementHandler osh=new OnlineStatementHandler();
    parser.setRDFHandler(osh);
    parser.setStopAtFirstError(false);
    log.info("String_Node_Str" + file);
    parser.parse(new FileReader(file),baseURI);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
catch (  RDFParseException e) {
    log.error(e.getLocalizedMessage());
  }
catch (  RDFHandlerException e) {
    log.error(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
private void indexTTLFile(String file,String baseURI){
  try {
    log.info("String_Node_Str" + file);
    RDFParser parser=new TurtleParser();
    OnlineStatementHandler osh=new OnlineStatementHandler();
    parser.setRDFHandler(osh);
    parser.setStopAtFirstError(false);
    parser.parse(new FileReader(file),baseURI);
    log.info("String_Node_Str" + file);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
catch (  RDFParseException e) {
    log.error(e.getLocalizedMessage());
  }
catch (  RDFHandlerException e) {
    log.error(e.getLocalizedMessage());
  }
}
Program: 161886
Project: 161886
Buggy source:
private void addDocumentToIndex(String subject,String object){
  try {
    Document doc=new Document();
    doc.add(new StringField(FIELD_NAME_URL,subject,Store.YES));
    doc.add(new TextField(FIELD_NAME_LABEL,object,Store.YES));
    iwriter.addDocument(doc);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
private void addDocumentToIndex(String subject,String predicate,String object){
  try {
    if (subject.startsWith("String_Node_Str") && predicate.equals("String_Node_Str")) {
      Document doc=new Document();
      doc.add(new StringField(FIELD_NAME_URL,subject,Store.YES));
      doc.add(new TextField(FIELD_NAME_LABEL,object,Store.YES));
      iwriter.addDocument(doc);
    }
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage());
  }
}
Program: 161887
Project: 161887
Buggy source:
@Override public void handleStatement(Statement st){
  String subject=st.getSubject().stringValue();
  String object=st.getObject().stringValue();
  addDocumentToIndex(subject,object);
}

Fixed version (ground truth):
@Override public void handleStatement(Statement st){
  String subject=st.getSubject().stringValue();
  String predicate=st.getPredicate().stringValue();
  String object=st.getObject().stringValue();
  addDocumentToIndex(subject,predicate,object);
}
Program: 161892
Project: 161892
Buggy source:
/** 
 * Workaround to delete resources not used anymore by lawena, since Getdown does not support this out of the box.
 */
public void cleanupUnusedFiles(){
  try {
    Map<String,Object> config=ConfigUtil.parseConfig(new File("String_Node_Str"),false);
    String[] toDelete=(String[])ConfigUtil.getMultiValue(config,"String_Node_Str");
    for (    String path : toDelete) {
      try {
        if (Files.deleteIfExists(Paths.get(path))) {
          log.info("String_Node_Str" + path);
        }
      }
 catch (      IOException e) {
        log.log(Level.INFO,"String_Node_Str" + path,e);
      }
    }
  }
 catch (  IllegalArgumentException|IOException e) {
    log.info("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
private void cleanupUnusedFiles(){
  try {
    Map<String,Object> config=ConfigUtil.parseConfig(new File("String_Node_Str"),false);
    String[] toDelete=(String[])ConfigUtil.getMultiValue(config,"String_Node_Str");
    for (    String path : toDelete) {
      try {
        if (Files.deleteIfExists(Paths.get(path))) {
          log.info("String_Node_Str" + path);
        }
      }
 catch (      IOException e) {
        log.log(Level.INFO,"String_Node_Str" + path,e);
      }
    }
  }
 catch (  IllegalArgumentException|IOException e) {
    log.info("String_Node_Str" + e);
  }
}
Program: 161893
Project: 161893
Buggy source:
@Override public String getSystemDxLevel(){
  try {
    int result=regQueryNumber("String_Node_Str","String_Node_Str");
    return result + "String_Node_Str";
  }
 catch (  NumberFormatException e) {
    log.warning("String_Node_Str" + e.toString() + "String_Node_Str");
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String getSystemDxLevel(){
  try {
    String result=regQueryNumber("String_Node_Str","String_Node_Str");
    return result;
  }
 catch (  IndexOutOfBoundsException e) {
    log.warning("String_Node_Str" + e.toString() + "String_Node_Str");
    return "String_Node_Str";
  }
}
Program: 161894
Project: 161894
Buggy source:
private int regQueryNumber(String key,String value){
  String result=regQueryLine(key,value);
  int number=Integer.decode(result.substring(result.lastIndexOf("String_Node_Str"),result.indexOf("String_Node_Str",result.lastIndexOf("String_Node_Str"))));
  log.finer("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ number);
  return number;
}

Fixed version (ground truth):
private String regQueryNumber(String key,String value){
  String result=regQueryLine(key,value);
  result=result.substring(result.lastIndexOf("String_Node_Str") + 2,result.indexOf("String_Node_Str",result.lastIndexOf("String_Node_Str")));
  log.finer("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ result);
  return result;
}
Program: 161897
Project: 161897
Buggy source:
private static FileSystem createZipFileSystem(Path path,boolean create) throws IOException {
  final URI uri=URI.create("String_Node_Str" + path.toUri().getRawPath());
  final Map<String,String> env=new HashMap<>();
  if (create) {
    env.put("String_Node_Str","String_Node_Str");
  }
  return FileSystems.newFileSystem(uri,env);
}

Fixed version (ground truth):
private static FileSystem createZipFileSystem(Path path,boolean create) throws IOException {
  final URI uri=URI.create("String_Node_Str" + path.toUri());
  final Map<String,String> env=new HashMap<>();
  if (create) {
    env.put("String_Node_Str","String_Node_Str");
  }
  return FileSystems.newFileSystem(uri,env);
}
Program: 161898
Project: 161898
Buggy source:
@Override public boolean isRunningTF2(){
  boolean found=false;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str");
    Process pr=pb.start();
    BufferedReader input=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line;
    line=input.readLine();
    if (line != null) {
      found=true;
    }
    input.close();
  }
 catch (  IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
  return found;
}

Fixed version (ground truth):
@Override public boolean isRunningTF2(){
  boolean found=false;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str");
    Process pr=pb.start();
    try (BufferedReader input=newProcessReader(pr)){
      String line;
      line=input.readLine();
      if (line != null) {
        found=true;
      }
    }
   }
 catch (  IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
  return found;
}
Program: 161899
Project: 161899
Buggy source:
@Override public boolean isRunningTF2(){
  boolean found=false;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str");
    Process pr=pb.start();
    BufferedReader input=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line;
    line=input.readLine();
    if (line != null) {
      found=true;
    }
    input.close();
  }
 catch (  IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
  return found;
}

Fixed version (ground truth):
@Override public boolean isRunningTF2(){
  boolean found=false;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str");
    Process pr=pb.start();
    try (BufferedReader input=newProcessReader(pr)){
      String line;
      line=input.readLine();
      if (line != null) {
        found=true;
      }
    }
   }
 catch (  IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
  return found;
}
Program: 161900
Project: 161900
Buggy source:
@Override public void closeHandles(Path path){
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str",path.toString());
    Process pr=pb.start();
    BufferedReader input=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line;
    int count=0;
    while ((line=input.readLine()) != null) {
      if (count > 4) {
        String[] columns=line.split("String_Node_Str");
        if (columns.length == 4) {
          log.info("String_Node_Str" + columns[3] + "String_Node_Str"+ columns[0]);
          closeHandle(columns[1],columns[2]);
        }
 else {
          log.info("String_Node_Str" + line);
        }
      }
      count++;
    }
    pr.waitFor();
  }
 catch (  InterruptedException|IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void closeHandles(Path path){
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str",path.toString());
    Process pr=pb.start();
    try (BufferedReader input=newProcessReader(pr)){
      String line;
      int count=0;
      while ((line=input.readLine()) != null) {
        if (count > 4) {
          String[] columns=line.split("String_Node_Str");
          if (columns.length == 4) {
            log.info("String_Node_Str" + columns[3] + "String_Node_Str"+ columns[0]);
            closeHandle(columns[1],columns[2]);
          }
 else {
            log.info("String_Node_Str" + line);
          }
        }
        count++;
      }
    }
     pr.waitFor();
  }
 catch (  InterruptedException|IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
}
Program: 161901
Project: 161901
Buggy source:
@Override public void delete(Path path){
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",path.toString());
    Process pr=pb.start();
    BufferedReader input=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line;
    while ((line=input.readLine()) != null) {
      log.info("String_Node_Str" + line);
    }
    pr.waitFor();
  }
 catch (  InterruptedException|IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void delete(Path path){
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",path.toString());
    Process pr=pb.start();
    try (BufferedReader input=newProcessReader(pr)){
      String line;
      while ((line=input.readLine()) != null) {
        log.info("String_Node_Str" + line);
      }
    }
     pr.waitFor();
  }
 catch (  InterruptedException|IOException e) {
    log.log(Level.INFO,"String_Node_Str",e);
  }
}
Program: 161902
Project: 161902
Buggy source:
@Override public boolean isRunningTF2(){
  String line;
  ProcessBuilder[] builders={new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str" + hl2 + "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),new ProcessBuilder("String_Node_Str","String_Node_Str",new File("String_Node_Str").getPath(),hl2)};
  for (  ProcessBuilder pb : builders) {
    try {
      Process p=pb.start();
      BufferedReader input=new BufferedReader(new InputStreamReader(p.getInputStream()));
      while ((line=input.readLine()) != null) {
        log.finest("String_Node_Str" + pb.command().get(0) + "String_Node_Str"+ line);
        if (line.contains(hl2)) {
          log.finer("String_Node_Str" + pb.command().get(0));
          return true;
        }
      }
      input.close();
    }
 catch (    IOException e) {
      log.log(Level.INFO,"String_Node_Str",e);
    }
  }
  log.finer("String_Node_Str");
  return false;
}

Fixed version (ground truth):
@Override public boolean isRunningTF2(){
  String line;
  ProcessBuilder[] builders={new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str" + hl2 + "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),new ProcessBuilder("String_Node_Str","String_Node_Str",new File("String_Node_Str").getPath(),hl2)};
  for (  ProcessBuilder pb : builders) {
    try {
      Process p=pb.start();
      try (BufferedReader input=newProcessReader(p)){
        while ((line=input.readLine()) != null) {
          log.finest("String_Node_Str" + pb.command().get(0) + "String_Node_Str"+ line);
          if (line.contains(hl2)) {
            log.finer("String_Node_Str" + pb.command().get(0));
            return true;
          }
        }
      }
     }
 catch (    IOException e) {
      log.log(Level.INFO,"String_Node_Str",e);
    }
  }
  log.finer("String_Node_Str");
  return false;
}