Program: 166828
Project: 166828
Buggy source:
/** 
 * Derived task comes from the inference rules.
 * @param task the derived task
 */
private void derivedTask(final Task task,final boolean revised,final boolean single){
  if (task.getBudget().aboveThreshold()) {
    if (task.getSentence() != null && task.getSentence().getTruth() != null) {
      float conf=task.getSentence().getTruth().getConfidence();
      if (conf == 0) {
        if (recorder.isActive()) {
          recorder.append("String_Node_Str" + task + "String_Node_Str");
        }
        return;
      }
    }
    final Stamp stamp=task.getSentence().getStamp();
    final List<Term> chain=stamp.getChain();
    if (currentBelief != null) {
      final Term currentBeliefContent=currentBelief.getContent();
      if (chain.contains(currentBeliefContent)) {
        chain.remove(currentBeliefContent);
      }
      stamp.addToChain(currentBeliefContent);
    }
    if (currentTask != null && !single) {
      final Term currentTaskContent=currentTask.getContent();
      if (chain.contains(currentTaskContent)) {
        chain.remove(currentTaskContent);
      }
      stamp.addToChain(currentTaskContent);
    }
    if (!revised) {
      for (      final Term chain1 : chain) {
        if (task.getContent() == chain1) {
          if (recorder.isActive()) {
            recorder.append("String_Node_Str" + task + "String_Node_Str");
          }
          return;
        }
      }
    }
 else {
      final int stampLength=stamp.length();
      for (int i=0; i < stampLength; i++) {
        final long baseI=stamp.getBase()[i];
        for (int j=0; j < stampLength; j++) {
          if ((i != j) && (baseI == stamp.getBase()[j])) {
            if (recorder.isActive()) {
              recorder.append("String_Node_Str" + task + "String_Node_Str");
            }
            return;
          }
        }
      }
    }
    if (recorder.isActive()) {
      recorder.append("String_Node_Str" + task + "String_Node_Str");
    }
    float budget=task.getBudget().summary();
    float minSilent=nar.param.getSilenceLevel() / 100.0f;
    if (budget > minSilent) {
      nar.output(OUT.class,task.getSentence());
    }
    newTasks.add(task);
  }
 else {
    if (recorder.isActive()) {
      recorder.append("String_Node_Str" + task + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Derived task comes from the inference rules.
 * @param task the derived task
 */
private void derivedTask(final Task task,final boolean revised,final boolean single){
  if (task.getBudget().aboveThreshold()) {
    if (task.getSentence() != null && task.getSentence().getTruth() != null) {
      float conf=task.getSentence().getTruth().getConfidence();
      if (conf == 0) {
        if (recorder.isActive()) {
          recorder.append("String_Node_Str" + task + "String_Node_Str");
        }
        return;
      }
    }
    final Stamp stamp=task.getSentence().getStamp();
    final List<Term> chain=stamp.getChain();
    if (currentBelief != null) {
      final Term currentBeliefContent=currentBelief.getContent();
      if (chain.contains(currentBeliefContent)) {
        chain.remove(currentBeliefContent);
      }
      stamp.addToChain(currentBeliefContent,task.getSentence());
    }
    if (currentTask != null && !single) {
      final Term currentTaskContent=currentTask.getContent();
      if (chain.contains(currentTaskContent)) {
        chain.remove(currentTaskContent);
      }
      stamp.addToChain(currentTaskContent,task.getSentence());
    }
    if (!revised) {
      for (      final Term chain1 : chain) {
        if (task.getContent() == chain1) {
          if (recorder.isActive()) {
            recorder.append("String_Node_Str" + task + "String_Node_Str");
          }
          return;
        }
      }
    }
 else {
      final int stampLength=stamp.length();
      for (int i=0; i < stampLength; i++) {
        final long baseI=stamp.getBase()[i];
        for (int j=0; j < stampLength; j++) {
          if ((i != j) && (baseI == stamp.getBase()[j])) {
            if (recorder.isActive()) {
              recorder.append("String_Node_Str" + task + "String_Node_Str");
            }
            return;
          }
        }
      }
    }
    if (recorder.isActive()) {
      recorder.append("String_Node_Str" + task + "String_Node_Str");
    }
    float budget=task.getBudget().summary();
    float minSilent=nar.param.getSilenceLevel() / 100.0f;
    if (budget > minSilent) {
      nar.output(OUT.class,task.getSentence());
    }
    newTasks.add(task);
  }
 else {
    if (recorder.isActive()) {
      recorder.append("String_Node_Str" + task + "String_Node_Str");
    }
  }
}