Program: 74502
Project: 74502
Buggy source:
/** 
 * This private function first decides variables that would be used in the Kripke structure. Once when it is decided, it performs step 1 and 2 of the variable domain generation process.
 * @param model
 * @param numSpan
 * @return returnVariableSet
 */
private static HashSet<String> _decideVariableSet(CompositeActor model,int numSpan) throws IllegalActionException {
  _variableInfo=new HashMap<String,VariableInfo>();
  HashSet<String> returnVariableSet=new HashSet<String>();
  for (Iterator actors=(((CompositeActor)model).entityList()).iterator(); actors.hasNext(); ) {
    Entity innerModel=(Entity)actors.next();
    if (innerModel instanceof FSMActor) {
      HashSet<State> stateSet=new HashSet<State>();
      try {
        HashMap<String,State> frontier=new HashMap<String,State>();
        State stateInThis=((FSMActor)innerModel).getInitialState();
        String name=stateInThis.getName();
        frontier.put(name,stateInThis);
        while (!frontier.isEmpty()) {
          Iterator<String> iterator=frontier.keySet().iterator();
          name=(String)iterator.next();
          stateInThis=(State)frontier.remove(name);
          if (stateInThis == null) {
            throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
          }
          ComponentPort outPort=stateInThis.outgoingPort;
          Iterator transitions=outPort.linkedRelationList().iterator();
          while (transitions.hasNext()) {
            Transition transition=(Transition)transitions.next();
            State destinationInThis=transition.destinationState();
            if (!stateSet.contains(destinationInThis)) {
              frontier.put(destinationInThis.getName(),destinationInThis);
              stateSet.add(destinationInThis);
            }
            boolean hasAnnotation=false;
            String text;
            try {
              text=transition.annotation.stringValue();
            }
 catch (            IllegalActionException e) {
              text="String_Node_Str" + e.getMessage();
            }
            if (!text.trim().equals("String_Node_Str")) {
              hasAnnotation=true;
            }
            String guard=transition.getGuardExpression();
            if ((guard != null) && !guard.trim().equals("String_Node_Str")) {
              if (hasAnnotation) {
              }
 else {
                String[] guardSplitExpression=guard.split("String_Node_Str");
                if (guardSplitExpression.length != 0) {
                  for (int i=0; i < guardSplitExpression.length; i++) {
                    String subGuardCondition=guardSplitExpression[i].trim();
                    String[] characterOfSubGuard=subGuardCondition.split("String_Node_Str");
                    boolean b=Pattern.matches("String_Node_Str",characterOfSubGuard[0].trim());
                    if (b == true) {
                    }
 else {
                      String rValue=null;
                      boolean isTrue=false;
                      try {
                        rValue=characterOfSubGuard[1].trim();
                      }
 catch (                      Exception ex) {
                        isTrue=true;
                      }
                      if (isTrue == false) {
                        int numberRetrival=0;
                        numberRetrival=Integer.parseInt(rValue);
                        returnVariableSet.add(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                        VariableInfo variable=(VariableInfo)_variableInfo.get(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                        if (variable == null) {
                          VariableInfo newVariable=new VariableInfo(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),Integer.toString(numberRetrival),Integer.toString(numberRetrival));
                          _variableInfo.put(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),newVariable);
                        }
 else {
                          if (Integer.parseInt(variable._maxValue) < numberRetrival) {
                            variable._maxValue=Integer.toString(numberRetrival);
                          }
                          if (Integer.parseInt(variable._minValue) > numberRetrival) {
                            variable._minValue=Integer.toString(numberRetrival);
                          }
                          _variableInfo.remove(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                          _variableInfo.put(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),variable);
                        }
                      }
                    }
                  }
                }
              }
            }
            String expression=transition.setActions.getExpression();
            if ((expression != null) && !expression.trim().equals("String_Node_Str")) {
              String[] splitExpression=expression.split("String_Node_Str");
              for (int i=0; i < splitExpression.length; i++) {
                String[] characters=splitExpression[i].split("String_Node_Str");
                String lValue=characters[0].trim();
                String rValue;
                int numberRetrival=0;
                boolean rvalueSingleNumber=true;
                try {
                  rValue=characters[1].trim();
                  numberRetrival=Integer.parseInt(rValue);
                }
 catch (                Exception ex) {
                  rvalueSingleNumber=false;
                }
                if (rvalueSingleNumber == true) {
                  VariableInfo variable=(VariableInfo)_variableInfo.get(innerModel.getName() + "String_Node_Str" + lValue);
                  if (variable == null) {
                    VariableInfo newVariable=new VariableInfo(innerModel.getName() + "String_Node_Str" + lValue,Integer.toString(numberRetrival),Integer.toString(numberRetrival));
                    _variableInfo.put(innerModel.getName() + "String_Node_Str" + lValue,newVariable);
                  }
 else {
                    if (Integer.parseInt(variable._maxValue) < numberRetrival) {
                      variable._maxValue=Integer.toString(numberRetrival);
                    }
                    if (Integer.parseInt(variable._minValue) > numberRetrival) {
                      variable._minValue=Integer.toString(numberRetrival);
                    }
                    _variableInfo.remove(innerModel.getName() + "String_Node_Str" + lValue);
                    _variableInfo.put(innerModel.getName() + "String_Node_Str" + lValue,variable);
                  }
                }
              }
            }
          }
        }
      }
 catch (      Exception exception) {
        throw new InternalErrorException("String_Node_Str" + exception.getMessage());
      }
    }
  }
  Iterator<String> itVariableSet=returnVariableSet.iterator();
  while (itVariableSet.hasNext()) {
    String valName=(String)itVariableSet.next();
    VariableInfo individual=(VariableInfo)_variableInfo.remove(valName);
    try {
      int lbOriginal=Integer.parseInt(individual._minValue);
      int ubOriginal=Integer.parseInt(individual._maxValue);
      int lbNew=lbOriginal - (ubOriginal - lbOriginal + 1) * numSpan;
      int ubNew=ubOriginal + (ubOriginal - lbOriginal + 1) * numSpan;
      individual._minValue=Integer.toString(lbNew);
      individual._maxValue=Integer.toString(ubNew);
      _variableInfo.put(valName,individual);
    }
 catch (    Exception ex) {
      throw new InternalErrorException("String_Node_Str" + ex.getMessage());
    }
  }
  return returnVariableSet;
}

Fixed version (ground truth):
/** 
 * This private function first decides variables that would be used in the Kripke structure. Once when it is decided, it performs step 1 and 2 of the variable domain generation process.
 * @param model
 * @param numSpan
 * @return returnVariableSet
 */
private static HashSet<String> _decideVariableSet(CompositeActor model,int numSpan) throws IllegalActionException {
  _variableInfo=new HashMap<String,VariableInfo>();
  HashSet<String> returnVariableSet=new HashSet<String>();
  for (Iterator actors=(((CompositeActor)model).entityList()).iterator(); actors.hasNext(); ) {
    Entity innerModel=(Entity)actors.next();
    if (innerModel instanceof FSMActor) {
      HashSet<State> stateSet=new HashSet<State>();
      try {
        HashMap<String,State> frontier=new HashMap<String,State>();
        State stateInThis=((FSMActor)innerModel).getInitialState();
        String name=stateInThis.getName();
        frontier.put(name,stateInThis);
        while (!frontier.isEmpty()) {
          Iterator<String> iterator=frontier.keySet().iterator();
          name=(String)iterator.next();
          stateInThis=(State)frontier.remove(name);
          if (stateInThis == null) {
            throw new IllegalActionException("String_Node_Str" + name + "String_Node_Str");
          }
          ComponentPort outPort=stateInThis.outgoingPort;
          Iterator transitions=outPort.linkedRelationList().iterator();
          while (transitions.hasNext()) {
            Transition transition=(Transition)transitions.next();
            State destinationInThis=transition.destinationState();
            if (!stateSet.contains(destinationInThis)) {
              frontier.put(destinationInThis.getName(),destinationInThis);
              stateSet.add(destinationInThis);
            }
            boolean hasAnnotation=false;
            String text;
            try {
              text=transition.annotation.stringValue();
            }
 catch (            IllegalActionException e) {
              text="String_Node_Str" + e.getMessage();
            }
            if (!text.trim().equals("String_Node_Str")) {
              hasAnnotation=true;
            }
            String guard=transition.getGuardExpression();
            if ((guard != null) && !guard.trim().equals("String_Node_Str")) {
              if (hasAnnotation) {
              }
 else {
                String[] guardSplitExpression=guard.split("String_Node_Str");
                if (guardSplitExpression.length != 0) {
                  for (int i=0; i < guardSplitExpression.length; i++) {
                    String subGuardCondition=guardSplitExpression[i].trim();
                    String[] characterOfSubGuard=subGuardCondition.split("String_Node_Str");
                    boolean b=Pattern.matches("String_Node_Str",characterOfSubGuard[0].trim());
                    if (b == true) {
                    }
 else {
                      String rValue=null;
                      boolean isTrue=false;
                      try {
                        rValue=characterOfSubGuard[1].trim();
                      }
 catch (                      Exception ex) {
                        isTrue=true;
                      }
                      if (isTrue == false) {
                        int numberRetrival=0;
                        numberRetrival=Integer.parseInt(rValue);
                        returnVariableSet.add(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                        VariableInfo variable=(VariableInfo)_variableInfo.get(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                        if (variable == null) {
                          VariableInfo newVariable=new VariableInfo(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),Integer.toString(numberRetrival),Integer.toString(numberRetrival));
                          _variableInfo.put(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),newVariable);
                        }
 else {
                          if (Integer.parseInt(variable._maxValue) < numberRetrival) {
                            variable._maxValue=Integer.toString(numberRetrival);
                          }
                          if (Integer.parseInt(variable._minValue) > numberRetrival) {
                            variable._minValue=Integer.toString(numberRetrival);
                          }
                          _variableInfo.remove(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim());
                          _variableInfo.put(innerModel.getName() + "String_Node_Str" + characterOfSubGuard[0].trim(),variable);
                        }
                      }
                    }
                  }
                }
              }
            }
            String expression=transition.setActions.getExpression();
            if ((expression != null) && !expression.trim().equals("String_Node_Str")) {
              String[] splitExpression=expression.split("String_Node_Str");
              for (int i=0; i < splitExpression.length; i++) {
                String[] characters=splitExpression[i].split("String_Node_Str");
                String lValue=characters[0].trim();
                String rValue;
                int numberRetrival=0;
                boolean rvalueSingleNumber=true;
                try {
                  rValue=characters[1].trim();
                  numberRetrival=Integer.parseInt(rValue);
                }
 catch (                Exception ex) {
                  rvalueSingleNumber=false;
                }
                if (rvalueSingleNumber == true) {
                  VariableInfo variable=(VariableInfo)_variableInfo.get(innerModel.getName() + "String_Node_Str" + lValue);
                  if (variable == null) {
                    VariableInfo newVariable=new VariableInfo(innerModel.getName() + "String_Node_Str" + lValue,Integer.toString(numberRetrival),Integer.toString(numberRetrival));
                    _variableInfo.put(innerModel.getName() + "String_Node_Str" + lValue,newVariable);
                  }
 else {
                    if (Integer.parseInt(variable._maxValue) < numberRetrival) {
                      variable._maxValue=Integer.toString(numberRetrival);
                    }
                    if (Integer.parseInt(variable._minValue) > numberRetrival) {
                      variable._minValue=Integer.toString(numberRetrival);
                    }
                    _variableInfo.remove(innerModel.getName() + "String_Node_Str" + lValue);
                    _variableInfo.put(innerModel.getName() + "String_Node_Str" + lValue,variable);
                  }
                }
              }
            }
          }
        }
      }
 catch (      Exception exception) {
        throw new InternalErrorException("String_Node_Str" + exception.getMessage());
      }
    }
  }
  for (Iterator actors=(((CompositeActor)model).entityList()).iterator(); actors.hasNext(); ) {
    Entity innerModel=(Entity)actors.next();
    if (innerModel instanceof FSMActor) {
      Iterator it=_variableInfo.keySet().iterator();
      while (it.hasNext()) {
        String originalAttribute=(String)it.next();
        String[] attributeList=originalAttribute.split("String_Node_Str");
        String attribute=attributeList[attributeList.length - 1].trim();
        String[] propertyList=null;
        try {
          propertyList=innerModel.getAttribute(attribute).description().split("String_Node_Str");
        }
 catch (        Exception ex) {
          continue;
        }
        String property=null;
        try {
          property=propertyList[propertyList.length - 1];
          int numberRetrival=Integer.parseInt(property);
          VariableInfo variable=_variableInfo.get(innerModel.getName() + "String_Node_Str" + attribute);
          if (variable == null) {
            continue;
          }
 else {
            if (Integer.parseInt(variable._maxValue) < numberRetrival) {
              variable._maxValue=Integer.toString(numberRetrival);
            }
            if (Integer.parseInt(variable._minValue) > numberRetrival) {
              variable._minValue=Integer.toString(numberRetrival);
            }
            _variableInfo.remove(innerModel.getName() + "String_Node_Str" + attribute);
            _variableInfo.put(innerModel.getName() + "String_Node_Str" + attribute,variable);
          }
        }
 catch (        Exception ex) {
          continue;
        }
      }
    }
  }
  Iterator<String> itVariableSet=returnVariableSet.iterator();
  while (itVariableSet.hasNext()) {
    String valName=(String)itVariableSet.next();
    VariableInfo individual=(VariableInfo)_variableInfo.remove(valName);
    try {
      int lbOriginal=Integer.parseInt(individual._minValue);
      int ubOriginal=Integer.parseInt(individual._maxValue);
      int lbNew=lbOriginal - (ubOriginal - lbOriginal + 1) * numSpan;
      int ubNew=ubOriginal + (ubOriginal - lbOriginal + 1) * numSpan;
      individual._minValue=Integer.toString(lbNew);
      individual._maxValue=Integer.toString(ubNew);
      _variableInfo.put(valName,individual);
    }
 catch (    Exception ex) {
      throw new InternalErrorException("String_Node_Str" + ex.getMessage());
    }
  }
  return returnVariableSet;
}