Program: 123648
Project: 123648
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=RepositoryViewerProvider.ALL_CHECKBOX;
  treeViewer=(CheckboxRepositoryTreeViewer)provider.createViewer(leftComposite);
  IProjectRepositoryNode projectRepositoryNode=provider.getProjectRepositoryNode();
  processItems(versionObjects,(RepositoryNode)projectRepositoryNode);
  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(projectRepositoryNode);
}

Fixed version (ground truth):
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  gridData.heightHint=400;
  leftComposite.setLayoutData(gridData);
  RepositoryViewerProvider provider=RepoCommonViewerProvider.CHECKBOX;
  treeViewer=(CheckboxRepositoryTreeViewer)provider.createViewer(leftComposite);
  IProjectRepositoryNode projectRepositoryNode=provider.getProjectRepositoryNode();
  processItems(versionObjects,(RepositoryNode)projectRepositoryNode);
  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(projectRepositoryNode);
}