diff --git a/model/build-processor/src/main/java/org/keycloak/models/map/processor/GenerateHotRodEntityImplementationsProcessor.java b/model/build-processor/src/main/java/org/keycloak/models/map/processor/GenerateHotRodEntityImplementationsProcessor.java index a366db589e..b5d5673ddc 100644 --- a/model/build-processor/src/main/java/org/keycloak/models/map/processor/GenerateHotRodEntityImplementationsProcessor.java +++ b/model/build-processor/src/main/java/org/keycloak/models/map/processor/GenerateHotRodEntityImplementationsProcessor.java @@ -169,6 +169,7 @@ public class GenerateHotRodEntityImplementationsProcessor extends AbstractGenera pw.println(" " + "public " + hotRodSimpleClassName + "(" + className + " " + ENTITY_VARIABLE + ") {" ); + pw.println(" java.util.Objects.requireNonNull(" + ENTITY_VARIABLE + ");"); pw.println(" this." + ENTITY_VARIABLE + " = " + ENTITY_VARIABLE + ";"); if (usingGeneratedCloner) { pw.println(" this.cloner = DeepCloner.DUMB_CLONER;"); diff --git a/model/map-hot-rod/src/main/java/org/keycloak/models/map/storage/hotRod/HotRodMapStorage.java b/model/map-hot-rod/src/main/java/org/keycloak/models/map/storage/hotRod/HotRodMapStorage.java index b7a64cfa19..3dbeb39af1 100644 --- a/model/map-hot-rod/src/main/java/org/keycloak/models/map/storage/hotRod/HotRodMapStorage.java +++ b/model/map-hot-rod/src/main/java/org/keycloak/models/map/storage/hotRod/HotRodMapStorage.java @@ -93,15 +93,25 @@ public class HotRodMapStorage