Remove pointless use of StringUtils

This commit is contained in:
Brendan Le Ny 2024-06-12 15:34:22 +02:00
parent 0c9dd3595e
commit 7d42a4e1d2
3 changed files with 5 additions and 4 deletions

View file

@ -121,8 +121,9 @@ public class GroupAdapter extends Adapter<GroupModel, Group> {
@Override
public Boolean tryToMap() {
Optional<GroupModel> group = session.groups().getGroupsStream(realm).filter(
x -> StringUtils.equals(x.getName(), externalId) || StringUtils.equals(x.getName(), displayName))
Set<String> names = Set.of(externalId, displayName);
Optional<GroupModel> group = session.groups().getGroupsStream(realm)
.filter(groupModel -> names.contains(groupModel.getName()))
.findFirst();
if (group.isPresent()) {
setId(group.get().getId());

View file

@ -25,7 +25,7 @@ public class ScimDispatcher {
public void run(String scope, Consumer<ScimClient> f) {
session.getContext().getRealm().getComponentsStream()
.filter((m) -> {
return StringUtils.equals(ScimStorageProviderFactory.ID, m.getProviderId())
return ScimStorageProviderFactory.ID.equals(m.getProviderId())
&& m.get("enabled", true)
&& m.get("propagation-" + scope, false);
})

View file

@ -235,6 +235,6 @@ public class UserAdapter extends Adapter<UserModel, User> {
@Override
public Boolean skipRefresh() {
return StringUtils.equals(getUsername(), "admin");
return "admin".equals(getUsername());
}
}