Program: 74219
Project: 74219
Buggy source:
public RefiringData fire(ArrayToken arguments) throws IllegalActionException {
  RefiringData data=super.fire(arguments);
  Effigy effigy=Configuration.findEffigy(toplevel());
  if (effigy == null) {
    return data;
  }
  CompositeEntity entity=getModelParameter().getModel();
  entity=(CompositeEntity)GTTools.cleanupModel(entity);
  try {
    IntMatrixToken size=(IntMatrixToken)screenSize.getToken();
    int width=size.getElementAt(0,0);
    int height=size.getElementAt(0,1);
    Dimension newSize=null;
    if (width >= 0 && height >= 0) {
      newSize=new Dimension(width,height);
      SizeAttribute sizeAttribute=(SizeAttribute)entity.getAttribute("String_Node_Str",SizeAttribute.class);
      if (sizeAttribute == null) {
        sizeAttribute=new SizeAttribute(entity,"String_Node_Str");
      }
      sizeAttribute.setExpression("String_Node_Str" + newSize.width + "String_Node_Str"+ newSize.height+ "String_Node_Str");
    }
    boolean reopen=((BooleanToken)reopenWindow.getToken()).booleanValue();
    Tableau tableau=_getTableau();
    if (tableau != null && !(tableau.getFrame() instanceof ExtendedGraphFrame)) {
      _setTableau(null);
      _closeTableau(tableau);
      tableau=null;
    }
    boolean openNewWindow=true;
    if (!reopen && tableau != null) {
      JFrame frame=tableau.getFrame();
      if (frame instanceof BasicGraphFrame && ((BasicGraphFrame)frame).getEffigy() != null) {
        openNewWindow=false;
      }
    }
    if (openNewWindow) {
      if (tableau != null) {
        _closeTableau(tableau);
      }
      Configuration configuration=(Configuration)effigy.toplevel();
      tableau=configuration.openInstance(entity,effigy);
      _setTableau(tableau);
      ((Effigy)tableau.getContainer()).uri.setURI(null);
    }
 else {
      GTFrameTools.changeModel((BasicGraphFrame)tableau.getFrame(),entity,true,true);
    }
    if (openNewWindow) {
      JFrame frame=tableau.getFrame();
      IntMatrixToken location=(IntMatrixToken)screenLocation.getToken();
      int x=location.getElementAt(0,0);
      int y=location.getElementAt(0,1);
      Point newLocation;
      if (x >= 0 && y >= 0) {
        newLocation=new Point(x,y);
      }
 else {
        newLocation=frame.getLocation();
      }
      if (newSize == null) {
        newSize=frame.getSize();
      }
      Toolkit toolkit=Toolkit.getDefaultToolkit();
      Dimension screenSize=toolkit.getScreenSize();
      newLocation.x=Math.min(newLocation.x,screenSize.width - newSize.width);
      newLocation.y=Math.min(newLocation.y,screenSize.height - newSize.height);
      frame.setLocation(newLocation);
    }
    String titleValue=((StringToken)title.getToken()).stringValue();
    String titleString=null;
    String modelName=entity.getName();
    URI uri=URIAttribute.getModelURI(entity);
    if (titleValue.equals("String_Node_Str")) {
      if (uri == null || modelName.equals("String_Node_Str")) {
        titleString="String_Node_Str";
      }
 else {
        titleString=uri.toString();
      }
      titleString+="String_Node_Str" + getName() + "String_Node_Str";
    }
 else {
      titleString=titleValue;
    }
    tableau.setTitle(titleString);
    entity.setDeferringChangeRequests(false);
  }
 catch (  NameDuplicationException e) {
    throw new IllegalActionException(this,e,"String_Node_Str");
  }
catch (  Exception e) {
    throw new IllegalActionException(this,e,"String_Node_Str");
  }
  return data;
}

Fixed version (ground truth):
public RefiringData fire(ArrayToken arguments) throws IllegalActionException {
  RefiringData data=super.fire(arguments);
  Effigy effigy=GTEntityUtils.findToplevelEffigy(this);
  if (effigy == null) {
    return data;
  }
  CompositeEntity entity=getModelParameter().getModel();
  entity=(CompositeEntity)GTTools.cleanupModel(entity);
  try {
    IntMatrixToken size=(IntMatrixToken)screenSize.getToken();
    int width=size.getElementAt(0,0);
    int height=size.getElementAt(0,1);
    Dimension newSize=null;
    if (width >= 0 && height >= 0) {
      newSize=new Dimension(width,height);
      SizeAttribute sizeAttribute=(SizeAttribute)entity.getAttribute("String_Node_Str",SizeAttribute.class);
      if (sizeAttribute == null) {
        sizeAttribute=new SizeAttribute(entity,"String_Node_Str");
      }
      sizeAttribute.setExpression("String_Node_Str" + newSize.width + "String_Node_Str"+ newSize.height+ "String_Node_Str");
    }
    boolean reopen=((BooleanToken)reopenWindow.getToken()).booleanValue();
    Tableau tableau=_getTableau();
    if (tableau != null && !(tableau.getFrame() instanceof ExtendedGraphFrame)) {
      _setTableau(null);
      _closeTableau(tableau);
      tableau=null;
    }
    boolean openNewWindow=true;
    if (!reopen && tableau != null) {
      JFrame frame=tableau.getFrame();
      if (frame instanceof BasicGraphFrame && ((BasicGraphFrame)frame).getEffigy() != null) {
        openNewWindow=false;
      }
    }
    if (openNewWindow) {
      if (tableau != null) {
        _closeTableau(tableau);
      }
      Configuration configuration=(Configuration)effigy.toplevel();
      tableau=configuration.openInstance(entity,effigy);
      _setTableau(tableau);
      ((Effigy)tableau.getContainer()).uri.setURI(null);
    }
 else {
      GTFrameTools.changeModel((BasicGraphFrame)tableau.getFrame(),entity,true,true);
    }
    if (openNewWindow) {
      JFrame frame=tableau.getFrame();
      IntMatrixToken location=(IntMatrixToken)screenLocation.getToken();
      int x=location.getElementAt(0,0);
      int y=location.getElementAt(0,1);
      Point newLocation;
      if (x >= 0 && y >= 0) {
        newLocation=new Point(x,y);
      }
 else {
        newLocation=frame.getLocation();
      }
      if (newSize == null) {
        newSize=frame.getSize();
      }
      Toolkit toolkit=Toolkit.getDefaultToolkit();
      Dimension screenSize=toolkit.getScreenSize();
      newLocation.x=Math.min(newLocation.x,screenSize.width - newSize.width);
      newLocation.y=Math.min(newLocation.y,screenSize.height - newSize.height);
      frame.setLocation(newLocation);
    }
    String titleValue=((StringToken)title.getToken()).stringValue();
    String titleString=null;
    String modelName=entity.getName();
    URI uri=URIAttribute.getModelURI(entity);
    if (titleValue.equals("String_Node_Str")) {
      if (uri == null || modelName.equals("String_Node_Str")) {
        titleString="String_Node_Str";
      }
 else {
        titleString=uri.toString();
      }
      titleString+="String_Node_Str" + getName() + "String_Node_Str";
    }
 else {
      titleString=titleValue;
    }
    tableau.setTitle(titleString);
    entity.setDeferringChangeRequests(false);
  }
 catch (  NameDuplicationException e) {
    throw new IllegalActionException(this,e,"String_Node_Str");
  }
catch (  Exception e) {
    throw new IllegalActionException(this,e,"String_Node_Str");
  }
  return data;
}