Program: 122870
Project: 122870
Buggy source:
/** 
 * 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());
}

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);
        }
        if (node != null && (ERepositoryObjectType.PROCESS).equals(node.getContentType())) {
          boolean isEnable=false;
          if (event.getChecked()) {
            isEnable=true;
          }
          checkButtonsState(isEnable);
        }
        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());
}