Program: 20551
Project: 20551
Buggy source:
/** 
 * @see IActionDelegate#run(IAction)
 */
public void run(IAction action){
  types.clear();
  boolean cpInited=false;
  IProject project=null;
  classLoader=null;
  try {
    for (    Object q : selectionObject) {
      if (!(q instanceof IJavaElement)) {
        continue;
      }
      if (!cpInited) {
        IJavaElement el=(IJavaElement)q;
        IResource resource=el.getResource();
        if (project != null && !project.equals(resource.getProject())) {
          MessageDialog.openInformation(shell,"String_Node_Str","String_Node_Str");
          return;
        }
        project=resource.getProject();
        Collection<String> constructProjectClassPath=new ClassPathCollector().constructProjectClassPath(project,true);
        URL[] urls=new URL[constructProjectClassPath.size()];
        int a=0;
        for (        String s : constructProjectClassPath) {
          urls[a++]=new File(s).toURL();
        }
        classLoader=new URLClassLoader(urls);
        cpInited=true;
      }
    }
  }
 catch (  MalformedURLException e1) {
    e1.printStackTrace();
  }
  if (project == null) {
    MessageDialog.openInformation(Display.getCurrent().getActiveShell(),"String_Node_Str","String_Node_Str");
    return;
  }
  IFile file=getNewRAMLFile(project);
  boolean doSingle=isSingle();
  if (file == null) {
    return;
  }
  File outputFile=file.getLocation().toFile();
  File actualFile=outputFile;
  if (doSingle) {
    File createTempFile;
    try {
      createTempFile=File.createTempFile("String_Node_Str","String_Node_Str");
      outputFile=createTempFile;
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  visitor=new JDTResourceVisitor(outputFile,classLoader);
  visitor.setPreferences(new PreferencesConfig());
  for (  Object q : selectionObject) {
    if (!(q instanceof IJavaElement)) {
      continue;
    }
    try {
      if (q instanceof IType) {
        visitType((IType)q);
      }
      if (q instanceof IPackageFragment) {
        visitPackage((IPackageFragment)q);
      }
      if (q instanceof IPackageFragmentRoot) {
        visitPackageFragmentRoot((IPackageFragmentRoot)q);
      }
      if (q instanceof IJavaProject) {
        visitProject((IJavaProject)q);
      }
      if (q instanceof ICompilationUnit) {
        visitUnit((ICompilationUnit)q);
      }
    }
 catch (    GenerationException e) {
      MessageDialog.openError(shell,e.getShortMessage(),e.getDetailMessage());
    }
catch (    Exception e) {
      MessageDialog.openError(shell,e.getMessage(),e.getMessage());
    }
  }
  if (project != null) {
    if (!separateFiles) {
      if (doSingle) {
        String raml=visitor.getRaml();
        Raml2 build=build(new ByteArrayInputStream(raml.getBytes()),new FileResourceLoader(outputFile.getParent()));
        RamlEmitterV2 emmitter=new RamlEmitterV2();
        emmitter.setSingle(true);
        String dump=emmitter.dump(build);
        try {
          save(dump,file);
        }
 catch (        Exception e) {
          MessageDialog.openError(shell,e.getMessage(),e.getMessage());
        }
        return;
      }
 else {
        saveResult(visitor,file);
      }
    }
    try {
      project.refreshLocal(IProject.DEPTH_INFINITE,new NullProgressMonitor());
    }
 catch (    CoreException e) {
      MessageDialog.openError(shell,e.getMessage(),e.getMessage());
    }
  }
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  monitor.beginTask("String_Node_Str",selectionObject.size() + 1);
  monitor.worked(1);
  visitor=new JDTResourceVisitor(_outputFile,classLoader);
  visitor.setPreferences(new PreferencesConfig());
  for (  Object q : selectionObject) {
    monitor.worked(1);
    if (!(q instanceof IJavaElement)) {
      continue;
    }
    try {
      if (q instanceof IType) {
        visitType((IType)q);
      }
      if (q instanceof IPackageFragment) {
        visitPackage((IPackageFragment)q);
      }
      if (q instanceof IPackageFragmentRoot) {
        visitPackageFragmentRoot((IPackageFragmentRoot)q);
      }
      if (q instanceof IJavaProject) {
        visitProject((IJavaProject)q);
      }
      if (q instanceof ICompilationUnit) {
        visitUnit((ICompilationUnit)q);
      }
    }
 catch (    GenerationException e) {
      MessageDialog.openError(shell,e.getShortMessage(),e.getDetailMessage());
    }
catch (    Exception e) {
      MessageDialog.openError(shell,e.getMessage(),e.getMessage());
    }
  }
  if (_project != null) {
    if (!separateFiles) {
      if (doSingle) {
        String raml=visitor.getRaml();
        Raml2 build=build(new ByteArrayInputStream(raml.getBytes()),new FileResourceLoader(_outputFile.getParent()));
        RamlEmitterV2 emmitter=new RamlEmitterV2();
        emmitter.setSingle(true);
        String dump=emmitter.dump(build);
        try {
          save(dump,file);
        }
 catch (        Exception e) {
          MessageDialog.openError(shell,e.getMessage(),e.getMessage());
        }
        return Status.OK_STATUS;
      }
 else {
        saveResult(visitor,file);
      }
    }
    try {
      _project.refreshLocal(IProject.DEPTH_INFINITE,new NullProgressMonitor());
    }
 catch (    CoreException e) {
      MessageDialog.openError(shell,e.getMessage(),e.getMessage());
    }
  }
  return Status.OK_STATUS;
}