From 26dc5edba2e5c8df7a2a77010c734dd5853ef615 Mon Sep 17 00:00:00 2001 From: Brendan Le Ny Date: Wed, 12 Jun 2024 14:49:28 +0200 Subject: [PATCH] Use diamond operator when possible --- src/main/java/sh/libre/scim/core/GroupAdapter.java | 4 ++-- src/main/java/sh/libre/scim/core/UserAdapter.java | 4 ++-- .../java/sh/libre/scim/event/ScimEventListenerProvider.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/sh/libre/scim/core/GroupAdapter.java b/src/main/java/sh/libre/scim/core/GroupAdapter.java index 1351fe0d95..3221f4bb7b 100644 --- a/src/main/java/sh/libre/scim/core/GroupAdapter.java +++ b/src/main/java/sh/libre/scim/core/GroupAdapter.java @@ -20,7 +20,7 @@ import java.util.stream.Stream; public class GroupAdapter extends Adapter { private String displayName; - private Set members = new HashSet(); + private Set members = new HashSet<>(); public GroupAdapter(KeycloakSession session, String componentId) { super(session, componentId, "Group", Logger.getLogger(GroupAdapter.class)); @@ -58,7 +58,7 @@ public class GroupAdapter extends Adapter { setDisplayName(group.getDisplayName().get()); var groupMembers = group.getMembers(); if (groupMembers != null && groupMembers.size() > 0) { - this.members = new HashSet(); + this.members = new HashSet<>(); for (var groupMember : groupMembers) { try { var userMapping = this.query("findByExternalId", groupMember.getValue().get(), "User") diff --git a/src/main/java/sh/libre/scim/core/UserAdapter.java b/src/main/java/sh/libre/scim/core/UserAdapter.java index 582f2a1ece..2b7cfb3914 100644 --- a/src/main/java/sh/libre/scim/core/UserAdapter.java +++ b/src/main/java/sh/libre/scim/core/UserAdapter.java @@ -169,7 +169,7 @@ public class UserAdapter extends Adapter { logger.warn(e); } user.setMeta(meta); - List roles = new ArrayList(); + List roles = new ArrayList<>(); for (var r : this.roles) { var role = new PersonRole(); role.setValue(r); @@ -227,7 +227,7 @@ public class UserAdapter extends Adapter { @Override public Stream getResourceStream() { - Map params = new HashMap() { + Map params = new HashMap<>() { }; return this.session.users().searchForUserStream(realm, params); } diff --git a/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java b/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java index 647bec7aee..7597bdfa9a 100644 --- a/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java +++ b/src/main/java/sh/libre/scim/event/ScimEventListenerProvider.java @@ -28,7 +28,7 @@ public class ScimEventListenerProvider implements EventListenerProvider { private final KeycloakSession session; - private final Map patterns = new HashMap(); + private final Map patterns = new HashMap<>(); public ScimEventListenerProvider(KeycloakSession session) { this.session = session;