Program: 116359
Project: 116359
Buggy source:
/** 
 * Builds the Application structure
 * @param appCtxt ApplicationContext object with Application information
 * @param definedGroupCtxts Map [cartridge alias -> Group] with extracted Group Information
 * @param subscribableInfoCtxts Map [cartridge alias -> Group] with extracted Subscription Information
 * @return Application Application object denoting the Application structure
 * @throws ApplicationDefinitionException If an error occurs in building the Application structure
 */
private Application buildCompositeAppStructure(ApplicationContext appCtxt,Map<String,GroupContext> definedGroupCtxts,Map<String,SubscribableInfoContext> subscribableInfoCtxts) throws ApplicationDefinitionException {
  Application application=new Application(appCtxt.getApplicationId());
  application.setTenantId(appCtxt.getTenantId());
  application.setTenantDomain(appCtxt.getTenantDomain());
  application.setTenantAdminUserName(appCtxt.getTeantAdminUsername());
  Map<String,ClusterDataHolder> clusterDataMap;
  if (appCtxt.getComponents() != null) {
    if (appCtxt.getComponents().getSubscribableContexts() != null) {
      clusterDataMap=parseLeafLevelSubscriptions(appCtxt.getApplicationId(),appCtxt.getTenantId(),application.getKey(),null,Arrays.asList(appCtxt.getComponents().getSubscribableContexts()),subscribableInfoCtxts);
      application.setClusterData(clusterDataMap);
    }
    if (appCtxt.getComponents().getGroupContexts() != null) {
      application.setGroups(parseGroups(appCtxt.getApplicationId(),appCtxt.getTenantId(),application.getKey(),Arrays.asList(appCtxt.getComponents().getGroupContexts()),subscribableInfoCtxts,definedGroupCtxts));
    }
    if (appCtxt.getComponents().getDependencyContext() != null) {
      DependencyOrder appDependencyOrder=new DependencyOrder();
      String[] startupOrders=appCtxt.getComponents().getDependencyContext().getStartupOrdersContexts();
      if (startupOrders != null) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + appCtxt.getAlias() + "String_Node_Str"+ startupOrders.length);
        }
        appDependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders));
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + appCtxt.getAlias());
        }
      }
      String terminationBehavior=appCtxt.getComponents().getDependencyContext().getTerminationBehaviour();
      validateTerminationBehavior(terminationBehavior);
      appDependencyOrder.setTerminationBehaviour(terminationBehavior);
      application.setDependencyOrder(appDependencyOrder);
    }
  }
  String alias;
  Properties properties=new Properties();
  for (  SubscribableInfoContext value : subscribableInfoCtxts.values()) {
    alias=value.getAlias();
    String username=value.getRepoUsername();
    String password=value.getRepoPassword();
    String repoUrl=value.getRepoUrl();
    if (StringUtils.isNotEmpty(username)) {
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(username);
      properties.addProperties(property);
    }
    if (StringUtils.isNotEmpty(password)) {
      String encryptedPassword=encryptPassword(password,application.getKey());
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(encryptedPassword);
      properties.addProperties(property);
    }
    if (StringUtils.isNotEmpty(repoUrl)) {
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(repoUrl);
      properties.addProperties(property);
    }
    this.addProperties(alias,properties);
  }
  log.info("String_Node_Str" + appCtxt.getApplicationId() + "String_Node_Str");
  return application;
}

Fixed version (ground truth):
/** 
 * Builds the Application structure
 * @param appCtxt ApplicationContext object with Application information
 * @param definedGroupCtxts Map [cartridge alias -> Group] with extracted Group Information
 * @param subscribableInfoCtxts Map [cartridge alias -> Group] with extracted Subscription Information
 * @return Application Application object denoting the Application structure
 * @throws ApplicationDefinitionException If an error occurs in building the Application structure
 */
private Application buildCompositeAppStructure(ApplicationContext appCtxt,Map<String,GroupContext> definedGroupCtxts,Map<String,SubscribableInfoContext> subscribableInfoCtxts) throws ApplicationDefinitionException {
  Application application=new Application(appCtxt.getApplicationId());
  application.setTenantId(appCtxt.getTenantId());
  application.setTenantDomain(appCtxt.getTenantDomain());
  application.setTenantAdminUserName(appCtxt.getTeantAdminUsername());
  Map<String,ClusterDataHolder> clusterDataMap;
  if (appCtxt.getComponents() != null) {
    if (appCtxt.getComponents().getSubscribableContexts() != null) {
      clusterDataMap=parseLeafLevelSubscriptions(appCtxt.getApplicationId(),appCtxt.getTenantId(),application.getKey(),null,Arrays.asList(appCtxt.getComponents().getSubscribableContexts()),subscribableInfoCtxts);
      application.setClusterData(clusterDataMap);
    }
    if (appCtxt.getComponents().getGroupContexts() != null) {
      application.setGroups(parseGroups(appCtxt.getApplicationId(),appCtxt.getTenantId(),application.getKey(),Arrays.asList(appCtxt.getComponents().getGroupContexts()),subscribableInfoCtxts,definedGroupCtxts));
    }
    if (appCtxt.getComponents().getDependencyContext() != null) {
      DependencyOrder appDependencyOrder=new DependencyOrder();
      String[] startupOrders=appCtxt.getComponents().getDependencyContext().getStartupOrdersContexts();
      if (startupOrders != null) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + appCtxt.getAlias() + "String_Node_Str"+ startupOrders.length);
        }
        appDependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders));
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + appCtxt.getAlias());
        }
      }
      String terminationBehavior=appCtxt.getComponents().getDependencyContext().getTerminationBehaviour();
      validateTerminationBehavior(terminationBehavior);
      appDependencyOrder.setTerminationBehaviour(terminationBehavior);
      application.setDependencyOrder(appDependencyOrder);
    }
  }
  String alias;
  Properties properties=new Properties();
  for (  SubscribableInfoContext value : subscribableInfoCtxts.values()) {
    alias=value.getAlias();
    String username=value.getRepoUsername();
    String password=value.getRepoPassword();
    String repoUrl=value.getRepoUrl();
    List<Property> propertyList=new ArrayList<Property>();
    if (StringUtils.isNotEmpty(username)) {
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(username);
      propertyList.add(property);
    }
    if (StringUtils.isNotEmpty(password)) {
      String encryptedPassword=encryptPassword(password,application.getKey());
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(encryptedPassword);
      propertyList.add(property);
    }
    if (StringUtils.isNotEmpty(repoUrl)) {
      Property property=new Property();
      property.setName("String_Node_Str");
      property.setValue(repoUrl);
      propertyList.add(property);
    }
    Property[] properties1=new Property[propertyList.size()];
    properties.setProperties(propertyList.toArray(properties1));
    this.addProperties(alias,properties);
  }
  log.info("String_Node_Str" + appCtxt.getApplicationId() + "String_Node_Str");
  return application;
}