Remove pointless if

This commit is contained in:
Brendan Le Ny 2024-06-17 14:38:42 +02:00
parent 676cddc0d9
commit 04f011b5bf

View file

@ -81,22 +81,20 @@ public class GroupAdapter extends Adapter<GroupModel, Group> {
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();