From 931f880cdb63d5a595c4732e911d499ea3aa2a24 Mon Sep 17 00:00:00 2001 From: D023954 Date: Wed, 18 Oct 2023 10:08:16 +0200 Subject: [PATCH] fix: possibly unnecessary method call --- .../uaa/scim/jdbc/JdbcScimGroupMembershipManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupMembershipManager.java b/server/src/main/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupMembershipManager.java index 63db5bdfa6d..32affc32d1a 100644 --- a/server/src/main/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupMembershipManager.java +++ b/server/src/main/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupMembershipManager.java @@ -118,10 +118,9 @@ private Set getDefaultUserGroups(String zoneId) { return emptySet(); } IdentityZone currentZone = IdentityZoneHolder.get(); - List zoneDefaultGroups = currentZone.getConfig().getUserConfig().getDefaultGroups(); - if (!zoneId.equals(currentZone.getId())) { - zoneDefaultGroups = zoneProvisioning.retrieve(zoneId).getConfig().getUserConfig().getDefaultGroups(); - } + List zoneDefaultGroups = (zoneId.equals(currentZone.getId())) ? + currentZone.getConfig().getUserConfig().getDefaultGroups() : + zoneProvisioning.retrieve(zoneId).getConfig().getUserConfig().getDefaultGroups(); return zoneDefaultGroups .stream() .map(groupName -> createOrGetGroup(groupName, zoneId))