Program: 74058
Project: 74058
Buggy source:
private static REDSingleEntityBean _translateFSMActor(FSMActor actor,int span,HashSet<String> globalSynchronizerSet) throws IllegalActionException {
  REDSingleEntityBean bean=new REDSingleEntityBean();
  bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str");
  REDModuleNameInitialBean moduleNameInitialState=new REDModuleNameInitialBean();
  moduleNameInitialState._name=actor.getName();
  moduleNameInitialState._initialStateDescription=actor.getName() + "String_Node_Str" + ((FSMActor)actor).getInitialState().getName().trim()+ "String_Node_Str";
  bean._nameInitialState=moduleNameInitialState;
  HashSet<String> guardSignalSet=_decideGuardSignalVariableSet(actor);
  Iterator<String> it=guardSignalSet.iterator();
  while (it.hasNext()) {
    String signalName=it.next();
    REDModuleNameInitialBean nameInitialBean=new REDModuleNameInitialBean();
    nameInitialBean._name=actor.getName().trim() + "String_Node_Str" + signalName.trim();
    nameInitialBean._initialStateDescription=actor.getName().trim() + "String_Node_Str" + signalName.trim()+ "String_Node_Str";
    bean._portSet.add(nameInitialBean);
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str");
  }
  HashSet<State> frontier=null;
  frontier=_enumerateStateSet(actor);
  HashSet<String> variableSet=null;
  HashMap<String,String> initialValueSet=null;
  variableSet=_decideVariableSet(actor,span);
  initialValueSet=_retrieveVariableInitialValue(actor,variableSet);
  if (variableSet != null) {
    Iterator<String> variables=variableSet.iterator();
    while (variables.hasNext()) {
      String variableName=variables.next();
      VariableInfo individual=(VariableInfo)_variableInfo.get(variableName);
      if (individual != null) {
        if ((individual._maxValue != null) && (individual._minValue != null)) {
          bean._declaredVariables.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ variableName+ "String_Node_Str"+ individual._minValue+ "String_Node_Str"+ individual._maxValue+ "String_Node_Str");
          bean._variableInitialDescriptionSet.add(actor.getName().trim() + "String_Node_Str" + variableName+ "String_Node_Str"+ initialValueSet.get(variableName)+ "String_Node_Str");
        }
      }
    }
  }
  Iterator<State> ite=frontier.iterator();
  while (ite.hasNext()) {
    State state=(State)ite.next();
    if (actor.getInitialState() == state) {
      bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ state.getName().trim()+ "String_Node_Str"+ "String_Node_Str");
      ArrayList<REDTransitionBean> transitionListWithinState=_generateTransition(actor,state,variableSet,globalSynchronizerSet);
      for (      REDTransitionBean transition : transitionListWithinState) {
        if (transition._isComplementaryEdge == false) {
          if (transition._postCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
 else           if (transition._postCondition.toString().trim().endsWith("String_Node_Str")) {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
 else {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
        }
      }
      bean._moduleDescription.append("String_Node_Str");
    }
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ state.getName().trim()+ "String_Node_Str");
    ArrayList<REDTransitionBean> transitionListWithinState=_generateTransition(actor,state,variableSet,globalSynchronizerSet);
    for (    REDTransitionBean transition : transitionListWithinState) {
      if (transition._postCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
 else       if (transition._postCondition.toString().trim().endsWith("String_Node_Str")) {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
 else {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
    }
    bean._moduleDescription.append("String_Node_Str");
  }
  return bean;
}

Fixed version (ground truth):
private static REDSingleEntityBean _translateFSMActor(FSMActor actor,int span,HashSet<String> globalSynchronizerSet) throws IllegalActionException {
  REDSingleEntityBean bean=new REDSingleEntityBean();
  bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str");
  REDModuleNameInitialBean moduleNameInitialState=new REDModuleNameInitialBean();
  moduleNameInitialState._name=actor.getName();
  moduleNameInitialState._initialStateDescription=actor.getName() + "String_Node_Str" + ((FSMActor)actor).getInitialState().getName().trim()+ "String_Node_Str";
  bean._nameInitialState=moduleNameInitialState;
  HashSet<String> guardSignalSet=_decideGuardSignalVariableSet(actor);
  Iterator<String> it=guardSignalSet.iterator();
  while (it.hasNext()) {
    String signalName=it.next();
    REDModuleNameInitialBean nameInitialBean=new REDModuleNameInitialBean();
    nameInitialBean._name=actor.getName().trim() + "String_Node_Str" + signalName.trim();
    nameInitialBean._initialStateDescription=actor.getName().trim() + "String_Node_Str" + signalName.trim()+ "String_Node_Str";
    bean._portSet.add(nameInitialBean);
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str" + signalName.trim() + "String_Node_Str"+ actor.getName().trim()+ "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ "String_Node_Str");
    bean._moduleDescription.append("String_Node_Str");
  }
  HashSet<State> frontier=null;
  frontier=_enumerateStateSet(actor);
  HashSet<String> variableSet=null;
  HashMap<String,String> initialValueSet=null;
  variableSet=_decideVariableSet(actor,span);
  initialValueSet=_retrieveVariableInitialValue(actor,variableSet);
  if (variableSet != null) {
    Iterator<String> variables=variableSet.iterator();
    while (variables.hasNext()) {
      String variableName=variables.next();
      VariableInfo individual=(VariableInfo)_variableInfo.get(variableName);
      if (individual != null) {
        if ((individual._maxValue != null) && (individual._minValue != null)) {
          bean._declaredVariables.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ variableName+ "String_Node_Str"+ individual._minValue+ "String_Node_Str"+ individual._maxValue+ "String_Node_Str");
          bean._variableInitialDescriptionSet.add(actor.getName().trim() + "String_Node_Str" + variableName+ "String_Node_Str"+ initialValueSet.get(variableName)+ "String_Node_Str");
        }
      }
    }
  }
  Iterator<State> ite=frontier.iterator();
  while (ite.hasNext()) {
    State state=(State)ite.next();
    if (actor.getInitialState() == state) {
      bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ state.getName().trim()+ "String_Node_Str"+ "String_Node_Str");
      ArrayList<REDTransitionBean> transitionListWithinState=_generateTransition(actor,state,variableSet,globalSynchronizerSet);
      for (      REDTransitionBean transition : transitionListWithinState) {
        if (transition._isComplementaryEdge == false) {
          if (transition._postCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
 else           if (transition._postCondition.toString().trim().endsWith("String_Node_Str")) {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
 else {
            if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              Iterator<IOPort> it2=actor.inputPortList().iterator();
              while (it2.hasNext()) {
                String signalName=it2.next().getName();
                bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
              }
            }
 else             if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
 else {
              bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
            }
          }
        }
      }
      bean._moduleDescription.append("String_Node_Str");
    }
    bean._moduleDescription.append("String_Node_Str" + actor.getName().trim() + "String_Node_Str"+ state.getName().trim()+ "String_Node_Str");
    ArrayList<REDTransitionBean> transitionListWithinState=_generateTransition(actor,state,variableSet,globalSynchronizerSet);
    for (    REDTransitionBean transition : transitionListWithinState) {
      if (transition._postCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
 else       if (transition._postCondition.toString().trim().endsWith("String_Node_Str")) {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
 else {
        if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          Iterator<IOPort> it2=actor.inputPortList().iterator();
          while (it2.hasNext()) {
            String signalName=it2.next().getName();
            bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ signalName.trim()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
          }
        }
 else         if (transition._preCondition.toString().trim().equalsIgnoreCase("String_Node_Str")) {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
 else {
          bean._moduleDescription.append("String_Node_Str" + transition._signal.toString() + "String_Node_Str"+ transition._preCondition.toString()+ "String_Node_Str"+ transition._postCondition.toString()+ "String_Node_Str"+ transition._newState.toString()+ "String_Node_Str");
        }
      }
    }
    bean._moduleDescription.append("String_Node_Str");
  }
  return bean;
}