nus-yam/ex-repair huggingface dataset:
Program: 12297
Project: 12297
Buggy source:
private double parseDoubleParam(String name,String value) throws JATEException {
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException nfe) {
    StringBuilder msg=new StringBuilder(name);
    msg.append("String_Node_Str");
    msg.append(value);
    log.error(msg.toString());
    throw new JATEException(msg.toString());
  }
}

Fixed version (ground truth):
private double parseDoubleParam(String name,String value) throws JATEException {
  try {
    return Double.parseDouble(value);
  }
 catch (  NumberFormatException nfe) {
    String msg=String.format("String_Node_Str" + "String_Node_Str",name,value);
    log.error(msg);
    throw new JATEException(msg);
  }
}
Program: 12298
Project: 12298
Buggy source:
/** 
 * Only effective under the Embedded mode. User can choose to output term offset information. If this is the case, this method will be called upon every final term. Iterating through the solr index can be slow so this method can take some time.
 * @param leafReader
 * @param terms
 * @param ngramInfoFieldname
 * @param idFieldname
 * @throws IOException
 */
public void collectTermOffsets(List<JATETerm> terms,LeafReader leafReader,String ngramInfoFieldname,String idFieldname) throws IOException {
  TermInfoCollector infoCollector=new TermInfoCollector(leafReader,ngramInfoFieldname,idFieldname);
  log.info("String_Node_Str" + terms.size());
  int count=0;
  for (  JATETerm jt : terms) {
    jt.setTermInfo(infoCollector.collect(jt.getString()));
    count++;
    if (count % 500 == 0)     log.info("String_Node_Str" + count);
  }
}

Fixed version (ground truth):
/** 
 * Only effective under the Embedded mode. <p> User can choose to output term offset information. If this is the case, this method will be called upon every final term. Iterating through the solr index can be slow so this method can take some time.
 * @param leafReader, index reader
 * @param terms, term list
 * @param ngramInfoFieldname, indexed n-gram field, see 'jate_text_2_ngrams' field in example schema
 * @param idFieldname, doc unique id field
 * @throws IOException
 */
public void collectTermOffsets(List<JATETerm> terms,LeafReader leafReader,String ngramInfoFieldname,String idFieldname) throws IOException {
  TermInfoCollector infoCollector=new TermInfoCollector(leafReader,ngramInfoFieldname,idFieldname);
  log.info("String_Node_Str" + terms.size());
  int count=0;
  for (  JATETerm jt : terms) {
    jt.setTermInfo(infoCollector.collect(jt.getString()));
    count++;
    if (count % 500 == 0)     log.info("String_Node_Str" + count);
  }
}
Program: 12299
Project: 12299
Buggy source:
protected void initalizeRefFreqParam(Map<String,String> initParams) throws JATEException {
  if (initParams.containsKey(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey())) {
    String refFreqFilePath=initParams.get(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey());
    if (refFreqFilePath == null) {
      StringBuilder msg=new StringBuilder("String_Node_Str");
      msg.append(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey()).append("String_Node_Str");
      log.error(msg.toString());
      throw new JATEException(msg.toString());
    }
    File refFreqFile=new File(refFreqFilePath);
    if (!refFreqFile.exists()) {
      StringBuilder msg=new StringBuilder("String_Node_Str");
      msg.append(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey()).append("String_Node_Str").append(refFreqFilePath);
      log.error(msg.toString());
      throw new JATEException(msg.toString());
    }
    this.referenceFrequencyFilePath=refFreqFilePath;
  }
 else {
    StringBuilder msg=new StringBuilder("String_Node_Str");
    msg.append(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey()).append("String_Node_Str");
    log.error(msg.toString());
    throw new JATEException(msg.toString());
  }
}

Fixed version (ground truth):
/** 
 * @param initParams, map param accepting reference frequency file
 * @throws JATEException
 * @see AppParams#REFERENCE_FREQUENCY_FILE
 */
protected void initalizeRefFreqParam(Map<String,String> initParams) throws JATEException {
  if (initParams.containsKey(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey())) {
    String refFreqFilePath=initParams.get(AppParams.REFERENCE_FREQUENCY_FILE.getParamKey());
    if (refFreqFilePath == null) {
      String msg=String.format("String_Node_Str",AppParams.REFERENCE_FREQUENCY_FILE.getParamKey());
      log.error(msg);
      throw new JATEException(msg);
    }
    File refFreqFile=new File(refFreqFilePath);
    if (!refFreqFile.exists()) {
      String msg=String.format("String_Node_Str",AppParams.REFERENCE_FREQUENCY_FILE.getParamKey(),refFreqFilePath);
      log.error(msg);
      throw new JATEException(msg);
    }
    this.referenceFrequencyFilePath=refFreqFilePath;
  }
 else {
    String msg=String.format("String_Node_Str",AppParams.REFERENCE_FREQUENCY_FILE.getParamKey());
    log.error(msg);
    throw new JATEException(msg);
  }
}
Program: 12300
Project: 12300
Buggy source:
private int parseIntParam(String name,String value) throws JATEException {
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException nfe) {
    StringBuilder msg=new StringBuilder(name);
    msg.append("String_Node_Str");
    msg.append(value);
    log.error(msg.toString());
    throw new JATEException(msg.toString());
  }
}

Fixed version (ground truth):
private int parseIntParam(String name,String value) throws JATEException {
  try {
    return Integer.parseInt(value);
  }
 catch (  NumberFormatException nfe) {
    String msg=String.format("String_Node_Str" + "String_Node_Str",name,value);
    log.error(msg);
    throw new JATEException(msg);
  }
}
Program: 12301
Project: 12301
Buggy source:
/** 
 * Rank and Filter terms candidates based on a given Solr index This method assume that documents are indexed in the solr container (solrHomePath) and term candidates have already been extracted at index-time. jate properties provides necessary information needed by the ATE algorithm (e.g., text field, ngram info field, term candiate field, cut-off threshold)
 * @param solrHomePath,     solr core home directory path
 * @param coreName,         solr core name from where term recognition is executed
 * @param jatePropertyFile, jate property file path
 * @return List<JATETerm>, the list of terms extracted
 * @throws IOException
 * @throws JATEException
 */
public List<JATETerm> extract(String solrHomePath,String coreName,String jatePropertyFile) throws IOException, JATEException {
  EmbeddedSolrServer solrServer=null;
  SolrCore core=null;
  List<JATETerm> result=new ArrayList<JATETerm>();
  try {
    solrServer=new EmbeddedSolrServer(Paths.get(solrHomePath),coreName);
    core=solrServer.getCoreContainer().getCore(coreName);
    result=extract(core,jatePropertyFile);
  }
  finally {
    try {
      if (core != null) {
        core.close();
      }
      if (solrServer != null) {
        solrServer.close();
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str");
      log.error(ExceptionUtils.getFullStackTrace(e));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Rank and Filter terms candidates based on a given Solr index <p> This method assume that documents are indexed in the solr container (solrHomePath) and term candidates have already been extracted at index-time. <p> jate properties provides necessary information needed by the ATE algorithm (e.g., text field, ngram info field, term candiate field, cut-off threshold)
 * @param solrHomePath,     solr core home directory path
 * @param coreName,         solr core name from where term recognition is executed
 * @param jatePropertyFile, jate property file path
 * @return List<JATETerm>, the list of terms extracted
 * @throws IOException
 * @throws JATEException
 */
public List<JATETerm> extract(String solrHomePath,String coreName,String jatePropertyFile) throws IOException, JATEException {
  EmbeddedSolrServer solrServer=null;
  SolrCore core=null;
  List<JATETerm> result=new ArrayList<JATETerm>();
  try {
    solrServer=new EmbeddedSolrServer(Paths.get(solrHomePath),coreName);
    core=solrServer.getCoreContainer().getCore(coreName);
    result=extract(core,jatePropertyFile);
  }
  finally {
    try {
      if (core != null) {
        core.close();
      }
      if (solrServer != null) {
        solrServer.close();
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str");
      log.error(ExceptionUtils.getFullStackTrace(e));
    }
  }
  return result;
}
Program: 12302
Project: 12302
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  if (args.length < 1) {
    printHelp();
    System.exit(1);
  }
  String solrHomePath=args[args.length - 3];
  String solrCoreName=args[args.length - 2];
  String jatePropertyFile=args[args.length - 1];
  Map<String,String> params=getParams(args);
  List<JATETerm> terms;
  try {
    AppATTF app=new AppATTF(params);
    terms=app.extract(solrHomePath,solrCoreName,jatePropertyFile);
    app.write(terms);
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
    e.printStackTrace();
  }
catch (  JATEException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param args, command-line params accepting solr home path, solr core name,jate properties file and more optional run-time parameters
 * @see uk.ac.shef.dcs.jate.app.AppParams
 */
public static void main(String[] args){
  if (args.length < 1) {
    printHelp();
    System.exit(1);
  }
  String solrHomePath=args[args.length - 3];
  String solrCoreName=args[args.length - 2];
  String jatePropertyFile=args[args.length - 1];
  Map<String,String> params=getParams(args);
  List<JATETerm> terms;
  try {
    AppATTF app=new AppATTF(params);
    terms=app.extract(solrHomePath,solrCoreName,jatePropertyFile);
    app.write(terms);
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
    e.printStackTrace();
  }
catch (  JATEException e) {
    e.printStackTrace();
  }
}
Program: 12303
Project: 12303
Buggy source:
public AppCValue(Map<String,String> initParams) throws JATEException {
  super(initParams);
}

Fixed version (ground truth):
/** 
 * @param initParams, initial parameters including pre-filtering and post-filtering parameters
 * @throws JATEException
 * @see uk.ac.shef.dcs.jate.app.AppParams
 */
public AppCValue(Map<String,String> initParams) throws JATEException {
  super(initParams);
}
Program: 12304
Project: 12304
Buggy source:
public static void main(String[] args){
  if (args.length < 1) {
    printHelp();
    System.exit(1);
  }
  String solrHomePath=args[args.length - 3];
  String solrCoreName=args[args.length - 2];
  String jatePropertyFile=args[args.length - 1];
  Map<String,String> params=getParams(args);
  List<JATETerm> terms;
  try {
    App app=new AppCValue(params);
    terms=app.extract(solrHomePath,solrCoreName,jatePropertyFile);
    app.write(terms);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  JATEException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param args, command-line params accepting solr home path, solr core name,jate properties file and more optional run-time parameters
 * @see uk.ac.shef.dcs.jate.app.AppParams
 */
public static void main(String[] args){
  if (args.length < 1) {
    printHelp();
    System.exit(1);
  }
  String solrHomePath=args[args.length - 3];
  String solrCoreName=args[args.length - 2];
  String jatePropertyFile=args[args.length - 1];
  Map<String,String> params=getParams(args);
  List<JATETerm> terms;
  try {
    App app=new AppCValue(params);
    terms=app.extract(solrHomePath,solrCoreName,jatePropertyFile);
    app.write(terms);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  JATEException e) {
    e.printStackTrace();
  }
}
Program: 12306
Project: 12306
Buggy source:
@Override protected Integer computeSingleWorker(List<ContextWindow> contextWindows){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(contextWindows.size()).append("String_Node_Str").append(ref_frequencyCtxBased.getMapTerm2Ctx().size());
  LOG.info(sb.toString());
  int total=0;
  for (  ContextWindow ctx : contextWindows) {
    Map<String,Integer> refTerm2TFIC=ref_frequencyCtxBased.getTFIC(ctx);
    if (refTerm2TFIC.size() == 0)     continue;
    Map<String,Integer> term2TFIC=frequencyCtxBased.getTFIC(ctx);
    List<String> terms=new ArrayList<>(term2TFIC.keySet());
    for (int i=0; i < terms.size(); i++) {
      String targetTerm=terms.get(i);
      if ((minTTF > 0 && frequencyTermBased.getTTF(targetTerm) < minTTF) || (minTCF > 0 && frequencyCtxBased.getContexts(targetTerm).size() < minTCF))       continue;
      int targetFIC=term2TFIC.get(targetTerm);
      int targetIdx=feature.lookupAndIndexTerm(targetTerm);
      for (      Map.Entry<String,Integer> en : refTerm2TFIC.entrySet()) {
        String refTerm=en.getKey();
        if (refTerm.equals(targetTerm))         continue;
        int refTermFIC=en.getValue();
        int refIdx=feature.lookupAndIndexRefTerm(refTerm);
        int coocurringFreq=targetFIC < refTermFIC ? targetFIC : refTermFIC;
        feature.increment(targetIdx,refIdx,coocurringFreq);
      }
    }
    total++;
  }
  return total;
}

Fixed version (ground truth):
@Override protected Integer computeSingleWorker(List<ContextWindow> contextWindows){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(contextWindows.size()).append("String_Node_Str").append(ref_frequencyCtxBased.getMapTerm2Ctx().size());
  LOG.info(sb.toString());
  int total=0;
  for (  ContextWindow ctx : contextWindows) {
    Map<String,Integer> refTerm2TFIC=ref_frequencyCtxBased.getTFIC(ctx);
    Map<String,Integer> term2TFIC=frequencyCtxBased.getTFIC(ctx);
    List<String> terms=new ArrayList<>(term2TFIC.keySet());
    for (int i=0; i < terms.size(); i++) {
      String targetTerm=terms.get(i);
      if ((minTTF > 0 && frequencyTermBased.getTTF(targetTerm) < minTTF) || (minTCF > 0 && frequencyCtxBased.getContexts(targetTerm).size() < minTCF))       continue;
      int targetFIC=term2TFIC.get(targetTerm);
      int targetIdx=feature.lookupAndIndexTerm(targetTerm);
      for (      Map.Entry<String,Integer> en : refTerm2TFIC.entrySet()) {
        String refTerm=en.getKey();
        if (refTerm.equals(targetTerm))         continue;
        int refTermFIC=en.getValue();
        int refIdx=feature.lookupAndIndexRefTerm(refTerm);
        int coocurringFreq=targetFIC < refTermFIC ? targetFIC : refTermFIC;
        feature.increment(targetIdx,refIdx,coocurringFreq);
      }
    }
    total++;
  }
  return total;
}
Program: 12308
Project: 12308
Buggy source:
protected void setReindex(){
  reindex=true;
}

Fixed version (ground truth):
protected void setReindex(){
  reindex=false;
}
Program: 12309
Project: 12309
Buggy source:
@Test public void benchmarking_appWeirdness() throws JATEException, IOException {
}

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

Fixed version (ground truth):
@Test public void benchmarking_appChiSquare() throws IOException, JATEException {
}
Program: 12311
Project: 12311
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);
  }
  clearAttributes();
  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=null;
    try {
      word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    }
 catch (    StringIndexOutOfBoundsException ioe) {
      LOG.error(ioe.toString());
      word=((PackedTokenAttributeImpl)offsetAtt).toString();
    }
    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: 12312
Project: 12312
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=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;
}

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=null;
    try {
      word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    }
 catch (    StringIndexOutOfBoundsException ioe) {
      LOG.error(ioe.toString());
      word=((PackedTokenAttributeImpl)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;
}
Program: 12313
Project: 12313
Buggy source:
protected void write(List<JATETerm> terms) throws IOException {
  Gson gson=new Gson();
  if (outputFile == null) {
    throw new IOException("String_Node_Str");
  }
 else {
    Writer w=IOUtil.getUTF8Writer(outputFile);
    gson.toJson(terms,w);
    w.close();
  }
}

Fixed version (ground truth):
public void write(List<JATETerm> terms) throws IOException {
  Gson gson=new Gson();
  if (outputFile == null) {
    throw new IOException("String_Node_Str");
  }
 else {
    Writer w=IOUtil.getUTF8Writer(outputFile);
    gson.toJson(terms,w);
    w.close();
  }
}
Program: 12315
Project: 12315
Buggy source:
static void indexJATEDocuments(Path file,JATEProperties jateProp,boolean commit) throws JATEException {
  try {
    JATEDocument jateDocument=JATEUtil.loadACLRDTECDocument(new FileInputStream(file.toFile()));
    if (jateDocument.getContent().trim().length() != 0)     JATEUtil.addNewDoc(server,jateDocument.getId(),jateDocument.getId(),jateDocument.getContent(),jateProp,commit);
  }
 catch (  FileNotFoundException ffe) {
    throw new JATEException(ffe.toString());
  }
catch (  IOException ioe) {
    throw new JATEException(String.format("String_Node_Str",file.toString()) + ioe.toString());
  }
catch (  SolrServerException sse) {
    throw new JATEException(String.format("String_Node_Str",file.toString()) + sse.toString());
  }
}

Fixed version (ground truth):
static void indexJATEDocuments(Path file,JATEProperties jateProp,boolean commit) throws JATEException {
  if (file == null || file.toString().contains("String_Node_Str")) {
    return;
  }
  try {
    JATEDocument jateDocument=JATEUtil.loadACLRDTECDocument(new FileInputStream(file.toFile()));
    if (jateDocument.getContent().trim().length() != 0)     JATEUtil.addNewDoc(server,jateDocument.getId(),jateDocument.getId(),jateDocument.getContent(),jateProp,commit);
  }
 catch (  FileNotFoundException ffe) {
    throw new JATEException(ffe.toString());
  }
catch (  IOException ioe) {
    throw new JATEException(String.format("String_Node_Str",file.toString()) + ioe.toString());
  }
catch (  SolrServerException sse) {
    throw new JATEException(String.format("String_Node_Str",file.toString()) + sse.toString());
  }
}
Program: 12316
Project: 12316
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);
  Collections.sort(files);
  LOG.info("String_Node_Str" + files.size() + "String_Node_Str");
  int count=0;
  for (  Path file : files) {
    try {
      if (!file.toString().contains("String_Node_Str")) {
        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 {
      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: 12317
Project: 12317
Buggy source:
@Override public List<JATETerm> execute(Collection<String> candidates) throws JATEException {
  AbstractFeature feature=features.get(FrequencyTermBased.class.getName() + SUFFIX_WORD);
  validateFeature(feature,FrequencyTermBased.class);
  FrequencyTermBased fFeatureWords=(FrequencyTermBased)feature;
  AbstractFeature feature2=features.get(FrequencyTermBased.class.getName() + SUFFIX_TERM);
  validateFeature(feature2,FrequencyTermBased.class);
  FrequencyTermBased fFeatureTerms=(FrequencyTermBased)feature2;
  AbstractFeature tciFeature=features.get(TermComponentIndex.class.getName());
  validateFeature(tciFeature,TermComponentIndex.class);
  TermComponentIndex fFeatureTermCompIndex=(TermComponentIndex)tciFeature;
  int cores=Runtime.getRuntime().availableProcessors();
  int maxPerWorker=candidates.size() / cores;
  StringBuilder msg=new StringBuilder("String_Node_Str");
  msg.append(cores).append("String_Node_Str" + candidates.size()).append("String_Node_Str").append("String_Node_Str").append(maxPerWorker);
  LOG.info(msg.toString());
  ForkJoinPool forkJoinPool=new ForkJoinPool(cores);
  RAKEWorker worker=new RAKEWorker(new ArrayList<>(candidates),maxPerWorker,fFeatureWords,fFeatureTerms,fFeatureTermCompIndex);
  List<JATETerm> result=forkJoinPool.invoke(worker);
  Collections.sort(result);
  LOG.info("String_Node_Str");
  return result;
}

Fixed version (ground truth):
@Override public List<JATETerm> execute(Collection<String> candidates) throws JATEException {
  AbstractFeature feature=features.get(FrequencyTermBased.class.getName() + SUFFIX_WORD);
  validateFeature(feature,FrequencyTermBased.class);
  FrequencyTermBased fFeatureWords=(FrequencyTermBased)feature;
  AbstractFeature feature2=features.get(FrequencyTermBased.class.getName() + SUFFIX_TERM);
  validateFeature(feature2,FrequencyTermBased.class);
  FrequencyTermBased fFeatureTerms=(FrequencyTermBased)feature2;
  AbstractFeature tciFeature=features.get(TermComponentIndex.class.getName());
  validateFeature(tciFeature,TermComponentIndex.class);
  TermComponentIndex fFeatureTermCompIndex=(TermComponentIndex)tciFeature;
  int cores=Runtime.getRuntime().availableProcessors();
  int maxPerWorker=candidates.size() / cores;
  if (maxPerWorker == 0)   maxPerWorker=50;
  StringBuilder msg=new StringBuilder("String_Node_Str");
  msg.append(cores).append("String_Node_Str" + candidates.size()).append("String_Node_Str").append("String_Node_Str").append(maxPerWorker);
  LOG.info(msg.toString());
  ForkJoinPool forkJoinPool=new ForkJoinPool(cores);
  RAKEWorker worker=new RAKEWorker(new ArrayList<>(candidates),Integer.MAX_VALUE,fFeatureWords,fFeatureTerms,fFeatureTermCompIndex);
  List<JATETerm> result=forkJoinPool.invoke(worker);
  Collections.sort(result);
  LOG.info("String_Node_Str");
  return result;
}
Program: 12318
Project: 12318
Buggy source:
@Override protected List<JATETerm> computeSingleWorker(List<String> candidates){
  List<JATETerm> result=new ArrayList<>();
  int count=0;
  for (  String tString : candidates) {
    String[] elements=tString.split("String_Node_Str");
    double score=0;
    for (    String e : elements) {
      int freq=fFeatureWords.getTTF(e);
      if (freq == 0)       continue;
      int degree=freq;
      List<Pair<String,Integer>> parentTerms=fTermCompIndex.getSorted(e);
      for (      Pair<String,Integer> pTerm : parentTerms) {
        String pTermStr=pTerm.getKey();
        if (pTerm.getValue() == 1)         continue;
        int pTF=fFeatureTerms.getTTF(pTermStr);
        String[] pTermElements=pTermStr.split("String_Node_Str");
        for (        String ep : pTermElements) {
          if (ep.equals(e))           continue;
          degree+=pTF;
        }
      }
      double wScore=(double)degree / freq;
      score+=wScore;
    }
    JATETerm term=new JATETerm(tString,score);
    result.add(term);
    count++;
    if (count % 2000 == 0) {
      LOG.info("String_Node_Str" + count + "String_Node_Str"+ candidates.size());
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected List<JATETerm> computeSingleWorker(List<String> candidates){
  List<JATETerm> result=new ArrayList<>();
  int count=0;
  for (  String tString : candidates) {
    if (tString.equals("String_Node_Str") || tString.equals("String_Node_Str"))     System.out.println("String_Node_Str");
    String[] elements=tString.split("String_Node_Str");
    double score=0;
    for (    String e : elements) {
      int freq=fFeatureWords.getTTF(e);
      if (freq == 0)       continue;
      int degree=freq;
      List<Pair<String,Integer>> parentTerms=fTermCompIndex.getSorted(e);
      for (      Pair<String,Integer> pTerm : parentTerms) {
        String pTermStr=pTerm.getKey();
        if (pTerm.getValue() == 1)         continue;
        int pTF=fFeatureTerms.getTTF(pTermStr);
        String[] pTermElements=pTermStr.split("String_Node_Str");
        for (        String ep : pTermElements) {
          if (ep.equals(e))           continue;
          degree+=pTF;
        }
      }
      double wScore=(double)degree / freq;
      score+=wScore;
    }
    JATETerm term=new JATETerm(tString,score);
    result.add(term);
    count++;
    if (count % 2000 == 0) {
      LOG.info("String_Node_Str" + count + "String_Node_Str"+ candidates.size());
    }
  }
  return result;
}
Program: 12319
Project: 12319
Buggy source:
protected void setReindex(){
  reindex=true;
}

Fixed version (ground truth):
protected void setReindex(){
  reindex=false;
}
Program: 12320
Project: 12320
Buggy source:
@Test public void benchmarking_appCValue() throws IOException, JATEException {
}

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

Fixed version (ground truth):
public void benchmarking_appWeirdness() throws JATEException, IOException {
}
Program: 12322
Project: 12322
Buggy source:
@Test public void benchmarking_appGlossEx() throws JATEException, IOException {
}

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

Fixed version (ground truth):
public void benchmarking_appTTF() throws JATEException, IOException {
}
Program: 12324
Project: 12324
Buggy source:
@Test public void validate_indexing(){
  ModifiableSolrParams params=new ModifiableSolrParams();
  params.set("String_Node_Str","String_Node_Str");
  try {
    QueryResponse qResp=server.query(params);
    SolrDocumentList docList=qResp.getResults();
    assert(docList.getNumFound() == 2000);
  }
 catch (  SolrServerException e) {
    e.printStackTrace();
  }
catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}

Fixed version (ground truth):
public void validate_indexing(){
  ModifiableSolrParams params=new ModifiableSolrParams();
  params.set("String_Node_Str","String_Node_Str");
  try {
    QueryResponse qResp=server.query(params);
    SolrDocumentList docList=qResp.getResults();
    assert(docList.getNumFound() == 2000);
  }
 catch (  SolrServerException e) {
    e.printStackTrace();
  }
catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}
Program: 12325
Project: 12325
Buggy source:
@Test public void benchmarking_appChiSquare() throws IOException, JATEException {
}

Fixed version (ground truth):
public void benchmarking_appChiSquare() throws IOException, JATEException {
}
Program: 12326
Project: 12326
Buggy source:
@Test public void benchmarking_appATTF() throws JATEException, IOException {
}

Fixed version (ground truth):
public void benchmarking_appATTF() throws JATEException, IOException {
}
Program: 12327
Project: 12327
Buggy source:
@Test public void benchmarking_appTermEx() throws JATEException, IOException {
}

Fixed version (ground truth):
public void benchmarking_appTermEx() throws JATEException, IOException {
}
Program: 12328
Project: 12328
Buggy source:
@Test public void benchmarking_appRIDF() throws JATEException, IOException {
}

Fixed version (ground truth):
public void benchmarking_appRIDF() throws JATEException, IOException {
}
Program: 12329
Project: 12329
Buggy source:
@Test public void benchmarking_appTFIDF() throws JATEException, IOException {
}

Fixed version (ground truth):
public void benchmarking_appTFIDF() throws JATEException, IOException {
}
Program: 12330
Project: 12330
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=null;
    try {
      word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    }
 catch (    StringIndexOutOfBoundsException ioe) {
      LOG.error(ioe.toString());
      word=((PackedTokenAttributeImpl)offsetAtt).toString();
    }
    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};
}

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=null;
    try {
      word=new String(buffer,0,offsetAtt.endOffset() - offsetAtt.startOffset());
    }
 catch (    StringIndexOutOfBoundsException ioe) {
      LOG.error(ExceptionUtils.getFullStackTrace(ioe));
      word=offsetAtt.toString();
    }
    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: 12331
Project: 12331
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=((PackedTokenAttributeImpl)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=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;
}
Program: 12332
Project: 12332
Buggy source:
@Override public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    String tok=new String(termAtt.buffer(),0,termAtt.length());
    tok=tok.trim();
    if (tok.length() > 0) {
      String normalised=stripPunctuations(tok,stripAnySymbols,stripLeadingSymbols,stripTrailingSymbols);
      if (normalised.length() == 0)       clearAttributes();
 else       termAtt.setEmpty().append(tok);
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    String tok=new String(termAtt.buffer(),0,termAtt.length());
    tok=tok.trim();
    if (tok.length() > 0) {
      String normalised=stripPunctuations(tok,stripAnySymbols,stripLeadingSymbols,stripTrailingSymbols);
      if (normalised.length() == 0)       clearAttributes();
 else       termAtt.setEmpty().append(normalised);
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 12334
Project: 12334
Buggy source:
public EnglishLemmatisationFilter(EngLemmatiser lemmatiser,TokenStream input){
  super(input);
  this.lemmatiser=lemmatiser;
  tagLookUp=new HashMap<>();
  tagLookUp.put("String_Node_Str",1);
  tagLookUp.put("String_Node_Str",1);
  tagLookUp.put("String_Node_Str",1);
  tagLookUp.put("String_Node_Str",1);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",2);
  tagLookUp.put("String_Node_Str",3);
  tagLookUp.put("String_Node_Str",3);
  tagLookUp.put("String_Node_Str",3);
  tagLookUp.put("String_Node_Str",4);
  tagLookUp.put("String_Node_Str",4);
  tagLookUp.put("String_Node_Str",4);
}

Fixed version (ground truth):
public EnglishLemmatisationFilter(EngLemmatiser dragontoolLemmatiser,TokenStream input){
  super(input);
  lemmatiser=new Lemmatiser(dragontoolLemmatiser);
}
Program: 12335
Project: 12335
Buggy source:
@Override public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    String tok=new String(termAtt.buffer(),0,termAtt.length());
    BytesRef payload=exitingPayload.getPayload();
    String pos="String_Node_Str";
    if (payload != null) {
      String attachedInfo=payload.utf8ToString();
      int index=attachedInfo.lastIndexOf("String_Node_Str");
      if (index != -1) {
        pos=attachedInfo.substring(index + 2);
        int end=pos.indexOf("String_Node_Str");
        if (end != -1)         pos=pos.substring(0,end);
      }
    }
    if (tok.length() > 2) {
      tok=normalize(tok,"String_Node_Str");
    }
    termAtt.setEmpty().append(tok);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    String tok=new String(termAtt.buffer(),0,termAtt.length());
    BytesRef payload=exitingPayload.getPayload();
    String pos="String_Node_Str";
    if (payload != null) {
      String attachedInfo=payload.utf8ToString();
      int index=attachedInfo.lastIndexOf("String_Node_Str");
      if (index != -1) {
        pos=attachedInfo.substring(index + 2);
        int end=pos.indexOf("String_Node_Str");
        if (end != -1)         pos=pos.substring(0,end);
      }
    }
    if (tok.length() > 2) {
      tok=lemmatiser.normalize(tok,"String_Node_Str");
    }
    termAtt.setEmpty().append(tok);
    return true;
  }
 else {
    return false;
  }
}
Program: 12336
Project: 12336
Buggy source:
public static List<String> loadACLRD(String file,boolean lowercase,boolean normalize) throws IOException {
  List<String> raw=FileUtils.readLines(new File(file));
  List<String> terms=new ArrayList<>(raw.size() - 1);
  int count=0;
  for (  String r : raw) {
    if (count == 0) {
      count++;
      continue;
    }
    String[] splits=r.split("String_Node_Str");
    if (splits[2].equals("String_Node_Str"))     continue;
    terms.add(splits[1].trim());
  }
  return terms;
}

Fixed version (ground truth):
public static List<String> loadACLRD(String file) throws IOException {
  List<String> raw=FileUtils.readLines(new File(file));
  List<String> terms=new ArrayList<>(raw.size() - 1);
  int count=0;
  for (  String r : raw) {
    if (count == 0) {
      count++;
      continue;
    }
    String[] splits=r.split("String_Node_Str");
    if (splits[2].equals("String_Node_Str"))     continue;
    terms.add(splits[1].trim());
  }
  return terms;
}
Program: 12337
Project: 12337
Buggy source:
public static List<String> loadGenia(File file,boolean lowercase,boolean normalize) throws IOException {
  List<String> terms=FileUtils.readLines(file);
  return prune(terms,lowercase,normalize);
}

Fixed version (ground truth):
/** 
 * @param file
 * @return
 */
public static List<String> loadGenia(String file) throws IOException {
  List<String> terms=FileUtils.readLines(new File(file));
  return terms;
}
Program: 12338
Project: 12338
Buggy source:
public static void createReportACLRD(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.loadACLRD(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 createReportACLRD(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, JATEException {
  PrintWriter p=new PrintWriter(outFile);
  List<String> gs=GSLoader.loadACLRD(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: 12339
Project: 12339
Buggy source:
/** 
 * prune term list for benchmarking this methods enable to calculate the agreement of two term set on a strict or lenient basis
 * @param terms, term list to be pruned
 * @param ignoreSymbols, remove symbols
 * @param ignoreDigits, remove digits
 * @param minChar, minimum characters allowed
 * @param maxChar, maximum characters allowed
 * @param minTokens, minimum tokens allowed
 * @param maxTokens, maximum tokens allowed
 * @return List, list of normalised term set
 */
public static List<String> prune(List<String> terms,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens){
  List<String> result=new ArrayList<>();
  for (  String term : terms) {
    if (ignoreDigits)     term=term.replaceAll(digitsPattern,"String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    if (ignoreSymbols)     term=term.replaceAll(symbolsPattern,"String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    term=term.trim();
    if (term.length() >= minChar && term.length() <= maxChar) {
      int tokens=term.split("String_Node_Str").length;
      if (tokens >= minTokens && tokens <= maxTokens)       if (lowercase) {
        result.add(term.toLowerCase());
      }
 else {
        result.add(term);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * prune term list for benchmarking this methods enable to calculate the agreement of two term set on a strict or lenient basis
 * @param terms, term list to be pruned
 * @param ignoreSymbols, remove symbols
 * @param ignoreDigits, remove digits
 * @param minChar, minimum characters allowed
 * @param maxChar, maximum characters allowed
 * @param minTokens, minimum tokens allowed
 * @param maxTokens, maximum tokens allowed
 * @return List, list of normalised term set
 */
public static List<String> prune(List<String> terms,boolean ignoreSymbols,boolean ignoreDigits,boolean lowercase,int minChar,int maxChar,int minTokens,int maxTokens){
  List<String> result=new ArrayList<>();
  for (  String term : terms) {
    if (ignoreDigits)     term=term.replaceAll(digitsPattern,"String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    if (ignoreSymbols)     term=term.replaceAll(symbolsPattern,"String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
    int start=0, end=term.length();
    for (int i=0; i < term.length(); i++) {
      if (Character.isLetterOrDigit(term.charAt(i))) {
        start=i;
        break;
      }
    }
    for (int i=term.length() - 1; i > -1; i--) {
      if (Character.isLetterOrDigit(term.charAt(i))) {
        end=i + 1;
        break;
      }
    }
    term=term.substring(start,end).trim();
    if (term.length() >= minChar && term.length() <= maxChar) {
      int tokens=term.split("String_Node_Str").length;
      if (tokens >= minTokens && tokens <= maxTokens)       if (lowercase) {
        result.add(term.toLowerCase());
      }
 else {
        result.add(term);
      }
    }
  }
  return result;
}
Program: 12340
Project: 12340
Buggy source:
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();
  }
}

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,10,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);
  }
}