Program: 166700
Project: 166700
Buggy source:
/** 
 * Create a Sentence with the given fields
 * @param content The Term that forms the content of the sentence
 * @param punctuation The punctuation indicating the type of the sentence
 * @param truth The truth value of the sentence, null for question
 * @param stamp The stamp of the sentence indicating its derivation time andbase
 */
private Sentence(T _content,final char punctuation,final TruthValue truth,final Stamp stamp,boolean normalize){
  if (punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    if (_content instanceof Conjunction) {
      Conjunction c=(Conjunction)_content;
      if (c.getTemporalOrder() == TemporalRules.ORDER_FORWARD) {
        if (c.term[c.term.length - 1] instanceof Interval) {
          Term[] term2=new Term[c.term.length - 1];
          for (int i=0; i < c.term.length - 1; i++) {
            term2[i]=c.term[i];
          }
          _content=(T)Conjunction.make(term2,c.getTemporalOrder());
          long time=Interval.magnitudeToTime(((Interval)c.term[c.term.length - 1]).magnitude,new AtomicDuration(Parameters.DURATION));
          if (stamp != null)           stamp.setOccurrenceTime(stamp.getOccurrenceTime() - time);
        }
      }
    }
  }
  this.punctuation=punctuation;
  if (_content instanceof Interval && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    truth.setConfidence(0.0f);
    if (Parameters.DEBUG)     throw new RuntimeException("String_Node_Str" + _content + punctuation+ "String_Node_Str"+ stamp);
  }
  if ((!isQuestion() && !isQuest()) && (truth == null) && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    throw new RuntimeException("String_Node_Str");
  }
  if (_content.subjectOrPredicateIsIndependentVar() && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    truth.setConfidence(0.0f);
    if (Parameters.DEBUG)     throw new RuntimeException("String_Node_Str");
  }
  if (Parameters.DEBUG && Parameters.DEBUG_INVALID_SENTENCES && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    if (!Term.valid(_content)) {
      truth.setConfidence(0.0f);
      if (Parameters.DEBUG) {
        CompoundTerm.UnableToCloneException ntc=new CompoundTerm.UnableToCloneException("String_Node_Str" + _content);
        ntc.printStackTrace();
        throw ntc;
      }
    }
  }
  if ((isQuestion() || isQuest()) && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK && !stamp.isEternal()) {
    stamp.setEternal();
  }
  this.truth=truth;
  this.stamp=stamp;
  this.revisible=!(_content.hasVarDep());
  if (normalize && _content.hasVar() && (_content instanceof CompoundTerm)&& (!((CompoundTerm)_content).isNormalized())) {
    this.term=(T)((CompoundTerm)_content).cloneDeepVariables();
    final CompoundTerm c=(CompoundTerm)term;
    List<Variable> vars=new ArrayList();
    c.recurseSubtermsContainingVariables(new Term.TermVisitor(){
      @Override public void visit(      final Term t,      final Term parent){
        if (t instanceof Variable) {
          Variable v=((Variable)t);
          vars.add(v);
        }
      }
    }
);
    Map<CharSequence,CharSequence> rename=new HashMap();
    boolean renamed=false;
    for (    final Variable v : vars) {
      CharSequence vname=v.name();
      if (!v.hasVarIndep())       vname=vname + "String_Node_Str" + v.getScope().name();
      CharSequence n=rename.get(vname);
      if (n == null) {
        rename.put(vname,n=Variable.getName(v.getType(),rename.size() + 1));
        if (!n.equals(vname))         renamed=true;
      }
      v.setScope(c,n);
    }
    if (renamed) {
      c.invalidateName();
      if (Parameters.DEBUG && Parameters.DEBUG_INVALID_SENTENCES) {
        if (!Term.valid(c)) {
          CompoundTerm.UnableToCloneException ntc=new CompoundTerm.UnableToCloneException("String_Node_Str" + c + "String_Node_Str"+ _content);
          ntc.printStackTrace();
          throw ntc;
        }
      }
    }
    c.setNormalized(true);
  }
 else {
    this.term=_content;
  }
  if (isUniqueByOcurrenceTime())   this.hash=Objects.hash(term,punctuation,truth,stamp.getOccurrenceTime());
 else   this.hash=Objects.hash(term,punctuation,truth);
}

Fixed version (ground truth):
/** 
 * Create a Sentence with the given fields
 * @param content The Term that forms the content of the sentence
 * @param punctuation The punctuation indicating the type of the sentence
 * @param truth The truth value of the sentence, null for question
 * @param stamp The stamp of the sentence indicating its derivation time andbase
 */
private Sentence(T _content,final char punctuation,final TruthValue truth,final Stamp stamp,boolean normalize){
  if (punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    if (_content instanceof Conjunction) {
      Conjunction c=(Conjunction)_content;
      if (c.getTemporalOrder() == TemporalRules.ORDER_FORWARD) {
        if (c.term[c.term.length - 1] instanceof Interval) {
          Term[] term2=new Term[c.term.length - 1];
          for (int i=0; i < c.term.length - 1; i++) {
            term2[i]=c.term[i];
          }
          _content=(T)Conjunction.make(term2,c.getTemporalOrder());
          long time=Interval.magnitudeToTime(((Interval)c.term[c.term.length - 1]).magnitude,new AtomicDuration(Parameters.DURATION));
          if (stamp != null)           stamp.setOccurrenceTime(stamp.getOccurrenceTime() - time);
        }
      }
    }
  }
  this.punctuation=punctuation;
  if (this.isJudgment() && _content.hasVarQuery()) {
    truth.setConfidence(0.0f);
  }
  if (_content instanceof Interval && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    truth.setConfidence(0.0f);
    if (Parameters.DEBUG)     throw new RuntimeException("String_Node_Str" + _content + punctuation+ "String_Node_Str"+ stamp);
  }
  if ((!isQuestion() && !isQuest()) && (truth == null) && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    throw new RuntimeException("String_Node_Str");
  }
  if (_content.subjectOrPredicateIsIndependentVar() && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    truth.setConfidence(0.0f);
    if (Parameters.DEBUG)     throw new RuntimeException("String_Node_Str");
  }
  if (Parameters.DEBUG && Parameters.DEBUG_INVALID_SENTENCES && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK) {
    if (!Term.valid(_content)) {
      truth.setConfidence(0.0f);
      if (Parameters.DEBUG) {
        CompoundTerm.UnableToCloneException ntc=new CompoundTerm.UnableToCloneException("String_Node_Str" + _content);
        ntc.printStackTrace();
        throw ntc;
      }
    }
  }
  if ((isQuestion() || isQuest()) && punctuation != Symbols.TERM_NORMALIZING_WORKAROUND_MARK && !stamp.isEternal()) {
    stamp.setEternal();
  }
  this.truth=truth;
  this.stamp=stamp;
  this.revisible=!(_content.hasVarDep());
  if (normalize && _content.hasVar() && (_content instanceof CompoundTerm)&& (!((CompoundTerm)_content).isNormalized())) {
    this.term=(T)((CompoundTerm)_content).cloneDeepVariables();
    final CompoundTerm c=(CompoundTerm)term;
    List<Variable> vars=new ArrayList();
    c.recurseSubtermsContainingVariables(new Term.TermVisitor(){
      @Override public void visit(      final Term t,      final Term parent){
        if (t instanceof Variable) {
          Variable v=((Variable)t);
          vars.add(v);
        }
      }
    }
);
    Map<CharSequence,CharSequence> rename=new HashMap();
    boolean renamed=false;
    for (    final Variable v : vars) {
      CharSequence vname=v.name();
      if (!v.hasVarIndep())       vname=vname + "String_Node_Str" + v.getScope().name();
      CharSequence n=rename.get(vname);
      if (n == null) {
        rename.put(vname,n=Variable.getName(v.getType(),rename.size() + 1));
        if (!n.equals(vname))         renamed=true;
      }
      v.setScope(c,n);
    }
    if (renamed) {
      c.invalidateName();
      if (Parameters.DEBUG && Parameters.DEBUG_INVALID_SENTENCES) {
        if (!Term.valid(c)) {
          CompoundTerm.UnableToCloneException ntc=new CompoundTerm.UnableToCloneException("String_Node_Str" + c + "String_Node_Str"+ _content);
          ntc.printStackTrace();
          throw ntc;
        }
      }
    }
    c.setNormalized(true);
  }
 else {
    this.term=_content;
  }
  if (isUniqueByOcurrenceTime())   this.hash=Objects.hash(term,punctuation,truth,stamp.getOccurrenceTime());
 else   this.hash=Objects.hash(term,punctuation,truth);
}