Program: 74040
Project: 74040
Buggy source:
/** 
 * Initialize all interaction on the graph pane. This method is called by the setGraphPane() method of the superclass. This initialization cannot be done in the constructor because the controller does not yet have a reference to its pane at that time.  Regrettably, the canvas is not yet associated with the GraphPane, so you can't do any initialization that involves the canvas.
 */
protected void initializeInteraction(){
  GraphPane pane=getGraphPane();
  List configsList=Configuration.configurations();
  Configuration config=_configuration;
  if (config == null) {
    for (Iterator it=configsList.iterator(); it.hasNext(); ) {
      config=(Configuration)it.next();
      if (config != null) {
        break;
      }
    }
  }
  if (config != null && _contextMenuFactoryCreator == null) {
    _contextMenuFactoryCreator=(ContextMenuFactoryCreator)config.getAttribute("String_Node_Str");
  }
  if (_contextMenuFactoryCreator != null) {
    try {
      _menuFactory=(PtolemyMenuFactory)_contextMenuFactoryCreator.createContextMenuFactory(this);
      _configureMenuFactory=new MenuActionFactory(_configureAction);
      _menuFactory.addMenuItemFactory(_configureMenuFactory);
    }
 catch (    Exception ex) {
    }
  }
  if (_menuFactory == null) {
    _menuFactory=new SchematicContextMenuFactory(this);
  }
  _menuCreator=new MenuCreator(_menuFactory);
  _menuCreator.setMouseFilter(new PopupMouseFilter());
  pane.getBackgroundEventLayer().addInteractor(_menuCreator);
  pane.getBackgroundEventLayer().setConsuming(false);
  Action[] actions={_getDocumentationAction,new CustomizeDocumentationAction(),new RemoveCustomDocumentationAction()};
  _menuFactory.addMenuItemFactory(new MenuActionFactory(actions,"String_Node_Str"));
  if (_configuration != null) {
    _menuFactory.addMenuItemFactory(new MenuActionFactory(_openBaseClassAction));
    _menuFactory.addMenuItemFactory(new MenuActionFactory(_unitSolverDialogAction));
  }
}

Fixed version (ground truth):
/** 
 * Initialize all interaction on the graph pane. This method is called by the setGraphPane() method of the superclass. This initialization cannot be done in the constructor because the controller does not yet have a reference to its pane at that time.  Regrettably, the canvas is not yet associated with the GraphPane, so you can't do any initialization that involves the canvas.
 */
protected void initializeInteraction(){
  _menuFactory=null;
  GraphPane pane=getGraphPane();
  List configsList=Configuration.configurations();
  Configuration config=_configuration;
  if (config == null) {
    for (Iterator it=configsList.iterator(); it.hasNext(); ) {
      config=(Configuration)it.next();
      if (config != null) {
        break;
      }
    }
  }
  if (config != null && _contextMenuFactoryCreator == null) {
    _contextMenuFactoryCreator=(ContextMenuFactoryCreator)config.getAttribute("String_Node_Str");
  }
  if (_contextMenuFactoryCreator != null) {
    try {
      _menuFactory=(PtolemyMenuFactory)_contextMenuFactoryCreator.createContextMenuFactory(this);
      _configureMenuFactory=new MenuActionFactory(_configureAction);
      _menuFactory.addMenuItemFactory(_configureMenuFactory);
    }
 catch (    Exception ex) {
    }
  }
  if (_menuFactory == null) {
    _menuFactory=new SchematicContextMenuFactory(this);
  }
  _menuCreator=new MenuCreator(_menuFactory);
  _menuCreator.setMouseFilter(new PopupMouseFilter());
  pane.getBackgroundEventLayer().addInteractor(_menuCreator);
  pane.getBackgroundEventLayer().setConsuming(false);
  Action[] actions={_getDocumentationAction,new CustomizeDocumentationAction(),new RemoveCustomDocumentationAction()};
  _menuFactory.addMenuItemFactory(new MenuActionFactory(actions,"String_Node_Str"));
  if (_configuration != null) {
    _menuFactory.addMenuItemFactory(new MenuActionFactory(_openBaseClassAction));
    _menuFactory.addMenuItemFactory(new MenuActionFactory(_unitSolverDialogAction));
  }
}