Program: 20594
Project: 20594
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 (!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();
  }
  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);
  for (  Object q : selectionObject) {
    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 (    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):
/** 
 * @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 (!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();
  }
  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);
  for (  Object q : selectionObject) {
    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());
    }
  }
}