/** * Determine if a {@link ScopeType} is an ancestor of another {@link ScopeType}. */ public static <S extends ScopeType<S>> boolean isScopeTypeAncestor(S scopeType, S possibleAncestor) { Queue<S> ancestors = new LinkedList<>(); ancestors.add(scopeType); while (true) { if (ancestors.isEmpty()) { return false; } if (ancestors.peek().equals(possibleAncestor)) { return true; } Collection<S> parentScopes = ancestors.poll().parentScopes(); if (parentScopes != null) { ancestors.addAll(parentScopes); } } }
Collection<S> parents = config.getScope().parentScopes(); if (parents != null && !parents.isEmpty()) { S parentScope = parents.iterator().next();
Collection<S> parentScopes = scope.parentScopes(); if (parentScopes != null) { try {
/** * Determine if a {@link ScopeType} is an ancestor of another {@link ScopeType}. */ public static <S extends ScopeType<S>> boolean isScopeTypeAncestor(S scopeType, S possibleAncestor) { Queue<S> ancestors = new LinkedList<>(); ancestors.add(scopeType); while (true) { if (ancestors.isEmpty()) { return false; } if (ancestors.peek().equals(possibleAncestor)) { return true; } Collection<S> parentScopes = ancestors.poll().parentScopes(); if (parentScopes != null) { ancestors.addAll(parentScopes); } } }
Collection<S> parents = config.getScope().parentScopes(); if (parents != null && !parents.isEmpty()) { S parentScope = parents.iterator().next();
Collection<S> parentScopes = scope.parentScopes(); if (parentScopes != null) { try {