Program: 74486
Project: 74486
Buggy source:
/** 
 * @param actor
 * @param span
 * @param isController
 * @param controllerName
 * @param refinementStateName
 * @return
 * @throws IllegalActionException
 */
public static StringBuffer translateSingleFSMActor(FSMActor actor,String span,boolean isController,String controllerName,String refinementStateName) throws IllegalActionException {
  String refinementStateActivePremise="String_Node_Str" + refinementStateName.trim();
  StringBuffer returnSmvFormat=new StringBuffer("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  if (isController == true) {
    ArrayList<StringBuffer> subModules=_retrieveSubSystemModuleNameParameterInfo(actor);
    for (int i=0; i < subModules.size(); i++) {
      returnSmvFormat.append(subModules.get(i));
      returnSmvFormat.append("String_Node_Str");
    }
  }
  returnSmvFormat.append("String_Node_Str");
  HashSet<State> frontier=null;
  frontier=_enumerateStateSet(actor);
  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=null;
  int numSpan=Integer.parseInt(span);
  variableSet=_decideVariableSet(actor,numSpan);
  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) {
    }
    VariableInfo individual=(VariableInfo)_variableInfo.get(valName);
    int lowerBound=Integer.parseInt(individual._minValue);
    int upperBound=Integer.parseInt(individual._maxValue);
    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");
  }
  HashSet<String> signalVariableSet=null;
  signalVariableSet=_decideSignalVariableSet(actor,numSpan);
  if (signalVariableSet != null) {
    Iterator<String> itSignalVariableSet=signalVariableSet.iterator();
    while (itSignalVariableSet.hasNext()) {
      String valName=(String)itSignalVariableSet.next();
      variableSet.add(valName);
    }
  }
  returnSmvFormat.append("String_Node_Str");
  String name=actor.getInitialState().getName();
  returnSmvFormat.append("String_Node_Str" + name + "String_Node_Str");
  _generateAllVariableTransitions(actor,variableSet);
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  LinkedList<VariableTransitionInfo> infoList=_variableTransitionInfo.get("String_Node_Str");
  if (infoList == null) {
  }
  for (int i=0; i < infoList.size(); i++) {
    VariableTransitionInfo info=infoList.get(i);
    if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
      returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
    }
 else {
      returnSmvFormat.append("String_Node_Str" + refinementStateActivePremise + "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(actor,variableSet);
  Iterator<String> newItVariableSet=variableSet.iterator();
  while (newItVariableSet.hasNext()) {
    String valName=(String)newItVariableSet.next();
    boolean b=Pattern.matches("String_Node_Str",valName);
    if (b == true) {
    }
 else {
      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) {
      }
      for (int i=0; i < innerInfoList.size(); i++) {
        VariableTransitionInfo info=innerInfoList.get(i);
        if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
          returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
        }
 else {
          returnSmvFormat.append("String_Node_Str" + refinementStateActivePremise + "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");
    }
  }
  StringBuffer frontAttachment=new StringBuffer("String_Node_Str" + actor.getName() + "String_Node_Str");
  ArrayList<String> guardSignalVariableInfo=_globalSignalDistributionInfo.get(actor.getName());
  if (guardSignalVariableInfo == null) {
    HashSet<String> guardSignalVariableSet=null;
    guardSignalVariableSet=_decideGuardSignalVariableSet(actor);
    Iterator<String> itGuardSignalVariableSet=guardSignalVariableSet.iterator();
    while (itGuardSignalVariableSet.hasNext()) {
      String valName=(String)itGuardSignalVariableSet.next();
      if (itGuardSignalVariableSet.hasNext() == true) {
        frontAttachment.append(valName + "String_Node_Str");
      }
 else {
        frontAttachment.append(valName);
      }
    }
  }
 else {
    for (int i=0; i < guardSignalVariableInfo.size(); i++) {
      String valName=guardSignalVariableInfo.get(i);
      if (i != guardSignalVariableInfo.size() - 1) {
        frontAttachment.append(valName + "String_Node_Str");
      }
 else {
        frontAttachment.append(valName);
      }
    }
  }
  if (refinementStateName.trim().equalsIgnoreCase("String_Node_Str")) {
    frontAttachment.append("String_Node_Str");
  }
 else {
    if (guardSignalVariableInfo.size() == 0) {
      frontAttachment.append("String_Node_Str");
    }
 else {
      frontAttachment.append("String_Node_Str");
    }
  }
  frontAttachment.append(returnSmvFormat);
  if (signalVariableSet != null) {
    if ((signalVariableSet.size() != 0)) {
      frontAttachment.append("String_Node_Str");
      Iterator<String> newItSignalVariableSet=signalVariableSet.iterator();
      while (newItSignalVariableSet.hasNext()) {
        String valName=(String)newItSignalVariableSet.next();
        frontAttachment.append("String_Node_Str" + valName + "String_Node_Str");
        List<VariableTransitionInfo> innerInfoList=_variableTransitionInfo.get(valName);
        if (innerInfoList == null) {
        }
        for (int i=0; i < innerInfoList.size(); i++) {
          VariableTransitionInfo info=innerInfoList.get(i);
          if (i == innerInfoList.size() - 1) {
            if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
              frontAttachment.append("String_Node_Str" + info._preCondition + "String_Node_Str");
            }
 else {
              frontAttachment.append("String_Node_Str" + refinementStateActivePremise + "String_Node_Str"+ info._preCondition+ "String_Node_Str");
            }
          }
 else {
            if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
              frontAttachment.append("String_Node_Str" + info._preCondition + "String_Node_Str");
            }
 else {
              frontAttachment.append("String_Node_Str" + refinementStateActivePremise + "String_Node_Str"+ info._preCondition+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
  return frontAttachment;
}

Fixed version (ground truth):
/** 
 * @param actor
 * @param span
 * @param isController
 * @param controllerName
 * @param refinementStateName
 * @return
 * @throws IllegalActionException
 */
public static StringBuffer translateSingleFSMActor(FSMActor actor,String span,boolean isController,String controllerName,String refinementStateName) throws IllegalActionException {
  String refinementStateActivePremise="String_Node_Str" + refinementStateName.trim();
  StringBuffer returnSmvFormat=new StringBuffer("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  if (isController == true) {
    ArrayList<StringBuffer> subModules=_retrieveSubSystemModuleNameParameterInfo(actor);
    for (int i=0; i < subModules.size(); i++) {
      returnSmvFormat.append(subModules.get(i));
      returnSmvFormat.append("String_Node_Str");
    }
  }
  returnSmvFormat.append("String_Node_Str");
  HashSet<State> frontier=null;
  frontier=_enumerateStateSet(actor);
  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=null;
  int numSpan=Integer.parseInt(span);
  variableSet=_decideVariableSet(actor,numSpan);
  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");
    }
 else {
      VariableInfo individual=(VariableInfo)_variableInfo.get(valName);
      int lowerBound=Integer.parseInt(individual._minValue);
      int upperBound=Integer.parseInt(individual._maxValue);
      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");
    }
  }
  HashSet<String> signalVariableSet=null;
  signalVariableSet=_decideSignalVariableSet(actor,numSpan);
  if (signalVariableSet != null) {
    Iterator<String> itSignalVariableSet=signalVariableSet.iterator();
    while (itSignalVariableSet.hasNext()) {
      String valName=(String)itSignalVariableSet.next();
      variableSet.add(valName);
    }
  }
  returnSmvFormat.append("String_Node_Str");
  String name=actor.getInitialState().getName();
  returnSmvFormat.append("String_Node_Str" + name + "String_Node_Str");
  _generateAllVariableTransitions(actor,variableSet);
  returnSmvFormat.append("String_Node_Str");
  returnSmvFormat.append("String_Node_Str");
  LinkedList<VariableTransitionInfo> infoList=_variableTransitionInfo.get("String_Node_Str");
  if (infoList == null) {
  }
  for (int i=0; i < infoList.size(); i++) {
    VariableTransitionInfo info=infoList.get(i);
    if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
      returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
    }
 else {
      returnSmvFormat.append("String_Node_Str" + refinementStateActivePremise + "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(actor,variableSet);
  Iterator<String> newItVariableSet=variableSet.iterator();
  while (newItVariableSet.hasNext()) {
    String valName=(String)newItVariableSet.next();
    boolean b=Pattern.matches("String_Node_Str",valName);
    if (b == true) {
    }
 else {
      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) {
      }
      for (int i=0; i < innerInfoList.size(); i++) {
        VariableTransitionInfo info=innerInfoList.get(i);
        if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
          returnSmvFormat.append("String_Node_Str" + info._preCondition + "String_Node_Str"+ info._varibleNewValue+ "String_Node_Str");
        }
 else {
          returnSmvFormat.append("String_Node_Str" + refinementStateActivePremise + "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");
    }
  }
  StringBuffer frontAttachment=new StringBuffer("String_Node_Str" + actor.getName() + "String_Node_Str");
  ArrayList<String> guardSignalVariableInfo=_globalSignalDistributionInfo.get(actor.getName());
  if (guardSignalVariableInfo == null) {
    HashSet<String> guardSignalVariableSet=null;
    guardSignalVariableSet=_decideGuardSignalVariableSet(actor);
    Iterator<String> itGuardSignalVariableSet=guardSignalVariableSet.iterator();
    while (itGuardSignalVariableSet.hasNext()) {
      String valName=(String)itGuardSignalVariableSet.next();
      if (itGuardSignalVariableSet.hasNext() == true) {
        frontAttachment.append(valName + "String_Node_Str");
      }
 else {
        frontAttachment.append(valName);
      }
    }
  }
 else {
    for (int i=0; i < guardSignalVariableInfo.size(); i++) {
      String valName=guardSignalVariableInfo.get(i);
      if (i != guardSignalVariableInfo.size() - 1) {
        frontAttachment.append(valName + "String_Node_Str");
      }
 else {
        frontAttachment.append(valName);
      }
    }
  }
  if (refinementStateName.trim().equalsIgnoreCase("String_Node_Str")) {
    frontAttachment.append("String_Node_Str");
  }
 else {
    if (guardSignalVariableInfo.size() == 0) {
      frontAttachment.append("String_Node_Str");
    }
 else {
      frontAttachment.append("String_Node_Str");
    }
  }
  frontAttachment.append(returnSmvFormat);
  if (signalVariableSet != null) {
    if ((signalVariableSet.size() != 0)) {
      frontAttachment.append("String_Node_Str");
      Iterator<String> newItSignalVariableSet=signalVariableSet.iterator();
      while (newItSignalVariableSet.hasNext()) {
        String valName=(String)newItSignalVariableSet.next();
        frontAttachment.append("String_Node_Str" + valName + "String_Node_Str");
        List<VariableTransitionInfo> innerInfoList=_variableTransitionInfo.get(valName);
        if (innerInfoList == null) {
        }
        for (int i=0; i < innerInfoList.size(); i++) {
          VariableTransitionInfo info=innerInfoList.get(i);
          if (i == innerInfoList.size() - 1) {
            if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
              frontAttachment.append("String_Node_Str" + info._preCondition + "String_Node_Str");
            }
 else {
              frontAttachment.append("String_Node_Str" + refinementStateActivePremise + "String_Node_Str"+ info._preCondition+ "String_Node_Str");
            }
          }
 else {
            if (refinementStateName.equalsIgnoreCase("String_Node_Str")) {
              frontAttachment.append("String_Node_Str" + info._preCondition + "String_Node_Str");
            }
 else {
              frontAttachment.append("String_Node_Str" + refinementStateActivePremise + "String_Node_Str"+ info._preCondition+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
  return frontAttachment;
}