nus-yam/ex-repair huggingface dataset:
Program: 72990
Project: 72990
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver();
  newObject._actorList=new LinkedList<StartOrResumable>();
  newObject._timeScheduler=new TimeScheduler();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver();
  newObject._actorList=new LinkedList<StartOrResumable>();
  newObject._timeScheduler=new TimeScheduler();
  newObject._debugger=new MetroDebugger();
  return newObject;
}
Program: 72991
Project: 72991
Buggy source:
public void getfire(ResultHandler<Iterable<Event.Builder>> resultHandler) throws CollectionAbortedException {
  FSMActor controller=null;
  try {
    controller=getController();
  }
 catch (  IllegalActionException e) {
    e.printStackTrace();
  }
  if (controller == null) {
  }
 else {
    State currentState=controller.currentState();
    if (_debugging) {
      _debug("String_Node_Str" + getFullName(),"String_Node_Str" + getModelTime());
      _debug("String_Node_Str",currentState.getName());
    }
    Event.Builder eb;
    do {
      eb=makeEventBuilder(currentState.getFullName(),Event.Type.BEGIN,Event.Status.PROPOSED);
      events.add(eb);
      resultHandler.handleResult(events);
      events.remove(events.size() - 1);
    }
 while (eb.getStatus() != Event.Status.NOTIFIED);
    try {
      super.fire();
    }
 catch (    IllegalActionException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void getfire(ResultHandler<Iterable<Event.Builder>> resultHandler) throws CollectionAbortedException {
  FSMActor controller=null;
  try {
    controller=getController();
  }
 catch (  IllegalActionException e) {
    e.printStackTrace();
  }
  if (controller == null) {
  }
 else {
    State currentState=controller.currentState();
    if (_debugging) {
      _debug("String_Node_Str" + getFullName(),"String_Node_Str" + getModelTime());
      _debug("String_Node_Str",currentState.getName());
    }
    Event.Builder eb;
    do {
      eb=MetroEventBuilder.newProposedEvent(MetroEventBuilder.trimModelName(currentState.getFullName()),"String_Node_Str");
      events.add(eb);
      resultHandler.handleResult(events);
      events.remove(events.size() - 1);
    }
 while (eb.getStatus() != Event.Status.NOTIFIED);
    try {
      super.fire();
    }
 catch (    IllegalActionException e) {
      e.printStackTrace();
    }
  }
}
Program: 72992
Project: 72992
Buggy source:
/** 
 * Return the MetroII event associated with the current state and  set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  return event;
}

Fixed version (ground truth):
/** 
 * Return the MetroII event associated with the current state and  set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  event.clearTime();
  return event;
}
Program: 72993
Project: 72993
Buggy source:
/** 
 * Return the MetroII event associated with the current state and  set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  return event;
}

Fixed version (ground truth):
/** 
 * Return the MetroII event associated with the current state and  set the state of the event to be PROPOSED.
 * @return the MetroII event associated with the current state
 */
protected Builder proposeStateEvent(){
  Builder event=getStateEvent();
  event.setStatus(Status.PROPOSED);
  event.clearTime();
  return event;
}
Program: 72994
Project: 72994
Buggy source:
@Override public void resolve(Iterable<Builder> metroIIEventList){
  long time=Long.MAX_VALUE;
  boolean hasEventWithoutTime=false;
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        if (event.getTime() < time) {
          time=event.getTime();
        }
        System.out.println(event.getName() + "String_Node_Str" + event.getTime());
      }
 else {
        hasEventWithoutTime=true;
      }
    }
  }
  System.out.println("String_Node_Str" + time);
  if (hasEventWithoutTime) {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          event.setStatus(Status.WAITING);
        }
      }
    }
  }
 else {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          if (event.getTime() > time) {
            event.setStatus(Status.WAITING);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void resolve(Iterable<Builder> metroIIEventList){
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        System.out.println(event.getTime() + "String_Node_Str" + event.getName());
      }
 else {
        System.out.println(current_time + "String_Node_Str" + event.getName());
      }
    }
  }
  long time=Long.MAX_VALUE;
  boolean hasEventWithoutTime=false;
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        if (event.getTime() < time) {
          time=event.getTime();
        }
        System.out.println(event.getName() + "String_Node_Str" + event.getTime());
      }
 else {
        hasEventWithoutTime=true;
      }
    }
  }
  System.out.println("String_Node_Str" + (double)current_time / Double.valueOf("String_Node_Str"));
  if (hasEventWithoutTime) {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          event.setStatus(Status.WAITING);
        }
      }
    }
  }
 else {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          if (event.getTime() > time) {
            event.setStatus(Status.WAITING);
          }
        }
      }
    }
  }
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        System.out.println(event.getTime() + "String_Node_Str" + event.getName());
        if (current_time < event.getTime()) {
          current_time=event.getTime();
        }
      }
    }
  }
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (!event.hasTime()) {
        event.setTime(current_time);
        System.out.println(current_time + "String_Node_Str" + event.getName());
      }
    }
  }
}
Program: 72995
Project: 72995
Buggy source:
public TimeScheduler(){
}

Fixed version (ground truth):
public TimeScheduler(){
  current_time=0;
}
Program: 72996
Project: 72996
Buggy source:
public FireMachine(Actor actor){
  _actor=actor;
  reset();
}

Fixed version (ground truth):
public FireMachine(Actor actor){
  _actor=actor;
  _BeginEvent=_createMetroIIEvent("String_Node_Str");
  _ProcessEvent=_createMetroIIEvent("String_Node_Str");
  _EndEvent=_createMetroIIEvent("String_Node_Str");
  reset();
}
Program: 72997
Project: 72997
Buggy source:
/** 
 * Dispose the current execution.
 */
public void reset(){
  if (_iteration > 0) {
    setStatus(Status.BEGIN);
    _currentStateEvent=_createMetroIIEvent("String_Node_Str");
  }
 else {
    setStatus(Status.START);
    _currentStateEvent=null;
  }
}

Fixed version (ground truth):
/** 
 * Dispose the current execution.
 */
public void reset(){
  setState(State.START);
}
Program: 72998
Project: 72998
Buggy source:
/** 
 * Dispose the current execution.
 */
public void reset(){
  _state=State.PREFIRE_BEGIN;
  _currentStateEvent=_createMetroIIEvent("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Dispose the current execution.
 */
public void reset(){
  _state=ProcessState.PREFIRE_BEGIN;
  _currentStateEvent=_createMetroIIEvent("String_Node_Str");
}
Program: 72999
Project: 72999
Buggy source:
/** 
 * Stop and dispose any associated thread.
 */
@Override public void reset(){
  if (_state == State.FIRING) {
    _eventIterator.dispose();
    _actor.stop();
  }
  super.reset();
}

Fixed version (ground truth):
/** 
 * Stop and dispose any associated thread.
 */
@Override public void reset(){
  if (_state == ProcessState.FIRING) {
    _eventIterator.dispose();
    _actor.stop();
  }
  super.reset();
}
Program: 73000
Project: 73000
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDEDirector newObject=(MetroIIDEDirector)super.clone(workspace);
  newObject._nameToActor=(Hashtable<String,Actor>)_nameToActor.clone();
  newObject._actorDictionary=(Hashtable<String,FireMachine>)_actorDictionary.clone();
  newObject._events=(ArrayList<Builder>)_events.clone();
  newObject.actorList=(ArrayList<Actor>)actorList.clone();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDEDirector newObject=(MetroIIDEDirector)super.clone(workspace);
  newObject._nameToActor=(Hashtable<String,Actor>)_nameToActor.clone();
  newObject._actorDictionary=(Hashtable<String,FireMachine>)_actorDictionary.clone();
  newObject._events=(ArrayList<Builder>)_events.clone();
  newObject.actorList=(ArrayList<Actor>)actorList.clone();
  newObject._pendingIteration=(Hashtable<String,Integer>)_pendingIteration.clone();
  return newObject;
}
Program: 73001
Project: 73001
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  newObject._actorList=(LinkedList)_actorList.clone();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  newObject._actorList=(LinkedList)_actorList.clone();
  newObject._timeScheduler=(TimeScheduler)_timeScheduler.clone();
  return newObject;
}
Program: 73002
Project: 73002
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  newObject._actorList=(LinkedList)_actorList.clone();
  newObject._timeScheduler=(TimeScheduler)_timeScheduler.clone();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDirector newObject=(MetroIIDirector)super.clone(workspace);
  newObject._mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  newObject._actorList=new LinkedList<StartOrResumable>();
  newObject._timeScheduler=new TimeScheduler();
  return newObject;
}
Program: 73003
Project: 73003
Buggy source:
public FireMachine(Actor actor){
  _actor=actor;
  _iteration=0;
  reset();
}

Fixed version (ground truth):
public FireMachine(Actor actor){
  _actor=actor;
  reset();
}
Program: 73004
Project: 73004
Buggy source:
/** 
 * Dispose the current execution.
 */
public void reset(){
  if (_iteration > 0) {
    setStatus(Status.BEGIN);
    _currentStateEvent=_createMetroIIEvent("String_Node_Str");
    _iteration--;
  }
 else {
    setStatus(Status.START);
    _currentStateEvent=null;
    _iteration=0;
  }
}

Fixed version (ground truth):
/** 
 * Dispose the current execution.
 */
public void reset(){
  if (_iteration > 0) {
    setStatus(Status.BEGIN);
    _currentStateEvent=_createMetroIIEvent("String_Node_Str");
  }
 else {
    setStatus(Status.START);
    _currentStateEvent=null;
  }
}
Program: 73005
Project: 73005
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDEDirector newObject=(MetroIIDEDirector)super.clone(workspace);
  newObject._nameToActor=(Hashtable<String,Actor>)_nameToActor.clone();
  newObject._actorDictionary=(Hashtable<String,FireMachine>)_actorDictionary.clone();
  newObject._events=(ArrayList<Builder>)_events.clone();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there).
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  MetroIIDEDirector newObject=(MetroIIDEDirector)super.clone(workspace);
  newObject._nameToActor=(Hashtable<String,Actor>)_nameToActor.clone();
  newObject._actorDictionary=(Hashtable<String,FireMachine>)_actorDictionary.clone();
  newObject._events=(ArrayList<Builder>)_events.clone();
  newObject.actorList=(ArrayList<Actor>)actorList.clone();
  return newObject;
}
Program: 73006
Project: 73006
Buggy source:
@Override public void initialize() throws IllegalActionException {
  super.initialize();
  Nameable container=getContainer();
  if (container instanceof CompositeActor) {
    Iterator<?> actors=((CompositeActor)container).deepEntityList().iterator();
    _actorDictionary.clear();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      if (actor instanceof MetroIIEventHandler) {
        _actorDictionary.put(actor.getFullName(),new ResumableFire(actor));
      }
 else {
        _actorDictionary.put(actor.getFullName(),new NonBlockingFire(actor));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void initialize() throws IllegalActionException {
  super.initialize();
  Nameable container=getContainer();
  if (container instanceof CompositeActor) {
    Iterator<?> actors=((CompositeActor)container).deepEntityList().iterator();
    _actorDictionary.clear();
    _pendingIteration.clear();
    while (actors.hasNext()) {
      Actor actor=(Actor)actors.next();
      if (actor instanceof MetroIIEventHandler) {
        _actorDictionary.put(actor.getFullName(),new ResumableFire(actor));
      }
 else {
        _actorDictionary.put(actor.getFullName(),new NonBlockingFire(actor));
      }
      _pendingIteration.put(actor.getFullName(),0);
    }
  }
  _events=new ArrayList<Event.Builder>();
  actorList=new ArrayList<Actor>();
}
Program: 73007
Project: 73007
Buggy source:
@Override public void resolve(Iterable<Builder> metroIIEventList){
  long time=Long.MAX_VALUE;
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        if (event.getTime() < time) {
          time=event.getTime();
        }
      }
    }
  }
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        if (event.getTime() > time) {
          event.setStatus(Status.WAITING);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void resolve(Iterable<Builder> metroIIEventList){
  long time=Long.MAX_VALUE;
  boolean hasEventWithoutTime=false;
  for (  Builder event : metroIIEventList) {
    if (event.getStatus() == Status.NOTIFIED) {
      if (event.hasTime()) {
        if (event.getTime() < time) {
          time=event.getTime();
        }
      }
 else {
        hasEventWithoutTime=true;
      }
    }
  }
  if (hasEventWithoutTime) {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          event.setStatus(Status.WAITING);
        }
      }
    }
  }
 else {
    for (    Builder event : metroIIEventList) {
      if (event.getStatus() == Status.NOTIFIED) {
        if (event.hasTime()) {
          if (event.getTime() > time) {
            event.setStatus(Status.WAITING);
          }
        }
      }
    }
  }
}
Program: 73010
Project: 73010
Buggy source:
/** 
 * Send a command to the OpenModelica Compiler(OMC) server and fetches the string result.
 * @param modelicaCommand The command which should be sent to the OMC.
 * @return CompilerResult The result of sendExpression("modelicaCommand") to the OMC.
 * @exception ConnectException If commands couldn't be sent to the OMC.
 */
public CompilerResult sendCommand(String modelicaCommand) throws ConnectException {
  String error=null;
  String[] retval={"String_Node_Str"};
  if (_couldNotStartOMC) {
    return CompilerResult.makeResult(retval,error);
  }
  if (_numberOfErrors > _showMaxErrors) {
    return CompilerResult.makeResult(retval,error);
  }
  modelicaCommand=modelicaCommand.trim();
  if (hasInitialized == false) {
    initServer();
  }
  try {
    retval[0]=omcc.sendExpression(modelicaCommand);
    if (!modelicaCommand.equalsIgnoreCase("String_Node_Str")) {
      error=omcc.sendExpression("String_Node_Str");
    }
    if (error != null && error.length() > 2) {
      error=error.trim();
      error=error.substring(1,error.length() - 1);
    }
 else {
      error=null;
    }
    return CompilerResult.makeResult(retval,error);
  }
 catch (  org.omg.CORBA.COMM_FAILURE x) {
    _numberOfErrors++;
    throw new ConnectException("String_Node_Str" + modelicaCommand);
  }
}

Fixed version (ground truth):
/** 
 * Send a command to the OpenModelica Compiler(OMC) server and fetches the string result.
 * @param modelicaCommand The command which should be sent to the OMC.
 * @return CompilerResult The result of sendExpression("modelicaCommand") to the OMC.
 * @exception ConnectException If commands couldn't be sent to the OMC.
 */
public CompilerResult sendCommand(String modelicaCommand) throws ConnectException {
  String error=null;
  String[] retval={"String_Node_Str"};
  if (_couldNotStartOMC)   return CompilerResult.makeResult(retval,error);
  if (_numberOfErrors > _showMaxErrors)   return CompilerResult.makeResult(retval,error);
  modelicaCommand=modelicaCommand.trim();
  if (hasInitialized == false)   initServer();
  try {
    retval[0]=omcc.sendExpression(modelicaCommand);
    if (!modelicaCommand.equalsIgnoreCase("String_Node_Str"))     error=omcc.sendExpression("String_Node_Str");
    if (error != null && error.length() > 2) {
      error=error.trim();
      error=error.substring(1,error.length() - 1);
    }
 else {
      error=null;
    }
    return CompilerResult.makeResult(retval,error);
  }
 catch (  org.omg.CORBA.COMM_FAILURE x) {
    _numberOfErrors++;
    throw new ConnectException("String_Node_Str" + modelicaCommand);
  }
}
Program: 73012
Project: 73012
Buggy source:
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcCommand=null;
    _omcLogger=null;
    _omcProxyInstance=null;
  }
}

Fixed version (ground truth):
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcLogger=null;
    _omcProxyInstance=null;
  }
}
Program: 73015
Project: 73015
Buggy source:
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static OMCProxy getInstance(){
  if (_omcProxyInstance == null) {
    _omcProxyInstance=new OMCProxy();
  }
  return _omcProxyInstance;
}

Fixed version (ground truth):
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static OMCProxy getInstance(){
  return _omcProxyInstance;
}
Program: 73016
Project: 73016
Buggy source:
/** 
 * Construct a director in the given container with the given name.  The container argument must not be null, or a NullPointerException will be thrown.  If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.
 * @param container Container of the director.
 * @param name Name of this director.
 * @exception IllegalActionException If the director is not compatiblewith the specified container.  May be thrown in a derived class.
 * @exception NameDuplicationException If the container is not aCompositeActor and the name collides with an entity in the container.
 */
public MetroIIDirector(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  _actorList=new LinkedList<StartOrResumable>();
  _mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  _initializeParameters();
  initialize();
}

Fixed version (ground truth):
/** 
 * Construct a director in the given container with the given name.  The container argument must not be null, or a NullPointerException will be thrown.  If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.
 * @param container Container of the director.
 * @param name Name of this director.
 * @exception IllegalActionException If the director is not compatiblewith the specified container.  May be thrown in a derived class.
 * @exception NameDuplicationException If the container is not aCompositeActor and the name collides with an entity in the container.
 */
public MetroIIDirector(CompositeEntity container,String name) throws NameDuplicationException, IllegalActionException {
  super(container,name);
  _actorList=new LinkedList<StartOrResumable>();
  _mappingConstraintSolver=new MappingConstraintSolver(_maxEvent);
  _timeScheduler=new TimeScheduler();
  _initializeParameters();
  initialize();
}
Program: 73017
Project: 73017
Buggy source:
/** 
 * Construct an OpenModelica Compiler(OMC) logger. This constructor has no parameter. It creates the log file in the temporary folder and sets the format of the log to show date and time first. This private Constructor prevents other class from instantiating.
 * @exception IllegalActionException
 */
private OMCLogger() throws IllegalActionException {
  String logPath=createDirectoryForResult();
  String logFileName=logPath + "String_Node_Str";
  try {
    _fileHandler=new FileHandler(logFileName);
  }
 catch (  SecurityException ex) {
    String message="String_Node_Str" + "String_Node_Str" + logFileName + "String_Node_Str";
    omcLogger.severe(message);
    throw new IllegalActionException(null,ex,message);
  }
catch (  IOException ex) {
    String message="String_Node_Str" + "String_Node_Str" + logFileName + "String_Node_Str";
    omcLogger.severe(message);
    throw new IllegalActionException(null,ex,message);
  }
  _fileHandler.setFormatter(new Formatter(){
    public String format(    LogRecord rec){
      StringBuffer buf=new StringBuffer(1000);
      buf.append(new java.util.Date());
      buf.append(' ');
      buf.append(rec.getLevel());
      buf.append(' ');
      buf.append(formatMessage(rec));
      buf.append('\n');
      return buf.toString();
    }
  }
);
  omcLogger.addHandler(_fileHandler);
}

Fixed version (ground truth):
/** 
 * Construct an OpenModelica Compiler(OMC) logger. This constructor has no parameter. It creates the log file in the temporary folder and sets the format of the log to show date and time first. This private Constructor prevents other class from instantiating.
 * @throws IllegalActionException 
 */
private OMCLogger() throws IllegalActionException {
  String logPath=createDirectoryForResult();
  String logFileName=logPath + "String_Node_Str";
  try {
    _fileHandler=new FileHandler(logFileName);
  }
 catch (  SecurityException ex) {
    String message="String_Node_Str" + "String_Node_Str" + logFileName + "String_Node_Str";
    omcLogger.severe(message);
    throw new IllegalActionException(null,ex,message);
  }
catch (  IOException ex) {
    String message="String_Node_Str" + "String_Node_Str" + logFileName + "String_Node_Str";
    omcLogger.severe(message);
    throw new IllegalActionException(null,ex,message);
  }
  _fileHandler.setFormatter(new Formatter(){
    public String format(    LogRecord rec){
      StringBuffer buf=new StringBuffer(1000);
      buf.append(new java.util.Date());
      buf.append(' ');
      buf.append(rec.getLevel());
      buf.append(' ');
      buf.append(formatMessage(rec));
      buf.append('\n');
      return buf.toString();
    }
  }
);
  omcLogger.addHandler(_fileHandler);
}
Program: 73018
Project: 73018
Buggy source:
/** 
 * Get the Info LogLevel and info message will be written in the log file.
 * @param infoMessage The info message.
 */
public void getInfo(String infoMessage){
  omcLogger.info(infoMessage);
}

Fixed version (ground truth):
/** 
 * Get the Info LogLevel and info message will be written in the log file. 
 * @param infoMessage The info message. 
 */
public void getInfo(String infoMessage){
  omcLogger.info(infoMessage);
}
Program: 73019
Project: 73019
Buggy source:
/** 
 * Create an instance of OMCLogger object in order to provide a global point of access to the instance. It provides a unique source of OMCLogger instance.
 * @return An OMCLogger object representing the instance value.
 */
public static OMCLogger getInstance(){
  if (_omcLoggerInstance == null) {
    try {
      _omcLoggerInstance=new OMCLogger();
    }
 catch (    IllegalActionException e) {
      String message="String_Node_Str";
      _omcLoggerInstance.getSever(message);
    }
  }
  return _omcLoggerInstance;
}

Fixed version (ground truth):
/** 
 * Create an instance of OMCLogger object in order to provide a global point of access to the instance. It provides a unique source of OMCLogger instance.
 * @return An OMCLogger object representing the instance value.
 */
public static OMCLogger getInstance(){
  if (_omcLoggerInstance == null) {
    try {
      _omcLoggerInstance=new OMCLogger();
    }
 catch (    IllegalActionException e) {
      new Exception("String_Node_Str").printStackTrace();
    }
  }
  return _omcLoggerInstance;
}
Program: 73020
Project: 73020
Buggy source:
/** 
 * Return the path to the (OpenModelica Compiler)OMC CORBA object that is stored on a disk.
 * @return String The path to the OMC CORBA object.
 */
private String _getPathToObject(){
  String fileName=null;
switch (getOs()) {
case UNIX:
    if (_username == null) {
      System.err.println("String_Node_Str");
      _username="String_Node_Str";
    }
  if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
    fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str";
  }
 else {
    fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str"+ "String_Node_Str"+ _corbaSessionName;
  }
break;
case WINDOWS:
if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
fileName=_temp + "String_Node_Str";
}
 else {
fileName=_temp + "String_Node_Str" + "String_Node_Str"+ _corbaSessionName;
}
break;
case MAC:
if (_username == null) {
System.err.println("String_Node_Str");
_username="String_Node_Str";
}
if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str";
}
 else {
fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str"+ "String_Node_Str"+ _corbaSessionName;
}
break;
}
String loggerInfo="String_Node_Str" + fileName + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
return fileName;
}

Fixed version (ground truth):
/** 
 * Return the path to the (OpenModelica Compiler)OMC CORBA object that is stored on a disk.
 * @return String The path to the OMC CORBA object.
 */
private String _getPathToObject(){
  String fileName=null;
switch (getOs()) {
case UNIX:
    if (_username == null) {
      System.err.println("String_Node_Str");
      _username="String_Node_Str";
    }
  if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
    fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str";
  }
 else {
    fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str"+ "String_Node_Str"+ _corbaSessionName;
  }
break;
case WINDOWS:
if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
fileName=_temp + "String_Node_Str";
}
 else {
fileName=_temp + "String_Node_Str" + "String_Node_Str"+ _corbaSessionName;
}
break;
case MAC:
if (_username == null) {
System.err.println("String_Node_Str");
_username="String_Node_Str";
}
if (_corbaSessionName == null || _corbaSessionName.equalsIgnoreCase("String_Node_Str")) {
fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str";
}
 else {
fileName=_temp + "String_Node_Str" + _username+ "String_Node_Str"+ "String_Node_Str"+ _corbaSessionName;
}
break;
}
if (_omcLogger == null) {
new Exception("String_Node_Str").printStackTrace();
_omcLogger=OMCLogger.getInstance();
}
String loggerInfo="String_Node_Str" + fileName + "String_Node_Str";
_omcLogger.getInfo(loggerInfo);
return fileName;
}
Program: 73021
Project: 73021
Buggy source:
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcLogger=null;
  }
}

Fixed version (ground truth):
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcLogger=null;
    _omcProxyInstance=null;
  }
}
Program: 73022
Project: 73022
Buggy source:
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static synchronized OMCProxy getInstance(){
  return _omcProxyInstance;
}

Fixed version (ground truth):
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static synchronized OMCProxy getInstance(){
  if (_omcProxyInstance == null)   _omcProxyInstance=new OMCProxy();
  return _omcProxyInstance;
}
Program: 73023
Project: 73023
Buggy source:
/** 
 * Construct an OpenModelica Compiler(OMC) proxy. This constructor has no parameter.  This private Constructor prevents other class from instantiating. 
 */
private OMCProxy(){
  _omcLogger=OMCLogger.getInstance();
}

Fixed version (ground truth):
/** 
 * Construct an OpenModelica Compiler(OMC) proxy. This constructor has no parameter.  This private Constructor prevents other class from instantiating. 
 */
private OMCProxy(){
}
Program: 73024
Project: 73024
Buggy source:
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcLogger=null;
    _omcProxyInstance=null;
  }
}

Fixed version (ground truth):
/** 
 * Leave and quit OpenModelica environment. Deallocate OMCProxy and OMCLogger objects.
 * @exception ConnectException If quit command couldn'tbe sent to OMC.
 */
public void quitServer() throws ConnectException {
  if (hasInitialized=true) {
    sendCommand("String_Node_Str");
    _omcLogger=null;
  }
}
Program: 73025
Project: 73025
Buggy source:
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static OMCProxy getInstance(){
  return _omcProxyInstance;
}

Fixed version (ground truth):
/** 
 * Create an instance of OMCProxy object in order to provide a global point of access to the instance. It provides a unique source of OMCProxy instance.
 * @return An OMCProxy object representing the instance value.
 */
public static synchronized OMCProxy getInstance(){
  return _omcProxyInstance;
}
Program: 73027
Project: 73027
Buggy source:
/** 
 * Construct a Bus with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.  This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public Bus(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  _tokens=new FIFOQueue();
  _receiversAndTokensToSendTo=new HashMap<Receiver,Token>();
  _tempReceiverQueue=new FIFOQueue();
  _messageLengths=new Hashtable<IOPort,Double>();
  _parameters=new HashMap<IOPort,List<Attribute>>();
  serviceTimeMultiplicationFactor=new Parameter(this,"String_Node_Str");
  serviceTimeMultiplicationFactor.setExpression("String_Node_Str");
  serviceTimeMultiplicationFactor.setTypeEquals(BaseType.DOUBLE);
}

Fixed version (ground truth):
/** 
 * Construct a Bus with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.  This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public Bus(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  _tokens=new FIFOQueue();
  _receiversAndTokensToSendTo=new HashMap<Receiver,Token>();
  _tempReceiverQueue=new FIFOQueue();
  _messageLengths=new Hashtable<IOPort,Double>();
  serviceTimeMultiplicationFactor=new Parameter(this,"String_Node_Str");
  serviceTimeMultiplicationFactor.setExpression("String_Node_Str");
  serviceTimeMultiplicationFactor.setTypeEquals(BaseType.DOUBLE);
}
Program: 73028
Project: 73028
Buggy source:
/** 
 * Return the list of Attributes that can be specified per port with default values for the specified port.
 * @param container The container parameter.
 * @param The port.
 * @return List of attributes.
 * @exception IllegalActionException Thrown if attributeList could not be created.
 */
public List<Attribute> getPortAttributeList(Parameter container,Port port) throws IllegalActionException {
  List<Attribute> list=_parameters.get(port);
  if (list == null) {
    list=new ArrayList<Attribute>();
    try {
      Parameter messageLengthParameter=new Parameter(container,"String_Node_Str",new IntToken(1));
      list.add(messageLengthParameter);
    }
 catch (    NameDuplicationException ex) {
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Return the list of Attributes that can be specified per port with default values for the specified port.
 * @param container The container parameter.
 * @param port The port.
 * @return List of attributes.
 * @exception IllegalActionException Thrown if attributeList could not be created.
 */
public List<Attribute> getPortAttributeList(Parameter container,Port port) throws IllegalActionException {
  List<Attribute> list=_parameters.get(port);
  if (list == null) {
    list=new ArrayList<Attribute>();
    try {
      Parameter messageLengthParameter=new Parameter(container,"String_Node_Str",new IntToken(1));
      list.add(messageLengthParameter);
    }
 catch (    NameDuplicationException ex) {
    }
  }
  return list;
}
Program: 73030
Project: 73030
Buggy source:
/** 
 * Get the value of the attribute, which is the evaluated expression. If the value is null, this returns the string "null"
 * @see #getExpression()
 */
public String getValueAsString(){
  ptolemy.data.Token value=null;
  try {
    value=getToken();
  }
 catch (  IllegalActionException ex) {
  }
  String tokenString;
  if (value == null) {
    tokenString="String_Node_Str";
  }
 else {
    tokenString=value.toString();
  }
  return tokenString;
}

Fixed version (ground truth):
/** 
 * Get the value of the attribute, which is the evaluated expression. If the value is null, this returns the string "null"
 * @see #getExpression()
 */
public String getValueAsString(){
  ptolemy.data.Token value=null;
  try {
    value=getToken();
  }
 catch (  IllegalActionException ex) {
  }
  String tokenString;
  if (value == null) {
    tokenString="String_Node_Str";
  }
 else   if (isStringMode()) {
    tokenString=((StringToken)value).stringValue();
  }
 else {
    tokenString=value.toString();
  }
  return tokenString;
}
Program: 73031
Project: 73031
Buggy source:
/** 
 * Call propagate() on all value listeners.
 * @return A list of instances of IllegalActionException, onefor each exception triggered by a failure to evaluate a value dependent, or null if there were no failures.
 */
protected List _propagateToValueListeners(){
  List result=null;
  if (_valueListeners != null) {
    Iterator listeners;
synchronized (this) {
      listeners=new LinkedList(_valueListeners).iterator();
    }
    while (listeners.hasNext()) {
      ValueListener listener=(ValueListener)listeners.next();
      if (listener instanceof Variable) {
        if (((Variable)listener)._needsEvaluation) {
          List additionalErrors=((Variable)listener)._propagate();
          if (additionalErrors != null) {
            if (result == null) {
              result=new LinkedList();
            }
            result.addAll(additionalErrors);
          }
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Call propagate() on all value listeners.
 * @return A list of instances of IllegalActionException, onefor each exception triggered by a failure to evaluate a value dependent, or null if there were no failures.
 */
protected List _propagateToValueListeners(){
  List result=null;
  if (_valueListeners != null) {
    Iterator listeners;
synchronized (this) {
      listeners=new LinkedList(_valueListeners).iterator();
    }
    while (listeners.hasNext()) {
      ValueListener listener=(ValueListener)listeners.next();
      if (listener instanceof Variable) {
        try {
          if (((Variable)listener).getVariable(getName()) != this) {
            listeners.remove();
            continue;
          }
        }
 catch (        IllegalActionException e) {
          listeners.remove();
          continue;
        }
        if (((Variable)listener)._needsEvaluation) {
          List additionalErrors=((Variable)listener)._propagate();
          if (additionalErrors != null) {
            if (result == null) {
              result=new LinkedList();
            }
            result.addAll(additionalErrors);
          }
        }
      }
    }
  }
  return result;
}
Program: 73032
Project: 73032
Buggy source:
/** 
 * Force evaluation of this variable, unless it is lazy, and call _propagate() on its value dependents.
 * @return A list of instances of IllegalActionException, onefor each exception triggered by a failure to evaluate a value dependent, or null if there were no failures.
 */
protected List _propagate(){
  if (_propagating) {
    return null;
  }
  _propagating=true;
  try {
    List result=null;
    if (_needsEvaluation && !_isLazy) {
      try {
        _evaluate();
      }
 catch (      IllegalActionException ex) {
        try {
          if (!handleModelError(this,ex)) {
            new IllegalActionException(this,ex,"String_Node_Str" + getName() + "String_Node_Str").printStackTrace();
          }
        }
 catch (        IllegalActionException ex2) {
          result=new LinkedList();
          result.add(ex2);
        }
      }
    }
    List additionalErrors=_propagateToValueListeners();
    if (result == null) {
      result=additionalErrors;
    }
 else {
      if (additionalErrors != null) {
        result.addAll(additionalErrors);
      }
    }
    return result;
  }
  finally {
    _propagating=false;
  }
}

Fixed version (ground truth):
/** 
 * Force evaluation of this variable, unless it is lazy, and call _propagate() on its value dependents.
 * @return A list of instances of IllegalActionException, onefor each exception triggered by a failure to evaluate a value dependent, or null if there were no failures.
 */
protected List _propagate(){
  if (_propagating) {
    return null;
  }
  _propagating=true;
  try {
    List result=null;
    if (_needsEvaluation && !_isLazy) {
      try {
        _evaluate();
      }
 catch (      IllegalActionException ex) {
        try {
          if (!handleModelError(this,ex)) {
            result=new LinkedList();
            result.add(ex);
          }
        }
 catch (        IllegalActionException ex2) {
          result=new LinkedList();
          result.add(ex2);
        }
      }
    }
    List additionalErrors=_propagateToValueListeners();
    if (result == null) {
      result=additionalErrors;
    }
 else {
      if (additionalErrors != null) {
        result.addAll(additionalErrors);
      }
    }
    return result;
  }
  finally {
    _propagating=false;
  }
}
Program: 73035
Project: 73035
Buggy source:
/** 
 * If there are still tokens in the queue and a token has been produced in the fire, schedule a refiring.
 */
public boolean postfire() throws IllegalActionException {
  Time currentTime=getDirector().getModelTime();
  if (_nextTimeFree != null && _tokens.size() > 0 && currentTime.compareTo(_nextTimeFree) == 0) {
    _tokens.take();
    _tokenCount--;
    sendQMTokenEvent(null,0,_tokenCount,EventType.RECEIVED);
  }
  if ((getDirector() instanceof FixedPointDirector) && _receiversAndTokensToSendTo != null) {
    while (_tempReceiverQueue.size() > 0) {
      Receiver receiver=(Receiver)_tempReceiverQueue.take();
      Token token=_receiversAndTokensToSendTo.get(receiver);
      if (token != null) {
        _tokens.put(new Object[]{receiver,token});
        _tokenCount++;
        sendQMTokenEvent((Actor)receiver.getContainer().getContainer(),0,_tokenCount,EventType.RECEIVED);
      }
    }
  }
  if (_tokens.size() > 0 && (_nextTimeFree == null || currentTime.compareTo(_nextTimeFree) >= 0)) {
    _scheduleRefire();
  }
  _receiversAndTokensToSendTo.clear();
  return super.postfire();
}

Fixed version (ground truth):
/** 
 * If there are still tokens in the queue and a token has been produced in the fire, schedule a refiring.
 */
public boolean postfire() throws IllegalActionException {
  Time currentTime=getDirector().getModelTime();
  if (_nextTimeFree != null && _tokens.size() > 0 && currentTime.compareTo(_nextTimeFree) == 0) {
    _tokens.take();
    _tokenCount--;
    sendQMTokenEvent(null,0,_tokenCount,EventType.SENT);
  }
  if ((getDirector() instanceof FixedPointDirector) && _receiversAndTokensToSendTo != null) {
    while (_tempReceiverQueue.size() > 0) {
      Receiver receiver=(Receiver)_tempReceiverQueue.take();
      Token token=_receiversAndTokensToSendTo.get(receiver);
      if (token != null) {
        _tokens.put(new Object[]{receiver,token});
        _tokenCount++;
        sendQMTokenEvent((Actor)receiver.getContainer().getContainer(),0,_tokenCount,EventType.RECEIVED);
      }
    }
  }
  if (_tokens.size() > 0 && (_nextTimeFree == null || currentTime.compareTo(_nextTimeFree) >= 0)) {
    _scheduleRefire();
  }
  _receiversAndTokensToSendTo.clear();
  return super.postfire();
}