Program: 74366
Project: 74366
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=_getRightComponent().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(_getRightComponent());
    JCanvas canvas=getJGraph().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 ExpertParameter(getModel(),"String_Node_Str");
    }
    zoom.setToken(new DoubleToken(scale));
    zoom.setVisibility(Settable.EXPERT);
    Point2D center=getCenter();
    Parameter pan=(Parameter)getModel().getAttribute("String_Node_Str",Parameter.class);
    if (pan == null) {
      pan=new ExpertParameter(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));
    pan.setVisibility(Settable.EXPERT);
  }
 catch (  Throwable throwable) {
  }
  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=_getRightComponent().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(_getSizeComponent());
    JCanvas canvas=getJGraph().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 ExpertParameter(getModel(),"String_Node_Str");
    }
    zoom.setToken(new DoubleToken(scale));
    zoom.setVisibility(Settable.EXPERT);
    Point2D center=getCenter();
    Parameter pan=(Parameter)getModel().getAttribute("String_Node_Str",Parameter.class);
    if (pan == null) {
      pan=new ExpertParameter(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));
    pan.setVisibility(Settable.EXPERT);
  }
 catch (  Throwable throwable) {
  }
  super._writeFile(file);
}