Program: 93020
Project: 93020
Buggy source:
private void finishLaunch(ILaunch launch,ILaunchConfiguration config,String command,IProgressMonitor monitor,boolean retry){
  String errorMessage="String_Node_Str";
  try {
    File workDir=getWorkingDirectory(config);
    if (workDir == null) {
      workDir=new File(System.getProperty("String_Node_Str","String_Node_Str"));
    }
    SystemTapCommandGenerator cmdGenerator=new SystemTapCommandGenerator();
    cmd=cmdGenerator.generateCommand(scriptPath,binaryPath,command,needsBinary,needsArguments,arguments,binaryArguments);
    String tmp[]=cmd.split("String_Node_Str");
    ArrayList<String> cmdLine=new ArrayList<String>();
    for (    String str : tmp) {
      cmdLine.add(str);
    }
    String[] commandArray=(String[])cmdLine.toArray(new String[cmdLine.size()]);
    if (monitor.isCanceled()) {
      return;
    }
    monitor.worked(1);
    if (launch == null) {
      return;
    }
    setDefaultSourceLocator(launch,config);
    String parserClass=config.getAttribute(LaunchConfigurationConstants.PARSER_CLASS,LaunchConfigurationConstants.DEFAULT_PARSER_CLASS);
    IExtensionRegistry reg=Platform.getExtensionRegistry();
    IConfigurationElement[] extensions=reg.getConfigurationElementsFor(PluginConstants.PARSER_RESOURCE,PluginConstants.PARSER_NAME,parserClass);
    if (extensions == null || extensions.length < 1) {
      SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str") + parserClass);
      mess.schedule();
      return;
    }
    IConfigurationElement element=extensions[0];
    SystemTapParser parser=(SystemTapParser)element.createExecutableExtension(PluginConstants.ATTR_CLASS);
    parser.setViewID(config.getAttribute(LaunchConfigurationConstants.VIEW_CLASS,LaunchConfigurationConstants.VIEW_CLASS));
    parser.setFilePath(outputPath);
    parser.setMonitor(SubMonitor.convert(monitor));
    parser.setDone(false);
    if (element.getAttribute(PluginConstants.ATTR_REALTIME).equals(PluginConstants.VAL_TRUE)) {
      parser.setRealTime(true);
      parser.schedule();
    }
    monitor.worked(1);
    Process subProcess=execute(commandArray,getEnvironment(config),workDir,true);
    System.out.println(cmd);
    if (subProcess == null) {
      SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      mess.schedule();
      return;
    }
    IProcess process=createNewProcess(launch,subProcess,commandArray[0]);
    process.setAttribute(IProcess.ATTR_CMDLINE,cmd);
    monitor.worked(1);
    ((TextConsole)Helper.getConsoleByName(config.getName())).activate();
    StreamListener s=new StreamListener();
    process.getStreamsProxy().getErrorStreamMonitor().addListener(s);
    while (!process.isTerminated()) {
      Thread.sleep(100);
      if (monitor.isCanceled() || process.isTerminated()) {
        if (parser != null) {
          parser.cancelJob();
        }
        Runtime run=Runtime.getRuntime();
        run.exec("String_Node_Str");
        process.terminate();
        return;
      }
    }
    Thread.sleep(100);
    s.close();
    if (process.getExitValue() != 0) {
      IDocument doc=Helper.getConsoleDocumentByName(config.getName());
      if (doc.get().length() < 1)       Thread.sleep(300);
      SystemTapErrorHandler errorHandler=new SystemTapErrorHandler();
      errorHandler.handle(monitor,config.getName() + Messages.getString("String_Node_Str") + PluginConstants.NEW_LINE+ cmd+ PluginConstants.NEW_LINE+ PluginConstants.NEW_LINE);
      errorMessage=errorHandler.handle(monitor,new FileReader(TEMP_ERROR_OUTPUT));
      if (monitor != null && monitor.isCanceled()) {
        if (parser != null) {
          parser.cancelJob();
        }
        return;
      }
      if (errorHandler.hasMismatchedProbePoints() && retry) {
        SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str")+ Messages.getString("String_Node_Str"));
        mess.schedule();
        errorHandler.finishHandling(monitor,s.getNumberOfErrors());
        if (monitor != null && monitor.isCanceled()) {
          if (parser != null) {
            parser.cancelJob();
          }
          return;
        }
        finishLaunch(launch,config,command,monitor,false);
        return;
      }
      errorHandler.finishHandling(monitor,s.getNumberOfErrors());
      return;
    }
    if (!element.getAttribute(PluginConstants.ATTR_REALTIME).equals(PluginConstants.VAL_TRUE)) {
      parser.schedule();
    }
 else {
      if (parser != null)       parser.setDone(true);
    }
    monitor.worked(1);
    errorMessage=generateErrorMessage(config.getName(),command) + errorMessage;
    DocWriter dw=new DocWriter(Messages.getString("String_Node_Str"),((TextConsole)Helper.getConsoleByName(config.getName())),errorMessage);
    dw.schedule();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  CoreException e) {
    e.printStackTrace();
  }
 finally {
    monitor.done();
  }
}

Fixed version (ground truth):
private void finishLaunch(ILaunch launch,ILaunchConfiguration config,String command,IProgressMonitor monitor,boolean retry){
  String errorMessage="String_Node_Str";
  try {
    File workDir=getWorkingDirectory(config);
    if (workDir == null) {
      workDir=new File(System.getProperty("String_Node_Str","String_Node_Str"));
    }
    SystemTapCommandGenerator cmdGenerator=new SystemTapCommandGenerator();
    cmd=cmdGenerator.generateCommand(scriptPath,binaryPath,command,needsBinary,needsArguments,arguments,binaryArguments);
    String tmp[]=cmd.split("String_Node_Str");
    ArrayList<String> cmdLine=new ArrayList<String>();
    for (    String str : tmp) {
      cmdLine.add(str);
    }
    String[] commandArray=(String[])cmdLine.toArray(new String[cmdLine.size()]);
    if (monitor.isCanceled()) {
      return;
    }
    monitor.worked(1);
    if (launch == null) {
      return;
    }
    setDefaultSourceLocator(launch,config);
    String parserClass=config.getAttribute(LaunchConfigurationConstants.PARSER_CLASS,LaunchConfigurationConstants.DEFAULT_PARSER_CLASS);
    IExtensionRegistry reg=Platform.getExtensionRegistry();
    IConfigurationElement[] extensions=reg.getConfigurationElementsFor(PluginConstants.PARSER_RESOURCE,PluginConstants.PARSER_NAME,parserClass);
    if (extensions == null || extensions.length < 1) {
      SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str") + parserClass);
      mess.schedule();
      return;
    }
    IConfigurationElement element=extensions[0];
    SystemTapParser parser=(SystemTapParser)element.createExecutableExtension(PluginConstants.ATTR_CLASS);
    parser.setViewID(config.getAttribute(LaunchConfigurationConstants.VIEW_CLASS,LaunchConfigurationConstants.VIEW_CLASS));
    parser.setFilePath(outputPath);
    parser.setMonitor(SubMonitor.convert(monitor));
    parser.setDone(false);
    if (element.getAttribute(PluginConstants.ATTR_REALTIME).equals(PluginConstants.VAL_TRUE)) {
      parser.setRealTime(true);
      parser.schedule();
    }
    monitor.worked(1);
    Process subProcess=execute(commandArray,getEnvironment(config),workDir,true);
    System.out.println(cmd);
    if (subProcess == null) {
      SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      mess.schedule();
      return;
    }
    IProcess process=createNewProcess(launch,subProcess,commandArray[0]);
    process.setAttribute(IProcess.ATTR_CMDLINE,cmd);
    monitor.worked(1);
    ((TextConsole)Helper.getConsoleByName(config.getName())).activate();
    StreamListener s=new StreamListener();
    process.getStreamsProxy().getErrorStreamMonitor().addListener(s);
    while (!process.isTerminated()) {
      Thread.sleep(100);
      if (monitor.isCanceled()) {
        if (parser != null) {
          parser.cancelJob();
        }
        Runtime run=Runtime.getRuntime();
        run.exec("String_Node_Str");
        process.terminate();
        return;
      }
    }
    Thread.sleep(100);
    s.close();
    if (process.getExitValue() != 0) {
      IDocument doc=Helper.getConsoleDocumentByName(config.getName());
      if (doc.get().length() < 1)       Thread.sleep(300);
      SystemTapErrorHandler errorHandler=new SystemTapErrorHandler();
      errorHandler.handle(monitor,config.getName() + Messages.getString("String_Node_Str") + PluginConstants.NEW_LINE+ cmd+ PluginConstants.NEW_LINE+ PluginConstants.NEW_LINE);
      errorMessage=errorHandler.handle(monitor,new FileReader(TEMP_ERROR_OUTPUT));
      if (monitor != null && monitor.isCanceled()) {
        if (parser != null) {
          parser.cancelJob();
        }
        return;
      }
      if (errorHandler.hasMismatchedProbePoints() && retry) {
        SystemTapUIErrorMessages mess=new SystemTapUIErrorMessages(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str")+ Messages.getString("String_Node_Str"));
        mess.schedule();
        errorHandler.finishHandling(monitor,s.getNumberOfErrors());
        if (monitor != null && monitor.isCanceled()) {
          if (parser != null) {
            parser.cancelJob();
          }
          return;
        }
        finishLaunch(launch,config,command,monitor,false);
        return;
      }
      errorHandler.finishHandling(monitor,s.getNumberOfErrors());
      return;
    }
    if (!element.getAttribute(PluginConstants.ATTR_REALTIME).equals(PluginConstants.VAL_TRUE)) {
      parser.schedule();
    }
 else {
      if (parser != null)       parser.setDone(true);
    }
    monitor.worked(1);
    errorMessage=generateErrorMessage(config.getName(),command) + errorMessage;
    DocWriter dw=new DocWriter(Messages.getString("String_Node_Str"),((TextConsole)Helper.getConsoleByName(config.getName())),errorMessage);
    dw.schedule();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  CoreException e) {
    e.printStackTrace();
  }
 finally {
    monitor.done();
  }
}