Program: 20539
Project: 20539
Buggy source:
@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;
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor monitor){
  GenerateRAML.this.monitor=monitor;
  monitor.beginTask("String_Node_Str",count[0] + 1);
  monitor.worked(1);
  visitor=new JDTResourceVisitor(_outputFile,classLoader);
  visitor.setPreferences(new PreferencesConfig());
  for (  Object q : selectionObject) {
    sourceVisitor.visitObject(q);
  }
  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;
}