Program: 58728
Project: 58728
Buggy source:
/** 
 * Method call update application on given tomcat webapp path
 * @param moduleRecorder Configuration record.
 * @throws InterruptedException 
 */
public String updateApp(boolean reset){
  try {
    AppSettings settings=AppSettings.get();
    String buildDirPath=checkParams("String_Node_Str",settings.get("String_Node_Str"),true);
    String webappPath=checkParams("String_Node_Str",settings.get("String_Node_Str"),true);
    File warDir=new File(buildDirPath + File.separator + "String_Node_Str","String_Node_Str");
    log.debug("String_Node_Str",warDir.getAbsolutePath());
    if (!warDir.exists()) {
      return I18n.get("String_Node_Str");
    }
    File webappDir=new File(webappPath);
    File warFile=null;
    for (    File file : warDir.listFiles()) {
      if (file.getName().endsWith("String_Node_Str")) {
        warFile=file;
        break;
      }
    }
    if (warFile == null) {
      return I18n.get("String_Node_Str");
    }
 else {
      String appName=warFile.getName();
      appName=appName.substring(0,appName.length() - 4);
      File appDir=new File(webappDir,appName);
      if (appDir.exists()) {
        FileUtils.deleteDirectory(appDir);
      }
      appDir.mkdir();
      log.debug("String_Node_Str",appDir.getAbsolutePath());
      log.debug("String_Node_Str",warFile.getAbsolutePath());
      JarHelper jarHelper=new JarHelper();
      jarHelper.unjarDir(warFile,appDir);
    }
  }
 catch (  ValidationException|IOException e) {
    e.printStackTrace();
    String msg=I18n.get("String_Node_Str");
    if (reset) {
      msg=I18n.get("String_Node_Str");
    }
    return msg + e.getMessage();
  }
  if (reset) {
    String msg=I18n.get("String_Node_Str");
    clearDatabase();
    return msg;
  }
  return I18n.get("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Method call update application on given tomcat webapp path
 * @param moduleRecorder Configuration record.
 * @throws AxelorException 
 * @throws InterruptedException 
 */
public String updateApp(boolean reset) throws AxelorException {
  try {
    AppSettings settings=AppSettings.get();
    String buildDirPath=checkParams("String_Node_Str",settings.get("String_Node_Str"),true);
    String tomcatHome=checkParams("String_Node_Str",settings.get("String_Node_Str"),true);
    File warDir=new File(buildDirPath + File.separator + "String_Node_Str","String_Node_Str");
    log.debug("String_Node_Str",warDir.getAbsolutePath());
    if (!warDir.exists()) {
      return I18n.get("String_Node_Str");
    }
    File webappDir=new File(tomcatHome,"String_Node_Str");
    File warFile=null;
    for (    File file : warDir.listFiles()) {
      if (file.getName().endsWith("String_Node_Str")) {
        warFile=file;
        break;
      }
    }
    if (warFile == null) {
      return I18n.get("String_Node_Str");
    }
 else {
      String appName=warFile.getName();
      appName=appName.substring(0,appName.length() - 4);
      File appDir=new File(webappDir,appName);
      if (appDir.exists()) {
        FileUtils.deleteDirectory(appDir);
      }
      appDir.mkdir();
      log.debug("String_Node_Str",appDir.getAbsolutePath());
      log.debug("String_Node_Str",warFile.getAbsolutePath());
      JarHelper jarHelper=new JarHelper();
      jarHelper.unjarDir(warFile,appDir);
    }
  }
 catch (  ValidationException|IOException e) {
    e.printStackTrace();
    String msg=I18n.get("String_Node_Str");
    if (reset) {
      msg=I18n.get("String_Node_Str");
    }
    return msg + e.getMessage();
  }
  if (reset) {
    String msg=I18n.get("String_Node_Str");
    resetApp();
    return msg;
  }
  return I18n.get("String_Node_Str");
}