Program: 91399
Project: 91399
Buggy source:
@Override public void createControl(Composite parent){
  Composite main=new Composite(parent,SWT.NO_RADIO_GROUP);
  main.setLayout(new GridLayout(1,false));
  SelectionListener sl=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      tv.getTree().setEnabled(!newProjectWizard.getSelection());
      if (importExisting.getSelection())       wizardSelection=EXISTING_PROJECTS_WIZARD;
 else       if (newProjectWizard.getSelection())       wizardSelection=NEW_WIZARD;
 else       if (generalWizard.getSelection())       wizardSelection=GENERAL_WIZARD;
 else       wizardSelection=EXISTING_PROJECTS_WIZARD;
      checkPage();
    }
  }
;
  Group wizardType=new Group(main,SWT.SHADOW_ETCHED_IN);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(wizardType);
  wizardType.setText(UIText.GitSelectWizardPage_ProjectCreationHeader);
  wizardType.setLayout(new GridLayout(1,false));
  importExisting=new Button(wizardType,SWT.RADIO);
  importExisting.setText(UIText.GitSelectWizardPage_ImportExistingButton);
  importExisting.addSelectionListener(sl);
  newProjectWizard=new Button(wizardType,SWT.RADIO);
  newProjectWizard.setText(UIText.GitSelectWizardPage_UseNewProjectsWizardButton);
  newProjectWizard.addSelectionListener(sl);
  generalWizard=new Button(wizardType,SWT.RADIO);
  generalWizard.setText(UIText.GitSelectWizardPage_ImportAsGeneralButton);
  generalWizard.addSelectionListener(sl);
  IDialogSettings settings=Activator.getDefault().getDialogSettings();
  try {
    wizardSelection=settings.getInt(PREF_WIZ);
  }
 catch (  NumberFormatException e) {
    wizardSelection=EXISTING_PROJECTS_WIZARD;
  }
switch (wizardSelection) {
case EXISTING_PROJECTS_WIZARD:
    importExisting.setSelection(true);
  break;
case GENERAL_WIZARD:
generalWizard.setSelection(true);
break;
case NEW_WIZARD:
newProjectWizard.setSelection(true);
break;
}
tv=new TreeViewer(main,SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER);
RepositoriesViewContentProvider cp=new RepositoriesViewContentProvider();
tv.setContentProvider(cp);
GridDataFactory.fillDefaults().grab(true,true).hint(SWT.DEFAULT,200).applyTo(tv.getTree());
tv.setLabelProvider(new RepositoriesViewLabelProvider());
tv.addSelectionChangedListener(new ISelectionChangedListener(){
@Override public void selectionChanged(SelectionChangedEvent event){
checkPage();
}
}
);
if (initialRepository != null) {
List<WorkingDirNode> input=new ArrayList<>();
WorkingDirNode node=new WorkingDirNode(null,initialRepository);
input.add(node);
tv.setInput(input);
tv.expandToLevel(2);
if (initialPath == null) tv.setSelection(new StructuredSelection(input.get(0)));
 else {
RepositoryTreeNode parentNode=node;
IPath fullPath=new Path(initialPath);
IPath workdirPath=new Path(initialRepository.getWorkTree().getPath());
if (workdirPath.isPrefixOf(fullPath)) {
IPath relPath=fullPath.removeFirstSegments(workdirPath.segmentCount());
for (String segment : relPath.segments()) {
for (Object child : cp.getChildren(parentNode)) {
if (child instanceof FolderNode) {
  FolderNode childFolder=(FolderNode)child;
  if (childFolder.getObject().getName().equals(segment)) {
    parentNode=childFolder;
    break;
  }
}
}
}
tv.setSelection(new StructuredSelection(parentNode));
}
}
}
tv.getTree().setEnabled(!newProjectWizard.getSelection());
Dialog.applyDialogFont(main);
setControl(main);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  Composite main=new Composite(parent,SWT.NO_RADIO_GROUP);
  main.setLayout(new GridLayout(1,false));
  SelectionListener sl=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      tv.getTree().setEnabled(!newProjectWizard.getSelection());
      if (importExisting.getSelection())       wizardSelection=EXISTING_PROJECTS_WIZARD;
 else       if (newProjectWizard.getSelection())       wizardSelection=NEW_WIZARD;
 else       if (generalWizard.getSelection())       wizardSelection=GENERAL_WIZARD;
 else       wizardSelection=EXISTING_PROJECTS_WIZARD;
      checkPage();
    }
  }
;
  Group wizardType=new Group(main,SWT.SHADOW_ETCHED_IN);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(wizardType);
  wizardType.setText(UIText.GitSelectWizardPage_ProjectCreationHeader);
  wizardType.setLayout(new GridLayout(1,false));
  importExisting=new Button(wizardType,SWT.RADIO);
  importExisting.setText(UIText.GitSelectWizardPage_ImportExistingButton);
  importExisting.addSelectionListener(sl);
  newProjectWizard=new Button(wizardType,SWT.RADIO);
  newProjectWizard.setText(UIText.GitSelectWizardPage_UseNewProjectsWizardButton);
  newProjectWizard.addSelectionListener(sl);
  generalWizard=new Button(wizardType,SWT.RADIO);
  generalWizard.setText(UIText.GitSelectWizardPage_ImportAsGeneralButton);
  generalWizard.addSelectionListener(sl);
  IDialogSettings settings=Activator.getDefault().getDialogSettings();
  try {
    wizardSelection=settings.getInt(PREF_WIZ);
  }
 catch (  NumberFormatException e) {
    wizardSelection=EXISTING_PROJECTS_WIZARD;
  }
switch (wizardSelection) {
default :
case EXISTING_PROJECTS_WIZARD:
    importExisting.setSelection(true);
  break;
case GENERAL_WIZARD:
generalWizard.setSelection(true);
break;
case NEW_WIZARD:
newProjectWizard.setSelection(true);
break;
}
tv=new TreeViewer(main,SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER);
RepositoriesViewContentProvider cp=new RepositoriesViewContentProvider();
tv.setContentProvider(cp);
GridDataFactory.fillDefaults().grab(true,true).hint(SWT.DEFAULT,200).applyTo(tv.getTree());
tv.setLabelProvider(new RepositoriesViewLabelProvider());
tv.addSelectionChangedListener(new ISelectionChangedListener(){
@Override public void selectionChanged(SelectionChangedEvent event){
checkPage();
}
}
);
if (initialRepository != null) {
List<WorkingDirNode> input=new ArrayList<>();
WorkingDirNode node=new WorkingDirNode(null,initialRepository);
input.add(node);
tv.setInput(input);
tv.expandToLevel(2);
if (initialPath == null) tv.setSelection(new StructuredSelection(input.get(0)));
 else {
RepositoryTreeNode parentNode=node;
IPath fullPath=new Path(initialPath);
IPath workdirPath=new Path(initialRepository.getWorkTree().getPath());
if (workdirPath.isPrefixOf(fullPath)) {
IPath relPath=fullPath.removeFirstSegments(workdirPath.segmentCount());
for (String segment : relPath.segments()) {
for (Object child : cp.getChildren(parentNode)) {
if (child instanceof FolderNode) {
  FolderNode childFolder=(FolderNode)child;
  if (childFolder.getObject().getName().equals(segment)) {
    parentNode=childFolder;
    break;
  }
}
}
}
tv.setSelection(new StructuredSelection(parentNode));
}
}
}
tv.getTree().setEnabled(!newProjectWizard.getSelection());
Dialog.applyDialogFont(main);
setControl(main);
}