[java-opensaml] branch master updated: OSJ-170 - Relax argument constraint.
Scott Cantor
cantor.2 at osu.edu
Thu Aug 3 11:31:36 EDT 2017
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=d32eaeba746572b70717d9fbf7e2ddd9665fd76e
The following commit(s) were added to refs/heads/master by this push:
new d32eaeb OSJ-170 - Relax argument constraint.
d32eaeb is described below
commit d32eaeba746572b70717d9fbf7e2ddd9665fd76e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Aug 3 11:31:34 2017 -0400
OSJ-170 - Relax argument constraint.
---
.../profile/logic/EntityGroupNamePredicate.java | 31 +++++++++++-----------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java
index 7eb95fc..9b86f3e 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityGroupNamePredicate.java
@@ -69,15 +69,7 @@ public class EntityGroupNamePredicate implements Predicate<EntityDescriptor> {
* @param names the group names to test for
*/
public EntityGroupNamePredicate(@Nonnull @NonnullElements final Collection<String> names) {
-
- Constraint.isNotNull(names, "Group name collection cannot be null");
- groupNames = new HashSet<>(names.size());
- for (final String name : names) {
- final String trimmed = StringSupport.trimOrNull(name);
- if (trimmed != null) {
- groupNames.add(trimmed);
- }
- }
+ this(names, null);
}
/**
@@ -89,14 +81,23 @@ public class EntityGroupNamePredicate implements Predicate<EntityDescriptor> {
* @since 3.4.0
*/
public EntityGroupNamePredicate(@Nonnull @NonnullElements final Collection<String> names,
- @Nonnull final MetadataResolver resolver) {
- this(names);
+ @Nullable final MetadataResolver resolver) {
- metadataResolver = Constraint.isNotNull(resolver, "MetadataResolver cannot be null");
+ Constraint.isNotNull(names, "Group name collection cannot be null");
+ groupNames = new HashSet<>(names.size());
+ for (final String name : names) {
+ final String trimmed = StringSupport.trimOrNull(name);
+ if (trimmed != null) {
+ groupNames.add(trimmed);
+ }
+ }
- criteriaSets = new ArrayList<>(groupNames.size());
- for (final String name : groupNames) {
- criteriaSets.add(new CriteriaSet(new EntityIdCriterion(name)));
+ metadataResolver = resolver;
+ if (resolver != null) {
+ criteriaSets = new ArrayList<>(groupNames.size());
+ for (final String name : groupNames) {
+ criteriaSets.add(new CriteriaSet(new EntityIdCriterion(name)));
+ }
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list