Program: 74467
Project: 74467
Buggy source:
/** 
 * Return an StringBuffer that contains the .smv format of the FmvAutomaton.
 * @param formula The temporal formula used to be attached in the .smv file.
 * @param choice The type of the formula. It may be either a CTL or LTLformula.
 * @param span A constant used to expand the size of the rough domain.
 * @return The .smv format of the FmvAutomaton.
 */
public StringBuffer convertToSMVFormat(String formula,String choice,String span) throws IllegalActionException {
  _variableInfo=new HashMap<String,VariableInfo>();
  StringBuffer returnSmvFormat=new StringBuffer("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str" + this.getDisplayName() + "String_Node_Str"+ this.getDisplayName()+ "String_Node_Str");
  if (choice.equalsIgnoreCase("String_Node_Str")) {
    returnSmvFormat.append("String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + formula + "String_Node_Str");
  }
 else   if (choice.equalsIgnoreCase("String_Node_Str")) {
    returnSmvFormat.append("String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + formula + "String_Node_Str");
  }
  returnSmvFormat.append("String_Node_Str" + this.getDisplayName() + "String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  HashSet<State> frontier;
  try {
    frontier=_enumerateStateSet();
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  Iterator<State> it=frontier.iterator();
  while (it.hasNext()) {
    State val=(State)it.next();
    returnSmvFormat.append(val.getDisplayName());
    if (it.hasNext()) {
      returnSmvFormat.append("String_Node_Str");
    }
  }
  returnSmvFormat.append("String_Node_Str");
  HashSet<String> variableSet;
  try {
    int numSpan=Integer.parseInt(span);
    variableSet=_decideVariableSet(numSpan);
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  Iterator<String> itVariableSet=variableSet.iterator();
  while (itVariableSet.hasNext()) {
    String valName=(String)itVariableSet.next();
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    if (_variableInfo.get(valName) == null) {
      throw new IllegalActionException("String_Node_Str" + valName + "String_Node_Str");
    }
 else {
      VariableInfo individual=(VariableInfo)_variableInfo.get(valName);
      int lowerBound=Integer.parseInt(individual._minValue);
      int upperBound=Integer.parseInt(individual._maxValue);
      if (Pattern.matches("String_Node_Str",span) == true) {
        returnSmvFormat.append("String_Node_Str");
        for (int number=lowerBound; number <= upperBound; number++) {
          returnSmvFormat.append(number);
          returnSmvFormat.append("String_Node_Str");
        }
        returnSmvFormat.append("String_Node_Str");
      }
 else {
        throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
      }
    }
  }
  returnSmvFormat.append("String_Node_Str");
  try {
    String name=this.getInitialState().getName();
    returnSmvFormat.append("String_Node_Str" + name + "String_Node_Str");
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  _generateAllVariableTransitions(variableSet);
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  LinkedList<VariableTransitionInfo> infoList=_variableTransitionInfo.get("String_Node_Str");
  if (infoList == null) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  for (int i=0; i < infoList.size(); i++) {
    VariableTransitionInfo info=infoList.get(i);
    returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
  }
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  HashMap<String,String> variableInitialValue;
  variableInitialValue=_retrieveVariableInitialValue(variableSet);
  Iterator<String> newItVariableSet=variableSet.iterator();
  while (newItVariableSet.hasNext()) {
    String valName=(String)newItVariableSet.next();
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str"+ variableInitialValue.get(valName)+ "String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    returnSmvFormat.append("String_Node_Str");
    List<VariableTransitionInfo> innerInfoList=_variableTransitionInfo.get(valName);
    if (innerInfoList == null) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    for (int i=0; i < innerInfoList.size(); i++) {
      VariableTransitionInfo info=innerInfoList.get(i);
      returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
    }
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    returnSmvFormat.append("String_Node_Str");
  }
  return returnSmvFormat;
}

Fixed version (ground truth):
/** 
 * Return an StringBuffer that contains the .smv format of the FmvAutomaton.
 * @param formula The temporal formula used to be attached in the .smv file.
 * @param choice The type of the formula. It may be either a CTL or LTLformula.
 * @param span A constant used to expand the size of the rough domain.
 * @return The .smv format of the FmvAutomaton.
 */
public StringBuffer convertToSMVFormat(String formula,String choice,String span) throws IllegalActionException {
  _variableInfo=new HashMap<String,VariableInfo>();
  StringBuffer returnSmvFormat=new StringBuffer("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str" + this.getDisplayName() + "String_Node_Str"+ this.getDisplayName()+ "String_Node_Str");
  if (choice.equalsIgnoreCase("String_Node_Str")) {
    returnSmvFormat.append("String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + formula + "String_Node_Str");
  }
 else   if (choice.equalsIgnoreCase("String_Node_Str")) {
    returnSmvFormat.append("String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + formula + "String_Node_Str");
  }
  returnSmvFormat.append("String_Node_Str" + this.getDisplayName() + "String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  HashSet<State> frontier;
  try {
    frontier=_enumerateStateSet();
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  Iterator<State> it=frontier.iterator();
  while (it.hasNext()) {
    State val=(State)it.next();
    returnSmvFormat.append(val.getDisplayName());
    if (it.hasNext()) {
      returnSmvFormat.append("String_Node_Str");
    }
  }
  returnSmvFormat.append("String_Node_Str");
  HashSet<String> variableSet;
  try {
    int numSpan=Integer.parseInt(span);
    variableSet=_decideVariableSet(numSpan);
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  Iterator<String> itVariableSet=variableSet.iterator();
  while (itVariableSet.hasNext()) {
    String valName=(String)itVariableSet.next();
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    VariableInfo individual=_variableInfo.get(valName);
    if (individual == null) {
      throw new IllegalActionException("String_Node_Str" + valName + "String_Node_Str");
    }
 else {
      if ((individual._minValue != null) && (individual._minValue != null)) {
        int lowerBound=Integer.parseInt(individual._minValue);
        int upperBound=Integer.parseInt(individual._maxValue);
        if (Pattern.matches("String_Node_Str",span) == true) {
          returnSmvFormat.append("String_Node_Str");
          for (int number=lowerBound; number <= upperBound; number++) {
            returnSmvFormat.append(number);
            returnSmvFormat.append("String_Node_Str");
          }
          returnSmvFormat.append("String_Node_Str");
        }
 else {
          throw new IllegalActionException("String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
  returnSmvFormat.append("String_Node_Str");
  try {
    String name=this.getInitialState().getName();
    returnSmvFormat.append("String_Node_Str" + name + "String_Node_Str");
  }
 catch (  Exception exception) {
    throw new IllegalActionException("String_Node_Str" + exception.getMessage());
  }
  _generateAllVariableTransitions(variableSet);
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  LinkedList<VariableTransitionInfo> infoList=_variableTransitionInfo.get("String_Node_Str");
  if (infoList == null) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  for (int i=0; i < infoList.size(); i++) {
    VariableTransitionInfo info=infoList.get(i);
    returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
  }
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  HashMap<String,String> variableInitialValue;
  variableInitialValue=_retrieveVariableInitialValue(variableSet);
  Iterator<String> newItVariableSet=variableSet.iterator();
  while (newItVariableSet.hasNext()) {
    String valName=(String)newItVariableSet.next();
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str"+ variableInitialValue.get(valName)+ "String_Node_Str");
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    returnSmvFormat.append("String_Node_Str");
    List<VariableTransitionInfo> innerInfoList=_variableTransitionInfo.get(valName);
    if (innerInfoList == null) {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    for (int i=0; i < innerInfoList.size(); i++) {
      VariableTransitionInfo info=innerInfoList.get(i);
      returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
    }
    returnSmvFormat.append("String_Node_Str" + valName + "String_Node_Str");
    returnSmvFormat.append("String_Node_Str");
  }
  return returnSmvFormat;
}