Program: 10522
Project: 10522
Buggy source:
@Override public void run(){
  Date start=new Date();
  this.setChanged();
  notifyObservers("String_Node_Str");
  int[] coverageCurve=new int[this.chartData.originalTimeSeries.length];
  for (  GrammarRuleRecord ruleEntry : this.chartData.getGrammarRules()) {
    if (0 == ruleEntry.ruleNumber()) {
      continue;
    }
    ArrayList<RuleInterval> intervals=getRulePositionsByRuleNum(ruleEntry.ruleNumber());
    for (    RuleInterval interval : intervals) {
      for (int j=interval.getStartPos(); j < interval.getEndPos(); j++) {
        coverageCurve[j]++;
      }
    }
  }
  HashMap<RuleDescriptor,ArrayList<RuleInterval>> rules=new HashMap<RuleDescriptor,ArrayList<RuleInterval>>();
  for (  GrammarRuleRecord r : this.chartData.getGrammarRules()) {
    if (0 == r.ruleNumber()) {
      continue;
    }
    ArrayList<RuleInterval> intervals=getRulePositionsByRuleNum(r.ruleNumber());
    rules.put(new RuleDescriptor(r.ruleNumber(),r.getRuleName(),r.getRuleString(),r.getMeanLength(),r.getRuleUseFrequency()),intervals);
  }
  ArrayList<RuleInterval> intervals=new ArrayList<RuleInterval>();
  for (  Entry<RuleDescriptor,ArrayList<RuleInterval>> e : rules.entrySet()) {
    for (    RuleInterval ri : e.getValue()) {
      ri.setCoverage(e.getKey().getRuleFrequency());
      ri.setId(e.getKey().getRuleIndex());
      intervals.add(ri);
    }
  }
  for (int i=0; i < coverageCurve.length; i++) {
    if (0 == coverageCurve[i]) {
      int j=i;
      while ((j < coverageCurve.length) && (0 == coverageCurve[j])) {
        j++;
      }
      if (Math.abs(i - j) > 1) {
        intervals.add(new RuleInterval(0,i,j,0.0d));
      }
      i=j;
    }
  }
  log("String_Node_Str");
  this.chartData.discords=new DiscordRecords();
  VisitRegistry globalTrackVisitRegistry=new VisitRegistry(this.chartData.originalTimeSeries.length);
  while (this.chartData.discords.getSize() < 10) {
    start=new Date();
    DiscordRecord bestDiscord;
    try {
      bestDiscord=SAXFactory.findBestDiscordForIntervals(this.chartData.originalTimeSeries,intervals,globalTrackVisitRegistry);
      Date end=new Date();
      if (bestDiscord.getNNDistance() == 0.0D || bestDiscord.getPosition() == -1) {
        log("String_Node_Str" + this.chartData.discords.getSize() + "String_Node_Str"+ bestDiscord.toString());
        break;
      }
      log("String_Node_Str" + bestDiscord.getPosition() + "String_Node_Str"+ bestDiscord.getLength()+ "String_Node_Str"+ bestDiscord.getNNDistance()+ "String_Node_Str"+ SAXFactory.timeToString(start.getTime(),end.getTime())+ "String_Node_Str"+ bestDiscord.getInfo());
      this.chartData.discords.add(bestDiscord);
      LargeWindowAlgorithm marker=new LargeWindowAlgorithm();
      marker.markVisited(globalTrackVisitRegistry,bestDiscord.getPosition(),bestDiscord.getLength());
    }
 catch (    TSException e) {
      log(StackTrace.toString(e));
      e.printStackTrace();
    }
  }
  Date end=new Date();
  log("String_Node_Str" + SAXFactory.timeToString(start.getTime(),end.getTime()));
}

Fixed version (ground truth):
@Override public void run(){
  Date start=new Date();
  this.setChanged();
  notifyObservers("String_Node_Str");
  int[] coverageCurve=new int[this.chartData.originalTimeSeries.length];
  for (  GrammarRuleRecord ruleEntry : this.chartData.getGrammarRules()) {
    if (0 == ruleEntry.ruleNumber()) {
      continue;
    }
    ArrayList<RuleInterval> intervals=getRulePositionsByRuleNum(ruleEntry.ruleNumber());
    for (    RuleInterval interval : intervals) {
      for (int j=interval.getStartPos(); j < interval.getEndPos(); j++) {
        coverageCurve[j]++;
      }
    }
  }
  HashMap<RuleDescriptor,ArrayList<RuleInterval>> rules=new HashMap<RuleDescriptor,ArrayList<RuleInterval>>();
  for (  GrammarRuleRecord r : this.chartData.getGrammarRules()) {
    if (0 == r.ruleNumber()) {
      continue;
    }
    ArrayList<RuleInterval> intervals=getRulePositionsByRuleNum(r.ruleNumber());
    rules.put(new RuleDescriptor(r.ruleNumber(),r.getRuleName(),r.getRuleString(),r.getMeanLength(),r.getRuleUseFrequency()),intervals);
  }
  ArrayList<RuleInterval> intervals=new ArrayList<RuleInterval>();
  for (  Entry<RuleDescriptor,ArrayList<RuleInterval>> e : rules.entrySet()) {
    for (    RuleInterval ri : e.getValue()) {
      ri.setCoverage(e.getKey().getRuleFrequency());
      ri.setId(e.getKey().getRuleIndex());
      intervals.add(ri);
    }
  }
  for (int i=0; i < coverageCurve.length; i++) {
    if (0 == coverageCurve[i]) {
      int j=i;
      while ((j < coverageCurve.length - 1) && (0 == coverageCurve[j])) {
        j++;
      }
      if (Math.abs(i - j) > 1) {
        intervals.add(new RuleInterval(0,i,j,0.0d));
      }
      i=j;
    }
  }
  log("String_Node_Str");
  this.chartData.discords=new DiscordRecords();
  VisitRegistry globalTrackVisitRegistry=new VisitRegistry(this.chartData.originalTimeSeries.length);
  while (this.chartData.discords.getSize() < 10) {
    start=new Date();
    DiscordRecord bestDiscord;
    try {
      bestDiscord=SAXFactory.findBestDiscordForIntervals(this.chartData.originalTimeSeries,intervals,globalTrackVisitRegistry);
      Date end=new Date();
      if (bestDiscord.getNNDistance() == 0.0D || bestDiscord.getPosition() == -1) {
        log("String_Node_Str" + this.chartData.discords.getSize() + "String_Node_Str"+ bestDiscord.toString());
        break;
      }
      log("String_Node_Str" + bestDiscord.getPosition() + "String_Node_Str"+ bestDiscord.getLength()+ "String_Node_Str"+ bestDiscord.getNNDistance()+ "String_Node_Str"+ SAXFactory.timeToString(start.getTime(),end.getTime())+ "String_Node_Str"+ bestDiscord.getInfo());
      this.chartData.discords.add(bestDiscord);
      LargeWindowAlgorithm marker=new LargeWindowAlgorithm();
      marker.markVisited(globalTrackVisitRegistry,bestDiscord.getPosition(),bestDiscord.getLength());
    }
 catch (    TSException e) {
      log(StackTrace.toString(e));
      e.printStackTrace();
    }
  }
  Date end=new Date();
  log("String_Node_Str" + SAXFactory.timeToString(start.getTime(),end.getTime()));
}