Program: 11022
Project: 11022
Buggy source:
protected void createActions(){
  addAction=new BasicAction("String_Node_Str",Icons.add.getIcon());
  addAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      TreePath path=tree.getSelectionPath();
      IData selected=getSelectedData(path);
      if (!(selected instanceof ILayerDefinition))       return;
      ILayerDefinition layer=(ILayerDefinition)selected;
      layerTreeModel.addLayer(layer,path.getPath());
      tree.repaint();
    }
  }
);
  removeAction=new BasicAction("String_Node_Str",Icons.remove.getIcon());
  removeAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      TreePath path=tree.getSelectionPath();
      IData selected=getSelectedData(path);
      if (!(selected instanceof ILayerDefinition))       return;
      ILayerDefinition layer=(ILayerDefinition)selected;
      layerTreeModel.removeLayer(layer);
      tree.repaint();
    }
  }
);
  addAllAction=new BasicAction("String_Node_Str",Icons.add.getIcon());
  addAllAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      final TreePath path=tree.getSelectionPath();
      final IData selected=getSelectedData(path);
      if (selected != null) {
        int choice=JOptionPane.showConfirmDialog(DatasetPanel.this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
        if (choice == JOptionPane.YES_OPTION) {
          Thread thread=new Thread(new Runnable(){
            @Override public void run(){
              addAll(selected,path.getPath());
              SwingUtil.invokeLaterTaskOnEDT(new Runnable(){
                @Override public void run(){
                  tree.repaint();
                }
              }
);
            }
          }
);
          thread.setDaemon(true);
          thread.start();
        }
      }
    }
  }
);
  tree.addTreeSelectionListener(new TreeSelectionListener(){
    @Override public void valueChanged(    TreeSelectionEvent event){
      IData selected=getSelectedData(event.getPath());
      if (selected == null)       return;
      addAction.setEnabled(false);
      removeAction.setEnabled(false);
      if (selected instanceof ILayerDefinition) {
        ILayerDefinition layer=(ILayerDefinition)selected;
        if (layerTreeModel.containsLayer(layer))         removeAction.setEnabled(true);
 else         addAction.setEnabled(true);
        addAllAction.setEnabled(false);
      }
 else {
        addAllAction.setEnabled(true);
      }
    }
  }
);
}

Fixed version (ground truth):
protected void createActions(){
  addAction=new BasicAction("String_Node_Str",Icons.add.getIcon());
  addAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      TreePath path=tree.getSelectionPath();
      IData selected=getSelectedData(path);
      if (!(selected instanceof ILayerDefinition))       return;
      ILayerDefinition layer=(ILayerDefinition)selected;
      layerTreeModel.addLayer(layer,path.getPath());
      tree.repaint();
      enableActions();
    }
  }
);
  removeAction=new BasicAction("String_Node_Str",Icons.remove.getIcon());
  removeAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      TreePath path=tree.getSelectionPath();
      IData selected=getSelectedData(path);
      if (!(selected instanceof ILayerDefinition))       return;
      ILayerDefinition layer=(ILayerDefinition)selected;
      layerTreeModel.removeLayer(layer);
      tree.repaint();
      enableActions();
    }
  }
);
  addAllAction=new BasicAction("String_Node_Str",Icons.add.getIcon());
  addAllAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      final TreePath path=tree.getSelectionPath();
      final IData selected=getSelectedData(path);
      if (selected != null) {
        int choice=JOptionPane.showConfirmDialog(DatasetPanel.this,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
        if (choice == JOptionPane.YES_OPTION) {
          Thread thread=new Thread(new Runnable(){
            @Override public void run(){
              addAll(selected,path.getPath());
              SwingUtil.invokeLaterTaskOnEDT(new Runnable(){
                @Override public void run(){
                  tree.repaint();
                  enableActions();
                }
              }
);
            }
          }
);
          thread.setDaemon(true);
          thread.start();
        }
      }
    }
  }
);
  tree.addTreeSelectionListener(new TreeSelectionListener(){
    @Override public void valueChanged(    TreeSelectionEvent event){
      IData selected=getSelectedData(event.getPath());
      enableActions(selected);
    }
  }
);
}