Program: 10876
Project: 10876
Buggy source:
/** 
 * Throws CoreException if an error occurred while launching the external application.
 * @param monitor
 */
public void run(IProgressMonitor monitor) throws CoreException {
  File scriptFile=null;
  String appOptions=serviceCommand.getOptions() != null ? serviceCommand.getOptions().getOptions() : null;
  CommandTerminal terminalCommand=serviceCommand.getCommandTerminal();
  final List<String> processArguments=new ArrayList<String>();
  try {
    if (terminalCommand != null) {
      String terminalCommandValue=terminalCommand.getTerminal();
      List<String> terminalElements=parseElement(terminalCommandValue);
      processArguments.addAll(terminalElements);
      if (Platform.OS_MACOSX.equals(PlatformUtil.getOS())) {
        StringWriter optionsWr=new StringWriter();
        optionsWr.append(serviceCommand.getExternalApplication().getExecutableNameAndPath());
        if (appOptions != null) {
          optionsWr.append(' ');
          optionsWr.append(appOptions);
        }
        scriptFile=getScriptFile(optionsWr.toString());
      }
 else       if (Platform.OS_WIN32.equals(PlatformUtil.getOS())) {
        StringBuffer windowsArgument=new StringBuffer();
        windowsArgument.append(' ');
        windowsArgument.append('"');
        windowsArgument.append(serviceCommand.getExternalApplication().getExecutableNameAndPath());
        windowsArgument.append('"');
        if (appOptions != null) {
          windowsArgument.append(' ');
          windowsArgument.append(appOptions);
        }
        processArguments.add(windowsArgument.toString());
      }
 else {
        String processArg=serviceCommand.getExternalApplication().getExecutableNameAndPath();
        if (appOptions != null) {
          processArg+="String_Node_Str" + appOptions;
        }
        processArguments.add(processArg);
      }
    }
 else {
      processArguments.add(serviceCommand.getExternalApplication().getExecutableNameAndPath());
      if (appOptions != null) {
        List<String> optionElements=parseElement(appOptions);
        processArguments.addAll(optionElements);
      }
    }
    if (!processArguments.isEmpty()) {
      new ProcessLauncher(){
        protected String getLaunchName(){
          return serviceCommand.getDisplayName();
        }
        protected List<String> getCommandArguments() throws CoreException {
          return processArguments;
        }
      }
.run();
    }
 else {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus("String_Node_Str" + getLaunchName()));
    }
  }
  finally {
    if (scriptFile != null && scriptFile.exists()) {
      scriptFile.deleteOnExit();
    }
  }
}

Fixed version (ground truth):
/** 
 * Throws CoreException if an error occurred while launching the external application.
 * @param monitor
 */
public void run(IProgressMonitor monitor) throws CoreException {
  File scriptFile=null;
  String appOptions=serviceCommand.getOptions() != null ? serviceCommand.getOptions().getOptions() : null;
  CommandTerminal terminalCommand=serviceCommand.getCommandTerminal();
  final List<String> processArguments=new ArrayList<String>();
  try {
    if (terminalCommand != null) {
      String terminalCommandValue=terminalCommand.getTerminal();
      List<String> terminalElements=parseElement(terminalCommandValue);
      processArguments.addAll(terminalElements);
      if (Platform.OS_MACOSX.equals(PlatformUtil.getOS())) {
        StringWriter optionsWr=new StringWriter();
        optionsWr.append(serviceCommand.getExternalApplication().getExecutableNameAndPath());
        if (appOptions != null) {
          optionsWr.append(' ');
          optionsWr.append(appOptions);
        }
        scriptFile=getScriptFile(optionsWr.toString());
        processArguments.add(scriptFile.getAbsolutePath());
      }
 else       if (Platform.OS_WIN32.equals(PlatformUtil.getOS())) {
        StringBuffer windowsArgument=new StringBuffer();
        windowsArgument.append(' ');
        windowsArgument.append('"');
        windowsArgument.append(serviceCommand.getExternalApplication().getExecutableNameAndPath());
        windowsArgument.append('"');
        if (appOptions != null) {
          windowsArgument.append(' ');
          windowsArgument.append(appOptions);
        }
        processArguments.add(windowsArgument.toString());
      }
 else {
        String processArg=serviceCommand.getExternalApplication().getExecutableNameAndPath();
        if (appOptions != null) {
          processArg+="String_Node_Str" + appOptions;
        }
        processArguments.add(processArg);
      }
    }
 else {
      processArguments.add(serviceCommand.getExternalApplication().getExecutableNameAndPath());
      if (appOptions != null) {
        List<String> optionElements=parseElement(appOptions);
        processArguments.addAll(optionElements);
      }
    }
    if (!processArguments.isEmpty()) {
      new ProcessLauncher(){
        protected String getLaunchName(){
          return serviceCommand.getDisplayName();
        }
        protected List<String> getCommandArguments() throws CoreException {
          return processArguments;
        }
      }
.run();
    }
 else {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus("String_Node_Str" + getLaunchName()));
    }
  }
  finally {
    if (scriptFile != null && scriptFile.exists()) {
      scriptFile.deleteOnExit();
    }
  }
}