Program: 19857
Project: 19857
Buggy source:
@Override protected IStatus run(IProgressMonitor p_monitor){
  if (!(m_selection instanceof IStructuredSelection)) {
    return Status.CANCEL_STATUS;
  }
  IStructuredSelection selection=(IStructuredSelection)m_selection;
  if (selection.getFirstElement() == null) {
    return Status.CANCEL_STATUS;
  }
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof GenModel)) {
    return Status.CANCEL_STATUS;
  }
  GenModel genModel=(GenModel)firstElement;
  if (!(m_activePart instanceof IEditorPart)) {
    return Status.CANCEL_STATUS;
  }
  IEditorPart editorPart=(IEditorPart)m_activePart;
  IEditorInput editorInput=editorPart.getEditorInput();
  if (!(editorInput instanceof FileEditorInput)) {
    return Status.CANCEL_STATUS;
  }
  FileEditorInput fileEditorInput=(FileEditorInput)editorInput;
  WorkflowRunner runner=new WorkflowRunner();
  WorkflowContext context=runner.getContext();
  Issues issues=new IssuesImpl();
  ProgressMonitor progressMonitor=new ProgressMonitorAdapter(p_monitor);
  EMFBuilderGenerator emfBuilderGenerator=new EMFBuilderGenerator();
  String ecoreFile=genModel.getForeignModel().get(0);
  IFile file=fileEditorInput.getFile();
  emfBuilderGenerator.setProjectPath(file.getProject().getLocation().toString());
  IResource ecoreFileResource=file.getParent().findMember(ecoreFile);
  emfBuilderGenerator.setEcoreURI(ecoreFileResource.getFullPath().toString());
  String targetDir=new Path(genModel.getModelDirectory()).makeRelativeTo(file.getProject().getFullPath()).toString();
  emfBuilderGenerator.setTargetDir(targetDir);
  GenPackage genPackage=genModel.getGenPackages().get(0);
  emfBuilderGenerator.setMetaModelPackageInstance(genPackage.getEcorePackage());
  String targetPackage=genPackage.getBasePackage() + "String_Node_Str" + genPackage.getEcorePackage().getName();
  emfBuilderGenerator.setTargetPackage(targetPackage + "String_Node_Str");
  emfBuilderGenerator.setMetaModelFactory(targetPackage + "String_Node_Str" + genPackage.getPrefix()+ "String_Node_Str");
  emfBuilderGenerator.checkConfiguration(issues);
  if (issues.getErrors().length > 0) {
    StringBuilder sb=new StringBuilder();
    for (    Diagnostic diagnostic : issues.getErrors()) {
      sb.append(diagnostic.getMessage()).append("String_Node_Str");
    }
    throw new RuntimeException(sb.toString());
  }
  emfBuilderGenerator.invoke(context,progressMonitor,issues);
  try {
    file.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
  }
 catch (  CoreException e) {
    throw new RuntimeException(e);
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
@Override protected IStatus run(IProgressMonitor p_monitor){
  if (!(m_selection instanceof IStructuredSelection)) {
    return Status.CANCEL_STATUS;
  }
  IStructuredSelection selection=(IStructuredSelection)m_selection;
  if (selection.getFirstElement() == null) {
    return Status.CANCEL_STATUS;
  }
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof GenModel)) {
    return Status.CANCEL_STATUS;
  }
  GenModel genModel=(GenModel)firstElement;
  if (!(m_activePart instanceof IEditorPart)) {
    return Status.CANCEL_STATUS;
  }
  IEditorPart editorPart=(IEditorPart)m_activePart;
  IEditorInput editorInput=editorPart.getEditorInput();
  if (!(editorInput instanceof FileEditorInput)) {
    return Status.CANCEL_STATUS;
  }
  FileEditorInput fileEditorInput=(FileEditorInput)editorInput;
  WorkflowRunner runner=new WorkflowRunner();
  WorkflowContext context=runner.getContext();
  Issues issues=new IssuesImpl();
  ProgressMonitor progressMonitor=new ProgressMonitorAdapter(p_monitor);
  EMFBuilderGenerator emfBuilderGenerator=new EMFBuilderGenerator();
  String ecoreFile=genModel.getForeignModel().get(0);
  IFile file=fileEditorInput.getFile();
  emfBuilderGenerator.setProjectPath(file.getProject().getLocation().toString());
  IResource ecoreFileResource=file.getParent().findMember(ecoreFile);
  emfBuilderGenerator.setEcoreURI(ecoreFileResource.getFullPath().toString());
  String targetDir=new Path(genModel.getModelDirectory()).makeRelativeTo(file.getProject().getFullPath()).toString();
  emfBuilderGenerator.setTargetDir(targetDir);
  GenPackage genPackage=genModel.getGenPackages().get(0);
  emfBuilderGenerator.setMetaModelPackageInstance(genPackage.getEcorePackage());
  StringBuilder targetPackageBuilder=new StringBuilder();
  if (genPackage.getBasePackage() != null && genPackage.getBasePackage().trim().length() > 0) {
    targetPackageBuilder.append(genPackage.getBasePackage()).append("String_Node_Str");
  }
  targetPackageBuilder.append(genPackage.getEcorePackage().getName());
  String targetPackage=targetPackageBuilder.toString();
  emfBuilderGenerator.setTargetPackage(targetPackage + "String_Node_Str");
  emfBuilderGenerator.setMetaModelFactory(targetPackage + "String_Node_Str" + genPackage.getPrefix()+ "String_Node_Str");
  emfBuilderGenerator.checkConfiguration(issues);
  if (issues.getErrors().length > 0) {
    StringBuilder sb=new StringBuilder();
    for (    Diagnostic diagnostic : issues.getErrors()) {
      sb.append(diagnostic.getMessage()).append("String_Node_Str");
    }
    throw new RuntimeException(sb.toString());
  }
  emfBuilderGenerator.invoke(context,progressMonitor,issues);
  try {
    file.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
  }
 catch (  CoreException e) {
    throw new RuntimeException(e);
  }
  return Status.OK_STATUS;
}