Program: 137865
Project: 137865
Buggy source:
/** 
 * physical delete generating report file.
 * @param repFileNode
 */
private void deleteReportFile(ReportFileRepNode repFileNode){
  try {
    RepositoryNode parentNode=repFileNode.getParent();
    IPath location=Path.fromOSString(repFileNode.getResource().getProjectRelativePath().toOSString());
    IFile latestRepIFile=ResourceManager.getRootProject().getFile(location);
    if (showConfirmDialog(repFileNode.getLabel())) {
      if (latestRepIFile.isLinked()) {
        File file=new File(latestRepIFile.getRawLocation().toOSString());
        if (file.exists()) {
          file.delete();
        }
      }
      latestRepIFile.delete(true,null);
      if (parentNode != null) {
        CorePlugin.getDefault().refreshDQView(parentNode);
      }
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
/** 
 * physical delete generating report file.
 * @param repFileNode
 * @throws PersistenceException
 */
private void deleteReportFile(final ReportFileRepNode repFileNode) throws PersistenceException {
  RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit(ProjectManager.getInstance().getCurrentProject(),"String_Node_Str"){
    @Override protected void run() throws LoginException, PersistenceException {
      final IWorkspaceRunnable op=new IWorkspaceRunnable(){
        public void run(        IProgressMonitor monitor){
          try {
            IPath location=Path.fromOSString(repFileNode.getResource().getProjectRelativePath().toOSString());
            IFile latestRepIFile=ResourceManager.getRootProject().getFile(location);
            if (showConfirmDialog(repFileNode.getLabel())) {
              if (latestRepIFile.isLinked()) {
                File file=new File(latestRepIFile.getRawLocation().toOSString());
                if (file.exists()) {
                  file.delete();
                }
              }
              latestRepIFile.delete(true,null);
              IContainer parent=latestRepIFile.getParent();
              if (parent != null) {
                parent.refreshLocal(IResource.DEPTH_INFINITE,monitor);
              }
            }
          }
 catch (          CoreException e) {
            log.error(e,e);
          }
        }
      }
;
      IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
        public void run(        IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
          IWorkspace workspace=ResourcesPlugin.getWorkspace();
          try {
            ISchedulingRule schedulingRule=workspace.getRoot();
            workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
          }
 catch (          CoreException e) {
            throw new InvocationTargetException(e);
          }
        }
      }
;
      try {
        PlatformUI.getWorkbench().getProgressService().run(false,false,iRunnableWithProgress);
      }
 catch (      InterruptedException e) {
        ExceptionHandler.process(e);
      }
catch (      InvocationTargetException e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  repositoryWorkUnit.setAvoidUnloadResources(true);
  ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
  repositoryWorkUnit.throwPersistenceExceptionIfAny();
  RepositoryNode parent=repFileNode.getParent();
  if (parent != null) {
    CorePlugin.getDefault().refreshDQView(parent);
  }
}