Program: 74752
Project: 74752
Buggy source:
/** 
 * Execute the model.  Begin with the initialization phase, followed by a sequence of iterations, followed by a wrapup phase. The sequence of iterations concludes when the postfire() method of the container (the top-level composite actor) returns false, or when the finish() method is called. <p> The execution is performed in the calling thread (the current thread), so this method returns only after execution finishes. If you wish to perform execution in a new thread, use startRun() instead.  Even if an exception occurs during the execution, the wrapup() method is called (in a finally clause).   <p>  If an exception occurs during the execution, delegate to the  exception handlers (if there are any) to handle these exceptions. If there are no exception handlers, it is up to the caller to handle (e.g. report) the exception. If you do not wish to handle exceptions, but want to execute within the calling thread, use run().
 * @see #run()
 * @exception KernelException If the model throws it.
 * @exception IllegalActionException If the model is already running, orif there is no container.
 */
public void execute() throws KernelException, IllegalActionException {
synchronized (this) {
    if (_state != IDLE) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
  }
  long startTime=(new Date()).getTime();
  _debug("String_Node_Str");
  _finishRequested=false;
  boolean completedSuccessfully=false;
  Throwable initialThrowable=null;
  try {
    try {
      initialize();
      _debug("String_Node_Str");
      while (!_finishRequested) {
        if (!iterate()) {
          break;
        }
        if (_pauseRequested) {
synchronized (this) {
            _setState(PAUSED);
            while (_pauseRequested && !_finishRequested) {
              try {
                wait();
              }
 catch (              InterruptedException e) {
              }
            }
          }
        }
      }
      completedSuccessfully=true;
    }
 catch (    Throwable throwable) {
      _setState(THROWING_A_THROWABLE);
      initialThrowable=throwable;
    }
  }
  finally {
    try {
      wrapup();
    }
 catch (    Exception exception) {
      if (initialThrowable == null) {
        initialThrowable=exception;
      }
    }
 finally {
      setDeferringChangeRequests(false);
      _finishRequested=false;
      if (_state != IDLE) {
        _setState(IDLE);
      }
      if (completedSuccessfully) {
        _notifyListenersOfCompletion();
      }
      System.out.println(timeAndMemory(startTime));
      if (initialThrowable != null) {
        List exceptionHandlersList=_container.entityList(ExceptionHandler.class);
        Iterator exceptionHandlers=exceptionHandlersList.iterator();
        if (exceptionHandlersList.size() > 0) {
          boolean exceptionHandled=false;
          while (exceptionHandlers.hasNext()) {
            ExceptionHandler exceptionHandler=(ExceptionHandler)exceptionHandlers.next();
            if (exceptionHandler.handleException(_container,(Exception)initialThrowable)) {
              exceptionHandled=true;
            }
          }
          if (exceptionHandled) {
            initialThrowable=null;
            _notifyListenersOfCompletion();
          }
        }
      }
      if (initialThrowable != null) {
        if (initialThrowable instanceof RuntimeException) {
          throw (RuntimeException)initialThrowable;
        }
 else         if (initialThrowable instanceof KernelException) {
          throw (KernelException)initialThrowable;
        }
 else         if (initialThrowable instanceof RuntimeException) {
          throw (RuntimeException)initialThrowable;
        }
 else {
          throw new IllegalActionException(this,initialThrowable,null);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute the model.  Begin with the initialization phase, followed by a sequence of iterations, followed by a wrapup phase. The sequence of iterations concludes when the postfire() method of the container (the top-level composite actor) returns false, or when the finish() method is called. <p> The execution is performed in the calling thread (the current thread), so this method returns only after execution finishes. If you wish to perform execution in a new thread, use startRun() instead.  Even if an exception occurs during the execution, the wrapup() method is called (in a finally clause).   <p>  If an exception occurs during the execution, delegate to the  exception handlers (if there are any) to handle these exceptions. If there are no exception handlers, it is up to the caller to handle (e.g. report) the exception. If you do not wish to handle exceptions, but want to execute within the calling thread, use run().
 * @see #run()
 * @exception KernelException If the model throws it.
 * @exception IllegalActionException If the model is already running, orif there is no container.
 */
public void execute() throws KernelException, IllegalActionException {
synchronized (this) {
    if (_state != IDLE) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
  }
  long startTime=(new Date()).getTime();
  _debug("String_Node_Str");
  _finishRequested=false;
  boolean completedSuccessfully=false;
  Throwable initialThrowable=null;
  try {
    try {
      initialize();
      _debug("String_Node_Str");
      while (!_finishRequested) {
        if (!iterate()) {
          break;
        }
        if (_pauseRequested) {
synchronized (this) {
            _setState(PAUSED);
            while (_pauseRequested && !_finishRequested) {
              try {
                wait();
              }
 catch (              InterruptedException e) {
              }
            }
          }
        }
      }
      completedSuccessfully=true;
    }
 catch (    Throwable throwable) {
      _setState(THROWING_A_THROWABLE);
      initialThrowable=throwable;
    }
  }
  finally {
    try {
      wrapup();
    }
 catch (    Exception exception) {
      if (initialThrowable == null) {
        initialThrowable=exception;
      }
    }
 finally {
      setDeferringChangeRequests(false);
      _finishRequested=false;
      if (_state != IDLE) {
        _setState(IDLE);
      }
      if (completedSuccessfully) {
        _notifyListenersOfCompletion();
      }
      System.out.println(timeAndMemory(startTime));
      if (initialThrowable != null) {
        List exceptionHandlersList=_container.entityList(ExceptionHandler.class);
        Iterator exceptionHandlers=exceptionHandlersList.iterator();
        if (exceptionHandlersList.size() > 0) {
          boolean exceptionHandled=false;
          while (exceptionHandlers.hasNext()) {
            ExceptionHandler exceptionHandler=(ExceptionHandler)exceptionHandlers.next();
            if (exceptionHandler.handleException(_container,initialThrowable)) {
              exceptionHandled=true;
            }
          }
          if (exceptionHandled) {
            initialThrowable=null;
            _notifyListenersOfCompletion();
          }
        }
      }
      if (initialThrowable != null) {
        if (initialThrowable instanceof RuntimeException) {
          throw (RuntimeException)initialThrowable;
        }
 else         if (initialThrowable instanceof KernelException) {
          throw (KernelException)initialThrowable;
        }
 else         if (initialThrowable instanceof RuntimeException) {
          throw (RuntimeException)initialThrowable;
        }
 else {
          throw new IllegalActionException(this,initialThrowable,null);
        }
      }
    }
  }
}