Program: 90099
Project: 90099
Buggy source:
/** 
 * Creates the start scripts for all the applications. The application should only be started, if it is not running already. The script starts by finding all running processes of the application. If any processes are found, a new application should not be started. Otherwise start the application. The start_app.sh should have the following structure: - echo Starting linux application. - cd path - #!/bin/bash - PIDS = $(ps -wwfe | grep fullapp | grep -v grep | grep  path\settings_app.xml | awk "{print \\$2}") - if [ -n "$PIDS" ]; then -     echo Application already running. - else -     export CLASSPATH = cp:$CLASSPATH; -     JAVA - fi where: path = the path to the install directory. fullapp = the full name application with path. app = the name of the application. cp = the classpaths for the application. JAVA = the command to run the java application.
 * @param directory The directory for this machine (use global variable?).
 */
@Override protected void createApplicationStartScripts(File directory){
  ArgumentNotValid.checkNotNull(directory,"String_Node_Str");
  for (  Application app : applications) {
    File appStartScript=new File(directory,"String_Node_Str" + app.getIdentification() + scriptExtension);
    try {
      PrintWriter appPrint=new PrintWriter(appStartScript);
      try {
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str" + app.installPathLinux());
        appPrint.println("String_Node_Str" + app.getTotalName() + "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str" + osGetClassPath(app) + "String_Node_Str");
        appPrint.println("String_Node_Str" + app.getMachineParameters().writeJavaOptions() + "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getTotalName()+ "String_Node_Str"+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str");
        appPrint.println("String_Node_Str");
      }
  finally {
        appPrint.close();
      }
    }
 catch (    IOException e) {
      log.trace("String_Node_Str");
      throw new IOFailure("String_Node_Str" + "String_Node_Str" + e);
    }
catch (    Exception e) {
      log.trace("String_Node_Str" + e);
      System.out.println("String_Node_Str" + "String_Node_Str" + e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates the start scripts for all the applications. The application should only be started, if it is not running already. The script starts by finding all running processes of the application. If any processes are found, a new application should not be started. Otherwise start the application. The start_app.sh should have the following structure: - echo Starting linux application: app - cd path - #!/bin/bash - PIDS = $(ps -wwfe | grep fullapp | grep -v grep | grep  path\settings_app.xml | awk "{print \\$2}") - if [ -n "$PIDS" ]; then -     echo Application already running. - else -     export CLASSPATH = cp:$CLASSPATH; -     JAVA - fi where: path = the path to the install directory. fullapp = the full name application with java path. app = the name of the application. cp = the classpaths for the application. JAVA = the command to run the java application.
 * @param directory The directory for this machine (use global variable?).
 */
@Override protected void createApplicationStartScripts(File directory){
  ArgumentNotValid.checkNotNull(directory,"String_Node_Str");
  for (  Application app : applications) {
    File appStartScript=new File(directory,"String_Node_Str" + app.getIdentification() + scriptExtension);
    try {
      PrintWriter appPrint=new PrintWriter(appStartScript);
      try {
        appPrint.println("String_Node_Str" + app.getIdentification());
        appPrint.println("String_Node_Str" + app.installPathLinux());
        appPrint.println("String_Node_Str" + app.getTotalName() + "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str");
        appPrint.println("String_Node_Str" + osGetClassPath(app) + "String_Node_Str");
        appPrint.println("String_Node_Str" + app.getMachineParameters().writeJavaOptions() + "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ getConfDirPath()+ "String_Node_Str"+ app.getTotalName()+ "String_Node_Str"+ "String_Node_Str"+ app.getIdentification()+ "String_Node_Str"+ "String_Node_Str");
        appPrint.println("String_Node_Str");
      }
  finally {
        appPrint.close();
      }
    }
 catch (    IOException e) {
      log.trace("String_Node_Str");
      throw new IOFailure("String_Node_Str" + "String_Node_Str" + e);
    }
catch (    Exception e) {
      log.trace("String_Node_Str" + e);
      System.out.println("String_Node_Str" + "String_Node_Str" + e);
    }
  }
}