From 04f011b5bfa3c15b0d4ba84b7003c0b83f6fe72c Mon Sep 17 00:00:00 2001 From: Brendan Le Ny Date: Mon, 17 Jun 2024 14:38:42 +0200 Subject: [PATCH] Remove pointless if --- .../java/sh/libre/scim/core/GroupAdapter.java | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/main/java/sh/libre/scim/core/GroupAdapter.java b/src/main/java/sh/libre/scim/core/GroupAdapter.java index 375b6434ef..b87bf30b68 100644 --- a/src/main/java/sh/libre/scim/core/GroupAdapter.java +++ b/src/main/java/sh/libre/scim/core/GroupAdapter.java @@ -81,22 +81,20 @@ public class GroupAdapter extends Adapter { group.setId(externalId); group.setExternalId(id); group.setDisplayName(displayName); - if (!members.isEmpty()) { - for (String member : members) { - Member groupMember = new Member(); - try { - ScimResource userMapping = this.query("findById", member, "User").getSingleResult(); - logger.debug(userMapping.getExternalId()); - logger.debug(userMapping.getId()); - groupMember.setValue(userMapping.getExternalId()); - URI ref = new URI(String.format("Users/%s", userMapping.getExternalId())); - groupMember.setRef(ref.toString()); - group.addMember(groupMember); - } catch (NoResultException e) { - logger.warnf("member %s not found for group %s", member, id); - } catch (URISyntaxException e) { - logger.warnf("bad ref uri"); - } + for (String member : members) { + Member groupMember = new Member(); + try { + ScimResource userMapping = this.query("findById", member, "User").getSingleResult(); + logger.debug(userMapping.getExternalId()); + logger.debug(userMapping.getId()); + groupMember.setValue(userMapping.getExternalId()); + URI ref = new URI(String.format("Users/%s", userMapping.getExternalId())); + groupMember.setRef(ref.toString()); + group.addMember(groupMember); + } catch (NoResultException e) { + logger.warnf("member %s not found for group %s", member, id); + } catch (URISyntaxException e) { + logger.warnf("bad ref uri"); } } Meta meta = new Meta();