Skip to content

Commit a805843

Browse files
committed
Change to use copyof in getSecurityRoles in AuthCredentials class
Signed-off-by: Ryan Liang <jiallian@amazon.com>
1 parent 308f269 commit a805843

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/opensearch/security/user/AuthCredentials.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public Set<String> getBackendRoles() {
222222
* @return Defensive copy of the security roles this user is member of.
223223
*/
224224
public Set<String> getSecurityRoles() {
225-
return new HashSet<String>(securityRoles);
225+
return Set.copyOf(securityRoles);
226226
}
227227

228228
public boolean isComplete() {

0 commit comments

Comments
 (0)