Program: 140626
Project: 140626
Buggy source:
@Override public void run(){
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder){
    public void dispose(){
      activeCount=0;
      super.dispose();
    }
  }
;
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard){
    public void openTray(    DialogTray tray) throws IllegalStateException, UnsupportedOperationException {
      super.openTray(tray);
      if (tray instanceof HelpTray) {
        HelpTray helpTray=(HelpTray)tray;
        ReusableHelpPart helpPart=helpTray.getHelpPart();
        helpPart.getForm().getForm().notifyListeners(SWT.Activate,new Event());
      }
    }
  }
;
  fileWizard.setWindowTitle(getText());
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    public void shellActivated(    ShellEvent e){
      if (activeCount < 2) {
        Point point=e.widget.getDisplay().getCursorLocation();
        IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
        IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
        helpSystem.displayContext(context,point.x + 15,point.y);
        activeCount++;
        ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
        if (lastActiveInstance != null) {
          IHelpResource[] relatedTopics=context.getRelatedTopics();
          String href=relatedTopics[0].getHref();
          lastActiveInstance.showURL(href);
        }
      }
    }
  }
);
  if (WizardDialog.OK == dialog.open()) {
    try {
      folder.refreshLocal(IResource.DEPTH_INFINITE,null);
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(fileWizard.getLocation());
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new FileEditorInput(file),PluginConstant.PATTERN_EDITOR);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  CreatePatternWizard fileWizard=new CreatePatternWizard(folder,type){
    public void dispose(){
      activeCount=0;
      super.dispose();
    }
  }
;
  WizardDialog dialog=new WizardDialog(Display.getDefault().getActiveShell(),fileWizard){
    public void openTray(    DialogTray tray) throws IllegalStateException, UnsupportedOperationException {
      super.openTray(tray);
      if (tray instanceof HelpTray) {
        HelpTray helpTray=(HelpTray)tray;
        ReusableHelpPart helpPart=helpTray.getHelpPart();
        helpPart.getForm().getForm().notifyListeners(SWT.Activate,new Event());
      }
    }
  }
;
  fileWizard.setWindowTitle(getText());
  dialog.create();
  dialog.getShell().addShellListener(new ShellAdapter(){
    public void shellActivated(    ShellEvent e){
      if (activeCount < 2) {
        Point point=e.widget.getDisplay().getCursorLocation();
        IContext context=HelpSystem.getContext(HelpPlugin.PATTERN_CONTEXT_HELP_ID);
        IWorkbenchHelpSystem helpSystem=PlatformUI.getWorkbench().getHelpSystem();
        helpSystem.displayContext(context,point.x + 15,point.y);
        activeCount++;
        ReusableHelpPart lastActiveInstance=ReusableHelpPart.getLastActiveInstance();
        if (lastActiveInstance != null) {
          IHelpResource[] relatedTopics=context.getRelatedTopics();
          String href=relatedTopics[0].getHref();
switch (type) {
case SQL_LIKE:
            href=relatedTopics[1].getHref();
          break;
default :
        break;
    }
    lastActiveInstance.showURL(href);
  }
}
}
}
);
if (WizardDialog.OK == dialog.open()) {
try {
folder.refreshLocal(IResource.DEPTH_INFINITE,null);
IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(fileWizard.getLocation());
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new FileEditorInput(file),PluginConstant.PATTERN_EDITOR);
}
 catch (CoreException e) {
e.printStackTrace();
}
}
}