nus-yam/ex-repair huggingface dataset:
Program: 73169
Project: 73169
Buggy source:
/** 
 * Construct a configurer for the specified object.  This stores the current values of any Settable attributes of the given object, and then defers to any editor pane factories contained by the given object to populate this panel with widgets that edit the attributes of the given object.  If there are no editor pane factories, then a default editor pane is created.
 * @param object The object to configure.
 */
public Configurer(final NamedObj object){
  setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  _object=object;
  _originalValues=new HashMap<Settable,String>();
  Set<Settable> parameters=_getVisibleSettables(object,true);
  for (  Settable parameter : parameters) {
    _originalValues.put(parameter,parameter.getExpression());
  }
  boolean foundOne=false;
  Iterator<?> editors=object.attributeList(EditorPaneFactory.class).iterator();
  while (editors.hasNext()) {
    foundOne=true;
    EditorPaneFactory editor=(EditorPaneFactory)editors.next();
    Component pane=editor.createEditorPane();
    add(pane);
    pane.setBackground(null);
    if (pane instanceof CloseListener) {
      _closeListeners.add(pane);
    }
  }
  if (!foundOne) {
    Component pane=EditorPaneFactory.createEditorPane(object);
    add(pane);
    pane.setBackground(null);
    if (pane instanceof CloseListener) {
      _closeListeners.add(pane);
    }
  }
}

Fixed version (ground truth):
/** 
 * Construct a configurer for the specified object.  This stores the current values of any Settable attributes of the given object, and then defers to any editor pane factories contained by the given object to populate this panel with widgets that edit the attributes of the given object.  If there are no editor pane factories, then a default editor pane is created.
 * @param object The object to configure.
 */
public Configurer(final NamedObj object){
  setLayout(new BorderLayout());
  _object=object;
  _originalValues=new HashMap<Settable,String>();
  Set<Settable> parameters=_getVisibleSettables(object,true);
  for (  Settable parameter : parameters) {
    _originalValues.put(parameter,parameter.getExpression());
  }
  boolean foundOne=false;
  Iterator<?> editors=object.attributeList(EditorPaneFactory.class).iterator();
  while (editors.hasNext()) {
    foundOne=true;
    EditorPaneFactory editor=(EditorPaneFactory)editors.next();
    Component pane=editor.createEditorPane();
    add(pane);
    pane.setBackground(null);
    if (pane instanceof CloseListener) {
      _closeListeners.add(pane);
    }
  }
  if (!foundOne) {
    Component pane=EditorPaneFactory.createEditorPane(object);
    add(pane,BorderLayout.CENTER);
    pane.setBackground(null);
    if (pane instanceof CloseListener) {
      _closeListeners.add(pane);
    }
  }
}
Program: 73171
Project: 73171
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIAffineTransform(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  affineMatrix=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(_initialMatrix));
  interpolationType=new StringAttribute(this,"String_Node_Str");
  interpolationType.setExpression("String_Node_Str");
  _interpolationType=_BILINEAR;
  subSampleBits=new Parameter(this,"String_Node_Str",new IntToken(8));
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIAffineTransform(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  double[][] initialMatrix={{1.0F,0.0F,0.0F},{0.0F,1.0F,0.0F}};
  affineMatrix=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(initialMatrix));
  interpolationType=new StringAttribute(this,"String_Node_Str");
  interpolationType.setExpression("String_Node_Str");
  _interpolationType=_BILINEAR;
  subSampleBits=new Parameter(this,"String_Node_Str",new IntToken(8));
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
}
Program: 73172
Project: 73172
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBandCombine(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  matrix=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(_initialMatrix));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBandCombine(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  double[][] initialMatrix={{1.0D,0.0D,0.0D,0.0D},{0.0D,1.0D,0.0D,0.0D},{0.0D,0.0D,1.0D,0.0D}};
  matrix=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(initialMatrix));
}
Program: 73173
Project: 73173
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIEdgeDetection(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
  firstMask=new StringAttribute(this,"String_Node_Str");
  firstMask.setExpression("String_Node_Str");
  _firstMask=_SOBEL_HORIZONTAL;
  secondMask=new StringAttribute(this,"String_Node_Str");
  secondMask.setExpression("String_Node_Str");
  _secondMask=_SOBEL_VERTICAL;
  userSpecifiedFirstMask=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(_initialMatrix));
  userSpecifiedSecondMask=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(_initialMatrix));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIEdgeDetection(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
  firstMask=new StringAttribute(this,"String_Node_Str");
  firstMask.setExpression("String_Node_Str");
  _firstMask=_SOBEL_HORIZONTAL;
  secondMask=new StringAttribute(this,"String_Node_Str");
  secondMask.setExpression("String_Node_Str");
  _secondMask=_SOBEL_VERTICAL;
  double[][] initialMatrix={{0.0F,0.0F,0.0F},{0.0F,0.707F,0.0F},{0.0F,0.0F,0.0F}};
  userSpecifiedFirstMask=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(initialMatrix));
  userSpecifiedSecondMask=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(initialMatrix));
}
Program: 73174
Project: 73174
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIPNGWriter(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  adam7Interlacing=new Parameter(this,"String_Node_Str");
  adam7Interlacing.setTypeEquals(BaseType.BOOLEAN);
  adam7Interlacing.setToken(BooleanToken.TRUE);
  bitDepth=new Parameter(this,"String_Node_Str",new IntToken(8));
  fileName.setExpression("String_Node_Str");
  setGamma=new Parameter(this,"String_Node_Str");
  setGamma.setTypeEquals(BaseType.BOOLEAN);
  setGamma.setToken(BooleanToken.FALSE);
  gamma=new Parameter(this,"String_Node_Str",new DoubleToken(0.455F));
  setBackground=new Parameter(this,"String_Node_Str");
  setBackground.setTypeEquals(BaseType.BOOLEAN);
  setBackground.setToken(BooleanToken.FALSE);
  background=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,_initialArray));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIPNGWriter(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  adam7Interlacing=new Parameter(this,"String_Node_Str");
  adam7Interlacing.setTypeEquals(BaseType.BOOLEAN);
  adam7Interlacing.setToken(BooleanToken.TRUE);
  bitDepth=new Parameter(this,"String_Node_Str",new IntToken(8));
  fileName.setExpression("String_Node_Str");
  setGamma=new Parameter(this,"String_Node_Str");
  setGamma.setTypeEquals(BaseType.BOOLEAN);
  setGamma.setToken(BooleanToken.FALSE);
  gamma=new Parameter(this,"String_Node_Str",new DoubleToken(0.455F));
  setBackground=new Parameter(this,"String_Node_Str");
  setBackground.setTypeEquals(BaseType.BOOLEAN);
  setBackground.setToken(BooleanToken.FALSE);
  IntToken[] initialArray={new IntToken(0),new IntToken(0),new IntToken(0)};
  background=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,initialArray));
}
Program: 73175
Project: 73175
Buggy source:
/** 
 * Accept an ObjectToken containing a DataSource, and set it up for playing.
 * @exception IllegalActionException If there is no director,if the file cannot be opened, or if the Java Media Framework throws an exception.
 * @return super.postfire()
 */
public boolean postfire() throws IllegalActionException {
  ObjectToken objectToken=(ObjectToken)input.get(0);
  DataSource input=(DataSource)objectToken.getValue();
  if (_player != null) {
    _player.removeControllerListener(this);
  }
  try {
    _player=Manager.createRealizedPlayer(input);
    _player.addControllerListener(this);
    _player.prefetch();
  }
 catch (  IOException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex.toString());
  }
catch (  MediaException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex.toString());
  }
  _player.setMediaTime(_startTime);
  _frame=new JFrame();
  _container=_frame.getContentPane();
  Component controlPanel=_player.getControlPanelComponent();
  _container.add(controlPanel);
  _frame.pack();
  _frame.setVisible(true);
  return super.postfire();
}

Fixed version (ground truth):
/** 
 * Accept an ObjectToken containing a DataSource, and set it up for playing.
 * @exception IllegalActionException If there is no director,if the file cannot be opened, or if the Java Media Framework throws an exception.
 * @return super.postfire()
 */
public boolean postfire() throws IllegalActionException {
  ObjectToken objectToken=(ObjectToken)input.get(0);
  DataSource input=(DataSource)objectToken.getValue();
  if (_player != null) {
    _player.removeControllerListener(this);
  }
  try {
    _player=Manager.createRealizedPlayer(input);
    _player.addControllerListener(this);
    _player.prefetch();
  }
 catch (  IOException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex.toString());
  }
catch (  MediaException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex.toString());
  }
  Time _startTime=new Time(0.0);
  _player.setMediaTime(_startTime);
  _frame=new JFrame();
  _container=_frame.getContentPane();
  Component controlPanel=_player.getControlPanelComponent();
  _container.add(controlPanel);
  _frame.pack();
  _frame.setVisible(true);
  return super.postfire();
}
Program: 73179
Project: 73179
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBandSelect(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  bandIndices=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,_initialArray));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBandSelect(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  IntToken[] initialArray={new IntToken(0),new IntToken(1),new IntToken(2)};
  bandIndices=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,initialArray));
}
Program: 73180
Project: 73180
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBorder(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  leftPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  rightPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  topPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  bottomPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  borderType=new StringAttribute(this,"String_Node_Str");
  borderType.setExpression("String_Node_Str");
  _borderType=_BORDER_ZERO;
  constants=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.DOUBLE,_initialArray));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIBorder(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  leftPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  rightPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  topPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  bottomPadding=new Parameter(this,"String_Node_Str",new IntToken(0));
  borderType=new StringAttribute(this,"String_Node_Str");
  borderType.setExpression("String_Node_Str");
  _borderType=_BORDER_ZERO;
  DoubleToken[] initialArray={new DoubleToken(0)};
  constants=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.DOUBLE,initialArray));
}
Program: 73181
Project: 73181
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIConstant(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  output.setTypeEquals(BaseType.OBJECT);
  width=new Parameter(this,"String_Node_Str",new IntToken(0));
  height=new Parameter(this,"String_Node_Str",new IntToken(0));
  bandValues=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,_defaultValues));
  _values=((ArrayToken)bandValues.getToken()).arrayValue();
  dataFormat=new StringAttribute(this,"String_Node_Str");
  dataFormat.setExpression("String_Node_Str");
  _dataFormat=_BYTE;
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIConstant(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  output.setTypeEquals(BaseType.OBJECT);
  width=new Parameter(this,"String_Node_Str",new IntToken(0));
  height=new Parameter(this,"String_Node_Str",new IntToken(0));
  IntToken[] defaultValues={IntToken.ZERO};
  bandValues=new Parameter(this,"String_Node_Str",new ArrayToken(BaseType.INT,defaultValues));
  _values=((ArrayToken)bandValues.getToken()).arrayValue();
  dataFormat=new StringAttribute(this,"String_Node_Str");
  dataFormat.setExpression("String_Node_Str");
  _dataFormat=_BYTE;
}
Program: 73182
Project: 73182
Buggy source:
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIConvolve(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
  filter=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(_initialMatrix));
}

Fixed version (ground truth):
/** 
 * Construct an actor with the given container and name.
 * @param container The container.
 * @param name The name of this actor.
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 */
public JAIConvolve(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  input.setTypeEquals(BaseType.OBJECT);
  output.setTypeEquals(BaseType.OBJECT);
  double[][] initialMatrix={{0.0F,0.0F,0.0F},{0.0F,1.0F,0.0F},{0.0F,0.0F,0.0F}};
  filter=new Parameter(this,"String_Node_Str",new DoubleMatrixToken(initialMatrix));
}
Program: 73183
Project: 73183
Buggy source:
/** 
 * Report that a manager state has changed. This method is called by the specified manager.
 * @param manager The manager calling this method.
 */
public void managerStateChanged(Manager manager){
  Manager.State newState=manager.getState();
  if (newState != _previousState) {
    String statusMessage=manager.getStatusMessage();
    if (statusMessage == _previousStatusMessage) {
      _previousStatusMessage=statusMessage;
      statusMessage="String_Node_Str";
    }
 else {
      _previousStatusMessage=statusMessage;
    }
    if (!statusMessage.isEmpty()) {
      statusMessage="String_Node_Str" + statusMessage;
    }
 else {
      statusMessage="String_Node_Str";
    }
    report(manager.getState().getDescription() + statusMessage);
    _previousState=newState;
  }
}

Fixed version (ground truth):
/** 
 * Report that a manager state has changed. This method is called by the specified manager.
 * @param manager The manager calling this method.
 */
public void managerStateChanged(Manager manager){
  Manager.State newState=manager.getState();
  if (newState != _previousState) {
    String statusMessage=manager.getStatusMessage();
    if (statusMessage.equals(_previousStatusMessage)) {
      _previousStatusMessage=statusMessage;
      statusMessage="String_Node_Str";
    }
 else {
      _previousStatusMessage=statusMessage;
    }
    if (!statusMessage.isEmpty()) {
      statusMessage="String_Node_Str" + statusMessage;
    }
 else {
      statusMessage="String_Node_Str";
    }
    report(manager.getState().getDescription() + statusMessage);
    _previousState=newState;
  }
}
Program: 73186
Project: 73186
Buggy source:
/** 
 * If configurations have been deferred, implement them now. Also, configure the plot legends, if appropriate.
 */
protected void _implementDeferredConfigurations(){
  if (_configureSources != null) {
    Iterator<String> sources=_configureSources.iterator();
    Iterator<String> texts=_configureTexts.iterator();
    Iterator<URL> bases=_configureBases.iterator();
    while (sources.hasNext()) {
      URL base=bases.next();
      String source=sources.next();
      String text=texts.next();
      try {
        configure(base,source,text);
      }
 catch (      Exception ex) {
        getManager().notifyListenersOfException(ex);
      }
    }
    _configureSources=null;
    _configureTexts=null;
    _configureBases=null;
  }
  try {
    attributeChanged(legend);
  }
 catch (  IllegalActionException ex) {
  }
}

Fixed version (ground truth):
/** 
 * If configurations have been deferred, implement them now. Also, configure the plot legends, if appropriate.
 */
protected void _implementDeferredConfigurations(){
  if (_configureSources != null) {
    Iterator<String> sources=_configureSources.iterator();
    Iterator<String> texts=_configureTexts.iterator();
    Iterator<URL> bases=_configureBases.iterator();
    while (sources.hasNext()) {
      URL base=bases.next();
      String source=sources.next();
      String text=texts.next();
      try {
        configure(base,source,text);
      }
 catch (      Exception ex) {
        System.out.println("String_Node_Str" + base + "String_Node_Str"+ source+ "String_Node_Str"+ text+ "String_Node_Str");
        getManager().notifyListenersOfException(ex);
      }
    }
    _configureSources=null;
    _configureTexts=null;
    _configureBases=null;
  }
  try {
    attributeChanged(legend);
  }
 catch (  IllegalActionException ex) {
  }
}
Program: 73187
Project: 73187
Buggy source:
/** 
 * Clone the actor into the specified workspace. This calls the base class and then creates new ports and parameters.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class has anattribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  PlotterBase newObject=(PlotterBase)super.clone(workspace);
  newObject.plot=null;
  newObject._implementation=null;
  try {
    newObject._getImplementation().initWindowAndSizeProperties();
    newObject.configure(_base,_source,_text);
  }
 catch (  Exception e) {
    throw new CloneNotSupportedException("String_Node_Str" + e);
  }
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace. This calls the base class and then creates new ports and parameters.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class has anattribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  PlotterBase newObject=(PlotterBase)super.clone(workspace);
  newObject._configureBases=null;
  newObject._configureSources=null;
  newObject._configureTexts=null;
  newObject._implementation=null;
  newObject.plot=null;
  try {
    if (_base != null) {
      newObject._base=new URL(_base.toString());
    }
    newObject.configure(newObject._base,_source,_text);
    if (PtolemyInjector.getInjector() == null) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      ActorModuleInitializer.initializeInjector();
    }
    newObject._implementation=PtolemyInjector.getInjector().getInstance(PlotterBaseInterface.class);
    newObject._implementation.init(newObject);
    newObject._implementation.initWindowAndSizeProperties();
  }
 catch (  Exception e) {
    throw new CloneNotSupportedException("String_Node_Str" + e);
  }
  return newObject;
}
Program: 73188
Project: 73188
Buggy source:
/** 
 * Initialize the class. 
 */
private void _init() throws IllegalActionException, NameDuplicationException {
  setClassName("String_Node_Str");
  new IterateDirector(this,uniqueName("String_Node_Str"));
  _iterationCount=new Variable(this,"String_Node_Str",new IntToken(0));
  _iterationCount.setTypeEquals(BaseType.INT);
}

Fixed version (ground truth):
/** 
 * Initialize the class. 
 */
private void _init() throws IllegalActionException, NameDuplicationException {
  setClassName("String_Node_Str");
  IterateDirector iterateDirector=this.new IterateDirector(workspace());
  iterateDirector.setContainer(this);
  iterateDirector.setName(uniqueName("String_Node_Str"));
  _iterationCount=new Variable(this,"String_Node_Str",new IntToken(0));
  _iterationCount.setTypeEquals(BaseType.INT);
}
Program: 73189
Project: 73189
Buggy source:
/** 
 * Create a new instance of the director for IterateOverArray.
 * @param container The container for the director.
 * @param name The name of the director.
 * @exception IllegalActionException Not thrown in this base class.
 * @exception NameDuplicationException Not thrown in this base class.
 */
public IterateDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  setPersistent(false);
}

Fixed version (ground truth):
/** 
 * Construct an IterateDirector in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.  You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
 * @param workspace The workspace that will list the actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public IterateDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException {
  super(workspace);
  setPersistent(false);
}
Program: 73190
Project: 73190
Buggy source:
/** 
 * Clone the object into the specified workspace. This overrides the base class to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  try {
    result.new IterateDirector(result,uniqueName("String_Node_Str"));
  }
 catch (  Throwable throwable) {
    new CloneNotSupportedException("String_Node_Str" + throwable);
  }
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. This overrides the base class to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  try {
    List iterateDirectors=result.attributeList(IterateDirector.class);
    IterateDirector oldIterateDirector=(IterateDirector)iterateDirectors.get(0);
    String iterateDirectorName=oldIterateDirector.getName();
    oldIterateDirector.setContainer(null);
    IterateDirector iterateDirector=result.new IterateDirector(workspace);
    iterateDirector.setContainer(result);
    iterateDirector.setName(iterateDirectorName);
  }
 catch (  Throwable throwable) {
    new CloneNotSupportedException("String_Node_Str" + throwable);
  }
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}
Program: 73191
Project: 73191
Buggy source:
/** 
 * Create a new instance of the director for ThreadedComposite.
 * @param container The container for the director.
 * @param name The name of the director.
 * @exception IllegalActionException Not thrown in this base class.
 * @exception NameDuplicationException Not thrown in this base class.
 */
public ThreadedDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  setPersistent(false);
}

Fixed version (ground truth):
/** 
 * Construct a new instance of the director for ThreadedComposite. The director is created in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.  You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
 * @param workspace The workspace that will list the actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public ThreadedDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException {
  super(workspace);
  setPersistent(false);
}
Program: 73192
Project: 73192
Buggy source:
/** 
 * Create an actor 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 actor.
 * @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 ThreadedComposite(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name,false);
  setClassName("String_Node_Str");
  new ThreadedDirector(this,"String_Node_Str");
  Parameter UNDEFINED=new Parameter(this,"String_Node_Str");
  UNDEFINED.setVisibility(Settable.EXPERT);
  UNDEFINED.setPersistent(false);
  UNDEFINED.setExpression("String_Node_Str");
  delay=new Parameter(this,"String_Node_Str");
  delay.setTypeEquals(BaseType.DOUBLE);
  delay.setExpression("String_Node_Str");
  synchronizeToRealTime=new Parameter(this,"String_Node_Str");
  synchronizeToRealTime.setTypeEquals(BaseType.BOOLEAN);
  synchronizeToRealTime.setExpression("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create an actor 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 actor.
 * @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 ThreadedComposite(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name,false);
  setClassName("String_Node_Str");
  ThreadedDirector threadedDirector=this.new ThreadedDirector(workspace());
  threadedDirector.setContainer(this);
  threadedDirector.setName(uniqueName("String_Node_Str"));
  Parameter UNDEFINED=new Parameter(this,"String_Node_Str");
  UNDEFINED.setVisibility(Settable.EXPERT);
  UNDEFINED.setPersistent(false);
  UNDEFINED.setExpression("String_Node_Str");
  delay=new Parameter(this,"String_Node_Str");
  delay.setTypeEquals(BaseType.DOUBLE);
  delay.setExpression("String_Node_Str");
  synchronizeToRealTime=new Parameter(this,"String_Node_Str");
  synchronizeToRealTime.setTypeEquals(BaseType.BOOLEAN);
  synchronizeToRealTime.setExpression("String_Node_Str");
}
Program: 73194
Project: 73194
Buggy source:
/** 
 * Clone this actor into the specified workspace. The new actor is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). The result is a new actor with the same ports as the original, but no connections and no container.  A container must be set before much can be done with this actor.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException If cloned ports cannot haveas their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.
 * @return A new ComponentEntity.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicActor newObject=(AtomicActor)super.clone(workspace);
  newObject._inputPortsVersion=-1;
  newObject._outputPortsVersion=-1;
  newObject._causalityInterface=null;
  newObject._causalityInterfaceDirector=null;
  newObject._receiversVersion=-1L;
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone this actor into the specified workspace. The new actor is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). The result is a new actor with the same ports as the original, but no connections and no container.  A container must be set before much can be done with this actor.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException If cloned ports cannot haveas their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.
 * @return A new ComponentEntity.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  AtomicActor newObject=(AtomicActor)super.clone(workspace);
  newObject._initializables=null;
  newObject._inputPortsVersion=-1;
  newObject._outputPortsVersion=-1;
  newObject._cachedInputPorts=null;
  newObject._cachedOutputPorts=null;
  newObject._causalityInterface=null;
  newObject._causalityInterfaceDirector=null;
  newObject._receiversVersion=-1L;
  return newObject;
}
Program: 73195
Project: 73195
Buggy source:
/** 
 * Clone the object into the specified workspace. This overrides the base class to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  try {
    List iterateDirectors=result.attributeList(IterateDirector.class);
    IterateDirector oldIterateDirector=(IterateDirector)iterateDirectors.get(0);
    String iterateDirectorName=oldIterateDirector.getName();
    oldIterateDirector.setContainer(null);
    IterateDirector iterateDirector=result.new IterateDirector(workspace);
    iterateDirector.setContainer(result);
    iterateDirector.setName(iterateDirectorName);
  }
 catch (  Throwable throwable) {
    new CloneNotSupportedException("String_Node_Str" + throwable);
  }
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. This overrides the base class to instantiate a new IterateDirector and to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  try {
    String iterateDirectorName=null;
    Iterator iterateDirectors=result.attributeList(IterateDirector.class).iterator();
    while (iterateDirectors.hasNext()) {
      IterateDirector oldIterateDirector=(IterateDirector)iterateDirectors.next();
      if (iterateDirectorName == null) {
        iterateDirectorName=oldIterateDirector.getName();
      }
      oldIterateDirector.setContainer(null);
    }
    IterateDirector iterateDirector=result.new IterateDirector(workspace);
    iterateDirector.setContainer(result);
    iterateDirector.setName(iterateDirectorName);
  }
 catch (  Throwable throwable) {
    new CloneNotSupportedException("String_Node_Str" + throwable);
  }
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}
Program: 73196
Project: 73196
Buggy source:
/** 
 * Create a new instance of the director for RealTimeComposite.
 * @param container The container for the director.
 * @param name The name of the director.
 * @exception IllegalActionException Not thrown in this base class.
 * @exception NameDuplicationException Not thrown in this base class.
 */
public RealTimeDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
  setPersistent(false);
}

Fixed version (ground truth):
/** 
 * Construct a RealTimeDirector in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.  You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
 * @param workspace The workspace that will list the actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public RealTimeDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException {
  super(workspace);
  setPersistent(false);
}
Program: 73197
Project: 73197
Buggy source:
public MergeDirector(CompositeEntity container,String name) throws IllegalActionException, NameDuplicationException {
  super(container,name);
}

Fixed version (ground truth):
/** 
 * Construct an MergeDirector in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.  You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
 * @param workspace The workspace that will list the actor.
 * @exception IllegalActionException If the container is incompatiblewith this actor.
 * @exception NameDuplicationException If the name coincides withan actor already in the container.
 */
public MergeDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException {
  super(workspace);
  setPersistent(false);
}
Program: 73198
Project: 73198
Buggy source:
/** 
 * Construct a NondeterministicMerge. 
 */
private void _constructor() throws NameDuplicationException, IllegalActionException {
  input=new TypedIOPort(this,"String_Node_Str",true,false);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  input.setMultiport(true);
  output.setTypeAtLeast(input);
  channel=new TypedIOPort(this,"String_Node_Str");
  channel.setOutput(true);
  channel.setTypeEquals(BaseType.INT);
  StringAttribute channelCardinal=new StringAttribute(channel,"String_Node_Str");
  channelCardinal.setExpression("String_Node_Str");
  _attachText("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  new MergeDirector(this,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Construct a NondeterministicMerge. 
 */
private void _constructor() throws NameDuplicationException, IllegalActionException {
  input=new TypedIOPort(this,"String_Node_Str",true,false);
  output=new TypedIOPort(this,"String_Node_Str",false,true);
  input.setMultiport(true);
  output.setTypeAtLeast(input);
  channel=new TypedIOPort(this,"String_Node_Str");
  channel.setOutput(true);
  channel.setTypeEquals(BaseType.INT);
  StringAttribute channelCardinal=new StringAttribute(channel,"String_Node_Str");
  channelCardinal.setExpression("String_Node_Str");
  _attachText("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  PNDirector director=new MergeDirector(workspace());
  director.setContainer(this);
  director.setName("String_Node_Str");
}
Program: 73199
Project: 73199
Buggy source:
/** 
 * Return the least Upper bound of this type with the specified type. The specified type must be a UnionType, otherwise an exception will be thrown.
 * @param type a UnionType.
 * @return a UnionType.
 * @exception IllegalArgumentException If the specified type isnot a UnionType.
 */
protected StructuredType _leastUpperBound(StructuredType type){
  if (!(type instanceof UnionType)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  UnionType unionType=(UnionType)type;
  Set unionSet=new HashSet();
  Set myLabelSet=_fields.keySet();
  Set argLabelSet=unionType._fields.keySet();
  unionSet.addAll(myLabelSet);
  unionSet.addAll(argLabelSet);
  Object[] labelArray=unionSet.toArray();
  int size=labelArray.length;
  String[] labels=new String[size];
  Type[] types=new Type[size];
  for (int i=0; i < size; i++) {
    labels[i]=(String)labelArray[i];
    Type type1=this.get(labels[i]);
    Type type2=unionType.get(labels[i]);
    if (type1 == null) {
      types[i]=type2;
    }
 else     if (type2 == null) {
      types[i]=type1;
    }
 else {
      types[i]=(Type)TypeLattice.lattice().greatestLowerBound(type1,type2);
    }
  }
  return new UnionType(labels,types);
}

Fixed version (ground truth):
/** 
 * Return the least Upper bound of this type with the specified type. The specified type must be a UnionType, otherwise an exception will be thrown.
 * @param type a UnionType.
 * @return a UnionType.
 * @exception IllegalArgumentException If the specified type isnot a UnionType.
 */
protected StructuredType _leastUpperBound(StructuredType type){
  if (!(type instanceof UnionType)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  UnionType unionType=(UnionType)type;
  Set unionSet=new HashSet();
  Set myLabelSet=_fields.keySet();
  Set argLabelSet=unionType._fields.keySet();
  unionSet.addAll(myLabelSet);
  unionSet.addAll(argLabelSet);
  Object[] labelArray=unionSet.toArray();
  int size=labelArray.length;
  String[] labels=new String[size];
  Type[] types=new Type[size];
  for (int i=0; i < size; i++) {
    labels[i]=(String)labelArray[i];
    Type type1=this.get(labels[i]);
    Type type2=unionType.get(labels[i]);
    if (type1 == null) {
      types[i]=type2;
    }
 else     if (type2 == null) {
      types[i]=type1;
    }
 else {
      types[i]=(Type)TypeLattice.lattice().leastUpperBound(type1,type2);
    }
  }
  return new UnionType(labels,types);
}
Program: 73200
Project: 73200
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). The result is an object with no container.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new object.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  GTIngredientsAttribute newObject=(GTIngredientsAttribute)super.clone(workspace);
  newObject._ingredientList=null;
  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). The result is an object with no container.
 * @param workspace The workspace for the cloned object.
 * @exception CloneNotSupportedException Not thrown in this base class
 * @return The new object.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  GTIngredientsAttribute newObject=(GTIngredientsAttribute)super.clone(workspace);
  try {
    newObject._parse();
  }
 catch (  MalformedStringException ex) {
    throw new CloneNotSupportedException("String_Node_Str" + ex);
  }
  return newObject;
}
Program: 73201
Project: 73201
Buggy source:
/** 
 * Clone the object into the specified workspace. This overrides the base class to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. This overrides the base class to set the association with iterationCount.
 * @param workspace The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  IterateOverArray result=(IterateOverArray)super.clone(workspace);
  try {
    new IterateDirector(result,uniqueName("String_Node_Str"));
  }
 catch (  Throwable throwable) {
    new CloneNotSupportedException("String_Node_Str" + throwable);
  }
  result._iterationCount=(Variable)result.getAttribute("String_Node_Str");
  return result;
}