From 3acee944eaac074bab301a450027906e070d1273 Mon Sep 17 00:00:00 2001 From: Andrei Arlou Date: Mon, 18 Nov 2019 22:51:12 +0300 Subject: [PATCH] KEYCLOAK-12090 Simplify conditions in module "model/infinispan" (#6497) --- .../org/keycloak/models/cache/infinispan/ClientAdapter.java | 2 +- .../keycloak/models/cache/infinispan/ClientScopeAdapter.java | 2 +- .../java/org/keycloak/models/cache/infinispan/GroupAdapter.java | 2 +- .../java/org/keycloak/models/cache/infinispan/RealmAdapter.java | 2 +- .../java/org/keycloak/models/cache/infinispan/RoleAdapter.java | 2 +- .../java/org/keycloak/models/cache/infinispan/UserAdapter.java | 2 +- .../models/cache/infinispan/authorization/PolicyAdapter.java | 2 +- .../models/cache/infinispan/authorization/ResourceAdapter.java | 2 +- .../cache/infinispan/authorization/ResourceServerAdapter.java | 2 +- .../models/cache/infinispan/authorization/ScopeAdapter.java | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientAdapter.java index a406f23da5..cb94bca3f6 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientAdapter.java @@ -655,7 +655,7 @@ public class ClientAdapter implements ClientModel, CachedObject { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof ClientModel)) return false; + if (!(o instanceof ClientModel)) return false; ClientModel that = (ClientModel) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientScopeAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientScopeAdapter.java index a15cbb6846..3aaaf6373e 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientScopeAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/ClientScopeAdapter.java @@ -239,7 +239,7 @@ public class ClientScopeAdapter implements ClientScopeModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof ClientModel)) return false; + if (!(o instanceof ClientModel)) return false; ClientScopeModel that = (ClientScopeModel) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java index 6a35951585..5871f6b480 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/GroupAdapter.java @@ -77,7 +77,7 @@ public class GroupAdapter implements GroupModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof GroupModel)) return false; + if (!(o instanceof GroupModel)) return false; GroupModel that = (GroupModel) o; diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java index 5f36995030..48d4de6f7f 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java @@ -970,7 +970,7 @@ public class RealmAdapter implements CachedRealmModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof RealmModel)) return false; + if (!(o instanceof RealmModel)) return false; RealmModel that = (RealmModel) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RoleAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RoleAdapter.java index 51620a1a0e..7721790eda 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RoleAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RoleAdapter.java @@ -229,7 +229,7 @@ public class RoleAdapter implements RoleModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof RoleModel)) return false; + if (!(o instanceof RoleModel)) return false; RoleModel that = (RoleModel) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/UserAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/UserAdapter.java index 4fdbbbdbc7..7f59cd9403 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/UserAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/UserAdapter.java @@ -389,7 +389,7 @@ public class UserAdapter implements CachedUserModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof UserModel)) return false; + if (!(o instanceof UserModel)) return false; UserModel that = (UserModel) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/PolicyAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/PolicyAdapter.java index 34785cc6cc..d54665399b 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/PolicyAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/PolicyAdapter.java @@ -318,7 +318,7 @@ public class PolicyAdapter implements Policy, CachedModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof Policy)) return false; + if (!(o instanceof Policy)) return false; Policy that = (Policy) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceAdapter.java index 458907494b..c77b8ab8cf 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceAdapter.java @@ -275,7 +275,7 @@ public class ResourceAdapter implements Resource, CachedModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof Resource)) return false; + if (!(o instanceof Resource)) return false; Resource that = (Resource) o; return that.getId().equals(getId()); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceServerAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceServerAdapter.java index d7cbbf9dbe..f2217b4b4d 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceServerAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/ResourceServerAdapter.java @@ -119,7 +119,7 @@ public class ResourceServerAdapter implements ResourceServer, CachedModel { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || !(o instanceof Scope)) return false; + if (!(o instanceof Scope)) return false; Scope that = (Scope) o; return that.getId().equals(getId());