Program: 177186
Project: 177186
Buggy source:
/** 
 * Invokes GWTCompile on the apps specified in the configuration file.
 */
protected void doGWTCompile() throws EnunciateException, IOException {
  if (this.gwtHome == null) {
    throw new EnunciateException("String_Node_Str");
  }
  File gwtHomeDir=new File(this.gwtHome);
  if (!gwtHomeDir.exists()) {
    throw new EnunciateException("String_Node_Str" + gwtHomeDir.getAbsolutePath() + "String_Node_Str");
  }
  File gwtUserJar=new File(gwtHomeDir,"String_Node_Str");
  if (!gwtUserJar.exists()) {
    warn("String_Node_Str",gwtUserJar.getAbsolutePath());
  }
  File linuxDevJar=new File(gwtHomeDir,"String_Node_Str");
  File gwtDevJar=linuxDevJar;
  if (!gwtDevJar.exists()) {
    File macDevJar=new File(gwtHomeDir,"String_Node_Str");
    gwtDevJar=macDevJar;
    if (!gwtDevJar.exists()) {
      File windowsDevJar=new File(gwtHomeDir,"String_Node_Str");
      gwtDevJar=windowsDevJar;
      if (!gwtDevJar.exists()) {
        throw new EnunciateException(String.format("String_Node_Str",linuxDevJar.getAbsolutePath(),macDevJar.getAbsolutePath(),windowsDevJar.getAbsolutePath()));
      }
    }
  }
  boolean windows=false;
  File javaBinDir=new File(System.getProperty("String_Node_Str"),"String_Node_Str");
  File javaExecutable=new File(javaBinDir,"String_Node_Str");
  if (!javaExecutable.exists()) {
    javaExecutable=new File(javaBinDir,"String_Node_Str");
    windows=true;
  }
  String javaCommand=javaExecutable.getAbsolutePath();
  if (!javaExecutable.exists()) {
    warn("String_Node_Str",javaBinDir.getAbsolutePath());
    javaCommand="String_Node_Str";
  }
  StringBuilder classpath=new StringBuilder(enunciate.getEnunciateClasspath());
  classpath.append(File.pathSeparatorChar).append(getClientSideGenerateDir().getAbsolutePath());
  classpath.append(File.pathSeparatorChar).append(gwtUserJar.getAbsolutePath());
  classpath.append(File.pathSeparatorChar).append(gwtDevJar.getAbsolutePath());
  List<String> jvmargs=getGwtCompileJVMArgs();
  String[] commandArray=new String[jvmargs.size() + 11];
  int argIndex=0;
  commandArray[argIndex++]=javaCommand;
  while (argIndex - 1 < jvmargs.size()) {
    String arg=jvmargs.get(argIndex - 1);
    commandArray[argIndex++]=arg;
  }
  commandArray[argIndex++]="String_Node_Str";
  int classpathArgIndex=argIndex;
  commandArray[argIndex++]=null;
  int compileClassIndex=argIndex;
  commandArray[argIndex++]=getGwtCompilerClass();
  commandArray[argIndex++]="String_Node_Str";
  commandArray[argIndex++]=getGwtGenDir().getAbsolutePath();
  commandArray[argIndex++]="String_Node_Str";
  int styleArgIndex=argIndex;
  commandArray[argIndex++]=null;
  commandArray[argIndex++]="String_Node_Str";
  int outArgIndex=argIndex;
  commandArray[argIndex++]=null;
  int moduleNameIndex=argIndex;
  commandArray[argIndex]=null;
  for (  GWTApp gwtApp : gwtApps) {
    String appName=gwtApp.getName();
    File appSource=enunciate.resolvePath(gwtApp.getSrcDir());
    String style=gwtApp.getJavascriptStyle().toString();
    File appDir=getAppGenerateDir(appName);
    String out=appDir.getAbsolutePath();
    commandArray[classpathArgIndex]=classpath.toString() + File.pathSeparatorChar + appSource.getAbsolutePath();
    commandArray[styleArgIndex]=style;
    commandArray[outArgIndex]=out;
    for (    GWTAppModule appModule : gwtApp.getModules()) {
      String moduleName=appModule.getName();
      String outputPath=appModule.getOutputPath();
      File moduleOutputDir=appDir;
      if ((outputPath != null) && (!"String_Node_Str".equals(outputPath.trim()))) {
        moduleOutputDir=new File(appDir,outputPath);
      }
      boolean upToDate=enunciate.isUpToDate(getClientSideGenerateDir(),moduleOutputDir) && enunciate.isUpToDate(appSource,moduleOutputDir);
      if (!upToDate) {
        commandArray[moduleNameIndex]=moduleName;
        info("String_Node_Str",moduleName);
        if (enunciate.isDebug()) {
          StringBuilder command=new StringBuilder();
          for (          String commandPiece : commandArray) {
            command.append(' ').append(commandPiece);
          }
          debug("String_Node_Str",moduleName,command);
        }
        ProcessBuilder processBuilder=new ProcessBuilder(commandArray);
        processBuilder.directory(getGenerateDir());
        processBuilder.redirectErrorStream(true);
        Process process=processBuilder.start();
        BufferedReader procReader=new BufferedReader(new InputStreamReader(process.getInputStream()));
        String line=procReader.readLine();
        while (line != null) {
          info(line);
          line=procReader.readLine();
        }
        int procCode;
        try {
          procCode=process.waitFor();
        }
 catch (        InterruptedException e1) {
          throw new EnunciateException("String_Node_Str");
        }
        if (procCode != 0) {
          throw new EnunciateException("String_Node_Str" + moduleName);
        }
        File moduleGenDir=new File(appDir,moduleName);
        if (!moduleOutputDir.equals(moduleGenDir)) {
          moduleOutputDir.mkdirs();
          enunciate.copyDir(moduleGenDir,moduleOutputDir);
          deleteDir(moduleGenDir);
        }
        StringBuilder shellCommand=new StringBuilder();
        StringBuilder noServerShellCommand=new StringBuilder();
        for (int i=0; i < commandArray.length; i++) {
          String commandArg=commandArray[i];
          if (i == compileClassIndex) {
            commandArg="String_Node_Str";
          }
 else           if (i == moduleNameIndex) {
            noServerShellCommand.append("String_Node_Str");
            shellCommand.append(windows ? "String_Node_Str" : "String_Node_Str").append(' ');
            noServerShellCommand.append(windows ? "String_Node_Str" : "String_Node_Str").append(' ');
            shellCommand.append(moduleName).append('/');
            if ((appName != null) && (appName.trim().length() > 0)) {
              noServerShellCommand.append(appName).append('/');
            }
            String shellPage=getModuleId(moduleName) + "String_Node_Str";
            if (appModule.getShellPage() != null) {
              shellPage=appModule.getShellPage();
            }
            shellCommand.append(shellPage);
            noServerShellCommand.append(shellPage);
            break;
          }
 else           if (commandArg.indexOf(' ') >= 0) {
            commandArg='"' + commandArg + '"';
          }
          shellCommand.append(commandArg).append(' ');
          noServerShellCommand.append(commandArg).append(' ');
        }
        File scriptFile=getShellScriptFile(appName,moduleName);
        FileWriter writer=new FileWriter(scriptFile);
        writer.write(shellCommand.toString());
        writer.flush();
        writer.close();
        File noServerScriptFile=new File(scriptFile.getParentFile(),scriptFile.getName() + "String_Node_Str");
        writer=new FileWriter(noServerScriptFile);
        writer.write(noServerShellCommand.toString());
        writer.flush();
        writer.close();
      }
 else {
        info("String_Node_Str",moduleName);
      }
      File shellFile=getShellScriptFile(appName,moduleName);
      if (shellFile.exists()) {
        StringBuilder scriptArtifactId=new StringBuilder();
        if ((appName != null) && (appName.trim().length() > 0)) {
          scriptArtifactId.append(appName).append('.');
        }
        scriptArtifactId.append(moduleName).append("String_Node_Str");
        getEnunciate().addArtifact(new FileArtifact(getName(),scriptArtifactId.toString(),shellFile));
        File noServerScriptFile=new File(shellFile.getParentFile(),shellFile.getName() + "String_Node_Str");
        getEnunciate().addArtifact(new FileArtifact(getName(),scriptArtifactId.append("String_Node_Str").toString(),noServerScriptFile));
      }
 else {
        info("String_Node_Str",shellFile);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes GWTCompile on the apps specified in the configuration file.
 */
protected void doGWTCompile() throws EnunciateException, IOException {
  if (this.gwtHome == null) {
    throw new EnunciateException("String_Node_Str");
  }
  File gwtHomeDir=new File(this.gwtHome);
  if (!gwtHomeDir.exists()) {
    throw new EnunciateException("String_Node_Str" + gwtHomeDir.getAbsolutePath() + "String_Node_Str");
  }
  File gwtUserJar=new File(gwtHomeDir,"String_Node_Str");
  if (!gwtUserJar.exists()) {
    warn("String_Node_Str",gwtUserJar.getAbsolutePath());
  }
  File linuxDevJar=new File(gwtHomeDir,"String_Node_Str");
  File gwtDevJar=linuxDevJar;
  if (!gwtDevJar.exists()) {
    File macDevJar=new File(gwtHomeDir,"String_Node_Str");
    gwtDevJar=macDevJar;
    if (!gwtDevJar.exists()) {
      File windowsDevJar=new File(gwtHomeDir,"String_Node_Str");
      gwtDevJar=windowsDevJar;
      if (!gwtDevJar.exists()) {
        throw new EnunciateException(String.format("String_Node_Str",linuxDevJar.getAbsolutePath(),macDevJar.getAbsolutePath(),windowsDevJar.getAbsolutePath()));
      }
    }
  }
  boolean windows=false;
  File javaBinDir=new File(System.getProperty("String_Node_Str"),"String_Node_Str");
  File javaExecutable=new File(javaBinDir,"String_Node_Str");
  if (!javaExecutable.exists()) {
    javaExecutable=new File(javaBinDir,"String_Node_Str");
    windows=true;
  }
  String javaCommand=javaExecutable.getAbsolutePath();
  if (!javaExecutable.exists()) {
    warn("String_Node_Str",javaBinDir.getAbsolutePath());
    javaCommand="String_Node_Str";
  }
  StringBuilder classpath=new StringBuilder(enunciate.getEnunciateClasspath());
  classpath.append(File.pathSeparatorChar).append(getClientSideGenerateDir().getAbsolutePath());
  classpath.append(File.pathSeparatorChar).append(gwtUserJar.getAbsolutePath());
  classpath.append(File.pathSeparatorChar).append(gwtDevJar.getAbsolutePath());
  List<String> jvmargs=getGwtCompileJVMArgs();
  String[] commandArray=new String[jvmargs.size() + 11];
  int argIndex=0;
  commandArray[argIndex++]=javaCommand;
  while (argIndex - 1 < jvmargs.size()) {
    String arg=jvmargs.get(argIndex - 1);
    commandArray[argIndex++]=arg;
  }
  commandArray[argIndex++]="String_Node_Str";
  int classpathArgIndex=argIndex;
  commandArray[argIndex++]=null;
  int compileClassIndex=argIndex;
  commandArray[argIndex++]=getGwtCompilerClass();
  commandArray[argIndex++]="String_Node_Str";
  commandArray[argIndex++]=getGwtGenDir().getAbsolutePath();
  commandArray[argIndex++]="String_Node_Str";
  int styleArgIndex=argIndex;
  commandArray[argIndex++]=null;
  commandArray[argIndex++]="String_Node_Str";
  int outArgIndex=argIndex;
  commandArray[argIndex++]=null;
  int moduleNameIndex=argIndex;
  commandArray[argIndex]=null;
  for (  GWTApp gwtApp : gwtApps) {
    String appName=gwtApp.getName();
    File appSource=enunciate.resolvePath(gwtApp.getSrcDir());
    String style=gwtApp.getJavascriptStyle().toString();
    File appDir=getAppGenerateDir(appName);
    String out=appDir.getAbsolutePath();
    commandArray[classpathArgIndex]=classpath.toString() + File.pathSeparatorChar + appSource.getAbsolutePath();
    commandArray[styleArgIndex]=style;
    commandArray[outArgIndex]=out;
    boolean upToDate=enunciate.isUpToDate(getClientSideGenerateDir(),appDir) && enunciate.isUpToDate(appSource,appDir);
    if (!upToDate) {
      for (      GWTAppModule appModule : gwtApp.getModules()) {
        String moduleName=appModule.getName();
        String outputPath=appModule.getOutputPath();
        File moduleOutputDir=appDir;
        if ((outputPath != null) && (!"String_Node_Str".equals(outputPath.trim()))) {
          moduleOutputDir=new File(appDir,outputPath);
        }
        commandArray[moduleNameIndex]=moduleName;
        info("String_Node_Str",moduleName);
        if (enunciate.isDebug()) {
          StringBuilder command=new StringBuilder();
          for (          String commandPiece : commandArray) {
            command.append(' ').append(commandPiece);
          }
          debug("String_Node_Str",moduleName,command);
        }
        ProcessBuilder processBuilder=new ProcessBuilder(commandArray);
        processBuilder.directory(getGenerateDir());
        processBuilder.redirectErrorStream(true);
        Process process=processBuilder.start();
        BufferedReader procReader=new BufferedReader(new InputStreamReader(process.getInputStream()));
        String line=procReader.readLine();
        while (line != null) {
          info(line);
          line=procReader.readLine();
        }
        int procCode;
        try {
          procCode=process.waitFor();
        }
 catch (        InterruptedException e1) {
          throw new EnunciateException("String_Node_Str");
        }
        if (procCode != 0) {
          throw new EnunciateException("String_Node_Str" + moduleName);
        }
        File moduleGenDir=new File(appDir,moduleName);
        if (!moduleOutputDir.equals(moduleGenDir)) {
          moduleOutputDir.mkdirs();
          enunciate.copyDir(moduleGenDir,moduleOutputDir);
          deleteDir(moduleGenDir);
        }
        StringBuilder shellCommand=new StringBuilder();
        StringBuilder noServerShellCommand=new StringBuilder();
        for (int i=0; i < commandArray.length; i++) {
          String commandArg=commandArray[i];
          if (i == compileClassIndex) {
            commandArg="String_Node_Str";
          }
 else           if (i == moduleNameIndex) {
            noServerShellCommand.append("String_Node_Str");
            shellCommand.append(windows ? "String_Node_Str" : "String_Node_Str").append(' ');
            noServerShellCommand.append(windows ? "String_Node_Str" : "String_Node_Str").append(' ');
            shellCommand.append(moduleName).append('/');
            if ((appName != null) && (appName.trim().length() > 0)) {
              noServerShellCommand.append(appName).append('/');
            }
            String shellPage=getModuleId(moduleName) + "String_Node_Str";
            if (appModule.getShellPage() != null) {
              shellPage=appModule.getShellPage();
            }
            shellCommand.append(shellPage);
            noServerShellCommand.append(shellPage);
            break;
          }
 else           if (commandArg.indexOf(' ') >= 0) {
            commandArg='"' + commandArg + '"';
          }
          shellCommand.append(commandArg).append(' ');
          noServerShellCommand.append(commandArg).append(' ');
        }
        File scriptFile=getShellScriptFile(appName,moduleName);
        FileWriter writer=new FileWriter(scriptFile);
        writer.write(shellCommand.toString());
        writer.flush();
        writer.close();
        File noServerScriptFile=new File(scriptFile.getParentFile(),scriptFile.getName() + "String_Node_Str");
        writer=new FileWriter(noServerScriptFile);
        writer.write(noServerShellCommand.toString());
        writer.flush();
        writer.close();
        File shellFile=getShellScriptFile(appName,moduleName);
        if (shellFile.exists()) {
          StringBuilder scriptArtifactId=new StringBuilder();
          if ((appName != null) && (appName.trim().length() > 0)) {
            scriptArtifactId.append(appName).append('.');
          }
          scriptArtifactId.append(moduleName).append("String_Node_Str");
          getEnunciate().addArtifact(new FileArtifact(getName(),scriptArtifactId.toString(),shellFile));
          getEnunciate().addArtifact(new FileArtifact(getName(),scriptArtifactId.append("String_Node_Str").toString(),noServerScriptFile));
        }
 else {
          info("String_Node_Str",shellFile);
        }
      }
    }
 else {
      info("String_Node_Str",appName);
    }
  }
}