Use diamond operator when possible

This commit is contained in:
Brendan Le Ny 2024-06-12 14:49:28 +02:00
parent 2782beafe6
commit 26dc5edba2
3 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@ import java.util.stream.Stream;
public class GroupAdapter extends Adapter<GroupModel, Group> {
private String displayName;
private Set<String> members = new HashSet<String>();
private Set<String> 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<GroupModel, Group> {
setDisplayName(group.getDisplayName().get());
var groupMembers = group.getMembers();
if (groupMembers != null && groupMembers.size() > 0) {
this.members = new HashSet<String>();
this.members = new HashSet<>();
for (var groupMember : groupMembers) {
try {
var userMapping = this.query("findByExternalId", groupMember.getValue().get(), "User")

View file

@ -169,7 +169,7 @@ public class UserAdapter extends Adapter<UserModel, User> {
logger.warn(e);
}
user.setMeta(meta);
List<PersonRole> roles = new ArrayList<PersonRole>();
List<PersonRole> roles = new ArrayList<>();
for (var r : this.roles) {
var role = new PersonRole();
role.setValue(r);
@ -227,7 +227,7 @@ public class UserAdapter extends Adapter<UserModel, User> {
@Override
public Stream<UserModel> getResourceStream() {
Map<String, String> params = new HashMap<String, String>() {
Map<String, String> params = new HashMap<>() {
};
return this.session.users().searchForUserStream(realm, params);
}

View file

@ -28,7 +28,7 @@ public class ScimEventListenerProvider implements EventListenerProvider {
private final KeycloakSession session;
private final Map<ResourceType, Pattern> patterns = new HashMap<ResourceType, Pattern>();
private final Map<ResourceType, Pattern> patterns = new HashMap<>();
public ScimEventListenerProvider(KeycloakSession session) {
this.session = session;