Program: 76006
Project: 76006
Buggy source:
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 * @param cheatSheetId
 * @param containerName
 * @param fileName
 * @param showCheatSheet
 * @param monitor
 */
private void doFinish(IPath containerName,String fileName,final String sourceFileName,String cheatSheetId,boolean showCheatSheet,IProgressMonitor monitor) throws CoreException {
  monitor.beginTask(CREATING + fileName,2);
  IResource resource=(IContainer)ResourcesPlugin.getWorkspace().getRoot().findMember(containerName);
  IContainer container=null;
  if (resource == null || !resource.exists() || !(resource instanceof IContainer)) {
    IFolder folder=createFolderHandle(containerName);
    UIUtil.createFolder(folder,monitor);
    container=folder;
  }
 else {
    container=(IContainer)resource;
  }
  final IFile file=container.getFile(new Path(fileName));
  final String cheatId=cheatSheetId;
  final boolean showCheat=showCheatSheet;
  try {
    ReportDesignHandle handle=SessionHandleAdapter.getInstance().getSessionHandle().createDesignFromTemplate(sourceFileName);
    if (ReportPlugin.getDefault().getEnableCommentPreference()) {
      handle.setStringProperty(ModuleHandle.COMMENTS_PROP,ReportPlugin.getDefault().getCommentPreference());
    }
    if (isPredifinedTemplate(sourceFileName)) {
      String displayName=handle.getDisplayName();
      if (displayName != null && displayName.trim().length() > 0) {
        handle.setDisplayName(Messages.getString(displayName));
      }
      String description=handle.getDescription();
      if (description != null && description.trim().length() > 0) {
        handle.setDescription(Messages.getString(description));
      }
    }
    handle.saveAs(file.getLocation().toOSString());
    handle.close();
  }
 catch (  Exception e) {
  }
  container.refreshLocal(IResource.DEPTH_INFINITE,monitor);
  monitor.worked(1);
  monitor.setTaskName(OPENING_FILE_FOR_EDITING);
  getShell().getDisplay().asyncExec(new Runnable(){
    public void run(){
      IWorkbench workbench=PlatformUI.getWorkbench();
      IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
      IWorkbenchPage page=window.getActivePage();
      try {
        IDE.openEditor(page,file,true);
        BasicNewProjectResourceWizard.updatePerspective(configElement);
        if (showCheat && !cheatId.equals("String_Node_Str")) {
          OpenCheatSheetAction action=null;
          action=new OpenCheatSheetAction(cheatId);
          action.run();
        }
      }
 catch (      Exception e) {
        ExceptionHandler.handle(e);
      }
    }
  }
);
  monitor.worked(1);
}

Fixed version (ground truth):
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 * @param cheatSheetId
 * @param containerName
 * @param fileName
 * @param showCheatSheet
 * @param monitor
 */
private void doFinish(IPath containerName,String fileName,final String sourceFileName,String cheatSheetId,boolean showCheatSheet,IProgressMonitor monitor) throws CoreException {
  monitor.beginTask(CREATING + fileName,2);
  IResource resource=(IContainer)ResourcesPlugin.getWorkspace().getRoot().findMember(containerName);
  IContainer container=null;
  if (resource == null || !resource.exists() || !(resource instanceof IContainer)) {
    IFolder folder=createFolderHandle(containerName);
    UIUtil.createFolder(folder,monitor);
    container=folder;
  }
 else {
    container=(IContainer)resource;
  }
  final IFile file=container.getFile(new Path(fileName));
  final String cheatId=cheatSheetId;
  final boolean showCheat=showCheatSheet;
  try {
    ReportDesignHandle handle=SessionHandleAdapter.getInstance().getSessionHandle().createDesignFromTemplate(sourceFileName);
    if (ReportPlugin.getDefault().getEnableCommentPreference()) {
      handle.setStringProperty(ModuleHandle.COMMENTS_PROP,ReportPlugin.getDefault().getCommentPreference());
    }
    if (isPredifinedTemplate(sourceFileName)) {
      String displayName=handle.getDisplayName();
      if (displayName != null && displayName.trim().length() > 0) {
        handle.setDisplayName(Messages.getString(displayName));
      }
      String description=handle.getDescription();
      if (description != null && description.trim().length() > 0) {
        handle.setDescription(Messages.getString(description));
      }
    }
    handle.saveAs(file.getLocation().toOSString());
    handle.close();
  }
 catch (  Exception e) {
  }
  container.refreshLocal(IResource.DEPTH_INFINITE,monitor);
  monitor.worked(1);
  monitor.setTaskName(OPENING_FILE_FOR_EDITING);
  getShell().getDisplay().asyncExec(new Runnable(){
    public void run(){
      IWorkbench workbench=PlatformUI.getWorkbench();
      IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
      IWorkbenchPage page=window.getActivePage();
      try {
        IDE.openEditor(page,file,true);
        BasicNewProjectResourceWizard.updatePerspective(configElement);
        if (showCheat && !cheatId.equals("String_Node_Str")) {
          Display.getCurrent().getActiveShell().setData(page);
          new OpenCheatSheetAction(cheatId).run();
        }
      }
 catch (      Exception e) {
        ExceptionHandler.handle(e);
      }
    }
  }
);
  monitor.worked(1);
}