Program: 10510
Project: 10510
Buggy source:
/** 
 * Process data with Sequitur. Populate and broadcast ChartData object.
 * @param algorithm the algorithm, 0 Sequitur, 1 RE-PAIR.
 * @param useSlidingWindow The use sliding window parameter.
 * @param numerosityReductionStrategy The numerosity reduction strategy.
 * @param windowSize The SAX sliding window size.
 * @param paaSize The SAX PAA size.
 * @param alphabetSize The SAX alphabet size.
 * @param normalizationThreshold The normalization threshold.
 * @param grammarOutputFileName The file name to where save the grammar.
 * @throws IOException
 */
public synchronized void processData(GIAlgorithm algorithm,boolean useSlidingWindow,NumerosityReductionStrategy numerosityReductionStrategy,int windowSize,int paaSize,int alphabetSize,double normalizationThreshold,String grammarOutputFileName) throws IOException {
  if (null == this.ts || this.ts.length == 0) {
    this.log("String_Node_Str");
  }
 else {
    StringBuffer sb=new StringBuffer("String_Node_Str");
    if (GIAlgorithm.SEQUITUR.equals(algorithm)) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str").append(useSlidingWindow);
    sb.append("String_Node_Str").append(numerosityReductionStrategy.toString());
    sb.append("String_Node_Str").append(windowSize);
    sb.append("String_Node_Str").append(paaSize);
    sb.append("String_Node_Str").append(alphabetSize);
    LOGGER.info(sb.toString());
    this.log(sb.toString());
    LOGGER.debug("String_Node_Str");
    this.chartData=new GrammarVizChartData(this.dataFileName,this.ts,useSlidingWindow,numerosityReductionStrategy,windowSize,paaSize,alphabetSize,normalizationThreshold);
    NormalAlphabet na=new NormalAlphabet();
    try {
      if (GIAlgorithm.SEQUITUR.equals(algorithm)) {
        SAXProcessor sp=new SAXProcessor();
        SAXRecords saxFrequencyData=new SAXRecords();
        if (useSlidingWindow) {
          saxFrequencyData=sp.ts2saxViaWindow(ts,windowSize,paaSize,na.getCuts(alphabetSize),numerosityReductionStrategy,normalizationThreshold);
        }
 else {
          saxFrequencyData=sp.ts2saxByChunking(ts,paaSize,na.getCuts(alphabetSize),normalizationThreshold);
        }
        LOGGER.trace("String_Node_Str" + saxFrequencyData.getSAXString(SPACE));
        LOGGER.debug("String_Node_Str");
        SAXRule sequiturGrammar=SequiturFactory.runSequitur(saxFrequencyData.getSAXString(SPACE));
        LOGGER.debug("String_Node_Str");
        GrammarRules rules=sequiturGrammar.toGrammarRulesData();
        LOGGER.debug("String_Node_Str");
        SequiturFactory.updateRuleIntervals(rules,saxFrequencyData,useSlidingWindow,this.ts,windowSize,paaSize);
        LOGGER.debug("String_Node_Str");
        this.chartData.setGrammarRules(rules);
      }
 else {
        ParallelSAXImplementation ps=new ParallelSAXImplementation();
        SAXRecords parallelRes=ps.process(ts,2,windowSize,paaSize,alphabetSize,numerosityReductionStrategy,normalizationThreshold);
        RePairGrammar rePairGrammar=RePairFactory.buildGrammar(parallelRes);
        rePairGrammar.expandRules();
        rePairGrammar.buildIntervals(parallelRes,ts,windowSize);
        GrammarRules rules=rePairGrammar.toGrammarRulesData();
        this.chartData.setGrammarRules(rules);
      }
    }
 catch (    Exception e) {
      this.log("String_Node_Str" + StackTrace.toString(e));
      e.printStackTrace();
    }
    this.log("String_Node_Str");
    LOGGER.info("String_Node_Str");
    setChanged();
    notifyObservers(new GrammarVizMessage(GrammarVizMessage.CHART_MESSAGE,this.chartData));
  }
}

Fixed version (ground truth):
/** 
 * Process data with GI algorithm. Instantiate, populate, and broadcast the ChartData object.
 * @param algorithm the algorithm, 0 Sequitur, 1 RE-PAIR.
 * @param useSlidingWindow The use sliding window parameter.
 * @param numerosityReductionStrategy The numerosity reduction strategy.
 * @param windowSize The SAX sliding window size.
 * @param paaSize The SAX PAA size.
 * @param alphabetSize The SAX alphabet size.
 * @param normalizationThreshold The normalization threshold.
 * @param grammarOutputFileName The file name to where save the grammar.
 * @throws IOException
 */
public synchronized void processData(GIAlgorithm algorithm,boolean useSlidingWindow,NumerosityReductionStrategy numerosityReductionStrategy,int windowSize,int paaSize,int alphabetSize,double normalizationThreshold,String grammarOutputFileName) throws IOException {
  if (null == this.ts || this.ts.length == 0) {
    this.log("String_Node_Str");
  }
 else {
    StringBuffer sb=new StringBuffer("String_Node_Str");
    if (GIAlgorithm.SEQUITUR.equals(algorithm)) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str").append(useSlidingWindow);
    sb.append("String_Node_Str").append(numerosityReductionStrategy.toString());
    sb.append("String_Node_Str").append(windowSize);
    sb.append("String_Node_Str").append(paaSize);
    sb.append("String_Node_Str").append(alphabetSize);
    LOGGER.info(sb.toString());
    this.log(sb.toString());
    LOGGER.debug("String_Node_Str");
    this.chartData=new GrammarVizChartData(this.dataFileName,this.ts,useSlidingWindow,numerosityReductionStrategy,windowSize,paaSize,alphabetSize,normalizationThreshold);
    NormalAlphabet na=new NormalAlphabet();
    try {
      if (GIAlgorithm.SEQUITUR.equals(algorithm)) {
        SAXProcessor sp=new SAXProcessor();
        SAXRecords saxFrequencyData=new SAXRecords();
        if (useSlidingWindow) {
          saxFrequencyData=sp.ts2saxViaWindow(ts,windowSize,paaSize,na.getCuts(alphabetSize),numerosityReductionStrategy,normalizationThreshold);
        }
 else {
          saxFrequencyData=sp.ts2saxByChunking(ts,paaSize,na.getCuts(alphabetSize),normalizationThreshold);
        }
        LOGGER.trace("String_Node_Str" + saxFrequencyData.getSAXString(SPACE));
        LOGGER.debug("String_Node_Str");
        SAXRule sequiturGrammar=SequiturFactory.runSequitur(saxFrequencyData.getSAXString(SPACE));
        LOGGER.debug("String_Node_Str");
        GrammarRules rules=sequiturGrammar.toGrammarRulesData();
        LOGGER.debug("String_Node_Str");
        SequiturFactory.updateRuleIntervals(rules,saxFrequencyData,useSlidingWindow,this.ts,windowSize,paaSize);
        LOGGER.debug("String_Node_Str");
        this.chartData.setGrammarRules(rules);
      }
 else {
        ParallelSAXImplementation ps=new ParallelSAXImplementation();
        SAXRecords parallelRes=ps.process(ts,2,windowSize,paaSize,alphabetSize,numerosityReductionStrategy,normalizationThreshold);
        RePairGrammar rePairGrammar=RePairFactory.buildGrammar(parallelRes);
        rePairGrammar.expandRules();
        rePairGrammar.buildIntervals(parallelRes,ts,windowSize);
        GrammarRules rules=rePairGrammar.toGrammarRulesData();
        this.chartData.setGrammarRules(rules);
      }
    }
 catch (    Exception e) {
      this.log("String_Node_Str" + StackTrace.toString(e));
      e.printStackTrace();
    }
    this.log("String_Node_Str");
    LOGGER.info("String_Node_Str");
    setChanged();
    notifyObservers(new GrammarVizMessage(GrammarVizMessage.CHART_MESSAGE,this.chartData));
  }
}