Program: 75072
Project: 75072
Buggy source:
/** 
 * Retun true if all the output-step-size-control actors of the enabled refinements are satisfied with the current step size and there is no enabled transition detected.
 * @return True if all the refinements are satisfied with thecurrent step size and there is no enabled transition detected.
 */
public boolean isOutputAccurate(){
  boolean result=true;
  Actor container=(Actor)getContainer();
  CTDirector dir=(CTDirector)(container.getExecutiveDirector());
  if (_enabledRefinements != null) {
    Iterator refinements=_enabledRefinements.iterator();
    while (refinements.hasNext()) {
      Actor refinement=(Actor)refinements.next();
      if (refinement instanceof CTStepSizeControlActor) {
        result=result && ((CTStepSizeControlActor)refinement).isOutputAccurate();
      }
    }
  }
  try {
    List preemptiveEnabledTransitions=_ctrl._checkTransition(_currentState.preemptiveTransitionList());
    if (preemptiveEnabledTransitions.size() != 0) {
      if (_debugging && _verbose) {
        _debug("String_Node_Str");
      }
    }
    List nonpreemptiveEnabledTransitions=_ctrl._checkTransition(_currentState.nonpreemptiveTransitionList());
    if (nonpreemptiveEnabledTransitions.size() != 0) {
      if (_debugging && _verbose) {
        _debug("String_Node_Str");
      }
    }
    Transition preemptiveTrWithEvent=_checkEvent(_currentState.preemptiveTransitionList());
    if (preemptiveTrWithEvent != null) {
      if (_debugging) {
        _debug("String_Node_Str" + preemptiveTrWithEvent.getGuardExpression());
      }
    }
    Transition nonPreemptiveTrWithEvent=_checkEvent(_currentState.nonpreemptiveTransitionList());
    if (nonPreemptiveTrWithEvent != null) {
      if (_debugging) {
        _debug("String_Node_Str" + nonPreemptiveTrWithEvent.getGuardExpression());
      }
    }
    double errorTolerance=dir.getErrorTolerance();
    if ((preemptiveEnabledTransitions.size() == 0) && (nonpreemptiveEnabledTransitions.size() == 0) && (preemptiveTrWithEvent == null)&& (nonPreemptiveTrWithEvent == null)) {
      _transitionHasEvent=false;
      _lastDistanceToBoundary=0.0;
      _distanceToBoundary=0.0;
      _outputAccurate=true;
    }
 else {
      Transition enabledTransition=null;
      _distanceToBoundary=Double.MIN_VALUE;
      Iterator iterator=preemptiveEnabledTransitions.iterator();
      while (iterator.hasNext()) {
        Transition transition=(Transition)iterator.next();
        RelationList relationList=transition.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=transition;
        }
      }
      iterator=nonpreemptiveEnabledTransitions.iterator();
      while (iterator.hasNext()) {
        Transition transition=(Transition)iterator.next();
        RelationList relationList=transition.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=transition;
        }
      }
      if (preemptiveTrWithEvent != null) {
        RelationList relationList=preemptiveTrWithEvent.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=preemptiveTrWithEvent;
        }
      }
      if (nonPreemptiveTrWithEvent != null) {
        RelationList relationList=nonPreemptiveTrWithEvent.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=nonPreemptiveTrWithEvent;
        }
      }
      if (_debugging && _verbose) {
        _debug("String_Node_Str" + enabledTransition.getGuardExpression() + "String_Node_Str"+ _distanceToBoundary);
      }
      _outputAccurate=_distanceToBoundary < errorTolerance;
      if (!_outputAccurate) {
        _transitionHasEvent=false;
      }
 else {
        _transitionHasEvent=true;
      }
    }
    return result && _outputAccurate;
  }
 catch (  Exception e) {
    throw new InternalErrorException(e);
  }
}

Fixed version (ground truth):
/** 
 * Retun true if all the output-step-size-control actors of the enabled refinements are satisfied with the current step size and there is no enabled transition detected.
 * @return True if all the refinements are satisfied with thecurrent step size and there is no enabled transition detected.
 */
public boolean isOutputAccurate(){
  boolean result=true;
  Actor container=(Actor)getContainer();
  CTDirector dir=(CTDirector)(container.getExecutiveDirector());
  if (_enabledRefinements != null) {
    Iterator refinements=_enabledRefinements.iterator();
    while (refinements.hasNext()) {
      Actor refinement=(Actor)refinements.next();
      if (refinement instanceof CTStepSizeControlActor) {
        result=result && ((CTStepSizeControlActor)refinement).isOutputAccurate();
      }
    }
  }
  try {
    List preemptiveEnabledTransitions=_ctrl._checkTransition(_currentState.preemptiveTransitionList());
    if (preemptiveEnabledTransitions.size() != 0) {
      if (_debugging && _verbose) {
        _debug("String_Node_Str");
      }
    }
    List nonpreemptiveEnabledTransitions=_ctrl._checkTransition(_currentState.nonpreemptiveTransitionList());
    if (nonpreemptiveEnabledTransitions.size() != 0) {
      if (_debugging && _verbose) {
        _debug("String_Node_Str");
      }
    }
    Transition preemptiveTrWithEvent=_checkEvent(_currentState.preemptiveTransitionList());
    if (preemptiveTrWithEvent != null) {
      if (_debugging) {
        _debug("String_Node_Str" + preemptiveTrWithEvent.getGuardExpression());
      }
    }
    Transition nonPreemptiveTrWithEvent=_checkEvent(_currentState.nonpreemptiveTransitionList());
    if (nonPreemptiveTrWithEvent != null) {
      if (_debugging) {
        _debug("String_Node_Str" + nonPreemptiveTrWithEvent.getGuardExpression());
      }
    }
    double errorTolerance=dir.getErrorTolerance();
    if ((preemptiveEnabledTransitions.size() == 0) && (nonpreemptiveEnabledTransitions.size() == 0) && (preemptiveTrWithEvent == null)&& (nonPreemptiveTrWithEvent == null)) {
      _transitionHasEvent=false;
      _lastDistanceToBoundary=0.0;
      _distanceToBoundary=0.0;
      _outputAccurate=true;
    }
 else {
      Transition enabledTransition=null;
      _distanceToBoundary=Double.MIN_VALUE;
      Iterator iterator=preemptiveEnabledTransitions.iterator();
      while (iterator.hasNext()) {
        Transition transition=(Transition)iterator.next();
        RelationList relationList=transition.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=transition;
        }
      }
      iterator=nonpreemptiveEnabledTransitions.iterator();
      while (iterator.hasNext()) {
        Transition transition=(Transition)iterator.next();
        RelationList relationList=transition.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=transition;
        }
      }
      if (preemptiveTrWithEvent != null) {
        RelationList relationList=preemptiveTrWithEvent.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=preemptiveTrWithEvent;
        }
      }
      if (nonPreemptiveTrWithEvent != null) {
        RelationList relationList=nonPreemptiveTrWithEvent.getRelationList();
        double distanceToBoundary=relationList.maximumDifference();
        if (distanceToBoundary > _distanceToBoundary) {
          _distanceToBoundary=distanceToBoundary;
          _lastDistanceToBoundary=relationList.getPreviousMaximumDistance();
          enabledTransition=nonPreemptiveTrWithEvent;
        }
      }
      if (_debugging && _verbose) {
        _debug("String_Node_Str" + enabledTransition.getGuardExpression() + "String_Node_Str"+ _distanceToBoundary);
      }
      _outputAccurate=_distanceToBoundary < errorTolerance;
      if (!_outputAccurate) {
        _transitionHasEvent=false;
      }
 else {
        _transitionHasEvent=true;
      }
    }
    return result && _outputAccurate;
  }
 catch (  Throwable throwable) {
    throw new InternalErrorException(throwable);
  }
}