method overload to avoid passing a new object: validateGroupDuplicationInGroupDefinition
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4194168c Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4194168c Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4194168c Branch: refs/heads/master Commit: 4194168c8c398c40c5aaf64f2441b61e61ab6ca2 Parents: 1bea6c8 Author: Vishanth <[email protected]> Authored: Mon May 11 10:46:56 2015 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Mon May 11 12:19:59 2015 +0530 ---------------------------------------------------------------------- .../rest/endpoint/api/StratosApiV41Utils.java | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/4194168c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java index 2081713..6fb0dac 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java @@ -994,7 +994,7 @@ public class StratosApiV41Utils { //validate the group definition to check if groups duplicate in any groups and //validate the group definition to check for cyclic group behaviour - validateGroupDuplicationInGroupDefinition(serviceGroupDefinition, new ArrayList<String>()); + validateGroupDuplicationInGroupDefinition(serviceGroupDefinition); CloudControllerServiceClient ccServiceClient = getCloudControllerServiceClient(); @@ -3279,13 +3279,25 @@ public class StratosApiV41Utils { } } + /** - * This method is to validate the group duplication in the group definition recursively for group within groups + * This is a wrapper method to invoke validateGroupDuplicationInGroupDefinition with a new arraylist of string * - * @param groupBean - cartridge group definition - * @param parentGroups - list of string which holds the parent group names (all parents in the hierarchy) - * @throws InvalidCartridgeGroupDefinitionException - throws when the group definition is invalid + * @param groupBean - cartridge group definition + * @throws InvalidCartridgeGroupDefinitionException */ + private static void validateGroupDuplicationInGroupDefinition(GroupBean groupBean) + throws InvalidCartridgeGroupDefinitionException { + validateGroupDuplicationInGroupDefinition(groupBean, new ArrayList<String>()); + } + + /** + * This is to validate the group duplication in the group definition recursively for group within groups + * + * @param groupBean - cartridge group definition + * @param parentGroups - list of string which holds the parent group names (all parents in the hierarchy) + * @throws InvalidCartridgeGroupDefinitionException - throws when the group definition is invalid + */ private static void validateGroupDuplicationInGroupDefinition(GroupBean groupBean, List<String> parentGroups) throws InvalidCartridgeGroupDefinitionException { if (groupBean == null) {
