Program: 76540
Project: 76540
Buggy source:
/** 
 * Run the sequence of execution. The execution is performed by the current thread. I.e. The execution is performed in 'foreground' and the method returns only after the execution finishes. This is useful for test scripts and batch mode runs. Note that this method is not synchronized since otherwise it would lock the  whole Manager object until it finishes. It is possible for other threads to come in and pause(), resume(), terminate() or finish() the execution of the simulation. <p> To start the simulation in 'background', use the startRun() method. startRun() creates a new thread which executes this run() method and then returns immediately. <p> The execution begins by calling initialize() on the toplevel  composite actor. It then continually calls iterate() based on the variables _keepIterating, and _isPaused.  It finally  calls wrapup() on its container to clean up the execution.
 */
public void run(){
  if (_simulationThread == null) {
    _simulationThread=Thread.currentThread();
  }
 else {
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return;
  }
  CompositeActor toplevel=((CompositeActor)getToplevel());
synchronized (this) {
    if (_keepIterating) {
      System.out.println("String_Node_Str");
      return;
    }
    _keepIterating=true;
    _isPaused=false;
    _iteration=0;
    _typeResolved=false;
  }
  ExecutionEvent event=new ExecutionEvent(this);
  Enumeration listeners=_ExecutionListeners.elements();
  while (listeners.hasMoreElements()) {
    ExecutionListener l=(ExecutionListener)listeners.nextElement();
    l.executionStarted(event);
  }
  try {
    try {
      toplevel.initialize();
      _needWriteAccessDuringIteration=_checkIfWriteAccessNeededDuringIteration();
      while (_keepIterating && _iterate()) {
        try {
          if (_isPaused) {
            event=new ExecutionEvent(this,_iteration);
            listeners=_ExecutionListeners.elements();
            while (listeners.hasMoreElements()) {
              ExecutionListener l=(ExecutionListener)listeners.nextElement();
              l.executionPaused(event);
            }
            _simulationThread.wait();
            event=new ExecutionEvent(this,_iteration);
            listeners=_ExecutionListeners.elements();
            while (listeners.hasMoreElements()) {
              ExecutionListener l=(ExecutionListener)listeners.nextElement();
              l.executionResumed(event);
            }
          }
        }
 catch (        InterruptedException e) {
        }
      }
    }
  finally {
      _keepIterating=false;
      _isPaused=false;
      toplevel.wrapup();
      event=new ExecutionEvent(this,_iteration);
      listeners=_ExecutionListeners.elements();
      while (listeners.hasMoreElements()) {
        ExecutionListener l=(ExecutionListener)listeners.nextElement();
        l.executionFinished(event);
      }
    }
  }
 catch (  Exception e) {
    fireExecutionError(e);
  }
  _simulationThread=null;
}

Fixed version (ground truth):
/** 
 * Run the sequence of execution. The execution is performed by the current thread. I.e. The execution is performed in 'foreground' and the method returns only after the execution finishes. This is useful for test scripts and batch mode runs. Note that this method is not synchronized since otherwise it would lock the  whole Manager object until it finishes. It is possible for other threads to come in and pause(), resume(), terminate() or finish() the execution of the simulation. <p> To start the simulation in 'background', use the startRun() method. startRun() creates a new thread which executes this run() method and then returns immediately. <p> The execution begins by calling initialize() on the toplevel  composite actor. It then continually calls iterate() based on the variables _keepIterating, and _isPaused.  It finally  calls wrapup() on its container to clean up the execution.
 */
public void run(){
  if (_simulationThread == null) {
    _simulationThread=Thread.currentThread();
  }
 else {
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return;
  }
  CompositeActor toplevel=((CompositeActor)getToplevel());
synchronized (this) {
    if (_keepIterating) {
      System.out.println("String_Node_Str");
      return;
    }
    _keepIterating=true;
    _isPaused=false;
    _iteration=0;
    _typeResolved=false;
  }
  ExecutionEvent event=new ExecutionEvent(this);
  Enumeration listeners=_ExecutionListeners.elements();
  while (listeners.hasMoreElements()) {
    ExecutionListener l=(ExecutionListener)listeners.nextElement();
    l.executionStarted(event);
  }
  try {
    try {
      toplevel.initialize();
      _needWriteAccessDuringIteration=_checkIfWriteAccessNeededDuringIteration();
      while (_keepIterating && _iterate()) {
        try {
          if (_isPaused) {
            event=new ExecutionEvent(this,_iteration);
            listeners=_ExecutionListeners.elements();
            while (listeners.hasMoreElements()) {
              ExecutionListener l=(ExecutionListener)listeners.nextElement();
              l.executionPaused(event);
            }
synchronized (_simulationThread) {
              _simulationThread.wait();
            }
            event=new ExecutionEvent(this,_iteration);
            listeners=_ExecutionListeners.elements();
            while (listeners.hasMoreElements()) {
              ExecutionListener l=(ExecutionListener)listeners.nextElement();
              l.executionResumed(event);
            }
          }
        }
 catch (        InterruptedException e) {
        }
      }
    }
  finally {
      _keepIterating=false;
      _isPaused=false;
      toplevel.wrapup();
      event=new ExecutionEvent(this,_iteration);
      listeners=_ExecutionListeners.elements();
      while (listeners.hasMoreElements()) {
        ExecutionListener l=(ExecutionListener)listeners.nextElement();
        l.executionFinished(event);
      }
    }
  }
 catch (  Exception e) {
    fireExecutionError(e);
  }
  _simulationThread=null;
}