Program: 119184
Project: 119184
Buggy source:
@Override public void generateCode(boolean statistics,boolean trace,boolean javaProperties) throws ProcessorException {
  super.generateCode(statistics,trace,javaProperties);
  try {
    String currentJavaProject=ProjectManager.getInstance().getProject(property).getTechnicalLabel();
    ICodeGenerator codeGen;
    ICodeGeneratorService service=RunProcessPlugin.getDefault().getCodeGeneratorService();
    if (javaProperties) {
      String javaInterpreter="String_Node_Str";
      String javaLib="String_Node_Str";
      String javaContext=getContextPath().toOSString();
      codeGen=service.createCodeGenerator(process,statistics,trace,javaInterpreter,javaLib,javaContext,currentJavaProject,exportAsOSGI);
    }
 else {
      codeGen=service.createCodeGenerator(process,statistics,trace);
    }
    if (!process.getContextManager().getDefaultContext().getName().equals(context.getName())) {
      boolean found=false;
      for (      IContext c : process.getContextManager().getListContext()) {
        if (c.getName().equals(context.getName())) {
          found=true;
        }
      }
      if (found) {
        codeGen.setContextName(context.getName());
      }
    }
    String processCode="String_Node_Str";
    try {
      processCode=codeGen.generateProcessCode();
      if (PluginChecker.isRulesPluginLoaded()) {
        IRulesProviderService rulesService=(IRulesProviderService)GlobalServiceRegister.getDefault().getService(IRulesProviderService.class);
        if (rulesService != null) {
          boolean useGenerateRuleFiles=false;
          List<? extends INode> allNodes=this.process.getGeneratingNodes();
          for (int i=0; i < allNodes.size(); i++) {
            if (allNodes.get(i) instanceof INode) {
              INode node=allNodes.get(i);
              if (rulesService.isRuleComponent(node) && !node.getElementParameter(EParameterName.PROPERTY_TYPE.getName()).getValue().toString().equals("String_Node_Str")) {
                useGenerateRuleFiles=true;
                break;
              }
            }
          }
          if (useGenerateRuleFiles && rulesService != null && currentJavaProject != null) {
            rulesService.generateFinalRuleFiles(currentJavaProject,this.process);
          }
        }
      }
    }
 catch (    SystemException e) {
      throw new ProcessorException(Messages.getString("String_Node_Str"),e);
    }
catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    IFile codeFile=this.project.getFile(this.codePath);
    final String toFormat=processCode;
    final Job job=new Job("String_Node_Str"){
      @Override protected IStatus run(      IProgressMonitor monitor){
        monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
        formatedCode=formatCode(toFormat);
        monitor.done();
        return Status.OK_STATUS;
      }
    }
;
    long time1=System.currentTimeMillis();
    job.setSystem(true);
    job.schedule();
    boolean f=true;
    while (f) {
      long time2=System.currentTimeMillis();
      if (time2 - time1 > 30000) {
        if (job.getResult() == null || !job.getResult().isOK()) {
          f=false;
          job.done(Status.OK_STATUS);
          job.cancel();
        }
 else {
          processCode=formatedCode;
          f=false;
        }
      }
 else {
        if (job.getState() != Job.RUNNING) {
          if (job.getResult() != null && job.getResult().isOK()) {
            processCode=formatedCode;
            f=false;
          }
        }
      }
    }
    formatedCode=null;
    processCode=computeMethodSizeIfNeeded(processCode);
    InputStream codeStream=new ByteArrayInputStream(processCode.getBytes());
    if (!codeFile.exists()) {
      deleteFileIfExisted(codeFile);
      codeFile.create(codeStream,true,null);
    }
 else {
      codeFile.setContents(codeStream,true,false,null);
    }
    processCode=null;
    codeFile.getProject().deleteMarkers("String_Node_Str",true,IResource.DEPTH_INFINITE);
    List<INode> breakpointNodes=CorePlugin.getContext().getBreakpointNodes(process);
    if (!breakpointNodes.isEmpty()) {
      String[] nodeNames=new String[breakpointNodes.size()];
      int pos=0;
      String nodeName;
      for (      INode node : breakpointNodes) {
        nodeName=node.getUniqueName();
        if (node.getComponent().getMultipleComponentManagers().size() > 0) {
          nodeName+="String_Node_Str" + node.getComponent().getMultipleComponentManagers().get(0).getInput().getName();
        }
        nodeNames[pos++]="String_Node_Str" + nodeName + "String_Node_Str";
      }
      int[] lineNumbers=getLineNumbers(codeFile,nodeNames);
      setBreakpoints(codeFile,getTypeName(),lineNumbers);
    }
  }
 catch (  CoreException e1) {
    if (e1.getStatus() != null && e1.getStatus().getException() != null) {
      ExceptionHandler.process(e1.getStatus().getException());
    }
    throw new ProcessorException(Messages.getString("String_Node_Str"),e1);
  }
}

Fixed version (ground truth):
@Override public void generateCode(boolean statistics,boolean trace,boolean javaProperties) throws ProcessorException {
  super.generateCode(statistics,trace,javaProperties);
  try {
    String currentJavaProject=ProjectManager.getInstance().getProject(property).getTechnicalLabel();
    ICodeGenerator codeGen;
    ICodeGeneratorService service=RunProcessPlugin.getDefault().getCodeGeneratorService();
    if (javaProperties) {
      String javaInterpreter="String_Node_Str";
      String javaLib="String_Node_Str";
      String javaContext=getContextPath().toOSString();
      codeGen=service.createCodeGenerator(process,statistics,trace,javaInterpreter,javaLib,javaContext,currentJavaProject,exportAsOSGI);
    }
 else {
      codeGen=service.createCodeGenerator(process,statistics,trace);
    }
    if (!process.getContextManager().getDefaultContext().getName().equals(context.getName())) {
      boolean found=false;
      for (      IContext c : process.getContextManager().getListContext()) {
        if (c.getName().equals(context.getName())) {
          found=true;
        }
      }
      if (found) {
        codeGen.setContextName(context.getName());
      }
    }
    String processCode="String_Node_Str";
    try {
      processCode=codeGen.generateProcessCode();
      if (PluginChecker.isRulesPluginLoaded()) {
        IRulesProviderService rulesService=(IRulesProviderService)GlobalServiceRegister.getDefault().getService(IRulesProviderService.class);
        if (rulesService != null) {
          boolean useGenerateRuleFiles=false;
          List<? extends INode> allNodes=this.process.getGeneratingNodes();
          for (int i=0; i < allNodes.size(); i++) {
            if (allNodes.get(i) instanceof INode) {
              INode node=allNodes.get(i);
              if (rulesService.isRuleComponent(node) && !node.getElementParameter(EParameterName.PROPERTY_TYPE.getName()).getValue().toString().equals("String_Node_Str")) {
                useGenerateRuleFiles=true;
                break;
              }
            }
          }
          if (useGenerateRuleFiles && rulesService != null && currentJavaProject != null) {
            rulesService.generateFinalRuleFiles(currentJavaProject,this.process);
          }
        }
      }
    }
 catch (    SystemException e) {
      throw new ProcessorException(Messages.getString("String_Node_Str"),e);
    }
catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    IFile codeFile=this.project.getFile(this.codePath);
    final String toFormat=processCode;
    final Job job=new Job("String_Node_Str"){
      @Override protected IStatus run(      IProgressMonitor monitor){
        monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
        formatedCode=formatCode(toFormat);
        monitor.done();
        return Status.OK_STATUS;
      }
    }
;
    long time1=System.currentTimeMillis();
    job.setSystem(true);
    job.schedule();
    boolean f=true;
    while (f) {
      long time2=System.currentTimeMillis();
      if (time2 - time1 > 30000) {
        if (job.getResult() == null || !job.getResult().isOK()) {
          f=false;
          job.done(Status.OK_STATUS);
          job.cancel();
        }
 else {
          processCode=formatedCode;
          f=false;
        }
      }
 else {
        if (job.getState() != Job.RUNNING) {
          if (job.getResult() != null && job.getResult().isOK()) {
            processCode=formatedCode;
            f=false;
          }
        }
      }
    }
    formatedCode=null;
    processCode=computeMethodSizeIfNeeded(processCode);
    InputStream codeStream=new ByteArrayInputStream(processCode.getBytes());
    if (!codeFile.exists()) {
      deleteFileIfExisted(codeFile);
      codeFile.create(codeStream,true,null);
    }
 else {
      codeFile.setContents(codeStream,true,false,null);
    }
    processCode=null;
    codeFile.getProject().deleteMarkers("String_Node_Str",true,IResource.DEPTH_INFINITE);
    List<INode> breakpointNodes=CorePlugin.getContext().getBreakpointNodes(process);
    if (!breakpointNodes.isEmpty()) {
      String[] nodeNames=new String[breakpointNodes.size()];
      int pos=0;
      String nodeName;
      for (      INode node : breakpointNodes) {
        nodeName=node.getUniqueName();
        if (node.getComponent().getMultipleComponentManagers().size() > 0) {
          nodeName+="String_Node_Str" + node.getComponent().getMultipleComponentManagers().get(0).getInput().getName();
        }
        nodeNames[pos++]="String_Node_Str" + nodeName + "String_Node_Str";
      }
      int[] lineNumbers=getLineNumbers(codeFile,nodeNames);
      setBreakpoints(codeFile,getMainClass(),lineNumbers);
    }
  }
 catch (  CoreException e1) {
    if (e1.getStatus() != null && e1.getStatus().getException() != null) {
      ExceptionHandler.process(e1.getStatus().getException());
    }
    throw new ProcessorException(Messages.getString("String_Node_Str"),e1);
  }
}