Skip to content

Commit

Permalink
Do defensive copy of roles when creating Identity
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Oct 1, 2019
1 parent 2d53c7c commit 5de8fec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Identity(String user, Optional<Principal> principal, Map<String, Selected
{
this.user = requireNonNull(user, "user is null");
this.principal = requireNonNull(principal, "principal is null");
this.roles = unmodifiableMap(requireNonNull(roles, "roles is null"));
this.roles = unmodifiableMap(new HashMap<>(requireNonNull(roles, "roles is null")));
this.extraCredentials = unmodifiableMap(new HashMap<>(requireNonNull(extraCredentials, "extraCredentials is null")));
}

Expand Down

0 comments on commit 5de8fec

Please sign in to comment.