Program: 123366
Project: 123366
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);
  processItems(versionObjects,view.getRoot());
  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<ItemVersionObject> objects=new ArrayList<ItemVersionObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        researchMaxVersion();
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
      refreshCheckedTreeView();
    }
  }
);
  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);
  processItems(versionObjects,((RepositoryContentProvider)treeViewer.getContentProvider()).getRoot());
  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<ItemVersionObject> objects=new ArrayList<ItemVersionObject>();
      processItems(objects,node);
      if (!objects.isEmpty()) {
        if (event.getChecked()) {
          checkedObjects.addAll(objects);
        }
 else {
          checkedObjects.removeAll(objects);
          removeItemElements(objects);
        }
        researchMaxVersion();
        refreshTableItems();
      }
    }
  }
);
  treeViewer.addTreeListener(new ITreeViewerListener(){
    public void treeCollapsed(    TreeExpansionEvent event){
    }
    public void treeExpanded(    TreeExpansionEvent event){
      refreshCheckedTreeView();
    }
  }
);
  treeViewer.expandToLevel(2);
  expandSomeNodes(((RepositoryContentProvider)treeViewer.getContentProvider()).getRoot());
}