From 30095c874fd659d91e0f94eadd9c4c8547c1add4 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Mon, 7 Aug 2023 16:10:51 -0400 Subject: [PATCH] Remove synchronized Signed-off-by: Craig Perkins --- src/main/java/org/opensearch/security/user/User.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/security/user/User.java b/src/main/java/org/opensearch/security/user/User.java index 05753903df..2642b368d7 100644 --- a/src/main/java/org/opensearch/security/user/User.java +++ b/src/main/java/org/opensearch/security/user/User.java @@ -272,13 +272,13 @@ public synchronized final Map getCustomAttributesMap() { return attributes; } - public synchronized final void addSecurityRoles(final Collection securityRoles) { + public final void addSecurityRoles(final Collection securityRoles) { if (securityRoles != null && this.securityRoles != null) { this.securityRoles.addAll(securityRoles); } } - public synchronized final Set getSecurityRoles() { + public final Set getSecurityRoles() { return this.securityRoles == null ? Collections.synchronizedSet(Collections.emptySet()) : Collections.unmodifiableSet(this.securityRoles);