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 @Override
public Boolean tryToMap() { public Boolean tryToMap() {
Optional<GroupModel> group = session.groups().getGroupsStream(realm).filter( Set<String> names = Set.of(externalId, displayName);
x -> StringUtils.equals(x.getName(), externalId) || StringUtils.equals(x.getName(), displayName)) Optional<GroupModel> group = session.groups().getGroupsStream(realm)
.filter(groupModel -> names.contains(groupModel.getName()))
.findFirst(); .findFirst();
if (group.isPresent()) { if (group.isPresent()) {
setId(group.get().getId()); setId(group.get().getId());

View file

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

View file

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