nus-yam/ex-repair huggingface dataset:
Program: 75371
Project: 75371
Buggy source:
/** 
 * Return a new array that is formed by converting the doubles in the argument array to complex numbers. Each complex number has real part equal to the value in the argument matrix and a zero imaginary part.
 * @param array An array of double.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final double[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex(array[i],0.0);
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by converting the doubles in the argument array to complex numbers. Each complex number has real part equal to the value in the argument array and a zero imaginary part.
 * @param array An array of double.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final double[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex(array[i],0.0);
  }
  return returnValue;
}
Program: 75372
Project: 75372
Buggy source:
/** 
 * Return a new array that is a copy of the array argument.
 * @param matrix An array of ints.
 * @return A new array of ints.
 */
public static final int[] allocCopy(final int[] array){
  int elements=array.length;
  int[] newArray=new int[elements];
  System.arraycopy(array,0,newArray,0,elements);
  return newArray;
}

Fixed version (ground truth):
/** 
 * Return a new array that is a copy of the array argument.
 * @param array An array of ints.
 * @return A new array of ints.
 */
public static final int[] allocCopy(final int[] array){
  int elements=array.length;
  int[] newArray=new int[elements];
  System.arraycopy(array,0,newArray,0,elements);
  return newArray;
}
Program: 75373
Project: 75373
Buggy source:
/** 
 * Return a new array that is formed by converting the integers in the argument array to complex numbers. Each complex number has real part equal to the value in the argument matrix and a zero imaginary part.
 * @param array An array of integers.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final int[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex((double)array[i],0.0);
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by converting the integers in the argument array to complex numbers. Each complex number has real part equal to the value in the argument array and a zero imaginary part.
 * @param array An array of integers.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final int[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex((double)array[i],0.0);
  }
  return returnValue;
}
Program: 75374
Project: 75374
Buggy source:
/** 
 * Return a new array that is a copy of the array argument.
 * @param matrix An array of ints.
 * @return A new array of ints.
 */
public static final long[] allocCopy(final long[] array){
  int elements=array.length;
  long[] newArray=new long[elements];
  System.arraycopy(array,0,newArray,0,elements);
  return newArray;
}

Fixed version (ground truth):
/** 
 * Return a new array that is a copy of the array argument.
 * @param array An array of ints.
 * @return A new array of ints.
 */
public static final long[] allocCopy(final long[] array){
  int elements=array.length;
  long[] newArray=new long[elements];
  System.arraycopy(array,0,newArray,0,elements);
  return newArray;
}
Program: 75375
Project: 75375
Buggy source:
/** 
 * Return a new array that is formed by converting the long numbers in the argument array to complex numbers. Each complex number has real part equal to the value in the argument matrix and a zero imaginary part.
 * @param array An array of long numbers.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final long[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex((double)array[i],0.0);
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array that is formed by converting the long numbers in the argument array to complex numbers. Each complex number has real part equal to the value in the argument array and a zero imaginary part.
 * @param array An array of long numbers.
 * @return A new array of complex numbers.
 */
public static final Complex[] toComplexArray(final long[] array){
  int length=array.length;
  Complex[] returnValue=new Complex[length];
  for (int i=0; i < length; i++) {
    returnValue[i]=new Complex((double)array[i],0.0);
  }
  return returnValue;
}
Program: 75378
Project: 75378
Buggy source:
/** 
 * Close the window.  Derived classes should override this to release any resources or remove any listeners.  In this class, if the data associated with this window has been modified, and there are no other tableaux in the parent effigy or any effigy that contains it, then ask the user whether to save the data before closing.
 * @return False if the user cancels on a save query.
 */
protected boolean _close(){
  if (getEffigy() == null) {
    return super._close();
  }
  Effigy topEffigy=getEffigy().topEffigy();
  List tableaux=topEffigy.entityList(Tableau.class);
  Iterator tableauxIterator=tableaux.iterator();
  while (tableauxIterator.hasNext()) {
    Tableau tableau=(Tableau)tableauxIterator.next();
    if (!(tableau instanceof DialogTableau) && (tableau != _tableau)) {
      dispose();
      return true;
    }
  }
  return super._close();
}

Fixed version (ground truth):
/** 
 * Close the window.  Derived classes should override this to release any resources or remove any listeners.  In this class, if the data associated with this window has been modified, and there are no other tableaux in the parent effigy or any effigy that contains it, then ask the user whether to save the data before closing.
 * @return False if the user cancels on a save query.
 */
protected boolean _close(){
  if (getEffigy() == null) {
    return super._close();
  }
  Effigy topEffigy=getEffigy().topEffigy();
  if (!_tableau.isMaster()) {
    List tableaux=topEffigy.entityList(Tableau.class);
    Iterator tableauxIterator=tableaux.iterator();
    while (tableauxIterator.hasNext()) {
      Tableau tableau=(Tableau)tableauxIterator.next();
      if (!(tableau instanceof DialogTableau) && (tableau != _tableau)) {
        dispose();
        return true;
      }
    }
  }
  return super._close();
}
Program: 75379
Project: 75379
Buggy source:
/** 
 * Set the size of the specified component to match the current value of the attribute.  If the value of the attribute has not been set, then do nothing.
 * @param component The component whose size is to be set.
 * @return True if successful.
 */
public boolean setSize(Component component){
  try {
    IntMatrixToken token=(IntMatrixToken)getToken();
    if (token != null) {
      int width=token.getElementAt(0,0);
      int height=token.getElementAt(0,1);
      Dimension dimension=new Dimension(width,height);
      component.setSize(dimension);
      if (component instanceof JComponent) {
        ((JComponent)component).setPreferredSize(dimension);
        ((JComponent)component).setMinimumSize(dimension);
      }
    }
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Set the size of the specified component to match the current value of the attribute.  If the value of the attribute has not been set, then do nothing.  If it has not already done so, this method also registers with the component as a listener for component events like resizing.
 * @param component The component whose size is to be set.
 * @return True if successful.
 */
public boolean setSize(Component component){
  if (_listeningTo != component) {
    if (_listeningTo != null) {
      _listeningTo.removeComponentListener(this);
    }
    component.addComponentListener(this);
    _listeningTo=component;
  }
  try {
    IntMatrixToken token=(IntMatrixToken)getToken();
    if (token != null) {
      int width=token.getElementAt(0,0);
      int height=token.getElementAt(0,1);
      Dimension dimension=new Dimension(width,height);
      component.setSize(dimension);
      if (component instanceof JComponent) {
        ((JComponent)component).setPreferredSize(dimension);
        ((JComponent)component).setMinimumSize(dimension);
      }
    }
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 75380
Project: 75380
Buggy source:
/** 
 * Set the value of the attribute to match those of the specified component.
 * @param component The component whose size is to be recorded.
 */
public void recordSize(Component component){
  try {
    Rectangle bounds=component.getBounds();
    int[][] boundsMatrix=new int[1][2];
    boundsMatrix[0][0]=bounds.width;
    boundsMatrix[0][1]=bounds.height;
    IntMatrixToken token=new IntMatrixToken(boundsMatrix);
    setToken(token);
  }
 catch (  IllegalActionException ex) {
    throw new InternalErrorException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Set the value of the attribute to match those of the specified component.
 * @param component The component whose size is to be recorded.
 */
public void recordSize(Component component){
  try {
    Rectangle bounds=component.getBounds();
    int[][] boundsMatrix=new int[1][2];
    boundsMatrix[0][0]=bounds.width;
    boundsMatrix[0][1]=bounds.height;
    IntMatrixToken token=new IntMatrixToken(boundsMatrix);
    setToken(token);
    setClassElement(false);
  }
 catch (  IllegalActionException ex) {
    throw new InternalErrorException("String_Node_Str");
  }
}
Program: 75381
Project: 75381
Buggy source:
/** 
 * Set the properties of the specified frame to match the current value of the attribute.  If the value of the attribute has not been set, then do nothing and return true. If the value of this attribute is malformed in any way, then just return false.
 * @param frame The frame whose properties are to be set.
 * @return True if successful.
 */
public boolean setProperties(Frame frame){
  try {
    RecordToken value=(RecordToken)getToken();
    if (value == null)     return true;
    ArrayToken boundsToken=(ArrayToken)value.get("String_Node_Str");
    int x=((IntToken)boundsToken.getElement(0)).intValue();
    int y=((IntToken)boundsToken.getElement(1)).intValue();
    int width=((IntToken)boundsToken.getElement(2)).intValue();
    int height=((IntToken)boundsToken.getElement(3)).intValue();
    frame.setBounds(x,y,width,height);
    if (frame instanceof Top) {
      ((Top)frame).setCentering(false);
    }
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Set the properties of the specified frame to match the current value of the attribute.  If the value of the attribute has not been set, then do nothing and return true. If the value of this attribute is malformed in any way, then just return false.
 * @param frame The frame whose properties are to be set.
 * @return True if successful.
 */
public boolean setProperties(Frame frame){
  if (_listeningTo != frame) {
    if (_listeningTo != null) {
      _listeningTo.removeComponentListener(this);
    }
    frame.addComponentListener(this);
    _listeningTo=frame;
  }
  try {
    RecordToken value=(RecordToken)getToken();
    if (value == null)     return true;
    ArrayToken boundsToken=(ArrayToken)value.get("String_Node_Str");
    BooleanToken maximizedToken=(BooleanToken)value.get("String_Node_Str");
    int x=((IntToken)boundsToken.getElement(0)).intValue();
    int y=((IntToken)boundsToken.getElement(1)).intValue();
    int width=((IntToken)boundsToken.getElement(2)).intValue();
    int height=((IntToken)boundsToken.getElement(3)).intValue();
    frame.setBounds(x,y,width,height);
    if (maximizedToken != null) {
      boolean maximized=maximizedToken.booleanValue();
      if (maximized) {
        frame.setExtendedState(frame.getExtendedState() | Frame.MAXIMIZED_BOTH);
      }
    }
    if (frame instanceof Top) {
      ((Top)frame).setCentering(false);
    }
    return true;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 75382
Project: 75382
Buggy source:
/** 
 * Set the value of the attribute to match those of the specified frame.
 * @param frame The frame whose properties are to be recorded.
 */
public void recordProperties(Frame frame){
  try {
    Rectangle bounds=frame.getBounds();
    Token[] boundsArray=new IntToken[4];
    boundsArray[0]=new IntToken(bounds.x);
    boundsArray[1]=new IntToken(bounds.y);
    boundsArray[2]=new IntToken(bounds.width);
    boundsArray[3]=new IntToken(bounds.height);
    Token[] values=new Token[1];
    values[0]=new ArrayToken(boundsArray);
    String[] names=new String[1];
    names[0]="String_Node_Str";
    setToken(new RecordToken(names,values));
  }
 catch (  IllegalActionException ex) {
    throw new InternalErrorException("String_Node_Str" + ex);
  }
}

Fixed version (ground truth):
/** 
 * Set the value of the attribute to match those of the specified frame.
 * @param frame The frame whose properties are to be recorded.
 */
public void recordProperties(Frame frame){
  try {
    Rectangle bounds=frame.getBounds();
    Token[] boundsArray=new IntToken[4];
    boundsArray[0]=new IntToken(bounds.x);
    boundsArray[1]=new IntToken(bounds.y);
    boundsArray[2]=new IntToken(bounds.width);
    boundsArray[3]=new IntToken(bounds.height);
    boolean maximized=(frame.getExtendedState() & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH;
    Token[] values=new Token[2];
    values[0]=new ArrayToken(boundsArray);
    values[1]=new BooleanToken(maximized);
    String[] names=new String[2];
    names[0]="String_Node_Str";
    names[1]="String_Node_Str";
    setToken(new RecordToken(names,values));
    setClassElement(false);
  }
 catch (  IllegalActionException ex) {
    throw new InternalErrorException("String_Node_Str" + ex);
  }
}
Program: 75383
Project: 75383
Buggy source:
/** 
 * Write the model to the specified file.  This overrides the base class to record the current size and position of the window in the model.
 * @param file The file to write to.
 * @exception IOException If the write fails.
 */
protected void _writeFile(File file) throws IOException {
  try {
    Component component=_jgraph.getParent();
    Component parent=component.getParent();
    while (parent != null && !(parent instanceof Frame)) {
      component=parent;
      parent=component.getParent();
    }
    if (parent instanceof Frame) {
      WindowPropertiesAttribute properties=(WindowPropertiesAttribute)getModel().getAttribute("String_Node_Str",WindowPropertiesAttribute.class);
      if (properties == null) {
        properties=new WindowPropertiesAttribute(getModel(),"String_Node_Str");
      }
      properties.recordProperties((Frame)parent);
    }
    SizeAttribute size=(SizeAttribute)getModel().getAttribute("String_Node_Str",SizeAttribute.class);
    if (size == null) {
      size=new SizeAttribute(getModel(),"String_Node_Str");
    }
    size.recordSize(_jgraph);
  }
 catch (  Exception ex) {
  }
  super._writeFile(file);
}

Fixed version (ground truth):
/** 
 * Write the model to the specified file.  This overrides the base class to record the current size and position of the window in the model.
 * @param file The file to write to.
 * @exception IOException If the write fails.
 */
protected void _writeFile(File file) throws IOException {
  try {
    Component component=_jgraph.getParent();
    Component parent=component.getParent();
    while (parent != null && !(parent instanceof Frame)) {
      component=parent;
      parent=component.getParent();
    }
    if (parent instanceof Frame) {
      WindowPropertiesAttribute properties=(WindowPropertiesAttribute)getModel().getAttribute("String_Node_Str",WindowPropertiesAttribute.class);
      if (properties == null) {
        properties=new WindowPropertiesAttribute(getModel(),"String_Node_Str");
      }
      properties.recordProperties((Frame)parent);
    }
    SizeAttribute size=(SizeAttribute)getModel().getAttribute("String_Node_Str",SizeAttribute.class);
    if (size == null) {
      size=new SizeAttribute(getModel(),"String_Node_Str");
    }
    size.recordSize(_jgraph);
    JCanvas canvas=_jgraph.getGraphPane().getCanvas();
    AffineTransform current=canvas.getCanvasPane().getTransformContext().getTransform();
    double scale=current.getScaleX();
    Parameter zoom=(Parameter)getModel().getAttribute("String_Node_Str",Parameter.class);
    if (zoom == null) {
      zoom=new Parameter(getModel(),"String_Node_Str");
    }
    zoom.setToken(new DoubleToken(scale));
    Point2D center=getCenter();
    Parameter pan=(Parameter)getModel().getAttribute("String_Node_Str",Parameter.class);
    if (pan == null) {
      pan=new Parameter(getModel(),"String_Node_Str");
    }
    Token[] centerArray=new Token[2];
    centerArray[0]=new DoubleToken(center.getX());
    centerArray[1]=new DoubleToken(center.getY());
    pan.setToken(new ArrayToken(centerArray));
  }
 catch (  Exception ex) {
  }
  super._writeFile(file);
}
Program: 75384
Project: 75384
Buggy source:
/** 
 * Zoom to fit the current figures.
 */
public void zoomFit(){
  GraphPane pane=_jgraph.getGraphPane();
  Rectangle2D bounds=pane.getForegroundLayer().getLayerBounds();
  if (bounds.isEmpty()) {
    return;
  }
  Rectangle2D viewSize=getVisibleRectangle();
  AffineTransform newTransform=CanvasUtilities.computeFitTransform(bounds,viewSize);
  JCanvas canvas=pane.getCanvas();
  canvas.getCanvasPane().setTransform(newTransform);
  _graphPanner.repaint();
}

Fixed version (ground truth):
/** 
 * Zoom to fit the current figures.
 */
public void zoomFit(){
  GraphPane pane=_jgraph.getGraphPane();
  Rectangle2D bounds=pane.getForegroundLayer().getLayerBounds();
  if (bounds.isEmpty()) {
    return;
  }
  Rectangle2D viewSize=getVisibleRectangle();
  AffineTransform newTransform=CanvasUtilities.computeFitTransform(bounds,viewSize);
  JCanvas canvas=pane.getCanvas();
  canvas.getCanvasPane().setTransform(newTransform);
  if (_graphPanner != null) {
    _graphPanner.repaint();
  }
}
Program: 75386
Project: 75386
Buggy source:
/** 
 * Zoom in or out to magnify by the specified factor, from the current magnification.
 * @param factor The magnification factor (relative to 1.0).
 */
public void zoom(double factor){
  JCanvas canvas=_jgraph.getGraphPane().getCanvas();
  AffineTransform current=canvas.getCanvasPane().getTransformContext().getTransform();
  Point2D center=getCenter();
  current.scale(factor,factor);
  canvas.getCanvasPane().setTransform(current);
  setCenter(center);
  _graphPanner.repaint();
}

Fixed version (ground truth):
/** 
 * Zoom in or out to magnify by the specified factor, from the current magnification.
 * @param factor The magnification factor (relative to 1.0).
 */
public void zoom(double factor){
  JCanvas canvas=_jgraph.getGraphPane().getCanvas();
  AffineTransform current=canvas.getCanvasPane().getTransformContext().getTransform();
  Point2D center=getCenter();
  current.scale(factor,factor);
  canvas.getCanvasPane().setTransform(current);
  setCenter(center);
  if (_graphPanner != null) {
    _graphPanner.repaint();
  }
}
Program: 75387
Project: 75387
Buggy source:
/** 
 * Set zoom to the nominal.
 */
public void zoomReset(){
  JCanvas canvas=_jgraph.getGraphPane().getCanvas();
  AffineTransform current=canvas.getCanvasPane().getTransformContext().getTransform();
  current.setToIdentity();
  canvas.getCanvasPane().setTransform(current);
  _graphPanner.repaint();
}

Fixed version (ground truth):
/** 
 * Set zoom to the nominal.
 */
public void zoomReset(){
  JCanvas canvas=_jgraph.getGraphPane().getCanvas();
  AffineTransform current=canvas.getCanvasPane().getTransformContext().getTransform();
  current.setToIdentity();
  canvas.getCanvasPane().setTransform(current);
  if (_graphPanner != null) {
    _graphPanner.repaint();
  }
}
Program: 75388
Project: 75388
Buggy source:
private void _checkBadTypes(NamedObj object) throws IllegalActionException {
  if (object instanceof Attribute && ModelTransformer._isIgnorableAttribute((Attribute)object)) {
    return;
  }
  if (object instanceof Typeable) {
    Typeable typeable=(Typeable)object;
    ptolemy.data.type.Type type=typeable.getType();
    boolean badType=false;
    if (type instanceof ptolemy.data.type.FunctionType) {
      badType=true;
    }
    if (type instanceof ptolemy.data.type.RecordType) {
      badType=true;
    }
    if (type instanceof ptolemy.data.type.ArrayType) {
      type=((ptolemy.data.type.ArrayType)type).getElementType();
      if (type instanceof ptolemy.data.type.ArrayType) {
        badType=true;
      }
    }
    if (badType) {
      throw new IllegalActionException(object.getFullName() + "String_Node_Str" + type+ "String_Node_Str");
    }
  }
  if (object instanceof CompositeEntity) {
    for (Iterator i=((CompositeEntity)object).entityList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
    for (Iterator i=((CompositeEntity)object).relationList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
  }
  if (object instanceof Entity) {
    for (Iterator i=((Entity)object).portList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
  }
  for (Iterator i=object.attributeList().iterator(); i.hasNext(); ) {
    _checkBadTypes((NamedObj)i.next());
  }
}

Fixed version (ground truth):
private void _checkBadTypes(NamedObj object) throws IllegalActionException {
  if (object instanceof Attribute && ModelTransformer._isIgnorableAttribute((Attribute)object)) {
    return;
  }
  if (object instanceof Typeable) {
    Typeable typeable=(Typeable)object;
    ptolemy.data.type.Type type=typeable.getType();
    boolean badType=false;
    if (type instanceof ptolemy.data.type.FunctionType) {
      badType=true;
    }
    if (type instanceof ptolemy.data.type.RecordType) {
      badType=true;
    }
    if (type instanceof ptolemy.data.type.ArrayType) {
      ptolemy.data.type.Type elementType=((ptolemy.data.type.ArrayType)type).getElementType();
      if (elementType instanceof ptolemy.data.type.ArrayType) {
        System.out.println("String_Node_Str" + elementType.getClass());
        badType=true;
      }
    }
    if (badType) {
      throw new IllegalActionException(object.getFullName() + "String_Node_Str" + type+ "String_Node_Str");
    }
  }
  if (object instanceof CompositeEntity) {
    for (Iterator i=((CompositeEntity)object).entityList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
    for (Iterator i=((CompositeEntity)object).relationList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
  }
  if (object instanceof Entity) {
    for (Iterator i=((Entity)object).portList().iterator(); i.hasNext(); ) {
      _checkBadTypes((NamedObj)i.next());
    }
  }
  for (Iterator i=object.attributeList().iterator(); i.hasNext(); ) {
    _checkBadTypes((NamedObj)i.next());
  }
}
Program: 75389
Project: 75389
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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ShapeIcon newObject=(ShapeIcon)super.clone(workspace);
  newObject._figures=new LinkedList();
  newObject._shape=_defaultShape;
  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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ShapeIcon newObject=(ShapeIcon)super.clone(workspace);
  newObject._figures=new LinkedList();
  return newObject;
}
Program: 75390
Project: 75390
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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  UpdatedValueIcon newObject=(UpdatedValueIcon)super.clone(workspace);
  newObject._associatedAttribute=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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  UpdatedValueIcon newObject=(UpdatedValueIcon)super.clone(workspace);
  newObject._associatedAttribute=null;
  try {
    newObject.attributeChanged(newObject.attributeName);
  }
 catch (  IllegalActionException e) {
    throw new InternalErrorException(e);
  }
  return newObject;
}
Program: 75391
Project: 75391
Buggy source:
/** 
 * Return a circle.
 * @return A Circle.
 */
public Shape _getDefaultShape(){
  return new Ellipse2D.Double(0.0,0.0,20.0,20.0);
}

Fixed version (ground truth):
/** 
 * Return a circle.
 * @return A Circle.
 */
protected Shape _getDefaultShape(){
  return new Ellipse2D.Double(0.0,0.0,20.0,20.0);
}
Program: 75392
Project: 75392
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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  FilledShapeAttribute newObject=(FilledShapeAttribute)super.clone(workspace);
  newObject._centeredValue=false;
  newObject._heightValue=0.0;
  newObject._inAttributeChanged=false;
  newObject._widthValue=0.0;
  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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  FilledShapeAttribute newObject=(FilledShapeAttribute)super.clone(workspace);
  newObject._inAttributeChanged=false;
  return newObject;
}
Program: 75393
Project: 75393
Buggy source:
/** 
 * Return the default shape to use for this icon. Note that this is called in the constructor, so if you override it in derived classed, you cannot access any methods or members of the derived class because they will not have been constructed.
 * @return The default shape for this attribute.
 */
public Shape _getDefaultShape(){
  return new Rectangle2D.Double(0.0,0.0,20.0,20.0);
}

Fixed version (ground truth):
/** 
 * Return the default shape to use for this icon. Note that this is called in the constructor, so if you override it in derived classed, you cannot access any methods or members of the derived class because they will not have been constructed.
 * @return The default shape for this attribute.
 */
protected Shape _getDefaultShape(){
  return new Rectangle2D.Double(0.0,0.0,20.0,20.0);
}
Program: 75394
Project: 75394
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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ShapeAttribute newObject=(ShapeAttribute)super.clone(workspace);
  newObject._icon=(ShapeIcon)newObject.getAttribute("String_Node_Str");
  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 Attribute.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  ShapeAttribute newObject=(ShapeAttribute)super.clone(workspace);
  newObject._icon=(ShapeIcon)newObject.getAttribute("String_Node_Str");
  newObject._none=(Variable)newObject.getAttribute("String_Node_Str");
  return newObject;
}
Program: 75395
Project: 75395
Buggy source:
/** 
 * Set the actor associated with this firing. This actor will then be returned when the getActor() method is invoked. If this firing already contains a reference to an actor, then the reference will overwritten.
 * @param actor The actor to associate with this firing.
 */
public void setActor(Actor actor){
  _incrementVersion();
  _actor=actor;
  if (_firing != null) {
    _firing.clear();
    _firing.add(this);
  }
}

Fixed version (ground truth):
/** 
 * Set the actor associated with this firing. This actor will then be returned when the getActor() method is invoked. If this firing already contains a reference to an actor, then the reference will overwritten.
 * @param actor The actor to associate with this firing.
 */
public void setActor(Actor actor){
  _incrementVersion();
  _actor=actor;
}
Program: 75396
Project: 75396
Buggy source:
/** 
 * Return the actor invocation sequence in the form of a sequence of firings. Since this ScheduleElement is a Firing, the iterator returned will contain exactly one Firing (this Firing). <p> A runtime exception is thrown if the underlying schedule structure is modified while the iterator is active.
 * @return An iterator over a sequence of firings.
 * @exception ConcurrentModificationException If theunderlying schedule structure is modified while the iterator is active.
 */
public Iterator firingIterator(){
  if (_firing == null) {
    _firing=new LinkedList();
    _firing.add(this);
  }
  return _firing.iterator();
}

Fixed version (ground truth):
/** 
 * Return the actor invocation sequence in the form of a sequence of firings. Since this ScheduleElement is a Firing, the iterator returned will contain exactly one Firing (this Firing). <p> A runtime exception is thrown if the underlying schedule structure is modified while the iterator is active.
 * @return An iterator over a sequence of firings.
 * @exception ConcurrentModificationException If theunderlying schedule structure is modified while the iterator is active.
 */
public Iterator firingIterator(){
  if (_firing == null) {
    _firing=Collections.singletonList(this);
  }
  return _firing.iterator();
}
Program: 75398
Project: 75398
Buggy source:
public String getFunctionName(){
  Node n=jjtGetChild(0);
  if (!(n instanceof ASTPtLeafNode))   return null;
 else   return ((ASTPtLeafNode)n).getName();
}

Fixed version (ground truth):
public String getFunctionName(){
  Node n=jjtGetChild(0);
  if (!(n instanceof ASTPtLeafNode))   return null;
 else {
    ASTPtLeafNode leaf=(ASTPtLeafNode)n;
    if (leaf.isIdentifier()) {
      return leaf.getName();
    }
 else {
      return null;
    }
  }
}
Program: 75400
Project: 75400
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(input,output);
}
Program: 75401
Project: 75401
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
  super.removeDependency(newServiceTime,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(input,output);
  removeDependency(newServiceTime,output);
}
Program: 75402
Project: 75402
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(input,output);
}
Program: 75403
Project: 75403
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(input,output);
}
Program: 75404
Project: 75404
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
  super.removeDependency(delay,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(input,output);
  removeDependency(delay,output);
}
Program: 75405
Project: 75405
Buggy source:
public void removeDependencies(){
  super.removeDependency(input,output);
}

Fixed version (ground truth):
public void removeDependencies(){
  removeDependency(input,output);
}
Program: 75406
Project: 75406
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(next,output);
  super.removeDependency(next,request);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(next,output);
  removeDependency(next,request);
}
Program: 75407
Project: 75407
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(set,expired);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  removeDependency(set,expired);
}
Program: 75408
Project: 75408
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies() throws IllegalActionException {
  IODependenceOfAtomicActor ioDependence=(IODependenceOfAtomicActor)this.getAttribute("String_Node_Str",IODependence.class);
  ioDependence.removeDependence(input,output);
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent.
 */
public void removeDependencies(){
  super.removeDependency(input,output);
}
Program: 75409
Project: 75409
Buggy source:
/** 
 * Transform the properties to take into account channel losses, noise, etc., for transmission between the specified sender and the specified receiver.  In this base class, the specified properties are merged with the defaultProperties so that the resulting properties contain at least all the fields of the defaultProperties.
 * @param properties The transmit properties.
 * @param sender The sending port.
 * @param receiver The receiving port.
 * @return The transformed properties.
 * @exception IllegalActionException If the properties cannotbe transformed. Not thrown in this base class.
 */
protected RecordToken _transformProperties(RecordToken properties,WirelessIOPort sender,WirelessReceiver receiver) throws IllegalActionException {
  RecordToken result=properties;
  Token defaultPropertiesValue=defaultProperties.getToken();
  if (properties != null && defaultPropertiesValue instanceof RecordToken) {
    result=RecordToken.merge(properties,(RecordToken)defaultPropertiesValue);
  }
  if (_debugging) {
    _debug("String_Node_Str" + result.toString() + "String_Node_Str");
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Transform the properties to take into account channel losses, noise, etc., for transmission between the specified sender and the specified receiver.  In this base class, the specified properties are merged with the defaultProperties so that the resulting properties contain at least all the fields of the defaultProperties.
 * @param properties The transmit properties.
 * @param sender The sending port.
 * @param receiver The receiving port.
 * @return The transformed properties.
 * @exception IllegalActionException If the properties cannotbe transformed. Not thrown in this base class.
 */
protected RecordToken _transformProperties(RecordToken properties,WirelessIOPort sender,WirelessReceiver receiver) throws IllegalActionException {
  RecordToken result=properties;
  Token defaultPropertiesValue=defaultProperties.getToken();
  if (properties != null && defaultPropertiesValue instanceof RecordToken) {
    result=RecordToken.merge(properties,(RecordToken)defaultPropertiesValue);
  }
  if (_debugging) {
    if (result != null) {
      _debug("String_Node_Str" + result.toString() + "String_Node_Str");
    }
 else {
      _debug("String_Node_Str");
    }
  }
  return result;
}
Program: 75410
Project: 75410
Buggy source:
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    return;
  }
  if (!_excludedNames.contains(node.getName())) {
    if (_scope != null) {
      ptolemy.data.Token token=_scope.get(node.getName());
      node.setToken(token);
      node.setConstant(true);
      node._name=null;
      return;
    }
    throw new IllegalActionException("String_Node_Str" + node.getName() + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    return;
  }
  if (!_excludedNames.contains(node.getName())) {
    if (_scope != null) {
      ptolemy.data.Token token=_scope.get(node.getName());
      if (token != null) {
        node.setToken(token);
        node.setConstant(true);
        node._name=null;
        return;
      }
    }
  }
}
Program: 75411
Project: 75411
Buggy source:
/** 
 * Explicitly declare which inputs and outputs are not dependent. In this base class, this method does nothing. Subclasses should implement the details.  <p> To declare a pair, input and output, independent, use the <i> removeDependency(IOPort IOPort)</i> method. 
 * @see ptolemy.domains.de.lib.TimedDelay
 * @see #removeDependency(IOPort IOPort)
 */
public void removeDependencies(){
}

Fixed version (ground truth):
/** 
 * Explicitly declare which inputs and outputs are not dependent. In this base class, this method does nothing. Subclasses should implement the details.  <p> To declare a pair, input and output, independent, use the <i> removeDependency(IOPort IOPort)</i> method. 
 * @see ptolemy.domains.de.lib.TimedDelay
 * @see #removeDependency(IOPort,IOPort)
 */
public void removeDependencies(){
}
Program: 75412
Project: 75412
Buggy source:
public Object selectField(Object o,String fieldName){
  Object composite=(o instanceof ObjectToken) ? ((ObjectToken)o).getValue() : o;
  Class c=composite.getClass();
  Field f;
  try {
    f=c.getField(fieldName);
    return this.fromJavaObject(f.get(composite));
  }
 catch (  NoSuchFieldException nsfe1) {
    if (this.isClass(composite)) {
      try {
        f=this.getJavaClass(composite).getField(fieldName);
        return this.fromJavaObject(f.get(composite));
      }
 catch (      NoSuchFieldException nsfe2) {
      }
catch (      IllegalAccessException iae) {
        throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite.toString(),iae);
      }
    }
    try {
      return new ObjectToken(new MethodObject(composite,fieldName,this));
    }
 catch (    Exception e) {
      throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite,e);
    }
  }
catch (  IllegalAccessException iae) {
    throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite,iae);
  }
}

Fixed version (ground truth):
public Object selectField(Object composite,String fieldName){
  Class c=this.getJavaClassOfObject(composite);
  Field f;
  try {
    f=c.getField(fieldName);
    return this.fromJavaObject(f.get(this.toJavaObject(composite)));
  }
 catch (  NoSuchFieldException nsfe1) {
    if (this.isClass(composite)) {
      try {
        f=this.getJavaClass(composite).getField(fieldName);
        return this.fromJavaObject(f.get(null));
      }
 catch (      NoSuchFieldException nsfe2) {
      }
catch (      IllegalAccessException iae) {
        throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite.toString(),iae);
      }
    }
    try {
      return new ObjectToken(new MethodObject(composite,fieldName,this));
    }
 catch (    Exception e) {
      throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite,e);
    }
  }
catch (  IllegalAccessException iae) {
    throw new InterpreterException("String_Node_Str" + fieldName + "String_Node_Str"+ composite,iae);
  }
}
Program: 75413
Project: 75413
Buggy source:
public Object toJavaObject(Object o){
  if (o instanceof BooleanToken) {
    return new Boolean(booleanValue(o));
  }
 else   if (o instanceof DoubleToken) {
    return new Double(realValue(o));
  }
 else   if (o instanceof IntToken) {
    return new Integer(intValue(o));
  }
 else   if (o instanceof StringToken) {
    return stringValue(o);
  }
 else   if (o instanceof ObjectToken) {
    return ((ObjectToken)o).getValue();
  }
 else   if (o instanceof Token) {
    return o;
  }
 else   throw new InterpreterException("String_Node_Str" + o.getClass().toString());
}

Fixed version (ground truth):
public Object toJavaObject(Object o){
  if (o instanceof BooleanToken) {
    return new Boolean(booleanValue(o));
  }
 else   if (o instanceof DoubleToken) {
    return new Double(realValue(o));
  }
 else   if (o instanceof IntToken) {
    return new Integer(intValue(o));
  }
 else   if (o instanceof StringToken) {
    return stringValue(o);
  }
 else   if (o instanceof ObjectToken) {
    Object v=((ObjectToken)o).getValue();
    if (v instanceof ClassObject)     return ((ClassObject)v).getClassObject();
 else     return ((ObjectToken)o).getValue();
  }
 else   if (o instanceof Token) {
    return o;
  }
 else   throw new InterpreterException("String_Node_Str" + o.getClass().toString());
}
Program: 75414
Project: 75414
Buggy source:
public Class getJavaClassOfObject(Object o){
  return (o instanceof ObjectToken) ? ObjectToken.class : o.getClass();
}

Fixed version (ground truth):
public Class getJavaClassOfObject(Object o){
  if (o == null) {
    return Object.class;
  }
 else   if (o instanceof BooleanToken) {
    return Boolean.class;
  }
 else   if (o instanceof DoubleToken) {
    return Double.class;
  }
 else   if (o instanceof IntToken) {
    return Integer.class;
  }
 else   if (o instanceof StringToken) {
    return String.class;
  }
 else   if (o instanceof ObjectToken) {
    Object v=((ObjectToken)o).getValue();
    if (v instanceof ClassObject)     return Class.class;
 else     return v.getClass();
  }
 else   if (o instanceof Token) {
    return o.getClass();
  }
 else   throw new InterpreterException("String_Node_Str" + o.getClass().toString());
}
Program: 75415
Project: 75415
Buggy source:
public Object fromJavaObject(Object o){
  try {
    if (o instanceof Token) {
      return o;
    }
 else     if (o instanceof Boolean) {
      return new BooleanToken(((Boolean)o).booleanValue());
    }
 else     if (o instanceof Double) {
      return new DoubleToken(((Double)o).doubleValue());
    }
 else     if (o instanceof Integer) {
      return new IntToken(((Integer)o).intValue());
    }
 else     if (o instanceof String) {
      return new StringToken((String)o);
    }
 else {
      return new ObjectToken(o);
    }
  }
 catch (  IllegalActionException ex) {
    throw new InterpreterException("String_Node_Str" + o.toString(),ex);
  }
}

Fixed version (ground truth):
public Object fromJavaObject(Object o){
  try {
    if (o instanceof Token) {
      return o;
    }
 else     if (o instanceof Boolean) {
      return new BooleanToken(((Boolean)o).booleanValue());
    }
 else     if (o instanceof Double) {
      return new DoubleToken(((Double)o).doubleValue());
    }
 else     if (o instanceof Integer) {
      return new IntToken(((Integer)o).intValue());
    }
 else     if (o instanceof String) {
      return new StringToken((String)o);
    }
 else     if (o instanceof Class) {
      return new ObjectToken(new ClassObject((Class)o,this));
    }
 else {
      return new ObjectToken(o);
    }
  }
 catch (  IllegalActionException ex) {
    throw new InterpreterException("String_Node_Str" + o.toString(),ex);
  }
}