Program: 123364
Project: 123364
Buggy source:
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  leftComposite.setLayoutData(gridData);
  RepositoryCheckBoxView view=new RepositoryCheckBoxView();
  try {
    view.init(RepositoryView.show().getViewSite());
  }
 catch (  PartInitException e) {
    ExceptionHandler.process(e);
  }
  view.createPartControl(leftComposite);
  treeViewer=(CheckboxRepositoryTreeViewer)view.getViewer();
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      RepositoryNode node=(RepositoryNode)element;
      return filterRepositoryNode(node);
    }
  }
);
  treeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      RepositoryNode node=(RepositoryNode)event.getElement();
      List<RepositoryObject> objects=new ArrayList<RepositoryObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
    }
  }
);
  expandSomeNodes(view);
}

Fixed version (ground truth):
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  leftComposite.setLayoutData(gridData);
  RepositoryViewerProvider provider=new RepositoryViewerProvider(){
    @Override protected RepositoryNode getInputRoot(    RepositoryContentProvider contentProvider){
      return contentProvider.getRoot();
    }
    public RepositoryContentProvider getContextProvider(){
      return new RepositoryContentProvider(getRepView());
    }
  }
;
  treeViewer=(CheckboxRepositoryTreeViewer)provider.createViewer(leftComposite);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      RepositoryNode node=(RepositoryNode)element;
      return filterRepositoryNode(node);
    }
  }
);
  treeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      RepositoryNode node=(RepositoryNode)event.getElement();
      List<RepositoryObject> objects=new ArrayList<RepositoryObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
    }
  }
);
  treeViewer.expandToLevel(2);
  expandSomeNodes(((RepositoryContentProvider)treeViewer.getContentProvider()).getRoot());
}