Close stream
This commit is contained in:
parent
54a2f10114
commit
51d4837c19
1 changed files with 8 additions and 4 deletions
|
@ -41,10 +41,14 @@ public class GroupScimService extends AbstractScimService<GroupModel, Group> {
|
||||||
Set<String> names = new TreeSet<>();
|
Set<String> names = new TreeSet<>();
|
||||||
resource.getId().ifPresent(names::add);
|
resource.getId().ifPresent(names::add);
|
||||||
resource.getDisplayName().ifPresent(names::add);
|
resource.getDisplayName().ifPresent(names::add);
|
||||||
Optional<GroupModel> group = getKeycloakDao().getGroupsStream()
|
try (Stream<GroupModel> groupsStream = getKeycloakDao().getGroupsStream()) {
|
||||||
.filter(groupModel -> names.contains(groupModel.getName()))
|
Optional<GroupModel> group = groupsStream
|
||||||
.findFirst();
|
.filter(groupModel -> names.contains(groupModel.getName()))
|
||||||
return group.map(GroupModel::getId).map(KeycloakId::new);
|
.findFirst();
|
||||||
|
return group
|
||||||
|
.map(GroupModel::getId)
|
||||||
|
.map(KeycloakId::new);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue