diff --git a/server/src/main/java/io/spine/server/entity/Repository.java b/server/src/main/java/io/spine/server/entity/Repository.java index 6a6d7fd1c32..940c4e1448e 100644 --- a/server/src/main/java/io/spine/server/entity/Repository.java +++ b/server/src/main/java/io/spine/server/entity/Repository.java @@ -203,7 +203,7 @@ public final TypeUrl entityStateType() { public void registerWith(BoundedContext context) { checkNotNull(context); boolean sameValue = context.equals(this.context); - if (this.context != null && !sameValue) { + if (hasContext() && !sameValue) { throw newIllegalStateException( "The repository `%s` has the Bounded Context (`%s`) assigned." + " This operation can be performed only once." + @@ -222,14 +222,11 @@ public void registerWith(BoundedContext context) { } /** - * {@inheritDoc} - * - *

Unlike, {@link #isOpen()}, once the repository is - * {@linkplain #registerWith(BoundedContext) initialized}, this method always returns {@code true}. + * Tells if the repository is registered in a {@code BoundedContext}. */ @Override public boolean isRegistered() { - return context != null; + return hasContext(); } /** @@ -262,7 +259,7 @@ protected final boolean hasContext() { * if the repository has no context assigned */ protected final BoundedContext context() { - checkState(context != null, + checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; @@ -364,7 +361,7 @@ public void close() { */ @Override public final boolean isOpen() { - return context != null; + return hasContext(); } @Internal diff --git a/version.gradle.kts b/version.gradle.kts index 1ee8e68583f..984d251dbfe 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -34,7 +34,7 @@ /** * Version of this library. */ -val coreJava = "1.5.28" +val coreJava = "1.5.29" /** * Versions of the Spine libraries that `core-java` depends on.