Program: 142670
Project: 142670
Buggy source:
private void initEvents(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  final GraphController gc=Lookup.getDefault().lookup(GraphController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
    }
    public void select(    Workspace workspace){
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
      AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
      dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
      if (dataTablesModel == null) {
        workspace.add(dataTablesModel=new DataTablesModel(attributeModel.getNodeTable(),attributeModel.getEdgeTable()));
      }
      nodeAvailableColumnsModel=dataTablesModel.getNodeAvailableColumnsModel();
      edgeAvailableColumnsModel=dataTablesModel.getEdgeAvailableColumnsModel();
      hideTable();
      enableTableControls();
      bannerPanel.setVisible(false);
      attributeModel.addAttributeListener(DataTableTopComponent.this);
      graphModel=gc.getModel();
      graphModel.addGraphListener(DataTableTopComponent.this);
      refreshAll();
    }
    public void unselect(    Workspace workspace){
      graphModel.removeGraphListener(DataTableTopComponent.this);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.removeAttributeListener(DataTableTopComponent.this);
      graphModel=null;
      dataTablesModel=null;
      nodeAvailableColumnsModel=null;
      edgeAvailableColumnsModel=null;
      clearAll();
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      clearAll();
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(null);
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
    dataTablesModel=pc.getCurrentWorkspace().getLookup().lookup(DataTablesModel.class);
    graphModel=gc.getModel();
    graphModel.addGraphListener(DataTableTopComponent.this);
    AttributeModel attributeModel=pc.getCurrentWorkspace().getLookup().lookup(AttributeModel.class);
    attributeModel.addAttributeListener(DataTableTopComponent.this);
  }
  if (dynamicFiltering) {
    filterTextField.getDocument().addDocumentListener(new DocumentListener(){
      public void insertUpdate(      DocumentEvent e){
        refreshFilter();
      }
      public void removeUpdate(      DocumentEvent e){
        refreshFilter();
      }
      public void changedUpdate(      DocumentEvent e){
      }
    }
);
  }
 else {
    filterTextField.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        refreshFilter();
      }
    }
);
  }
  columnComboBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      refreshFilter();
    }
  }
);
}

Fixed version (ground truth):
private void initEvents(){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  final GraphController gc=Lookup.getDefault().lookup(GraphController.class);
  pc.addWorkspaceListener(new WorkspaceListener(){
    public void initialize(    Workspace workspace){
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
    }
    public void select(    Workspace workspace){
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
      AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
      dataTablesModel=workspace.getLookup().lookup(DataTablesModel.class);
      if (dataTablesModel == null) {
        workspace.add(dataTablesModel=new DataTablesModel(attributeModel.getNodeTable(),attributeModel.getEdgeTable()));
      }
      nodeAvailableColumnsModel=dataTablesModel.getNodeAvailableColumnsModel();
      edgeAvailableColumnsModel=dataTablesModel.getEdgeAvailableColumnsModel();
      hideTable();
      enableTableControls();
      attributeModel.addAttributeListener(DataTableTopComponent.this);
      graphModel=gc.getModel();
      graphModel.addGraphListener(DataTableTopComponent.this);
      refreshAllOnce();
    }
    public void unselect(    Workspace workspace){
      graphModel.removeGraphListener(DataTableTopComponent.this);
      AttributeModel attributeModel=workspace.getLookup().lookup(AttributeModel.class);
      attributeModel.removeAttributeListener(DataTableTopComponent.this);
      graphModel=null;
      dataTablesModel=null;
      nodeAvailableColumnsModel=null;
      edgeAvailableColumnsModel=null;
      clearAll();
    }
    public void close(    Workspace workspace){
    }
    public void disable(){
      clearAll();
      Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(null);
    }
  }
);
  if (pc.getCurrentWorkspace() != null) {
    Lookup.getDefault().lookup(DataTablesController.class).setDataTablesEventListener(DataTableTopComponent.this);
    dataTablesModel=pc.getCurrentWorkspace().getLookup().lookup(DataTablesModel.class);
    graphModel=gc.getModel();
    graphModel.addGraphListener(DataTableTopComponent.this);
    AttributeModel attributeModel=pc.getCurrentWorkspace().getLookup().lookup(AttributeModel.class);
    attributeModel.addAttributeListener(DataTableTopComponent.this);
  }
  if (dynamicFiltering) {
    filterTextField.getDocument().addDocumentListener(new DocumentListener(){
      public void insertUpdate(      DocumentEvent e){
        refreshFilter();
      }
      public void removeUpdate(      DocumentEvent e){
        refreshFilter();
      }
      public void changedUpdate(      DocumentEvent e){
      }
    }
);
  }
 else {
    filterTextField.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        refreshFilter();
      }
    }
);
  }
  columnComboBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      refreshFilter();
    }
  }
);
}