Program: 10519
Project: 10519
Buggy source:
public void performRanking(){
  boolean[] range=new boolean[this.originalTimeSeries.length];
  HashSet<Integer> usedRules=new HashSet<Integer>();
  usedRules.add(0);
  while (hasEmptyRanges(range)) {
    GrammarRuleRecord bestRule=null;
    double bestDelta=Integer.MIN_VALUE;
    for (    GrammarRuleRecord rule : grammarRules) {
      int id=rule.getRuleNumber();
      if (usedRules.contains(id)) {
        continue;
      }
 else {
        double delta=getCoverDelta(range,rule);
        if (delta > bestDelta) {
          bestDelta=delta;
          bestRule=rule;
        }
      }
    }
    if (0.0 == bestDelta) {
      break;
    }
    ArrayList<Integer> rulesToRemove=new ArrayList<Integer>();
    for (    int rid : usedRules) {
      if (0 != rid) {
        ArrayList<RuleInterval> intervalsA=grammarRules.get(rid).getRuleIntervals();
        ArrayList<RuleInterval> intervalsB=bestRule.getRuleIntervals();
        if (isCompletlyCovered(intervalsB,intervalsA)) {
          rulesToRemove.add(rid);
        }
      }
    }
    if (!(rulesToRemove.isEmpty())) {
      System.out.println("String_Node_Str" + rulesToRemove.toString());
    }
    usedRules.removeAll(rulesToRemove);
    System.out.println("String_Node_Str" + bestRule.getRuleNumber());
    usedRules.add(bestRule.getRuleNumber());
    range=updateRanges(range,bestRule.getRuleIntervals());
  }
  System.out.println("String_Node_Str" + Arrays.toString(usedRules.toArray(new Integer[usedRules.size()])));
  GrammarRules prunedRules=new GrammarRules();
  prunedRules.addRule(grammarRules.get(0));
  for (  Integer rId : usedRules) {
    prunedRules.addRule(grammarRules.get(rId));
  }
  this.grammarRules=prunedRules;
}

Fixed version (ground truth):
public void performRanking(){
  boolean[] range=new boolean[this.originalTimeSeries.length];
  HashSet<Integer> usedRules=new HashSet<Integer>();
  usedRules.add(0);
  while (hasEmptyRanges(range)) {
    GrammarRuleRecord bestRule=null;
    double bestDelta=Integer.MIN_VALUE;
    for (    GrammarRuleRecord rule : grammarRules) {
      int id=rule.getRuleNumber();
      if (usedRules.contains(id)) {
        continue;
      }
 else {
        double delta=getCoverDelta(range,rule);
        if (delta > bestDelta) {
          bestDelta=delta;
          bestRule=rule;
        }
      }
    }
    if (0.0 == bestDelta) {
      break;
    }
    System.out.println("String_Node_Str" + bestRule.getRuleNumber());
    usedRules.add(bestRule.getRuleNumber());
    System.out.println("String_Node_Str");
    boolean continueSearch=true;
    while (continueSearch) {
      continueSearch=false;
      for (      int rid : usedRules) {
        if (0 == rid) {
          continue;
        }
        ArrayList<RuleInterval> intervalsA=grammarRules.get(rid).getRuleIntervals();
        ArrayList<RuleInterval> intervalsB=new ArrayList<RuleInterval>();
        for (        int ridB : usedRules) {
          if (0 == ridB || rid == ridB) {
            continue;
          }
          intervalsB.addAll(grammarRules.get(ridB).getRuleIntervals());
        }
        if (intervalsB.isEmpty()) {
          break;
        }
 else         if (isCompletlyCovered(intervalsB,intervalsA)) {
          System.out.println("String_Node_Str" + grammarRules.get(rid).getRuleName());
          usedRules.remove(rid);
          continueSearch=true;
          break;
        }
      }
    }
    range=updateRanges(range,bestRule.getRuleIntervals());
  }
  System.out.println("String_Node_Str" + Arrays.toString(usedRules.toArray(new Integer[usedRules.size()])));
  GrammarRules prunedRules=new GrammarRules();
  prunedRules.addRule(grammarRules.get(0));
  for (  Integer rId : usedRules) {
    prunedRules.addRule(grammarRules.get(rId));
  }
  this.grammarRules=prunedRules;
}