[java-identity-provider] branch master updated: Allow internal addition to unmodifiable list.
Scott Cantor
cantor.2 at osu.edu
Mon Oct 28 15:53:39 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=9213e07835c64a64bd94494e24141d0c18558663
The following commit(s) were added to refs/heads/master by this push:
new 9213e07 Allow internal addition to unmodifiable list.
9213e07 is described below
commit 9213e07835c64a64bd94494e24141d0c18558663
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Oct 28 15:53:34 2019 -0400
Allow internal addition to unmodifiable list.
---
.../idp/authn/impl/DefaultAuthenticationResultSerializer.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
index 138c74f..00b9b9f 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializer.java
@@ -22,7 +22,7 @@ import java.io.StringReader;
import java.io.StringWriter;
import java.security.Principal;
import java.time.Instant;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -145,9 +145,11 @@ public class DefaultAuthenticationResultSerializer extends AbstractInitializable
if (principalSerializers.isEmpty()) {
final PrincipalSerializer<String> ups = new UsernamePrincipalSerializer();
ups.initialize();
- principalSerializers = Arrays.asList(ups, authnResultPrincipalSerializer);
+ principalSerializers = List.of(ups, authnResultPrincipalSerializer);
} else {
- principalSerializers.add(authnResultPrincipalSerializer);
+ final List<PrincipalSerializer<String>> copy = new ArrayList<>(principalSerializers);
+ copy.add(authnResultPrincipalSerializer);
+ principalSerializers = List.copyOf(copy);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list