Program: 29533
Project: 29533
Buggy source:
private void loadApplicationForTenants(Application app,ApplicationRef appRef,ActionReport report,Logger logger){
  if (app.getAppTenants() == null) {
    return;
  }
  for (  AppTenant tenant : app.getAppTenants().getAppTenant()) {
    DeployCommandParameters commandParams=app.getDeployParameters(appRef);
    commandParams.contextroot=tenant.getContextRoot();
    commandParams.target=server.getName();
    commandParams.name=DeploymentUtils.getInternalNameForTenant(app.getName(),tenant.getTenant());
    commandParams.enabled=Boolean.TRUE;
    commandParams.origin=DeployCommandParameters.Origin.load;
    ActionReport subReport=report.addSubActionsReport();
    ReadableArchive archive=null;
    try {
      URI uri=new URI(app.getLocation());
      File file=new File(uri);
      if (file.exists()) {
        archive=archiveFactoryProvider.get().openArchive(file);
        ExtendedDeploymentContext deploymentContext=deployment.getBuilder(logger,commandParams,subReport).source(archive).build();
        deploymentContext.getAppProps().putAll(app.getDeployProperties());
        deploymentContext.getAppProps().putAll(tenant.getDeployProperties());
        deploymentContext.setModulePropsMap(app.getModulePropertiesMap());
        deploymentContext.setTenant(tenant.getTenant(),app.getName());
        deployment.deploy(deployment.getSniffersFromApp(app),deploymentContext);
      }
 else {
        logger.log(Level.SEVERE,"String_Node_Str" + new Object[]{app.getLocation()});
      }
    }
 catch (    Throwable e) {
      subReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
      subReport.setMessage(e.getMessage());
      subReport.setFailureCause(e);
    }
 finally {
      try {
        if (archive != null) {
          archive.close();
        }
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void loadApplicationForTenants(Application app,ApplicationRef appRef,ActionReport report,Logger logger){
  if (app.getAppTenants() == null) {
    return;
  }
  for (  AppTenant tenant : app.getAppTenants().getAppTenant()) {
    DeployCommandParameters commandParams=app.getDeployParameters(appRef);
    commandParams.contextroot=tenant.getContextRoot();
    commandParams.target=server.getName();
    commandParams.name=DeploymentUtils.getInternalNameForTenant(app.getName(),tenant.getTenant());
    commandParams.enabled=Boolean.TRUE;
    commandParams.origin=DeployCommandParameters.Origin.load;
    ActionReport subReport=report.addSubActionsReport();
    ReadableArchive archive=null;
    try {
      URI uri=new URI(app.getLocation());
      File file=new File(uri);
      if (file.exists()) {
        archive=archiveFactoryProvider.get().openArchive(file);
        ExtendedDeploymentContext deploymentContext=deployment.getBuilder(logger,commandParams,subReport).source(archive).build();
        deploymentContext.getAppProps().putAll(app.getDeployProperties());
        deploymentContext.getAppProps().putAll(tenant.getDeployProperties());
        deploymentContext.setModulePropsMap(app.getModulePropertiesMap());
        deploymentContext.setTenant(tenant.getTenant(),app.getName());
        deployment.deploy(deployment.getSniffersFromApp(app),deploymentContext);
      }
 else {
        logger.log(Level.SEVERE,"String_Node_Str",new Object[]{app.getLocation()});
      }
    }
 catch (    Throwable e) {
      subReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
      subReport.setMessage(e.getMessage());
      subReport.setFailureCause(e);
    }
 finally {
      try {
        if (archive != null) {
          archive.close();
        }
      }
 catch (      IOException e) {
      }
    }
  }
}