Program: 74433
Project: 74433
Buggy source:
/** 
 * Read the input, if there is any, and issue a change request to apply the MoML in the input to the displayed model.
 * @exception IllegalActionException If there is an error readingthe input.
 */
public void fire() throws IllegalActionException {
  super.fire();
  title.update();
  String titleValue=((StringToken)title.getToken()).stringValue();
  for (int i=0; i < input.getWidth(); i++) {
    if (input.hasToken(i)) {
synchronized (this) {
        ActorToken token=(ActorToken)input.get(i);
        Entity model=token.getEntity();
        Effigy effigy=Configuration.findEffigy(toplevel());
        Configuration configuration=(Configuration)effigy.toplevel();
        try {
          _parser.reset();
          NamedObj newModel=_parser.parse(model.exportMoML());
          Tableau tableau=_tableaus[i];
          boolean reopen=((BooleanToken)reopenWindow.getToken()).booleanValue();
          if (tableau == null || reopen || !(tableau.getFrame() instanceof BasicGraphFrame)) {
            if (tableau != null) {
              tableau.close();
            }
            tableau=configuration.openModel(newModel,effigy);
            _tableaus[i]=tableau;
          }
 else {
            GTFrameTools.changeModel((BasicGraphFrame)tableau.getFrame(),(CompositeEntity)newModel,true);
          }
          JFrame frame=tableau.getFrame();
          RecordToken location=(RecordToken)screenLocation.getToken();
          int x=((IntToken)location.get("String_Node_Str")).intValue();
          int y=((IntToken)location.get("String_Node_Str")).intValue();
          Point newLocation=frame.getLocation();
          if (x >= 0) {
            newLocation.x=x;
          }
          if (y >= 0) {
            newLocation.y=y;
          }
          Dimension size=frame.getSize();
          Toolkit toolkit=Toolkit.getDefaultToolkit();
          Dimension screenSize=toolkit.getScreenSize();
          newLocation.x=Math.min(newLocation.x,screenSize.width - size.width);
          newLocation.y=Math.min(newLocation.y,screenSize.height - size.height);
          frame.setLocation(newLocation);
          frame.addWindowListener(this);
          String titleString=null;
          String modelName=newModel.getName();
          URI modelURI=null;
          URI uri=URIAttribute.getModelURI(newModel);
          if (uri != null) {
            String fileName;
            if (modelName.equals("String_Node_Str")) {
              fileName="String_Node_Str";
            }
 else {
              fileName=modelName + "String_Node_Str";
            }
            modelURI=new URI(uri.getScheme(),uri.getUserInfo(),uri.getHost(),uri.getPort(),uri.getPath() + fileName,null,null);
            Effigy newEffigy=(Effigy)tableau.getContainer();
            newEffigy.uri.setURI(modelURI);
          }
          if (titleValue.equals("String_Node_Str")) {
            if (uri != null) {
              if (modelName.equals("String_Node_Str")) {
                titleString="String_Node_Str";
              }
 else {
                titleString=modelURI.toString();
              }
            }
            titleString+="String_Node_Str" + getName() + "String_Node_Str";
          }
 else {
            titleString=titleValue;
          }
          tableau.setTitle(titleString);
          output.send(i,token);
        }
 catch (        NameDuplicationException e) {
          throw new IllegalActionException(this,e,"String_Node_Str");
        }
catch (        Exception e) {
          throw new IllegalActionException(this,e,"String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Read the input, if there is any, and issue a change request to apply the MoML in the input to the displayed model.
 * @exception IllegalActionException If there is an error readingthe input.
 */
public void fire() throws IllegalActionException {
  super.fire();
  title.update();
  String titleValue=((StringToken)title.getToken()).stringValue();
  for (int i=0; i < input.getWidth(); i++) {
    if (input.hasToken(i)) {
synchronized (this) {
        ActorToken token=(ActorToken)input.get(i);
        Entity model=token.getEntity();
        Effigy effigy=Configuration.findEffigy(toplevel());
        Configuration configuration=(Configuration)effigy.toplevel();
        try {
          Tableau tableau=_tableaus[i];
          boolean reopen=((BooleanToken)reopenWindow.getToken()).booleanValue();
          if (tableau == null || reopen || !(tableau.getFrame() instanceof BasicGraphFrame)) {
            if (tableau != null) {
              tableau.close();
            }
            tableau=configuration.openModel(model,effigy);
            _tableaus[i]=tableau;
          }
 else {
            GTFrameTools.changeModel((BasicGraphFrame)tableau.getFrame(),(CompositeEntity)model,true);
          }
          JFrame frame=tableau.getFrame();
          RecordToken location=(RecordToken)screenLocation.getToken();
          int x=((IntToken)location.get("String_Node_Str")).intValue();
          int y=((IntToken)location.get("String_Node_Str")).intValue();
          Point newLocation=frame.getLocation();
          if (x >= 0) {
            newLocation.x=x;
          }
          if (y >= 0) {
            newLocation.y=y;
          }
          Dimension size=frame.getSize();
          Toolkit toolkit=Toolkit.getDefaultToolkit();
          Dimension screenSize=toolkit.getScreenSize();
          newLocation.x=Math.min(newLocation.x,screenSize.width - size.width);
          newLocation.y=Math.min(newLocation.y,screenSize.height - size.height);
          frame.setLocation(newLocation);
          frame.addWindowListener(this);
          String titleString=null;
          String modelName=model.getName();
          URI uri=URIAttribute.getModelURI(model);
          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);
          output.send(i,token);
        }
 catch (        NameDuplicationException e) {
          throw new IllegalActionException(this,e,"String_Node_Str");
        }
catch (        Exception e) {
          throw new IllegalActionException(this,e,"String_Node_Str");
        }
      }
    }
  }
}