Program: 122548
Project: 122548
Buggy source:
private TreeViewer createTreeViewer(Composite listComposite){
  filteredCheckboxTree=new FilteredCheckboxTree(listComposite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.MULTI);
  CheckboxTreeViewer viewer=filteredCheckboxTree.getViewer();
  viewer.setContentProvider(new ITreeContentProvider(){
    public Object[] getChildren(    Object parentElement){
      if (parentElement instanceof IContainerNode) {
        return ((IContainerNode)parentElement).getChildren().toArray();
      }
      return null;
    }
    public Object[] getElements(    Object inputElement){
      return repositoryUtil.getTreeViewInput().toArray();
    }
    public boolean hasChildren(    Object element){
      if (element instanceof IContainerNode) {
        return ((IContainerNode)element).hasChildren();
      }
      return false;
    }
    public Object getParent(    Object element){
      return null;
    }
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
);
  viewer.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      if (element instanceof IContainerNode) {
        if (element instanceof ProjectNode) {
          Project project=((ProjectNode)element).getProject();
          return ProjectManager.getInstance().getProjectDisplayLabel(project);
        }
        return ((IContainerNode)element).getLabel();
      }
 else       if (element instanceof ItemRecord) {
        return ((ItemRecord)element).getLabel();
      }
      return super.getText(element);
    }
    @Override public Image getImage(    Object element){
      if (element instanceof IContainerNode) {
        return ((IContainerNode)element).getImage();
      }
 else       if (element instanceof ItemRecord) {
        return ((ItemRecord)element).getImage();
      }
      return super.getImage(element);
    }
  }
);
  viewer.setSorter(TreeBuilder.createSorter());
  viewer.setInput(this);
  viewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      filteredCheckboxTree.calculateCheckedLeafNodes();
      updateFinishStatus();
    }
  }
);
  filteredCheckboxTree.getViewer().addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return selectRepositoryNode(viewer,element);
    }
  }
);
  return viewer;
}

Fixed version (ground truth):
private TreeViewer createTreeViewer(Composite listComposite){
  filteredCheckboxTree=new FilteredCheckboxTree(listComposite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.MULTI);
  CheckboxTreeViewer viewer=filteredCheckboxTree.getViewer();
  viewer.setContentProvider(new ITreeContentProvider(){
    public Object[] getChildren(    Object parentElement){
      if (parentElement instanceof IContainerNode) {
        return ((IContainerNode)parentElement).getChildren().toArray();
      }
      return null;
    }
    public Object[] getElements(    Object inputElement){
      return repositoryUtil.getTreeViewInput().toArray();
    }
    public boolean hasChildren(    Object element){
      if (element instanceof IContainerNode) {
        return ((IContainerNode)element).hasChildren();
      }
      return false;
    }
    public Object getParent(    Object element){
      return null;
    }
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
);
  viewer.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      if (element instanceof IContainerNode) {
        if (element instanceof ProjectNode) {
          Project project=((ProjectNode)element).getProject();
          return ProjectManager.getProjectDisplayLabel(project);
        }
        return ((IContainerNode)element).getLabel();
      }
 else       if (element instanceof ItemRecord) {
        return ((ItemRecord)element).getLabel();
      }
      return super.getText(element);
    }
    @Override public Image getImage(    Object element){
      if (element instanceof IContainerNode) {
        return ((IContainerNode)element).getImage();
      }
 else       if (element instanceof ItemRecord) {
        return ((ItemRecord)element).getImage();
      }
      return super.getImage(element);
    }
  }
);
  viewer.setSorter(TreeBuilder.createSorter());
  viewer.setInput(this);
  viewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      filteredCheckboxTree.calculateCheckedLeafNodes();
      updateFinishStatus();
    }
  }
);
  filteredCheckboxTree.getViewer().addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return selectRepositoryNode(viewer,element);
    }
  }
);
  return viewer;
}