Program: 137342
Project: 137342
Buggy source:
/** 
 * qzhang FolderSelectionDialog constructor comment.
 * @param parent
 * @param labelProvider
 * @param contentProvider
 */
public FolderSelectionDialog(Shell parent,ILabelProvider labelProvider,ITreeContentProvider contentProvider){
  super(parent,labelProvider,contentProvider);
  this.setTitle(DIALOG_TITLE);
  this.setMessage(DIALOG_MESSAGE);
  IProject rootProject=ReponsitoryContextBridge.getRootProject();
  this.setInput(rootProject);
  final IFolder defaultValidFolder=rootProject.getFolder(TDQ_LIBRARIES).getFolder(SOURCE_FILES);
  this.setInitialSelection(defaultValidFolder);
  this.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        if (SOURCE_FILES.equals(folder.getName()) || TDQ_LIBRARIES.equals(folder.getName())) {
          return true;
        }
 else {
          return defaultValidFolder.getFullPath().isPrefixOf(folder.getFullPath()) && !FilesUtils.isSVNFolder(folder.getName());
        }
      }
      return false;
    }
  }
);
  setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      if (selection.length == 1) {
        if (selection[0] instanceof IFolder) {
          selectedFolder=(IFolder)selection[0];
          IPath projectRelativePath=selectedFolder.getProjectRelativePath();
          if (SOURCE_FILES.equals(selectedFolder.getName()) || defaultValidFolder.getFullPath().isPrefixOf(selectedFolder.getFullPath())) {
            return checkFileName(fileNameText.getText());
          }
        }
      }
      return SELECT_FOLDER_ERROR_STATUS;
    }
  }
);
  setComparator(new ResourceComparator(ResourceComparator.NAME));
}

Fixed version (ground truth):
/** 
 * qzhang FolderSelectionDialog constructor comment.
 * @param parent
 * @param labelProvider
 * @param contentProvider
 */
public FolderSelectionDialog(Shell parent,ILabelProvider labelProvider,ITreeContentProvider contentProvider){
  super(parent,labelProvider,contentProvider);
  this.setTitle(DIALOG_TITLE);
  this.setMessage(DIALOG_MESSAGE);
  this.setInput(rootFolder);
  this.setInitialSelection(defaultValidFolder);
  this.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        if (SOURCE_FILES.equals(folder.getName())) {
          return true;
        }
 else {
          return defaultValidFolder.getFullPath().isPrefixOf(folder.getFullPath()) && !FilesUtils.isSVNFolder(folder.getName());
        }
      }
      return false;
    }
  }
);
  setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      if (selection.length == 1) {
        if (selection[0] instanceof IFolder) {
          selectedFolder=(IFolder)selection[0];
          IPath projectRelativePath=selectedFolder.getProjectRelativePath();
          if (SOURCE_FILES.equals(selectedFolder.getName()) || defaultValidFolder.getFullPath().isPrefixOf(selectedFolder.getFullPath())) {
            return checkFileName(fileNameText.getText());
          }
        }
      }
      return SELECT_FOLDER_ERROR_STATUS;
    }
  }
);
  setComparator(new ResourceComparator(ResourceComparator.NAME));
}