nus-yam/ex-repair huggingface dataset:
Program: 76260
Project: 76260
Buggy source:
/** 
 * Return true if this step does not cross zero. The current trigger token will be compared to the history trigger token. If they cross the zero threshold, this step is not successful. A special case is taken care such that if the history trigger and the current trigger are both zero, then no new event is triggered. If this step crosses zero, then the refined integration step size is computed.
 */
public boolean isThisStepSuccessful(){
  if (_first) {
    _first=false;
    return true;
  }
  _debug(this.getFullName() + "String_Node_Str" + _thisTrg);
  _debug(this.getFullName() + "String_Node_Str" + _lastTrg);
  if (Math.abs(_thisTrg) < _errorTolerance) {
    if (_enabled) {
      _eventNow=true;
      _debug(getFullName() + "String_Node_Str" + getDirector().getCurrentTime());
      _enabled=false;
    }
    _eventMissed=false;
    return true;
  }
 else {
    if (!_enabled) {
      _enabled=true;
    }
 else {
      if ((_lastTrg * _thisTrg) < 0.0) {
        CTDirector dir=(CTDirector)getDirector();
        _eventMissed=true;
        _refineStep=(-_lastTrg * dir.getCurrentStepSize()) / (_thisTrg - _lastTrg);
        _debug(getFullName() + "String_Node_Str" + _refineStep);
        return false;
      }
    }
    _eventMissed=false;
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Return true if this step does not cross zero. The current trigger token will be compared to the history trigger token. If they cross the zero threshold, this step is not successful. A special case is taken care such that if the history trigger and the current trigger are both zero, then no new event is triggered. If this step crosses zero, then the refined integration step size is computed.
 */
public boolean isThisStepSuccessful(){
  if (_first) {
    _first=false;
    return true;
  }
  if (_debugging) {
    _debug(this.getFullName() + "String_Node_Str" + _thisTrg);
    _debug(this.getFullName() + "String_Node_Str" + _lastTrg);
  }
  if (Math.abs(_thisTrg) < _errorTolerance) {
    if (_enabled) {
      _eventNow=true;
      if (_debugging)       _debug(getFullName() + "String_Node_Str" + getDirector().getCurrentTime());
      _enabled=false;
    }
    _eventMissed=false;
    return true;
  }
 else {
    if (!_enabled) {
      _enabled=true;
    }
 else {
      if ((_lastTrg * _thisTrg) < 0.0) {
        CTDirector dir=(CTDirector)getDirector();
        _eventMissed=true;
        _refineStep=(-_lastTrg * dir.getCurrentStepSize()) / (_thisTrg - _lastTrg);
        if (_debugging)         _debug(getFullName() + "String_Node_Str" + _refineStep);
        return false;
      }
    }
    _eventMissed=false;
    return true;
  }
}
Program: 76261
Project: 76261
Buggy source:
/** 
 * Return a Fixvalue for the value and precision given. The value is rounded to the nearest value that can be presented with the given precision, possibly introducing quantization errors.  
 * @param value The value for which to create a Fixpoint
 * @param precision The precision of the Fixpoint
 * @return A Fixvalue for the value with a given precision
 */
public static FixPoint round(double value,Precision precision){
  BigInteger tmpValue;
  BigInteger fxvalue;
  boolean overflow=false;
  double x=value;
  double maxValue=precision.findMax();
  double minValue=precision.findMin();
  if (x > maxValue) {
    overflow=true;
    x=maxValue;
  }
  if (x < minValue) {
    overflow=true;
    x=minValue;
  }
  int number=precision.getFractionBitLength();
  double resolution=Math.pow(2,-(number + 2));
  BigDecimal multiplier;
  if (x >= 0) {
    multiplier=new BigDecimal(x + resolution);
  }
 else {
    multiplier=new BigDecimal(x - resolution);
  }
  BigDecimal kl=_twoRaisedTo[number].multiply(multiplier);
  fxvalue=kl.toBigInteger();
  FixPoint fxp=new FixPoint(precision,fxvalue);
  if (overflow) {
  }
  return fxp;
}

Fixed version (ground truth):
/** 
 * Return a Fixvalue for the value and precision given. The value is rounded to the nearest value that can be presented with the given precision, possibly introducing quantization errors.  
 * @param value The value for which to create a Fixpoint
 * @param precision The precision of the Fixpoint
 * @return A Fixvalue for the value with a given precision
 */
public static FixPoint round(double value,Precision precision){
  BigInteger tmpValue;
  BigInteger fxvalue;
  boolean overflow=false;
  double x=value;
  double maxValue=precision.findMax();
  double minValue=precision.findMin();
  if (x > maxValue) {
    overflow=true;
    x=maxValue;
  }
  if (x < minValue) {
    overflow=true;
    x=minValue;
  }
  int number=precision.getFractionBitLength();
  double resolution=Math.pow(2,-(number + 1));
  BigDecimal multiplier;
  if (x >= 0) {
    multiplier=new BigDecimal(x + resolution);
  }
 else {
    multiplier=new BigDecimal(x - resolution);
  }
  BigDecimal kl=_twoRaisedTo[number].multiply(multiplier);
  fxvalue=kl.toBigInteger();
  FixPoint fxp=new FixPoint(precision,fxvalue);
  if (overflow) {
    fxp.setError(FixPoint.OVERFLOW);
  }
  return fxp;
}
Program: 76262
Project: 76262
Buggy source:
/** 
 * Clear the plot of data points in the specified dataset. This calls repaint() to request an update of the display.
 * @param dataset The dataset to clear.
 */
public synchronized void clear(int dataset){
  _checkDatasetIndex(dataset);
  Vector points=(Vector)_points.elementAt(dataset);
  _points.setElementAt(new Vector(),dataset);
  repaint();
}

Fixed version (ground truth):
/** 
 * Clear the plot of data points in the specified dataset. This calls repaint() to request an update of the display.
 * @param dataset The dataset to clear.
 */
public synchronized void clear(int dataset){
  _checkDatasetIndex(dataset);
  _xyInvalid=true;
  Vector points=(Vector)_points.elementAt(dataset);
  _points.setElementAt(new Vector(),dataset);
  repaint();
}
Program: 76263
Project: 76263
Buggy source:
public void fire() throws IllegalActionException {
  System.out.println("String_Node_Str");
  currentIterFireCount++;
  _takenTransition=null;
  FSMTransition trans;
  if (currentRefinement() != null) {
    System.out.println("String_Node_Str");
    currentRefinement().fire();
  }
  Enumeration nonPreTrans=_currentState.getNonPreemptiveTrans();
  while (nonPreTrans.hasMoreElements()) {
    trans=(FSMTransition)nonPreTrans.nextElement();
    System.out.println("String_Node_Str" + trans.getFullName());
    if (trans.isEnabled()) {
      System.out.println("String_Node_Str");
      if (_takenTransition != null) {
      }
 else {
        _takenTransition=trans;
      }
    }
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void fire() throws IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  currentIterFireCount++;
  _takenTransition=null;
  FSMTransition trans;
  if (currentRefinement() != null) {
    if (_debugging)     _debug("String_Node_Str");
    currentRefinement().fire();
  }
  Enumeration nonPreTrans=_currentState.getNonPreemptiveTrans();
  while (nonPreTrans.hasMoreElements()) {
    trans=(FSMTransition)nonPreTrans.nextElement();
    if (_debugging)     _debug("String_Node_Str" + trans.getFullName());
    if (trans.isEnabled()) {
      if (_debugging)       _debug("String_Node_Str");
      if (_takenTransition != null) {
      }
 else {
        _takenTransition=trans;
      }
    }
  }
  if (_debugging)   _debug("String_Node_Str");
}
Program: 76264
Project: 76264
Buggy source:
/** 
 * What does this do?
 */
public void preinitialize() throws IllegalActionException {
  System.out.println("String_Node_Str");
  try {
    _createReceivers();
    setupScope();
  }
 catch (  NameDuplicationException ex) {
    throw new InvalidStateException(this,"String_Node_Str" + ex.getMessage());
  }
  if (_localVariables != null) {
    Enumeration localVars=_localVariables.getVariables();
    Variable var=null;
    while (localVars.hasMoreElements()) {
      var=(Variable)localVars.nextElement();
      var.reset();
    }
  }
  _setInputVars();
  _takenTransition=null;
  if (_initialTransitions != null) {
    Enumeration trs=_initialTransitions.elements();
    FSMTransition trans;
    while (trs.hasMoreElements()) {
      trans=(FSMTransition)trs.nextElement();
      if (trans.isEnabled()) {
        if (_takenTransition != null) {
        }
 else {
          _takenTransition=trans;
        }
      }
    }
  }
  if (_takenTransition != null) {
    _outputTriggerActions(_takenTransition.getTriggerActions());
    _updateLocalVariables(_takenTransition.getLocalVariableUpdates());
    _currentState=_takenTransition.destinationState();
  }
 else {
    _currentState=_initialState;
  }
  if (_currentState == null) {
  }
  TypedCompositeActor curRefinement=(TypedCompositeActor)currentRefinement();
  if (curRefinement != null) {
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * What does this do?
 */
public void preinitialize() throws IllegalActionException {
  try {
    _createReceivers();
    setupScope();
  }
 catch (  NameDuplicationException ex) {
    throw new InvalidStateException(this,"String_Node_Str" + ex.getMessage());
  }
  if (_localVariables != null) {
    Enumeration localVars=_localVariables.getVariables();
    Variable var=null;
    while (localVars.hasMoreElements()) {
      var=(Variable)localVars.nextElement();
      var.reset();
    }
  }
  _setInputVars();
  _takenTransition=null;
  if (_initialTransitions != null) {
    Enumeration trs=_initialTransitions.elements();
    FSMTransition trans;
    while (trs.hasMoreElements()) {
      trans=(FSMTransition)trs.nextElement();
      if (trans.isEnabled()) {
        if (_takenTransition != null) {
        }
 else {
          _takenTransition=trans;
        }
      }
    }
  }
  if (_takenTransition != null) {
    _outputTriggerActions(_takenTransition.getTriggerActions());
    _updateLocalVariables(_takenTransition.getLocalVariableUpdates());
    _currentState=_takenTransition.destinationState();
  }
 else {
    _currentState=_initialState;
  }
  if (_currentState == null) {
  }
  TypedCompositeActor curRefinement=(TypedCompositeActor)currentRefinement();
  if (curRefinement != null) {
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}
Program: 76265
Project: 76265
Buggy source:
protected void _setInputVars() throws IllegalArgumentException, IllegalActionException {
  Enumeration inports=inputPorts();
  IOPort port;
  System.out.println("String_Node_Str");
  while (inports.hasMoreElements()) {
    port=(IOPort)inports.nextElement();
    if (port.numLinks() > 0) {
      if (port.hasToken(0)) {
        System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str");
        _inputStatusVars.setVarValue(port.getName(),PRESENT);
        _inputValueVars.setVarValue(port.getName(),port.get(0));
      }
 else {
        System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str");
        _inputStatusVars.setVarValue(port.getName(),ABSENT);
      }
    }
 else {
      Receiver[][] recs=port.getReceivers();
      if (recs != null) {
        Receiver rec=recs[0][0];
        if (rec.hasToken()) {
          _inputStatusVars.setVarValue(port.getName(),PRESENT);
          _inputValueVars.setVarValue(port.getName(),rec.get());
        }
 else {
          _inputStatusVars.setVarValue(port.getName(),ABSENT);
        }
      }
 else {
        _inputStatusVars.setVarValue(port.getName(),ABSENT);
      }
    }
  }
}

Fixed version (ground truth):
protected void _setInputVars() throws IllegalArgumentException, IllegalActionException {
  Enumeration inports=inputPorts();
  IOPort port;
  while (inports.hasMoreElements()) {
    port=(IOPort)inports.nextElement();
    if (port.numLinks() > 0) {
      if (port.hasToken(0)) {
        if (_debugging)         _debug("String_Node_Str" + port.getFullName() + "String_Node_Str");
        _inputStatusVars.setVarValue(port.getName(),PRESENT);
        _inputValueVars.setVarValue(port.getName(),port.get(0));
      }
 else {
        if (_debugging)         _debug("String_Node_Str" + port.getFullName() + "String_Node_Str");
        _inputStatusVars.setVarValue(port.getName(),ABSENT);
      }
    }
 else {
      Receiver[][] recs=port.getReceivers();
      if (recs != null) {
        Receiver rec=recs[0][0];
        if (rec.hasToken()) {
          _inputStatusVars.setVarValue(port.getName(),PRESENT);
          _inputValueVars.setVarValue(port.getName(),rec.get());
        }
 else {
          _inputStatusVars.setVarValue(port.getName(),ABSENT);
        }
      }
 else {
        _inputStatusVars.setVarValue(port.getName(),ABSENT);
      }
    }
  }
}
Program: 76268
Project: 76268
Buggy source:
/** 
 * Invoke an iteration on all of the deeply contained actors of the container of this Director.  In general, this may be called more than once in the same iteration of the Directors container. An iteration is defined as multiple invocations of prefire(), until it returns true, any number of invocations of fire(), followed by one invocation of postfire(). Notice that we ignore the return value of postfire() in this base class.   In general, derived classes will want to do something intelligent with the returned value. This method is <i>not</i> synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If any called method of thecontainer or one of the deeply contained actors throws it.
 */
public void fire() throws IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  if (_controller != null) {
    _controller.fire();
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Invoke an iteration on all of the deeply contained actors of the container of this Director.  In general, this may be called more than once in the same iteration of the Directors container. An iteration is defined as multiple invocations of prefire(), until it returns true, any number of invocations of fire(), followed by one invocation of postfire(). Notice that we ignore the return value of postfire() in this base class.   In general, derived classes will want to do something intelligent with the returned value. This method is <i>not</i> synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If any called method of thecontainer or one of the deeply contained actors throws it.
 */
public void fire() throws IllegalActionException {
  if (_controller != null) {
    _controller.fire();
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
}
Program: 76269
Project: 76269
Buggy source:
/** 
 * Create receivers and then invoke the initialize() methods of all its deeply contained actors. <p> This method should be invoked once per execution, before any iteration. It may produce output data. This method is <i>not</i> synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If the initialize() method of thecontainer or one of the deeply contained actors throws it.
 */
public void initialize() throws IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  CompositeActor container=(CompositeActor)getContainer();
  if (container != null) {
    Enumeration allActors=container.deepGetEntities();
    while (allActors.hasMoreElements()) {
      Actor actor=(Actor)allActors.nextElement();
      if (actor == _controller) {
        continue;
      }
 else {
        if (_debugging)         _debug("String_Node_Str" + "String_Node_Str" + ((NamedObj)actor).getFullName());
        actor.initialize();
      }
    }
    if (_debugging)     _debug("String_Node_Str" + "String_Node_Str" + ((NamedObj)_controller).getFullName());
    _controller.initialize();
  }
}

Fixed version (ground truth):
/** 
 * Create receivers and then invoke the initialize() methods of all its deeply contained actors. <p> This method should be invoked once per execution, before any iteration. It may produce output data. This method is <i>not</i> synchronized on the workspace, so the caller should be.
 * @exception IllegalActionException If the initialize() method of thecontainer or one of the deeply contained actors throws it.
 */
public void initialize() throws IllegalActionException {
  CompositeActor container=(CompositeActor)getContainer();
  if (container != null) {
    Enumeration allActors=container.deepGetEntities();
    while (allActors.hasMoreElements()) {
      Actor actor=(Actor)allActors.nextElement();
      if (actor == _controller) {
        continue;
      }
 else {
        actor.initialize();
      }
    }
    _controller.initialize();
  }
}
Program: 76271
Project: 76271
Buggy source:
/** 
 * Set the controller associated with this director. This method must be called in the model code.
 */
public void setController(HDFFSMController ctrl) throws IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  if (_controller == null) {
    if (getContainer() == null) {
      throw new IllegalActionException(this,ctrl,"String_Node_Str" + "String_Node_Str");
    }
    if (getContainer() != ctrl.getContainer()) {
      throw new IllegalActionException(this,ctrl,"String_Node_Str" + "String_Node_Str");
    }
    _controller=ctrl;
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Set the controller associated with this director. This method must be called in the model code.
 */
public void setController(HDFFSMController ctrl) throws IllegalActionException {
  if (_controller == null) {
    if (getContainer() == null) {
      throw new IllegalActionException(this,ctrl,"String_Node_Str" + "String_Node_Str");
    }
    if (getContainer() != ctrl.getContainer()) {
      throw new IllegalActionException(this,ctrl,"String_Node_Str" + "String_Node_Str");
    }
    _controller=ctrl;
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
  }
}
Program: 76273
Project: 76273
Buggy source:
/** 
 * Return true if this transition is enabled.
 */
public boolean isEnabled() throws IllegalActionException {
  if (_teSet) {
    System.out.println("String_Node_Str" + this.getFullName());
    _te.getToken();
  }
  if (_tcSet) {
    System.out.println("String_Node_Str" + this.getFullName());
    _tc.getToken();
    if (((BooleanToken)_tc.getToken()).booleanValue() == false) {
      return false;
    }
  }
  System.out.println("String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * Return true if this transition is enabled.
 */
public boolean isEnabled() throws IllegalActionException {
  if (_teSet) {
    if (_debugging)     _debug("String_Node_Str" + this.getFullName());
    _te.getToken();
  }
  if (_tcSet) {
    if (_debugging)     _debug("String_Node_Str" + this.getFullName());
    _tc.getToken();
    if (((BooleanToken)_tc.getToken()).booleanValue() == false) {
      return false;
    }
  }
  if (_debugging)   _debug("String_Node_Str");
  return true;
}
Program: 76274
Project: 76274
Buggy source:
/** 
 * Setup the scope of the guard (trigger condition). The scope consists of the guard variables. There is a sequence of guard variables associated with each port contained by the the local director's container (an opaque composite actor). For example, if the director's container has an input port called "dataIn", then the associated sequence of guard variables is dataIn$0, dataIn$1, dataIn$2, .... Here,  dataIn$0 denotes the most recently read token, dataIn$1 denotes the next most recently read token, and so on. <p> The director method setGuardTokenHistory() sets the number of guard tokens (largest n in dataIn$n).
 */
public void setupScope() throws NameDuplicationException, IllegalActionException {
  System.out.println("String_Node_Str");
  HDFFSMController ctrl=(HDFFSMController)getContainer();
  HDFFSMDirector direct=((HDFFSMDirector)ctrl.getDirector());
  Enumeration dirScopeVars=direct._getTransitionGuardVars();
  if (dirScopeVars != null) {
    while (dirScopeVars.hasMoreElements()) {
      Variable var1=(Variable)dirScopeVars.nextElement();
      _te.addToScope(var1);
      _tc.addToScope(var1);
    }
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Setup the scope of the guard (trigger condition). The scope consists of the guard variables. There is a sequence of guard variables associated with each port contained by the the local director's container (an opaque composite actor). For example, if the director's container has an input port called "dataIn", then the associated sequence of guard variables is dataIn$0, dataIn$1, dataIn$2, .... Here,  dataIn$0 denotes the most recently read token, dataIn$1 denotes the next most recently read token, and so on. <p> The director method setGuardTokenHistory() sets the number of guard tokens (largest n in dataIn$n).
 */
public void setupScope() throws NameDuplicationException, IllegalActionException {
  if (_debugging)   _debug("String_Node_Str");
  HDFFSMController ctrl=(HDFFSMController)getContainer();
  HDFFSMDirector direct=((HDFFSMDirector)ctrl.getDirector());
  Enumeration dirScopeVars=direct._getTransitionGuardVars();
  if (dirScopeVars != null) {
    while (dirScopeVars.hasMoreElements()) {
      Variable var1=(Variable)dirScopeVars.nextElement();
      _te.addToScope(var1);
      _tc.addToScope(var1);
    }
  }
 else {
    if (_debugging)     _debug("String_Node_Str");
  }
}
Program: 76277
Project: 76277
Buggy source:
/** 
 * Override the baseclass start method so that the model does not immediately begin executing as soon as the the applet page is displayed. Execution begins once the "Go" button is depressed.
 */
public void start(){
}

Fixed version (ground truth):
/** 
 * Override the baseclass start method so that the model does not immediately begin executing as soon as the the applet page is displayed. Execution begins once the "Go" button is depressed.
 */
public void start(){
  _table.initialize(_philosophers);
}
Program: 76278
Project: 76278
Buggy source:
public void run(){
  while ((simulationThread != null) || simulationThread.isAlive()) {
    double currentTime=_localDirector.getCurrentTime();
    _currentTimeLabel.setText("String_Node_Str" + nf.format(currentTime));
    try {
      sleep(100);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    if (simulationThread == null) {
      return;
    }
 else     if (!simulationThread.isAlive()) {
      return;
    }
    double currentTime=_localDirector.getCurrentTime();
    _currentTimeLabel.setText("String_Node_Str" + nf.format(currentTime));
    try {
      sleep(100);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 76279
Project: 76279
Buggy source:
public boolean postfire(){
  return false;
}

Fixed version (ground truth):
/** 
 * Return true if this actor is enabled to proceed with additional iterations; return false otherwise.
 * @return True if continued execution is enabled; false otherwise.
 */
public boolean postfire(){
  return false;
}
Program: 76282
Project: 76282
Buggy source:
public void philosopherChanged();

Fixed version (ground truth):
/** 
 * Indicate to the object that implements this interface that the state of a philosopher has changed.
 * @see ptolemy.domains.csp.demo.Philosopher
 */
public void philosopherChanged();
Program: 76283
Project: 76283
Buggy source:
/** 
 * Constructs the new panel. Initializes the objects and the display.
 */
protected TablePanel(Philosopher[] philosophers){
  _philosophers=philosophers;
  for (int i=0; i < 5; i++) {
    philsLoc[i]=new PhilosopherCoords();
    chopsticksLoc[i]=new ChopstickCoords();
  }
  initPos();
}

Fixed version (ground truth):
/** 
 * Constructs the new panel. Initializes the objects and the display.
 */
protected TablePanel(Philosopher[] philosophers){
  initialize(philosophers);
}
Program: 76284
Project: 76284
Buggy source:
/** 
 * Return a string representing the (possibly unevaluated) value of this variable.  If the value has been set by an expression, then return that expression.  If the value has been set via a token, then return a string representation of the value of that token.  If neither, then return an empty string.
 * @return A string representation of this variable.
 */
public String stringRepresentation(){
  String value=getExpression();
  if (value == null) {
    ptolemy.data.Token token=null;
    try {
      token=getToken();
    }
 catch (    IllegalActionException ex) {
    }
    if (token != null) {
      value=token.toString();
    }
  }
  if (value != null) {
    value="String_Node_Str";
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Return a string representing the (possibly unevaluated) value of this variable.  If the value has been set by an expression, then return that expression.  If the value has been set via a token, then return a string representation of the value of that token.  If neither, then return an empty string.
 * @return A string representation of this variable.
 */
public String stringRepresentation(){
  String value=getExpression();
  if (value == null) {
    ptolemy.data.Token token=null;
    try {
      token=getToken();
    }
 catch (    IllegalActionException ex) {
    }
    if (token != null) {
      value=token.toString();
    }
  }
  if (value == null) {
    value="String_Node_Str";
  }
  return value;
}
Program: 76285
Project: 76285
Buggy source:
/** 
 * Return true if it  transfers data from an input port of the container to the ports it is connected to on the inside.  The port argument must be an opaque input port.  If any channel of the input port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueinput port.
 * @param port The port to transfer tokens from.
 * @return True if data are tranfered.
 */
public boolean transferInputs(IOPort port) throws IllegalActionException {
  if (!port.isInput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  boolean trans=false;
  Receiver[][] insiderecs=port.deepGetReceivers();
  for (int i=0; i < port.getWidth(); i++) {
    if (port.hasToken(i)) {
      try {
        Token t=port.get(i);
        if (insiderecs != null && insiderecs[i] != null) {
          if (_debugging)           _debug(getName(),"String_Node_Str" + port.getName());
          for (int j=0; j < insiderecs[i].length; j++) {
            insiderecs[i][j].put(t);
          }
          trans=true;
        }
      }
 catch (      NoTokenException ex) {
        throw new InternalErrorException("String_Node_Str" + ex.getMessage());
      }
    }
  }
  return trans;
}

Fixed version (ground truth):
/** 
 * Return true if it  transfers data from an input port of the container to the ports it is connected to on the inside.  The port argument must be an opaque input port.  If any channel of the input port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueinput port.
 * @param port The port to transfer tokens from.
 * @return True if data are tranfered.
 */
public boolean transferInputs(IOPort port) throws IllegalActionException {
  if (!port.isInput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  boolean trans=false;
  Receiver[][] insiderecs=port.deepGetReceivers();
  for (int i=0; i < port.getWidth(); i++) {
    while (port.hasToken(i)) {
      try {
        Token t=port.get(i);
        if (insiderecs != null && insiderecs[i] != null) {
          if (_debugging)           _debug(getName(),"String_Node_Str" + port.getName());
          for (int j=0; j < insiderecs[i].length; j++) {
            insiderecs[i][j].put(t);
          }
          trans=true;
        }
      }
 catch (      NoTokenException ex) {
        throw new InternalErrorException("String_Node_Str" + ex.getMessage());
      }
    }
  }
  return trans;
}
Program: 76286
Project: 76286
Buggy source:
/** 
 * Return true if it  transfers data from an output port of the container to the ports it is connected to on the outside.  The port argument must be an opaque output port.  If any channel of the output port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueoutput port.
 * @param port The port to transfer tokens from.
 * @return True if data are transfered.
 */
public boolean transferOutputs(IOPort port) throws IllegalActionException {
  if (!port.isOutput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  boolean trans=false;
  Receiver[][] insiderecs=port.getInsideReceivers();
  if (insiderecs != null) {
    for (int i=0; i < insiderecs.length; i++) {
      if (insiderecs[i] != null) {
        for (int j=0; j < insiderecs[i].length; j++) {
          if (insiderecs[i][j].hasToken()) {
            try {
              Token t=insiderecs[i][j].get();
              port.send(i,t);
              trans=true;
            }
 catch (            NoTokenException ex) {
              throw new InternalErrorException("String_Node_Str" + "String_Node_Str" + ex.getMessage());
            }
          }
        }
      }
    }
  }
  return trans;
}

Fixed version (ground truth):
/** 
 * Return true if it  transfers data from an output port of the container to the ports it is connected to on the outside.  The port argument must be an opaque output port.  If any channel of the output port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueoutput port.
 * @param port The port to transfer tokens from.
 * @return True if data are transfered.
 */
public boolean transferOutputs(IOPort port) throws IllegalActionException {
  if (!port.isOutput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  boolean trans=false;
  Receiver[][] insiderecs=port.getInsideReceivers();
  if (insiderecs != null) {
    for (int i=0; i < insiderecs.length; i++) {
      if (insiderecs[i] != null) {
        for (int j=0; j < insiderecs[i].length; j++) {
          while (insiderecs[i][j].hasToken()) {
            try {
              Token t=insiderecs[i][j].get();
              port.send(i,t);
              trans=true;
            }
 catch (            NoTokenException ex) {
              throw new InternalErrorException("String_Node_Str" + "String_Node_Str" + ex.getMessage());
            }
          }
        }
      }
    }
  }
  return trans;
}
Program: 76287
Project: 76287
Buggy source:
/** 
 * End an element. This method calls the appropriate Plot methods. &AElig;lfred will call this method at the end of each element (including EMPTY elements).
 * @param elementName The element type name.
 */
public void endElement(String elementName) throws Exception {
  super.endElement(elementName);
  if (elementName.equals("String_Node_Str")) {
    ((Plot)_plot).setBars(_bars);
    ((Plot)_plot).setConnected(_connected);
  }
}

Fixed version (ground truth):
/** 
 * End an element. This method calls the appropriate Plot methods. &AElig;lfred will call this method at the end of each element (including EMPTY elements).
 * @param elementName The element type name.
 */
public void endElement(String elementName) throws Exception {
  super.endElement(elementName);
  if (elementName.equals("String_Node_Str")) {
    ((Plot)_plot).setConnected(_connected);
  }
}
Program: 76290
Project: 76290
Buggy source:
/** 
 * Resolve an external entity.  This method returns null, which has the effect of defering to &AElig;lfred for resolution of the URI.  Derived classes may return a a modified URI (a string), an InputStream, or a Reader. In the latter two cases, the input character stream is provided.
 * @param publicId The public identifier, or null if none was supplied.
 * @param systemId The system identifier.
 * @return Null, indicating to use the default system identifier.
 */
public Object resolveEntity(String publicID,String systemID){
  if (publicID.equals("String_Node_Str")) {
    return new StringReader(MoML_DTD_1);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Resolve an external entity.  This method returns null, which has the effect of defering to &AElig;lfred for resolution of the URI.  Derived classes may return a a modified URI (a string), an InputStream, or a Reader. In the latter two cases, the input character stream is provided.
 * @param publicId The public identifier, or null if none was supplied.
 * @param systemId The system identifier.
 * @return Null, indicating to use the default system identifier.
 */
public Object resolveEntity(String publicID,String systemID){
  if (publicID != null && publicID.equals("String_Node_Str")) {
    return new StringReader(MoML_DTD_1);
  }
 else {
    return null;
  }
}
Program: 76291
Project: 76291
Buggy source:
public void traverseChildren(IVisitor v,LinkedList args){
  LinkedList retList=TNLManip.traverseList(v,this,args,_childList);
  setProperty("String_Node_Str",(Object)retList);
}

Fixed version (ground truth):
public void traverseChildren(IVisitor v,LinkedList args){
  LinkedList retList=TNLManip.traverseList(v,this,args,_childList);
  setProperty("String_Node_Str",retList);
}
Program: 76292
Project: 76292
Buggy source:
public Object visitParameterNode(ParameterNode node,LinkedList args){
  String retval=new String();
  retval+=(String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE);
  retval+="String_Node_Str" + node.getName().getIdent();
  return retval;
}

Fixed version (ground truth):
public Object visitParameterNode(ParameterNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE));
  sb.append("String_Node_Str" + node.getName().getIdent());
  return sb.toString();
}
Program: 76293
Project: 76293
Buggy source:
public Object visitVarDeclNode(VarDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE));
  sb.append(' ');
  sb.append(node.getName().getIdent());
  sb.append("String_Node_Str");
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_INITEXPR));
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public Object visitVarDeclNode(VarDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE));
  sb.append(' ');
  sb.append(node.getName().getIdent());
  sb.append("String_Node_Str");
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_INITEXPR));
  return sb.toString();
}
Program: 76294
Project: 76294
Buggy source:
public Object visitCompileUnitNode(CompileUnitNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  String pkgStr=(String)node.childReturnValueAt(node.CHILD_INDEX_PKG);
  sb.append(pkgStr);
  sb.append('\n');
  LinkedList impList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_IMPORTS);
  ListIterator impItr=impList.listIterator();
  while (impItr.hasNext()) {
    sb.append((String)impItr.next());
  }
  sb.append('\n');
  LinkedList typeList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_DEFTYPES);
  ListIterator typeItr=typeList.listIterator();
  while (typeItr.hasNext()) {
    sb.append((String)typeItr.next());
    sb.append('\n');
  }
  return sb.toString();
}

Fixed version (ground truth):
public Object visitCompileUnitNode(CompileUnitNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  String pkgStr=(String)node.childReturnValueAt(node.CHILD_INDEX_PKG);
  if (pkgStr.length() > 0) {
    sb.append("String_Node_Str");
    sb.append(pkgStr);
    sb.append("String_Node_Str");
  }
  LinkedList impList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_IMPORTS);
  ListIterator impItr=impList.listIterator();
  while (impItr.hasNext()) {
    sb.append((String)impItr.next());
  }
  sb.append('\n');
  LinkedList typeList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_DEFTYPES);
  ListIterator typeItr=typeList.listIterator();
  while (typeItr.hasNext()) {
    sb.append((String)typeItr.next());
    sb.append('\n');
  }
  return sb.toString();
}
Program: 76295
Project: 76295
Buggy source:
public Object visitFieldDeclNode(FieldDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE));
  sb.append(' ');
  sb.append(node.getName().getIdent());
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public Object visitFieldDeclNode(FieldDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_DTYPE));
  sb.append(' ');
  sb.append(node.getName().getIdent());
  String initStr=(String)node.childReturnValueAt(node.CHILD_INDEX_INITEXPR);
  if (initStr.length() > 0) {
    sb.append("String_Node_Str");
    sb.append(initStr);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 76296
Project: 76296
Buggy source:
public Object visitBlockNode(BlockNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  LinkedList stmtList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_STMTS);
  LinkedList stmtTreeList=(LinkedList)node.getStmts();
  ListIterator stmtItr=stmtList.listIterator();
  ListIterator stmtTreeItr=stmtTreeList.listIterator();
  while (stmtItr.hasNext()) {
    sb.append((String)stmtItr.next());
    TreeNode stmt=(TreeNode)stmtTreeItr.next();
    if (stmt instanceof ExprNode) {
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public Object visitBlockNode(BlockNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  LinkedList stmtList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_STMTS);
  LinkedList stmtTreeList=(LinkedList)node.getStmts();
  ListIterator stmtItr=stmtList.listIterator();
  ListIterator stmtTreeItr=stmtTreeList.listIterator();
  while (stmtItr.hasNext()) {
    sb.append((String)stmtItr.next());
    TreeNode stmt=(TreeNode)stmtTreeItr.next();
    if ((stmt instanceof ExprNode) || (stmt instanceof VarDeclNode)) {
      sb.append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 76297
Project: 76297
Buggy source:
public Object visitConstructorDeclNode(ConstructorDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append(node.getIdent());
  sb.append('(');
  LinkedList paramList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_PARAMS);
  sb.append(_commaList(paramList));
  sb.append("String_Node_Str");
  LinkedList throwsList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_THROWSLIST);
  if (!throwsList.isEmpty()) {
    sb.append("String_Node_Str");
    sb.append(_commaList(throwsList));
    sb.append(' ');
  }
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_BODY));
  sb.append('\n');
  return sb.toString();
}

Fixed version (ground truth):
public Object visitConstructorDeclNode(ConstructorDeclNode node,LinkedList args){
  StringBuffer sb=new StringBuffer();
  sb.append(Modifier.toString(node.getModifiers()));
  sb.append(node.getIdent());
  sb.append('(');
  LinkedList paramList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_PARAMS);
  sb.append(_commaList(paramList));
  sb.append("String_Node_Str");
  LinkedList throwsList=(LinkedList)node.childReturnValueAt(node.CHILD_INDEX_THROWSLIST);
  if (!throwsList.isEmpty()) {
    sb.append("String_Node_Str");
    sb.append(_commaList(throwsList));
    sb.append(' ');
  }
  sb.append("String_Node_Str");
  sb.append((String)node.childReturnValueAt(node.CHILD_INDEX_CONSTRUCTORCALL));
  String bodyStr=(String)node.childReturnValueAt(node.CHILD_INDEX_BODY);
  if (bodyStr.length() > 2) {
    bodyStr=bodyStr.substring(2);
    sb.append(bodyStr);
  }
  sb.append('\n');
  return sb.toString();
}
Program: 76298
Project: 76298
Buggy source:
/** 
 * Read at most one token from each input channel and display its string value on the screen.  Each value is terminated with a newline character.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  int width=input.getWidth();
  for (int i=0; i < width; i++) {
    if (input.hasToken(i)) {
      Token token=input.get(i);
      String value=token.stringValue();
      textArea.append(value + "String_Node_Str");
      JScrollBar bar=_scrollPane.getVerticalScrollBar();
      if (bar != null) {
        bar.setValue(bar.getMaximum() - bar.getVisibleAmount());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Read at most one token from each input channel and display its string value on the screen.  Each value is terminated with a newline character.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  int width=input.getWidth();
  for (int i=0; i < width; i++) {
    if (input.hasToken(i)) {
      Token token=input.get(i);
      String value=token.stringValue();
      textArea.append(value + "String_Node_Str");
      try {
        int lineOffset=textArea.getLineEndOffset(textArea.getLineCount() - 1);
        textArea.setCaretPosition(lineOffset);
      }
 catch (      BadLocationException ex) {
      }
    }
  }
}
Program: 76299
Project: 76299
Buggy source:
/** 
 * Create a text area on the screen, if necessary, or clear the previously existing text area. If a grapical container has not been specified, place the text area into its own frame.  Otherwise, place it in the specified container.
 * @exception IllegalActionException If the parent class throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  if (textArea == null) {
    place(_container);
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * Create a text area on the screen, if necessary, or clear the previously existing text area. If a grapical container has not been specified, place the text area into its own frame.  Otherwise, place it in the specified container.
 * @exception IllegalActionException If the parent class throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  if (textArea == null) {
    place(_container);
  }
 else {
    textArea.setText(null);
  }
  if (_frame != null) {
    _frame.setVisible(true);
  }
}
Program: 76300
Project: 76300
Buggy source:
/** 
 * Specify the container in which the data should be displayed. An instance of JTextArea will be added to that container. This method needs to be called before the first call to initialize(). Otherwise, an instance of TextArea will be placed in its own frame. The text area is also placed in its own frame if this method is called with a null argument.
 * @param container The container into which to place the text area.
 */
public void place(Container container){
  _container=container;
  if (_container == null) {
    JFrame frame=new JFrame(getFullName());
    textArea=new JTextArea();
    _scrollPane=new JScrollPane(textArea);
    frame.getContentPane().add(_scrollPane);
  }
 else {
    textArea=new JTextArea();
    _scrollPane=new JScrollPane(textArea);
    _container.add(_scrollPane);
  }
}

Fixed version (ground truth):
/** 
 * Specify the container in which the data should be displayed. An instance of JTextArea will be added to that container. This method needs to be called before the first call to initialize(). Otherwise, an instance of TextArea will be placed in its own frame. The text area is also placed in its own frame if this method is called with a null argument.
 * @param container The container into which to place the text area.
 */
public void place(Container container){
  _container=container;
  if (_container == null) {
    JFrame _frame=new JFrame(getFullName());
    textArea=new JTextArea();
    _scrollPane=new JScrollPane(textArea);
    _frame.getContentPane().add(_scrollPane);
  }
 else {
    textArea=new JTextArea();
    _scrollPane=new JScrollPane(textArea);
    _container.add(_scrollPane);
  }
  textArea.setEditable(false);
}
Program: 76301
Project: 76301
Buggy source:
public Object visitDeclaratorNode(DeclaratorNode node,LinkedList args){
  return _defaultVisit((TreeNode)node,args);
}

Fixed version (ground truth):
public Object visitDeclaratorNode(DeclaratorNode node,LinkedList args){
  throw new RuntimeException("String_Node_Str" + "String_Node_Str");
}
Program: 76302
Project: 76302
Buggy source:
public static final void checkClassModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | PROTECTED_MOD | PRIVATE_MOD| FINAL_MOD| ABSTRACT_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static final void checkClassModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | PROTECTED_MOD | PRIVATE_MOD| FINAL_MOD| ABSTRACT_MOD| STRICTFP_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str" + toString(modifiers));
  }
}
Program: 76303
Project: 76303
Buggy source:
public static final void checkMethodModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | PROTECTED_MOD | PRIVATE_MOD| STATIC_MOD| FINAL_MOD| ABSTRACT_MOD| NATIVE_MOD| SYNCHRONIZED_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static final void checkMethodModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | PROTECTED_MOD | PRIVATE_MOD| STATIC_MOD| FINAL_MOD| ABSTRACT_MOD| NATIVE_MOD| SYNCHRONIZED_MOD| STRICTFP_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str" + toString(modifiers));
  }
}
Program: 76304
Project: 76304
Buggy source:
public static final void checkMethodSignatureModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | ABSTRACT_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static final void checkMethodSignatureModifiers(final int modifiers){
  if ((modifiers & ~(PUBLIC_MOD | ABSTRACT_MOD)) != 0) {
    throw new RuntimeException("String_Node_Str" + toString(modifiers));
  }
}