Skip to content

Commit

Permalink
Remove synchronized
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Aug 7, 2023
1 parent c604f93 commit 30095c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/opensearch/security/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ public synchronized final Map<String, String> getCustomAttributesMap() {
return attributes;
}

public synchronized final void addSecurityRoles(final Collection<String> securityRoles) {
public final void addSecurityRoles(final Collection<String> securityRoles) {
if (securityRoles != null && this.securityRoles != null) {
this.securityRoles.addAll(securityRoles);
}
}

public synchronized final Set<String> getSecurityRoles() {
public final Set<String> getSecurityRoles() {
return this.securityRoles == null
? Collections.synchronizedSet(Collections.emptySet())
: Collections.unmodifiableSet(this.securityRoles);
Expand Down

0 comments on commit 30095c8

Please sign in to comment.