Program: 122086
Project: 122086
Buggy source:
/** 
 * repository tree viewer.
 */
private void addRepositoryTreeViewer(Composite leftComposite){
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.widthHint=210;
  gridData.heightHint=400;
  leftComposite.setLayoutData(gridData);
  RepoCommonViewerProvider 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);
        }
        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();
    }
  }
);
  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);
  RepoCommonViewerProvider 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);
        }
        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){
    }
  }
);
  expandSomeNodes(projectRepositoryNode);
}