diff --git a/core/src/main/java/org/keycloak/representations/AccessToken.java b/core/src/main/java/org/keycloak/representations/AccessToken.java index eea0ed68bc..b46c1c7ba3 100755 --- a/core/src/main/java/org/keycloak/representations/AccessToken.java +++ b/core/src/main/java/org/keycloak/representations/AccessToken.java @@ -48,7 +48,7 @@ public class AccessToken extends IDToken { Access access = new Access(); access.verifyCaller = verifyCaller; if (roles != null) { - access.roles = new HashSet(); + access.roles = new HashSet<>(); access.roles.addAll(roles); } return access; @@ -70,7 +70,7 @@ public class AccessToken extends IDToken { } public Access addRole(String role) { - if (roles == null) roles = new HashSet(); + if (roles == null) roles = new HashSet<>(); roles.add(role); return this; } diff --git a/core/src/main/java/org/keycloak/representations/AccessTokenResponse.java b/core/src/main/java/org/keycloak/representations/AccessTokenResponse.java index 6539cd9420..5b791e19e3 100755 --- a/core/src/main/java/org/keycloak/representations/AccessTokenResponse.java +++ b/core/src/main/java/org/keycloak/representations/AccessTokenResponse.java @@ -55,7 +55,7 @@ public class AccessTokenResponse { @JsonProperty("session_state") protected String sessionState; - protected Map otherClaims = new HashMap(); + protected Map otherClaims = new HashMap<>(); // OIDC Financial API Read Only Profile : scope MUST be returned in the response from Token Endpoint @JsonProperty("scope") diff --git a/core/src/main/java/org/keycloak/representations/RefreshToken.java b/core/src/main/java/org/keycloak/representations/RefreshToken.java index 4a8547c5b2..d2749a7706 100755 --- a/core/src/main/java/org/keycloak/representations/RefreshToken.java +++ b/core/src/main/java/org/keycloak/representations/RefreshToken.java @@ -52,7 +52,7 @@ public class RefreshToken extends AccessToken { realmAccess = token.realmAccess.clone(); } if (token.resourceAccess != null) { - resourceAccess = new HashMap(); + resourceAccess = new HashMap<>(); for (Map.Entry entry : token.resourceAccess.entrySet()) { resourceAccess.put(entry.getKey(), entry.getValue().clone()); } diff --git a/core/src/main/java/org/keycloak/representations/adapters/action/GlobalRequestResult.java b/core/src/main/java/org/keycloak/representations/adapters/action/GlobalRequestResult.java index 1eac14b8e0..688ae705dc 100644 --- a/core/src/main/java/org/keycloak/representations/adapters/action/GlobalRequestResult.java +++ b/core/src/main/java/org/keycloak/representations/adapters/action/GlobalRequestResult.java @@ -32,28 +32,28 @@ public class GlobalRequestResult { public void addSuccessRequest(String reqUri) { if (successRequests == null) { - successRequests = new ArrayList(); + successRequests = new ArrayList<>(); } successRequests.add(reqUri); } public void addFailedRequest(String reqUri) { if (failedRequests == null) { - failedRequests = new ArrayList(); + failedRequests = new ArrayList<>(); } failedRequests.add(reqUri); } public void addAllSuccessRequests(List reqUris) { if (successRequests == null) { - successRequests = new ArrayList(); + successRequests = new ArrayList<>(); } successRequests.addAll(reqUris); } public void addAllFailedRequests(List reqUris) { if (failedRequests == null) { - failedRequests = new ArrayList(); + failedRequests = new ArrayList<>(); } failedRequests.addAll(reqUris); } diff --git a/core/src/main/java/org/keycloak/representations/idm/AuthenticatorConfigRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/AuthenticatorConfigRepresentation.java index 258f9257ed..5db7278157 100755 --- a/core/src/main/java/org/keycloak/representations/idm/AuthenticatorConfigRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/AuthenticatorConfigRepresentation.java @@ -29,7 +29,7 @@ public class AuthenticatorConfigRepresentation implements Serializable { private String id; private String alias; - private Map config = new HashMap(); + private Map config = new HashMap<>(); public String getId() { return id; diff --git a/core/src/main/java/org/keycloak/representations/idm/IdentityProviderMapperRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/IdentityProviderMapperRepresentation.java index 2e1f566243..1627c231a3 100755 --- a/core/src/main/java/org/keycloak/representations/idm/IdentityProviderMapperRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/IdentityProviderMapperRepresentation.java @@ -29,7 +29,7 @@ public class IdentityProviderMapperRepresentation { protected String name; protected String identityProviderAlias; protected String identityProviderMapper; - protected Map config = new HashMap(); + protected Map config = new HashMap<>(); public String getId() { diff --git a/core/src/main/java/org/keycloak/representations/idm/IdentityProviderRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/IdentityProviderRepresentation.java index 65b94c65d9..9ca5a0d23b 100755 --- a/core/src/main/java/org/keycloak/representations/idm/IdentityProviderRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/IdentityProviderRepresentation.java @@ -56,7 +56,7 @@ public class IdentityProviderRepresentation { protected boolean linkOnly; protected String firstBrokerLoginFlowAlias; protected String postBrokerLoginFlowAlias; - protected Map config = new HashMap(); + protected Map config = new HashMap<>(); public String getInternalId() { return this.internalId; diff --git a/core/src/main/java/org/keycloak/representations/idm/ProtocolMapperRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/ProtocolMapperRepresentation.java index b07a8d16d0..354c4b569a 100755 --- a/core/src/main/java/org/keycloak/representations/idm/ProtocolMapperRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/ProtocolMapperRepresentation.java @@ -35,7 +35,7 @@ public class ProtocolMapperRepresentation { @Deprecated // backwards compatibility only protected String consentText; - protected Map config = new HashMap(); + protected Map config = new HashMap<>(); public String getId() { diff --git a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java index 6967042093..f2b70bd98e 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java @@ -227,7 +227,7 @@ public class RealmRepresentation { public UserRepresentation user(String username) { UserRepresentation user = new UserRepresentation(); user.setUsername(username); - if (users == null) users = new ArrayList(); + if (users == null) users = new ArrayList<>(); users.add(user); return user; } @@ -360,7 +360,7 @@ public class RealmRepresentation { public ScopeMappingRepresentation clientScopeMapping(String clientName) { ScopeMappingRepresentation mapping = new ScopeMappingRepresentation(); mapping.setClient(clientName); - if (scopeMappings == null) scopeMappings = new ArrayList(); + if (scopeMappings == null) scopeMappings = new ArrayList<>(); scopeMappings.add(mapping); return mapping; } @@ -368,7 +368,7 @@ public class RealmRepresentation { public ScopeMappingRepresentation clientScopeScopeMapping(String clientScopeName) { ScopeMappingRepresentation mapping = new ScopeMappingRepresentation(); mapping.setClientScope(clientScopeName); - if (scopeMappings == null) scopeMappings = new ArrayList(); + if (scopeMappings == null) scopeMappings = new ArrayList<>(); scopeMappings.add(mapping); return mapping; } diff --git a/core/src/main/java/org/keycloak/representations/idm/RequiredActionProviderRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RequiredActionProviderRepresentation.java index 4e1d76e40f..6f6085e9e6 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RequiredActionProviderRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RequiredActionProviderRepresentation.java @@ -32,7 +32,7 @@ public class RequiredActionProviderRepresentation { private boolean enabled; private boolean defaultAction; private int priority; - private Map config = new HashMap(); + private Map config = new HashMap<>(); public String getAlias() { diff --git a/core/src/main/java/org/keycloak/representations/idm/ScopeMappingRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/ScopeMappingRepresentation.java index 488f250cbb..42397fd4f1 100755 --- a/core/src/main/java/org/keycloak/representations/idm/ScopeMappingRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/ScopeMappingRepresentation.java @@ -71,7 +71,7 @@ public class ScopeMappingRepresentation { } public ScopeMappingRepresentation role(String role) { - if (this.roles == null) this.roles = new HashSet(); + if (this.roles == null) this.roles = new HashSet<>(); this.roles.add(role); return this; } diff --git a/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java index 66206046fe..9d244f5fb5 100755 --- a/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java @@ -31,7 +31,7 @@ public class UserSessionRepresentation { private String ipAddress; private long start; private long lastAccess; - private Map clients = new HashMap(); + private Map clients = new HashMap<>(); public String getId() { return id; diff --git a/core/src/main/java/org/keycloak/representations/idm/authorization/PermissionRequest.java b/core/src/main/java/org/keycloak/representations/idm/authorization/PermissionRequest.java index bd2a94bb5d..e7b9b1be87 100644 --- a/core/src/main/java/org/keycloak/representations/idm/authorization/PermissionRequest.java +++ b/core/src/main/java/org/keycloak/representations/idm/authorization/PermissionRequest.java @@ -43,7 +43,7 @@ public class PermissionRequest { public PermissionRequest(String resourceId, String... scopes) { this.resourceId = resourceId; if (scopes != null) { - this.scopes = new HashSet(Arrays.asList(scopes)); + this.scopes = new HashSet<>(Arrays.asList(scopes)); } }