Program: 116164
Project: 116164
Buggy source:
/** 
 * Parses an individual Group
 * @param appId Application id
 * @param tenantId tenant id of tenant which deployed the Application
 * @param key Generated key for the Application
 * @param groupCtxt Group definition information
 * @param subscribableInfoCtxts Map [cartridge alias -> Group] with extracted Subscription Information
 * @param definedGroupCtxts Map [group alias -> Group] with extracted Group Information
 * @return  Group object
 * @throws ApplicationDefinitionException if unable to parse
 */
private Group parseGroup(String appId,int tenantId,String key,GroupContext groupCtxt,Map<String,SubscribableInfoContext> subscribableInfoCtxts,Map<String,GroupContext> definedGroupCtxts) throws ApplicationDefinitionException {
  GroupContext definedGroupDef=definedGroupCtxts.get(groupCtxt.getAlias());
  if (definedGroupDef == null) {
    handleError("String_Node_Str" + groupCtxt.getName() + "String_Node_Str"+ groupCtxt.getAlias()+ "String_Node_Str");
  }
  Group group=new Group(appId,groupCtxt.getName(),groupCtxt.getAlias());
  group.setGroupScalingEnabled(isGroupScalingEnabled(groupCtxt.getName()));
  group.setGroupMinInstances(groupCtxt.getGroupMinInstances());
  group.setGroupMaxInstances(groupCtxt.getGroupMaxInstances());
  group.setGroupScalingEnabled(groupCtxt.isGroupScalingEnabled());
  DependencyOrder dependencyOrder=new DependencyOrder();
  String[] startupOrders=getStartupOrderForGroup(groupCtxt);
  if (startupOrders != null) {
    dependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders,groupCtxt));
  }
  dependencyOrder.setTerminationBehaviour(getKillbehaviour(groupCtxt.getName()));
  group.setDependencyOrder(dependencyOrder);
  Map<String,ClusterDataHolder> clusterDataMap;
  if (groupCtxt.getCartridgeContexts() != null) {
    clusterDataMap=parseLeafLevelSubscriptions(appId,tenantId,key,groupCtxt.getName(),Arrays.asList(groupCtxt.getCartridgeContexts()));
    group.setClusterData(clusterDataMap);
  }
  if (groupCtxt.getGroupContexts() != null) {
    Map<String,Group> nestedGroups=new HashMap<String,Group>();
    for (    GroupContext subGroupCtxt : groupCtxt.getGroupContexts()) {
      subGroupCtxt=definedGroupCtxts.get(subGroupCtxt.getAlias());
      if (subGroupCtxt != null) {
        Group nestedGroup=parseGroup(appId,tenantId,key,subGroupCtxt,subscribableInfoCtxts,definedGroupCtxts);
        nestedGroups.put(nestedGroup.getAlias(),nestedGroup);
      }
    }
    group.setGroups(nestedGroups);
  }
  return group;
}

Fixed version (ground truth):
/** 
 * Parses an individual Group
 * @param appId Application id
 * @param tenantId tenant id of tenant which deployed the Application
 * @param key Generated key for the Application
 * @param groupCtxt Group definition information
 * @param subscribableInfoCtxts Map [cartridge alias -> Group] with extracted Subscription Information
 * @param definedGroupCtxts Map [group alias -> Group] with extracted Group Information
 * @return  Group object
 * @throws ApplicationDefinitionException if unable to parse
 */
private Group parseGroup(String appId,int tenantId,String key,GroupContext groupCtxt,Map<String,SubscribableInfoContext> subscribableInfoCtxts,Map<String,GroupContext> definedGroupCtxts,ServiceGroup serviceGroup) throws ApplicationDefinitionException {
  Group group=new Group(appId,groupCtxt.getName(),groupCtxt.getAlias());
  group.setGroupScalingEnabled(isGroupScalingEnabled(groupCtxt.getName(),serviceGroup));
  group.setGroupMinInstances(groupCtxt.getGroupMinInstances());
  group.setGroupMaxInstances(groupCtxt.getGroupMaxInstances());
  group.setGroupScalingEnabled(groupCtxt.isGroupScalingEnabled());
  DependencyOrder dependencyOrder=new DependencyOrder();
  String[] startupOrders=getStartupOrderForGroup(groupCtxt.getName(),serviceGroup);
  if (startupOrders != null) {
    dependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders,groupCtxt));
  }
  dependencyOrder.setTerminationBehaviour(getKillbehaviour(groupCtxt.getName(),serviceGroup));
  group.setDependencyOrder(dependencyOrder);
  Map<String,ClusterDataHolder> clusterDataMap;
  if (groupCtxt.getCartridgeContexts() != null) {
    clusterDataMap=parseLeafLevelSubscriptions(appId,tenantId,key,groupCtxt.getName(),Arrays.asList(groupCtxt.getCartridgeContexts()));
    group.setClusterData(clusterDataMap);
  }
  if (groupCtxt.getGroupContexts() != null) {
    Map<String,Group> nestedGroups=new HashMap<String,Group>();
    for (    GroupContext subGroupCtxt : groupCtxt.getGroupContexts()) {
      if (subGroupCtxt != null) {
        Group nestedGroup=parseGroup(appId,tenantId,key,subGroupCtxt,subscribableInfoCtxts,definedGroupCtxts,serviceGroup);
        nestedGroups.put(nestedGroup.getAlias(),nestedGroup);
      }
    }
    group.setGroups(nestedGroups);
  }
  return group;
}