nus-yam/ex-repair huggingface dataset:
Program: 12341
Project: 12341
Buggy source:
public static void createReportGenia(String ateOutputFolder,String gsFile,String outFile,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens,int... ranks) throws IOException {
  PrintWriter p=new PrintWriter(outFile);
  List<String> gs=GSLoader.loadGenia(gsFile,true,true);
  Map<String,double[]> scores=new HashMap<>();
  for (  File f : new File(ateOutputFolder).listFiles()) {
    String name=f.getName();
    if (name.charAt(0) == '.')     continue;
    System.out.println(f);
    List<String> terms=ATEResultLoader.load(f.toString());
    double[] s=computePrecisionAtRank(gs,terms,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens,ranks);
    scores.put(name,s);
  }
  StringBuilder sb=new StringBuilder();
  for (  int i : ranks) {
    sb.append("String_Node_Str").append(i);
  }
  sb.append("String_Node_Str");
  for (  Map.Entry<String,double[]> en : scores.entrySet()) {
    sb.append(en.getKey()).append("String_Node_Str");
    double[] s=en.getValue();
    for (int i=0; i < ranks.length; i++) {
      sb.append(s[i]).append("String_Node_Str");
    }
    sb.append("String_Node_Str");
  }
  p.println(sb.toString());
  p.close();
}

Fixed version (ground truth):
public static void createReportGenia(Lemmatiser lemmatiser,String ateOutputFolder,String gsFile,String outFile,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens,int... ranks) throws IOException {
  PrintWriter p=new PrintWriter(outFile);
  List<String> gs=GSLoader.loadGenia(gsFile);
  Map<String,double[]> scores=new HashMap<>();
  for (  File f : new File(ateOutputFolder).listFiles()) {
    String name=f.getName();
    if (name.charAt(0) == '.')     continue;
    System.out.println(f);
    List<String> terms=ATEResultLoader.load(f.toString());
    double[] s=computePrecisionAtRank(lemmatiser,gs,terms,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens,ranks);
    scores.put(name,s);
  }
  StringBuilder sb=new StringBuilder();
  for (  int i : ranks) {
    sb.append("String_Node_Str").append(i);
  }
  sb.append("String_Node_Str");
  for (  Map.Entry<String,double[]> en : scores.entrySet()) {
    sb.append(en.getKey()).append("String_Node_Str");
    double[] s=en.getValue();
    for (int i=0; i < ranks.length; i++) {
      sb.append(s[i]).append("String_Node_Str");
    }
    sb.append("String_Node_Str");
  }
  p.println(sb.toString());
  p.close();
}
Program: 12342
Project: 12342
Buggy source:
/** 
 * compute pre-configured top Ks precision with normalisation for both gold standard spans and ranked terms
 * @param gs, gold standards
 * @param terms, extracted results
 * @param ignoreSymbols, remove symbols
 * @param ignoreDigits, remove digits
 * @param minChar,
 * @param maxChar
 * @param minTokens
 * @param maxTokens
 * @param ranks
 * @return
 */
public static double[] computePrecisionAtRank(List<String> gs,List<String> terms,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens,int... ranks){
  gs=stem(gs);
  gs=prune(gs,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens);
  terms=prune(terms,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens);
  double[] scores=new double[ranks.length];
  for (int i=0; i < ranks.length; i++) {
    double p=precision(gs,terms.subList(0,ranks[i]));
    scores[i]=round(p,2);
  }
  return scores;
}

Fixed version (ground truth):
/** 
 * compute pre-configured top Ks precision with normalisation for both gold standard spans and ranked terms
 * @param gs, gold standards
 * @param terms, extracted results
 * @param ignoreSymbols, remove symbols
 * @param ignoreDigits, remove digits
 * @param minChar,
 * @param maxChar
 * @param minTokens
 * @param maxTokens
 * @param ranks
 * @return
 */
public static double[] computePrecisionAtRank(Lemmatiser lemmatiser,List<String> gs,List<String> terms,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens,int... ranks){
  gs=prune(gs,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens);
  gs=normalize(gs,lemmatiser);
  terms=prune(terms,ignoreSymbols,ignoreDigits,lowercase,minChar,maxChar,minTokens,maxTokens);
  double[] scores=new double[ranks.length];
  for (int i=0; i < ranks.length; i++) {
    double p=precision(gs,terms.subList(0,ranks[i]));
    scores[i]=round(p,2);
  }
  return scores;
}
Program: 12343
Project: 12343
Buggy source:
protected String[] walkTokens() throws IOException {
  List<String> wordList=new ArrayList<>();
  while (input.incrementToken()) {
    CharTermAttribute textAtt=input.getAttribute(CharTermAttribute.class);
    OffsetAttribute offsetAtt=input.getAttribute(OffsetAttribute.class);
    char[] buffer=textAtt.buffer();
    String word=null;
    try {
      word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    }
 catch (    StringIndexOutOfBoundsException ioe) {
      LOG.error(ioe.toString());
      word=offsetAtt.toString();
    }
    wordList.add(word);
    AttributeSource attrs=input.cloneAttributes();
    tokenAttrs.add(attrs);
  }
  String[] words=new String[wordList.size()];
  for (int i=0; i < words.length; i++) {
    words[i]=wordList.get(i);
  }
  return words;
}

Fixed version (ground truth):
protected String[] walkTokens() throws IOException {
  List<String> wordList=new ArrayList<>();
  while (input.incrementToken()) {
    CharTermAttribute textAtt=input.getAttribute(CharTermAttribute.class);
    OffsetAttribute offsetAtt=input.getAttribute(OffsetAttribute.class);
    char[] buffer=textAtt.buffer();
    String word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    wordList.add(word);
    AttributeSource attrs=input.cloneAttributes();
    tokenAttrs.add(attrs);
  }
  String[] words=new String[wordList.size()];
  for (int i=0; i < words.length; i++) {
    words[i]=wordList.get(i);
  }
  return words;
}
Program: 12345
Project: 12345
Buggy source:
public static void main(String[] args) throws IOException, JATEException {
  Lemmatiser lem=new Lemmatiser(new EngLemmatiser(args[4],false,false));
  if (args[3].equals("String_Node_Str")) {
    createReportGenia(lem,args[0],args[1],args[2],true,false,true,2,100,1,5,50,100,500,1000,5000,10000);
  }
 else {
    createReportACLRD(lem,args[0],args[1],args[2],true,false,true,2,100,1,10,50,100,500,1000,5000,10000);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, JATEException {
  Lemmatiser lem=new Lemmatiser(new EngLemmatiser(args[4],false,false));
  if (args[3].equals("String_Node_Str")) {
    createReportGenia(lem,args[0],args[1],args[2],true,false,true,2,100,1,5,50,100,300,500,800,1000,1500,2000,3000,4000,5000,6000,7000,8000,9000,10000);
  }
 else {
    createReportACLRD(lem,args[0],args[1],args[2],true,false,true,2,100,1,10,50,100,300,500,800,1000,1500,2000,3000,4000,5000,6000,7000,8000,9000,10000);
  }
}
Program: 12346
Project: 12346
Buggy source:
/** 
 * Retrieve term candidates from solr field see @code {uk.ac.shef.dcs.jate.JATEProperties.PROPERTY_SOLR_FIELD_CONTENT_TERMS} The method assumes that the term candidates are extracted at index-time and stored in pre-configured field
 * @return Set, a set of term candidate surface form
 * @throws JATEException
 * @throws IOException
 */
protected Set<String> getUniqueTerms() throws JATEException, IOException {
  Terms terms=SolrUtil.getTermVector(properties.getSolrFieldNameJATECTerms(),solrIndexSearcher);
  TermsEnum termsEnum=terms.iterator();
  Set<String> allTermCandidates=new HashSet<>();
  while (termsEnum.next() != null) {
    BytesRef t=termsEnum.term();
    if (t.length == 0)     continue;
    allTermCandidates.add(t.utf8ToString());
  }
  return allTermCandidates;
}

Fixed version (ground truth):
/** 
 * Retrieve term candidates from solr field see @code {uk.ac.shef.dcs.jate.JATEProperties.PROPERTY_SOLR_FIELD_CONTENT_TERMS} The method assumes that the term candidates are extracted at index-time and stored in pre-configured field
 * @return Set, a set of term candidate surface form
 * @throws JATEException
 * @throws IOException
 */
protected Set<String> getUniqueTerms() throws JATEException, IOException {
  Terms terms=SolrUtil.getTermVector(properties.getSolrFieldNameJATECTerms(),solrIndexSearcher);
  TermsEnum termsEnum=terms.iterator();
  Set<String> allTermCandidates=new HashSet<>();
  while (termsEnum.next() != null) {
    BytesRef t=termsEnum.term();
    if (t.length == 0)     continue;
    allTermCandidates.add(t.utf8ToString());
    if (t.utf8ToString().equals("String_Node_Str"))     System.out.println();
  }
  return allTermCandidates;
}
Program: 12347
Project: 12347
Buggy source:
/** 
 * Corpus indexing and candidate term (at index-time)
 * @param corpusDir, ACL RD-TEC cleansed text xml.zip corpus directory
 * @return List<JATETerm>
 * @throws JATEException
 */
public void indexAndExtract(Path corpusDir) throws JATEException {
  List<Path> files=JATEUtil.loadFiles(corpusDir);
  LOG.info("String_Node_Str" + files.size() + "String_Node_Str");
  int count=0;
  for (  Path file : files) {
    try {
      indexJATEDocuments(file,jateProp,false);
      count++;
      if (count % 100 == 0)       LOG.info("String_Node_Str" + count + "String_Node_Str"+ files.size());
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
    }
  }
  try {
    server.commit();
    LOG.info("String_Node_Str");
  }
 catch (  SolrServerException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Corpus indexing and candidate term (at index-time)
 * @param corpusDir, ACL RD-TEC cleansed text xml.zip corpus directory
 * @return List<JATETerm>
 * @throws JATEException
 */
public void indexAndExtract(Path corpusDir) throws JATEException {
  List<Path> files=JATEUtil.loadFiles(corpusDir);
  LOG.info("String_Node_Str" + files.size() + "String_Node_Str");
  int count=0;
  for (  Path file : files) {
    try {
      System.out.println(file);
      indexJATEDocuments(file,jateProp,false);
      count++;
      if (count % 100 == 0)       LOG.info("String_Node_Str" + count + "String_Node_Str"+ files.size());
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
    }
  }
  try {
    server.commit();
    LOG.info("String_Node_Str");
  }
 catch (  SolrServerException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 12348
Project: 12348
Buggy source:
protected String[][] walkTokens() throws IOException {
  List<String> wordList=new ArrayList<>();
  List<String> posList=new ArrayList<>();
  while (input.incrementToken()) {
    CharTermAttribute textAtt=input.getAttribute(CharTermAttribute.class);
    OffsetAttribute offsetAtt=input.getAttribute(OffsetAttribute.class);
    char[] buffer=textAtt.buffer();
    String word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    wordList.add(word);
    PayloadAttribute posAtt=input.getAttribute(PayloadAttribute.class);
    if (posAtt != null) {
      posList.add(new SentenceContext(posAtt.getPayload().utf8ToString()).getPosTag());
    }
    AttributeSource attrs=input.cloneAttributes();
    tokenAttrs.add(attrs);
  }
  if (wordList.size() != posList.size()) {
    StringBuilder sb=new StringBuilder(this.getClass().getName());
    sb.append("String_Node_Str").append(wordList.size()).append("String_Node_Str").append(posList.size()).append("String_Node_Str").append("String_Node_Str");
    throw new IOException(sb.toString());
  }
  String[] words=new String[wordList.size()];
  String[] pos=new String[posList.size()];
  for (int i=0; i < words.length; i++) {
    words[i]=wordList.get(i);
    pos[i]=posList.get(i);
  }
  return new String[][]{words,pos};
}

Fixed version (ground truth):
protected String[][] walkTokens() throws IOException {
  List<String> wordList=new ArrayList<>();
  List<String> posList=new ArrayList<>();
  while (input.incrementToken()) {
    CharTermAttribute textAtt=input.getAttribute(CharTermAttribute.class);
    OffsetAttribute offsetAtt=input.getAttribute(OffsetAttribute.class);
    char[] buffer=textAtt.buffer();
    String word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    wordList.add(word);
    PayloadAttribute posAtt=input.getAttribute(PayloadAttribute.class);
    if (posAtt != null) {
      posList.add(new SentenceContext(posAtt.getPayload().utf8ToString()).getPosTag());
    }
    AttributeSource attrs=input.cloneAttributes();
    tokenAttrs.add(attrs);
  }
  if (wordList.size() != posList.size()) {
    StringBuilder sb=new StringBuilder(this.getClass().getName());
    sb.append("String_Node_Str").append(wordList.size()).append("String_Node_Str").append(posList.size()).append("String_Node_Str").append("String_Node_Str");
    throw new IOException(sb.toString());
  }
  String[] words=new String[wordList.size()];
  String[] pos=new String[posList.size()];
  for (int i=0; i < words.length; i++) {
    words[i]=wordList.get(i);
    pos[i]=posList.get(i);
  }
  clearAttributes();
  return new String[][]{words,pos};
}
Program: 12349
Project: 12349
Buggy source:
protected void resetParams(){
  first=true;
  tokenIdx=0;
  chunkStart=-1;
  chunkEnd=-1;
  chunkSpans.clear();
  chunkTypes.clear();
}

Fixed version (ground truth):
protected void resetParams(){
  first=true;
  tokenIdx=0;
  chunkStart=-1;
  chunkEnds.clear();
  ;
  chunkSpans.clear();
  chunkTypes.clear();
}
Program: 12350
Project: 12350
Buggy source:
protected boolean addMWE(){
  AttributeSource start=tokenAttrs.get(chunkStart);
  AttributeSource end=tokenAttrs.get(chunkEnd - 1);
  SentenceContext firstTokenSentCtx=parseSentenceContextPayload(start.getAttribute(PayloadAttribute.class));
  SentenceContext lastTokenSentCtx=parseSentenceContextPayload(end.getAttribute(PayloadAttribute.class));
  boolean added=false;
  if (!crossBoundary(firstTokenSentCtx,lastTokenSentCtx)) {
    StringBuilder phrase=new StringBuilder();
    for (int i=chunkStart; i <= chunkEnd - 1; i++)     phrase.append(tokenAttrs.get(i).getAttribute(CharTermAttribute.class).buffer()).append("String_Node_Str");
    termAtt.setEmpty().append(phrase.toString().trim());
    offsetAtt.setOffset(start.getAttribute(OffsetAttribute.class).startOffset(),end.getAttribute(OffsetAttribute.class).endOffset());
    typeAtt.setType(chunkTypes.get(chunkStart));
    addSentenceContextPayload(firstTokenSentCtx,lastTokenSentCtx);
    added=true;
  }
  chunkStart=-1;
  chunkEnd=-1;
  return added;
}

Fixed version (ground truth):
protected boolean addMWE(int chunkEnd){
  AttributeSource start=tokenAttrs.get(chunkStart);
  AttributeSource end=tokenAttrs.get(chunkEnd - 1);
  SentenceContext firstTokenSentCtx=parseSentenceContextPayload(start.getAttribute(PayloadAttribute.class));
  SentenceContext lastTokenSentCtx=parseSentenceContextPayload(end.getAttribute(PayloadAttribute.class));
  boolean added=false;
  if (!crossBoundary(firstTokenSentCtx,lastTokenSentCtx)) {
    StringBuilder phrase=new StringBuilder();
    for (int i=chunkStart; i <= chunkEnd - 1; i++)     phrase.append(tokenAttrs.get(i).getAttribute(CharTermAttribute.class).buffer()).append("String_Node_Str");
    termAtt.setEmpty().append(phrase.toString().trim());
    offsetAtt.setOffset(start.getAttribute(OffsetAttribute.class).startOffset(),end.getAttribute(OffsetAttribute.class).endOffset());
    typeAtt.setType(chunkTypes.get(chunkStart));
    addSentenceContextPayload(firstTokenSentCtx,lastTokenSentCtx);
    added=true;
  }
  chunkEnds.remove(Integer.valueOf(chunkEnd));
  if (chunkEnds.size() == 0) {
    tokenIdx=chunkStart + 1;
    chunkStart=-1;
  }
 else {
    tokenIdx=chunkEnds.get(0);
  }
  return added;
}
Program: 12351
Project: 12351
Buggy source:
@Override public boolean incrementToken() throws IOException {
  clearAttributes();
  if (first) {
    String[][] wordsAndPOS=walkTokens();
    String[] words=wordsAndPOS[0];
    if (words.length == 0) {
      return false;
    }
    String[] pos=wordsAndPOS[1];
    Span[] chunks=regexChunker.find(pos);
    chunks=prune(chunks,words);
    for (    Span sp : chunks) {
      chunkSpans.put(sp.getStart(),sp.getEnd());
      chunkTypes.put(sp.getStart(),sp.getType());
    }
    first=false;
    tokenIdx=0;
  }
  if (tokenIdx == tokenAttrs.size()) {
    resetParams();
    return false;
  }
  if (chunkStart != -1 && tokenIdx == chunkEnd) {
    boolean added=addMWE();
    return true;
  }
  if (chunkSpans.containsKey(tokenIdx)) {
    chunkStart=tokenIdx;
    chunkEnd=chunkSpans.get(tokenIdx);
    tokenIdx++;
    return true;
  }
 else {
    tokenIdx++;
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean incrementToken() throws IOException {
  clearAttributes();
  if (first) {
    String[][] wordsAndPOS=walkTokens();
    String[] words=wordsAndPOS[0];
    if (words.length == 0) {
      return false;
    }
    String[] pos=wordsAndPOS[1];
    Span[] chunks=regexChunker.find(pos);
    chunks=prune(chunks,words);
    for (    Span sp : chunks) {
      List<Integer> ends=chunkSpans.get(sp.getStart());
      if (ends == null)       ends=new ArrayList<>();
      ends.add(sp.getEnd());
      chunkSpans.put(sp.getStart(),ends);
      chunkTypes.put(sp.getStart(),sp.getType());
    }
    first=false;
    tokenIdx=0;
  }
  if (tokenIdx == tokenAttrs.size()) {
    resetParams();
    return false;
  }
  if (chunkStart != -1 && chunkEnds.contains(tokenIdx)) {
    boolean added=addMWE(tokenIdx);
    return true;
  }
  if (chunkSpans.containsKey(tokenIdx)) {
    chunkStart=tokenIdx;
    chunkEnds=chunkSpans.get(tokenIdx);
    tokenIdx=chunkEnds.get(0);
    return true;
  }
 else {
    tokenIdx++;
    return true;
  }
}
Program: 12352
Project: 12352
Buggy source:
public static void main(String[] args) throws IOException {
  createReportGenia(args[0],args[1],args[2],true,false,true,2,150,1,5,50,100,500,1000,5000,10000);
  System.out.println("String_Node_Str");
  System.out.println();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  if (args[3].equals("String_Node_Str")) {
    createReportGenia(args[0],args[1],args[2],true,false,true,2,150,1,5,50,100,500,1000,5000,10000);
    System.out.println("String_Node_Str");
  }
 else {
    createReportACLRD(args[0],args[1],args[2],true,false,true,2,150,1,5,50,100,500,1000,5000,10000);
    System.out.println();
  }
}
Program: 12354
Project: 12354
Buggy source:
@Test public void benchmarking_appWeirdness() throws JATEException, IOException {
}

Fixed version (ground truth):
public void benchmarking_appWeirdness() throws JATEException, IOException {
}
Program: 12355
Project: 12355
Buggy source:
public void benchmarking_appTTF() throws JATEException, IOException {
}

Fixed version (ground truth):
@Test public void benchmarking_appTTF() throws JATEException, IOException {
}
Program: 12356
Project: 12356
Buggy source:
@Test public void benchmarking_appCValue() throws IOException, JATEException {
}

Fixed version (ground truth):
public void benchmarking_appCValue() throws IOException, JATEException {
}
Program: 12357
Project: 12357
Buggy source:
public void benchmarking_appWeirdness() throws JATEException, IOException {
}

Fixed version (ground truth):
@Test public void benchmarking_appWeirdness() throws JATEException, IOException {
}
Program: 12358
Project: 12358
Buggy source:
public void benchmarking_appTermEx() throws JATEException, IOException {
  initParams.put(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey(),FREQ_GENIC_FILE.toString());
  AppTermEx appTermEx=new AppTermEx(initParams);
  List<JATETerm> termList=appTermEx.extract(server.getCoreContainer().getCore(solrCoreName),jateProperties);
  Assert.assertEquals("String_Node_Str",10681,termList.size());
  List<String> rankedTerms=ATEResultLoader.load(termList);
  double[] scores=Scorer.computePrecisionAtRank(gsTerms,rankedTerms,true,false,true,2,100,1,5,50,100,500,1000,3000,5000,8000,10000);
  LOG.info("String_Node_Str");
  LOG.info("String_Node_Str" + scores[0]);
  LOG.info("String_Node_Str" + scores[1]);
  LOG.info("String_Node_Str" + scores[2]);
  LOG.info("String_Node_Str" + scores[3]);
  LOG.info("String_Node_Str" + scores[4]);
  LOG.info("String_Node_Str" + scores[5]);
  LOG.info("String_Node_Str" + scores[6]);
  LOG.info("String_Node_Str" + scores[7]);
  LOG.info("String_Node_Str" + 0);
}

Fixed version (ground truth):
public void benchmarking_appTermEx() throws JATEException, IOException {
}
Program: 12359
Project: 12359
Buggy source:
public void characters(char ch[],int start,int length) throws SAXException {
  if (paper) {
    paper=false;
  }
  if (title) {
    title=false;
    if (!reference) {
      paperTitle.append(new String(ch,start,length)).append("String_Node_Str");
    }
    reference=false;
  }
  if (section) {
    section=false;
  }
  if (sectionTitle) {
    sectionTitle=false;
  }
  if (paragraph) {
    paragraph=false;
    paperParagraphs.append(new String(ch,start,length));
  }
}

Fixed version (ground truth):
public void characters(char ch[],int start,int length) throws SAXException {
  if (paper) {
    paper=false;
  }
  if (title) {
    title=false;
    if (!reference) {
      paperTitle.append(new String(ch,start,length)).append("String_Node_Str");
    }
    reference=false;
  }
  if (section) {
    section=false;
  }
  if (sectionTitle) {
    sectionTitle=false;
  }
  if (paragraph) {
    String paragraph=new String(ch,start,length);
    paperParagraphs.append(paragraph);
  }
}
Program: 12361
Project: 12361
Buggy source:
public void endElement(String uri,String localName,String qName) throws SAXException {
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String qName) throws SAXException {
  if (qName.equalsIgnoreCase("String_Node_Str")) {
    paragraph=false;
  }
}
Program: 12367
Project: 12367
Buggy source:
@Override public boolean incrementToken() throws IOException {
  clearAttributes();
  if (first) {
    String[] words=walkTokens();
    if (words.length == 0) {
      return false;
    }
    String[] pos=createTags(words);
    Span[] chunks=regexChunker.find(pos);
    chunks=prune(chunks,words);
    for (    Span sp : chunks) {
      chunkSpans.put(sp.getStart(),sp.getEnd());
      chunkTypes.put(sp.getStart(),sp.getType());
    }
    first=false;
    tokenIdx=0;
  }
  if (tokenIdx == tokenAttrs.size()) {
    resetParams();
    return false;
  }
  if (chunkStart != -1 && tokenIdx == chunkEnd) {
    AttributeSource start=tokenAttrs.get(chunkStart);
    AttributeSource end=tokenAttrs.get(chunkEnd - 1);
    StringBuilder phrase=new StringBuilder();
    for (int i=chunkStart; i <= chunkEnd - 1; i++) {
      phrase.append(tokenAttrs.get(i).getAttribute(CharTermAttribute.class).buffer()).append("String_Node_Str");
    }
    if (phrase.toString().trim().equals("String_Node_Str") || phrase.toString().trim().equals("String_Node_Str"))     System.out.println();
    termAtt.setEmpty().append(phrase.toString().trim());
    offsetAtt.setOffset(start.getAttribute(OffsetAttribute.class).startOffset(),end.getAttribute(OffsetAttribute.class).endOffset());
    typeAtt.setType(chunkTypes.get(chunkStart));
    chunkStart=-1;
    chunkEnd=-1;
    return true;
  }
  if (chunkSpans.containsKey(tokenIdx)) {
    chunkStart=tokenIdx;
    chunkEnd=chunkSpans.get(tokenIdx);
    tokenIdx++;
    return true;
  }
 else {
    tokenIdx++;
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean incrementToken() throws IOException {
  clearAttributes();
  if (first) {
    String[] words=walkTokens();
    if (words.length == 0) {
      return false;
    }
    String[] pos=createTags(words);
    Span[] chunks=regexChunker.find(pos);
    chunks=prune(chunks,words);
    for (    Span sp : chunks) {
      chunkSpans.put(sp.getStart(),sp.getEnd());
      chunkTypes.put(sp.getStart(),sp.getType());
    }
    first=false;
    tokenIdx=0;
  }
  if (tokenIdx == tokenAttrs.size()) {
    resetParams();
    return false;
  }
  if (chunkStart != -1 && tokenIdx == chunkEnd) {
    AttributeSource start=tokenAttrs.get(chunkStart);
    AttributeSource end=tokenAttrs.get(chunkEnd - 1);
    StringBuilder phrase=new StringBuilder();
    for (int i=chunkStart; i <= chunkEnd - 1; i++) {
      phrase.append(tokenAttrs.get(i).getAttribute(CharTermAttribute.class).buffer()).append("String_Node_Str");
    }
    termAtt.setEmpty().append(phrase.toString().trim());
    offsetAtt.setOffset(start.getAttribute(OffsetAttribute.class).startOffset(),end.getAttribute(OffsetAttribute.class).endOffset());
    typeAtt.setType(chunkTypes.get(chunkStart));
    chunkStart=-1;
    chunkEnd=-1;
    return true;
  }
  if (chunkSpans.containsKey(tokenIdx)) {
    chunkStart=tokenIdx;
    chunkEnd=chunkSpans.get(tokenIdx);
    tokenIdx++;
    return true;
  }
 else {
    tokenIdx++;
    return true;
  }
}
Program: 12369
Project: 12369
Buggy source:
public boolean equals(Object o){
  if (o instanceof ContextWindow) {
    ContextWindow ctx=(ContextWindow)o;
    return ctx.getDocId() == getDocId() && ctx.getSentenceId() == getSentenceId() && ctx.getTokStart() == getTokStart() && ctx.getTokEnd() == getTokEnd();
  }
  return false;
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (o instanceof ContextWindow) {
    ContextWindow ctx=(ContextWindow)o;
    return ctx.getDocId() == getDocId() && ctx.getSentenceId() == getSentenceId() && ctx.getFirstTok() == getFirstTok() && ctx.getLastTok() == getLastTok();
  }
  return false;
}
Program: 12370
Project: 12370
Buggy source:
public String getContextId(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(docId).append("String_Node_Str").append(sentenceId).append("String_Node_Str").append(tokStart).append("String_Node_Str").append(tokEnd);
  return sb.toString();
}

Fixed version (ground truth):
public String getContextId(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(docId).append("String_Node_Str").append(sentenceId).append("String_Node_Str").append(firstTok).append("String_Node_Str").append(lastTok);
  return sb.toString();
}
Program: 12371
Project: 12371
Buggy source:
@Override public int compareTo(ContextWindow o){
  if (docId == o.docId) {
    if (sentenceId == o.sentenceId) {
      if (tokStart == o.tokStart) {
        return Integer.valueOf(tokEnd).compareTo(o.tokEnd);
      }
      return Integer.valueOf(tokStart).compareTo(o.tokStart);
    }
    return Integer.valueOf(sentenceId).compareTo(o.sentenceId);
  }
  return Integer.valueOf(docId).compareTo(o.docId);
}

Fixed version (ground truth):
@Override public int compareTo(ContextWindow o){
  if (docId == o.docId) {
    if (sentenceId == o.sentenceId) {
      if (firstTok == o.firstTok) {
        return Integer.valueOf(lastTok).compareTo(o.lastTok);
      }
      return Integer.valueOf(firstTok).compareTo(o.firstTok);
    }
    return Integer.valueOf(sentenceId).compareTo(o.sentenceId);
  }
  return Integer.valueOf(docId).compareTo(o.docId);
}
Program: 12372
Project: 12372
Buggy source:
void deduce(int rowIndex,int colIndex,int value){
  int newValue=cooccurrence.get(rowIndex,colIndex);
  newValue-=value;
  newValue=newValue < 0 ? 0 : newValue;
  cooccurrence.setQuick(rowIndex,colIndex,newValue);
}

Fixed version (ground truth):
void deduce(int rowIndex,int colIndex,int value){
  int newValue=cooccurrence.get(rowIndex,colIndex);
  if (newValue == 0) {
    System.out.println(rowIndex + "String_Node_Str" + colIndex);
    System.out.println(lookupTerm(rowIndex) + "String_Node_Str" + lookupRefTerm(colIndex));
  }
  newValue-=value;
  newValue=newValue < 0 ? 0 : newValue;
  cooccurrence.setQuick(rowIndex,colIndex,newValue);
}
Program: 12374
Project: 12374
Buggy source:
public void addCtxOverlapZone(ContextOverlap ctxOverlapZone){
  this.ctxOverlapZones.put(ctxOverlapZone.getPrevContext().getContextId() + "String_Node_Str" + ctxOverlapZone.getNextContext().getContextId(),ctxOverlapZone);
}

Fixed version (ground truth):
protected synchronized void addCtxOverlapZone(ContextOverlap ctxOverlapZone){
  this.ctxOverlapZones.put(ctxOverlapZone.getPrevContext().getContextId() + "String_Node_Str" + ctxOverlapZone.getNextContext().getContextId(),ctxOverlapZone);
}
Program: 12375
Project: 12375
Buggy source:
/** 
 * @param solrIndexSearcher
 * @param properties
 * @param existingContextWindows  if we want to use context windows already generated by another processof FrequencyCtxWindowBasedFBMaster, pass them here. otherwise, context windows will be generated, in this case use null or an empty set
 * @param window
 * @param termOrWord
 */
public FrequencyCtxWindowBasedFBMaster(SolrIndexSearcher solrIndexSearcher,JATEProperties properties,Set<ContextWindow> existingContextWindows,int window,int termOrWord){
  super(solrIndexSearcher,properties);
  this.termOrWord=termOrWord;
  this.window=window;
  if (existingContextWindows != null) {
    contextLookup=new HashMap<>();
    for (    ContextWindow ctx : existingContextWindows) {
      List<ContextWindow> container=contextLookup.get(ctx.getDocId());
      if (container == null)       container=new ArrayList<>();
      container.add(ctx);
      contextLookup.put(ctx.getDocId(),container);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param solrIndexSearcher
 * @param properties
 * @param existingContextWindows  if we want to use context windows already generated by another processof FrequencyCtxWindowBasedFBMaster, pass them here. In that case, the existing context windows are used as references, within which candidate terms/words are searched. Otherwise, context windows will be generated, in this case pass null or an empty set
 * @param window
 * @param termOrWord
 */
public FrequencyCtxWindowBasedFBMaster(SolrIndexSearcher solrIndexSearcher,JATEProperties properties,Set<ContextWindow> existingContextWindows,int window,int termOrWord){
  super(solrIndexSearcher,properties);
  this.termOrWord=termOrWord;
  this.window=window;
  if (existingContextWindows != null) {
    contextLookup=new HashMap<>();
    for (    ContextWindow ctx : existingContextWindows) {
      List<ContextWindow> container=contextLookup.get(ctx.getDocId());
      if (container == null)       container=new ArrayList<>();
      container.add(ctx);
      contextLookup.put(ctx.getDocId(),container);
    }
  }
}
Program: 12377
Project: 12377
Buggy source:
protected int[] clean(int start,int end,String[] tokens){
  int newStart=start, newEnd=end;
  if (removeLeadingStopwords) {
    String tok=tokens[newStart];
    if (stopWordsIgnoreCase)     tok=tok.toLowerCase();
    if (stopWords.contains(tok)) {
      newStart++;
      if (newStart > newEnd)       return null;
    }
  }
  if (removeTrailingStopwords) {
    String tok=tokens[newEnd];
    if (stopWordsIgnoreCase)     tok=tok.toLowerCase();
    if (stopWords.contains(tok)) {
      newEnd--;
      if (newStart > newEnd)       return null;
    }
  }
  if (removeLeadingSymbolicTokens) {
    String tok=tokens[newStart];
    String normalized=tok.replaceAll("String_Node_Str","String_Node_Str");
    if (normalized.length() == 0) {
      newStart++;
      if (newStart > newEnd)       return null;
    }
  }
  if (removeLeadingSymbolicTokens) {
    String tok=tokens[newEnd];
    String normalized=tok.replaceAll("String_Node_Str","String_Node_Str");
    if (normalized.length() == 0) {
      newEnd--;
      if (newStart > newEnd)       return null;
    }
  }
  if (newEnd == end && newStart == start)   return new int[]{newStart,newEnd};
 else   return clean(newStart,newEnd,tokens);
}

Fixed version (ground truth):
/** 
 * @param start
 * @param end THIS IS EXCLUSIVE
 * @param tokens
 * @return
 */
protected int[] clean(int start,int end,String[] tokens){
  int newStart=start, newEnd=end;
  if (removeLeadingStopwords) {
    String tok=tokens[newStart];
    if (stopWordsIgnoreCase)     tok=tok.toLowerCase();
    if (stopWords.contains(tok)) {
      newStart++;
      if (newStart >= newEnd)       return null;
    }
  }
  if (removeTrailingStopwords) {
    String tok=tokens[newEnd - 1];
    if (stopWordsIgnoreCase)     tok=tok.toLowerCase();
    if (stopWords.contains(tok)) {
      newEnd--;
      if (newStart >= newEnd)       return null;
    }
  }
  if (removeLeadingSymbolicTokens) {
    String tok=tokens[newStart];
    String normalized=tok.replaceAll("String_Node_Str","String_Node_Str");
    if (normalized.length() == 0) {
      newStart++;
      if (newStart >= newEnd)       return null;
    }
  }
  if (removeLeadingSymbolicTokens) {
    String tok=tokens[newEnd - 1];
    String normalized=tok.replaceAll("String_Node_Str","String_Node_Str");
    if (normalized.length() == 0) {
      newEnd--;
      if (newStart >= newEnd)       return null;
    }
  }
  if (newEnd == end && newStart == start)   return new int[]{newStart,newEnd};
 else   if (newEnd - newStart == 1)   return new int[]{newStart,newEnd};
 else   return clean(newStart,newEnd,tokens);
}
Program: 12378
Project: 12378
Buggy source:
/** 
 * Assert that the User-Agent header is of the expected form.
 */
@Test public void testUserAgentHeaderString(){
  assertTrue("String_Node_Str" + "String_Node_Str" + "String_Node_Str",new Version().getUserAgentString().matches(userAgentRegex));
}

Fixed version (ground truth):
/** 
 * Assert that the User-Agent header is of the expected form.
 */
@Test public void testUserAgentHeaderString(){
  assertTrue("String_Node_Str" + "String_Node_Str" + "String_Node_Str",new LibraryVersion().getUserAgentString().matches(userAgentRegex));
}
Program: 12380
Project: 12380
Buggy source:
private DatabaseURIHelper revId(String revId){
  this.path(revId);
  return returnThis();
}

Fixed version (ground truth):
private DatabaseURIHelper revId(String revId){
  this.query("String_Node_Str",revId);
  return returnThis();
}
Program: 12381
Project: 12381
Buggy source:
public InputStream executeToInputStream(HttpConnection connection) throws CouchDbException {
  if (proxyUrl != null) {
    connection.setProxy(proxyUrl);
  }
  connection.requestProperties.put("String_Node_Str","String_Node_Str");
  connection.responseInterceptors.addAll(this.responseInterceptors);
  connection.requestInterceptors.addAll(this.requestInterceptors);
  InputStream is=null;
  InputStream es=null;
  String response=null;
  int code=-1;
  Throwable cause=null;
  try {
    is=connection.execute().responseAsInputStream();
  }
 catch (  IOException ioe) {
    cause=ioe;
  }
  try {
    code=connection.getConnection().getResponseCode();
    response=connection.getConnection().getResponseMessage();
    if (code / 100 == 2) {
      return is;
    }
 else     if (code == 404) {
      throw new NoDocumentException(response,cause);
    }
 else     if (code == 412) {
      throw new PreconditionFailedException(response,cause);
    }
 else {
      CouchDbException ex=new CouchDbException(response,code);
      es=connection.getConnection().getErrorStream();
      if (es != null) {
        try {
          ex=getGson().fromJson(new InputStreamReader(es),CouchDbException.class);
          ex.setStatusCode(code);
        }
 catch (        JsonParseException e) {
        }
      }
      throw ex;
    }
  }
 catch (  IOException ioe) {
    throw new CouchDbException("String_Node_Str",ioe,code);
  }
 finally {
    close(es);
  }
}

Fixed version (ground truth):
public InputStream executeToInputStream(HttpConnection connection) throws CouchDbException {
  if (proxyUrl != null) {
    connection.setProxy(proxyUrl);
  }
  connection.requestProperties.put("String_Node_Str","String_Node_Str");
  connection.responseInterceptors.addAll(this.responseInterceptors);
  connection.requestInterceptors.addAll(this.requestInterceptors);
  InputStream es=null;
  try {
    connection=connection.execute();
    int code=connection.getConnection().getResponseCode();
    String response=connection.getConnection().getResponseMessage();
    if (code / 100 == 2) {
      return connection.responseAsInputStream();
    }
 else {
      CouchDbException ex=new CouchDbException(response,code);
switch (code) {
case 404:
        ex=new NoDocumentException(response);
      break;
case 409:
    ex=new DocumentConflictException(response);
  break;
case 412:
ex=new PreconditionFailedException(response);
break;
}
es=connection.getConnection().getErrorStream();
if (es != null) {
Class<? extends CouchDbException> exceptionClass=ex.getClass();
try {
ex=getGson().fromJson(new InputStreamReader(es),exceptionClass);
}
 catch (JsonParseException e) {
}
}
ex.setStatusCode(code);
throw ex;
}
}
 catch (IOException ioe) {
throw new CouchDbException("String_Node_Str",ioe);
}
 finally {
close(es);
}
}
Program: 12382
Project: 12382
Buggy source:
/** 
 * Performs a HTTP PUT request, saves or updates a document.
 * @param object    Object for updating request
 * @param newEntity If true, saves a new document. Else, updates an existing one.
 * @return {@link Response}
 */
public Response put(URI uri,Object object,boolean newEntity,int writeQuorum){
  assertNotEmpty(object,"String_Node_Str");
  try {
    final JsonObject json=getGson().toJsonTree(object).getAsJsonObject();
    String id=getAsString(json,"String_Node_Str");
    String rev=getAsString(json,"String_Node_Str");
    if (newEntity) {
      assertNull(rev,"String_Node_Str");
      id=(id == null) ? generateUUID() : id;
    }
 else {
      assertNotEmpty(id,"String_Node_Str");
      assertNotEmpty(rev,"String_Node_Str");
    }
    URI httpUri=null;
    if (writeQuorum > -1) {
      httpUri=buildUri(uri).pathToEncode(id).query("String_Node_Str",writeQuorum).buildEncoded();
    }
 else {
      httpUri=buildUri(uri).pathToEncode(id).buildEncoded();
    }
    HttpConnection connection=Http.PUT(httpUri,"String_Node_Str");
    connection.setRequestBody(json.toString());
    return executeToResponse(connection);
  }
 catch (  CouchDbException e) {
    if (e.getStatusCode() == 409) {
      throw new DocumentConflictException(e.toString());
    }
 else {
      throw e;
    }
  }
}

Fixed version (ground truth):
/** 
 * Performs a HTTP PUT request, saves or updates a document.
 * @param object    Object for updating request
 * @param newEntity If true, saves a new document. Else, updates an existing one.
 * @return {@link Response}
 */
public Response put(URI uri,Object object,boolean newEntity,int writeQuorum){
  assertNotEmpty(object,"String_Node_Str");
  final JsonObject json=getGson().toJsonTree(object).getAsJsonObject();
  String id=getAsString(json,"String_Node_Str");
  String rev=getAsString(json,"String_Node_Str");
  if (newEntity) {
    assertNull(rev,"String_Node_Str");
    id=(id == null) ? generateUUID() : id;
  }
 else {
    assertNotEmpty(id,"String_Node_Str");
    assertNotEmpty(rev,"String_Node_Str");
  }
  URI httpUri=null;
  if (writeQuorum > -1) {
    httpUri=buildUri(uri).pathToEncode(id).query("String_Node_Str",writeQuorum).buildEncoded();
  }
 else {
    httpUri=buildUri(uri).pathToEncode(id).buildEncoded();
  }
  HttpConnection connection=Http.PUT(httpUri,"String_Node_Str");
  connection.setRequestBody(json.toString());
  return executeToResponse(connection);
}
Program: 12383
Project: 12383
Buggy source:
/** 
 * Executes a HTTP request. <p><b>Note</b>: The stream must be closed after use to release the connection.
 * @param connection The HTTP request to execute.
 * @return Class type of object T (i.e. {@link Response}
 */
public Response executeToResponse(HttpConnection connection){
  InputStream is=null;
  try {
    is=this.executeToInputStream(connection);
    return getResponse(is,Response.class,getGson());
  }
 catch (  CouchDbException e) {
    if (e.getStatusCode() == 409) {
      throw new DocumentConflictException(e.toString());
    }
 else {
      throw e;
    }
  }
 finally {
    close(is);
  }
}

Fixed version (ground truth):
/** 
 * Executes a HTTP request. <p><b>Note</b>: The stream must be closed after use to release the connection.
 * @param connection The HTTP request to execute.
 * @return Class type of object T (i.e. {@link Response}
 */
public Response executeToResponse(HttpConnection connection){
  InputStream is=null;
  try {
    is=this.executeToInputStream(connection);
    return getResponse(is,Response.class,getGson());
  }
  finally {
    close(is);
  }
}
Program: 12385
Project: 12385
Buggy source:
/** 
 * @return A JSON element as a String, or null if not found, from the response
 */
public static String getAsString(InputStream response,String e){
  InputStream instream=null;
  try {
    Reader reader=new InputStreamReader(instream,"String_Node_Str");
    return getAsString(new JsonParser().parse(reader).getAsJsonObject(),e);
  }
 catch (  UnsupportedEncodingException e1) {
    throw new RuntimeException(e1);
  }
 finally {
    close(instream);
  }
}

Fixed version (ground truth):
/** 
 * @return A JSON element as a String, or null if not found, from the response
 */
public static String getAsString(InputStream response,String e){
  Reader reader=null;
  try {
    reader=new InputStreamReader(response,"String_Node_Str");
    return getAsString(new JsonParser().parse(reader).getAsJsonObject(),e);
  }
 catch (  UnsupportedEncodingException e1) {
    throw new RuntimeException(e1);
  }
 finally {
    close(reader);
    close(response);
  }
}
Program: 12386
Project: 12386
Buggy source:
/** 
 * Build a request for the _all_docs endpoint. <P> Example usage: <pre>  {@code getAllDocsRequestBuilder().build().getResponse();}</pre> </P>
 * @return a request builder for the _all_docs endpoint of this database
 */
public AllDocsRequestBuilder getAllDocsRequestBuilder(){
  return new AllDocsRequestBuilderImpl(new ViewQueryParameters<String,Document.Revision>(client,this,"String_Node_Str","String_Node_Str",String.class,Document.Revision.class){
    protected URIBuilder getViewURIBuilder(){
      return URIBuilder.buildUri(db.getDBUri()).path("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Build a request for the _all_docs endpoint. <P> Example usage: </P> <pre>  {@code getAllDocsRequestBuilder().build().getResponse();}</pre>
 * @return a request builder for the _all_docs endpoint of this database
 */
public AllDocsRequestBuilder getAllDocsRequestBuilder(){
  return new AllDocsRequestBuilderImpl(new ViewQueryParameters<String,Document.Revision>(client,this,"String_Node_Str","String_Node_Str",String.class,Document.Revision.class){
    protected URIBuilder getViewURIBuilder(){
      return URIBuilder.buildUri(db.getDBUri()).path("String_Node_Str");
    }
  }
);
}
Program: 12387
Project: 12387
Buggy source:
/** 
 * Constructs a new instance of this class and connects to the cloudant account with the specified credentials
 * @param account The cloudant account to connect to
 * @param authCookie The cookie obtained from last login
 * @param connectOptions optional properties to connect e.g connectionTime,socketTimeout,etc 
 */
public CloudantClient(String account,String authCookie,ConnectOptions connectOptions){
  super();
  Map<String,String> h=parseAccount(account);
  assertNotEmpty(authCookie,"String_Node_Str");
  CouchDbProperties props=new CouchDbProperties(h.get("String_Node_Str"),h.get("String_Node_Str"),new Integer(h.get("String_Node_Str")).intValue(),authCookie);
  if (connectOptions != null) {
    props.setConnectionTimeout(connectOptions.getConnectionTimeout());
    props.setSocketTimeout(connectOptions.getSocketTimeout());
    props.setMaxConnections(connectOptions.getMaxConnections());
    props.setProxyHost(connectOptions.getProxyHost());
    props.setProxyPort(connectOptions.getProxyPort());
  }
  this.client=new CouchDbClient(props);
}

Fixed version (ground truth):
/** 
 * Constructs a new instance of this class and connects to the cloudant account with the specified credentials
 * @param account For cloudant.com, the cloudant account to connect to. For Cloudant local, the server URL
 * @param account The cloudant account to connect to
 * @param authCookie The cookie obtained from last login
 * @param connectOptions optional properties to connect e.g connectionTime,socketTimeout,etc 
 */
public CloudantClient(String account,String authCookie,ConnectOptions connectOptions){
  super();
  Map<String,String> h=parseAccount(account);
  assertNotEmpty(authCookie,"String_Node_Str");
  CouchDbProperties props=new CouchDbProperties(h.get("String_Node_Str"),h.get("String_Node_Str"),new Integer(h.get("String_Node_Str")).intValue(),authCookie);
  if (connectOptions != null) {
    props.setConnectionTimeout(connectOptions.getConnectionTimeout());
    props.setSocketTimeout(connectOptions.getSocketTimeout());
    props.setMaxConnections(connectOptions.getMaxConnections());
    props.setProxyHost(connectOptions.getProxyHost());
    props.setProxyPort(connectOptions.getProxyPort());
  }
  this.client=new CouchDbClient(props);
}
Program: 12390
Project: 12390
Buggy source:
/** 
 * Constructs a new instance of this class and connects to the cloudant account with the specified credentials
 * @param account For cloudant.com, the cloudant account to connect to. For Cloudant local, the server URL
 * @param account The cloudant account to connect to
 * @param authCookie The cookie obtained from last login
 * @param connectOptions optional properties to connect e.g connectionTime,socketTimeout,etc 
 */
public CloudantClient(String account,String authCookie,ConnectOptions connectOptions){
  super();
  Map<String,String> h=parseAccount(account);
  assertNotEmpty(authCookie,"String_Node_Str");
  CouchDbProperties props=new CouchDbProperties(h.get("String_Node_Str"),h.get("String_Node_Str"),new Integer(h.get("String_Node_Str")).intValue(),authCookie);
  if (connectOptions != null) {
    props.setConnectionTimeout(connectOptions.getConnectionTimeout());
    props.setSocketTimeout(connectOptions.getSocketTimeout());
    props.setMaxConnections(connectOptions.getMaxConnections());
    props.setProxyHost(connectOptions.getProxyHost());
    props.setProxyPort(connectOptions.getProxyPort());
  }
  this.client=new CouchDbClient(props);
}

Fixed version (ground truth):
/** 
 * Constructs a new instance of this class and connects to the cloudant account with the specified credentials
 * @param account For cloudant.com, the cloudant account to connect to. For Cloudant local, the server URL
 * @param account The cloudant account to connect to
 * @param authCookie The cookie obtained from last login
 * @param connectOptions optional properties to connect e.g connectionTime,socketTimeout,etc 
 */
public CloudantClient(String account,String authCookie,ConnectOptions connectOptions){
  super();
  Map<String,String> h=parseAccount(account);
  assertNotEmpty(authCookie,"String_Node_Str");
  doInit(h.get("String_Node_Str"),h.get("String_Node_Str"),new Integer(h.get("String_Node_Str")).intValue(),null,null,connectOptions,authCookie);
}
Program: 12391
Project: 12391
Buggy source:
/** 
 * Get all active tasks
 * @return List of tasks
 */
public List<Task> getActiveTasks(){
  HttpResponse response=null;
  HttpGet get=new HttpGet(buildUri(getBaseUri()).path("String_Node_Str").build());
  try {
    response=executeRequest(get);
    return getResponseList(response,Database.getGson(),Task.class,new TypeToken<List<Task>>(){
    }
.getType());
  }
  finally {
    close(response);
  }
}

Fixed version (ground truth):
/** 
 * Get all active tasks
 * @return List of tasks
 */
public List<Task> getActiveTasks(){
  HttpResponse response=null;
  HttpGet get=new HttpGet(buildUri(getBaseUri()).path("String_Node_Str").build());
  try {
    response=executeRequest(get);
    return getResponseList(response,client.getGson(),Task.class,new TypeToken<List<Task>>(){
    }
.getType());
  }
  finally {
    close(response);
  }
}
Program: 12392
Project: 12392
Buggy source:
/** 
 * List all indices
 * @return List of Index
 */
public List<Index> listIndices(){
  HttpResponse response=null;
  try {
    response=client.executeRequest(new HttpGet(buildUri(getDBUri()).path("String_Node_Str").build()));
    return getResponseList(response,ownGSON,Index.class,new TypeToken<List<Index>>(){
    }
.getType());
  }
  finally {
    close(response);
  }
}

Fixed version (ground truth):
/** 
 * List all indices
 * @return List of Index
 */
public List<Index> listIndices(){
  HttpResponse response=null;
  try {
    response=client.executeRequest(new HttpGet(buildUri(getDBUri()).path("String_Node_Str").build()));
    return getResponseList(response,client.getGson(),Index.class,new TypeToken<List<Index>>(){
    }
.getType());
  }
  finally {
    close(response);
  }
}