From 24881bba26506aebba940602cdbc69dacd10c058 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 18 Jun 2026 18:22:47 +0100 Subject: [PATCH 1/8] Bump version -> `2.0.0-SNAPSHOT.420` --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index edbaca1e74..118dfb538f 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -24,4 +24,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -val versionToPublish: String by extra("2.0.0-SNAPSHOT.413") +val versionToPublish: String by extra("2.0.0-SNAPSHOT.420") From fa8ef15b3ca100375946b33e6ff8740af89282e4 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 22 Jun 2026 23:55:29 +0100 Subject: [PATCH 2/8] Introduce `QueryCriterion.isEqualTo` and make `is` delegate to it `isEqualTo` is now the canonical "equals" criterion. It carries the behavior previously implemented by `is`, and `is` delegates to it. `is` is documented as a short form of `isEqualTo`, convenient when working with a `QueryCriterion` from Java. Kotlin callers should prefer `isEqualTo`, because `is` is a reserved word in Kotlin and calling it requires wrapping the method name in backticks. Co-Authored-By: Claude Opus 4.8 --- .../java/io/spine/query/QueryCriterion.java | 28 ++++++++++++++- .../spine/query/RecordQueryBuilderTest.java | 36 +++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/base/src/main/java/io/spine/query/QueryCriterion.java b/base/src/main/java/io/spine/query/QueryCriterion.java index 91307fd36e..61f11ee090 100644 --- a/base/src/main/java/io/spine/query/QueryCriterion.java +++ b/base/src/main/java/io/spine/query/QueryCriterion.java @@ -88,16 +88,42 @@ abstract class QueryCriterionThe shorter {@link #is(Object) is()} alias has the same effect and reads more + * fluently from Java. Prefer this method in Kotlin, where {@code is} is a reserved + * word and calling {@code is()} requires wrapping the name in backticks. + * * @param value * the column value to use when querying * @return the instance of query builder associated with this criterion + * @see #is(Object) */ @CanIgnoreReturnValue - public B is(V value) { + public B isEqualTo(V value) { checkNotNull(value); return addParameter(builder, column, EQUALS, value); } + /** + * Appends an associated query builder with a criterion checking that the value + * of the associated column equals to the one provided. + * + *

This method is a short form of {@link #isEqualTo(Object) isEqualTo()}. + * It is a convenience wrapper for working with a {@code QueryCriterion} from Java. + * + *

In Kotlin, prefer {@link #isEqualTo(Object) isEqualTo()} because {@code is} is + * a reserved word there, so calling this method requires wrapping its name in + * backticks. + * + * @param value + * the column value to use when querying + * @return the instance of query builder associated with this criterion + * @see #isEqualTo(Object) + */ + @CanIgnoreReturnValue + public B is(V value) { + return isEqualTo(value); + } + /** * Appends an associated query builder with a criterion checking that the value * of the associated column is less than the one provided. diff --git a/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java b/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java index 343821ec64..2a755f3cac 100644 --- a/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java +++ b/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -254,6 +254,38 @@ void returnSameBuilder() { } } + @Nested + @DisplayName("treat `is` as a short form of `isEqualTo`") + final class IsEqualToAlias { + + @Test + @DisplayName("appending an `EQUALS` parameter via `isEqualTo`") + void appendEqualsParameter() { + var isinValue = "JP 3496600002"; + var parameters = queryManufacturer() + .where(isin).isEqualTo(isinValue) + .predicate() + .parameters(); + assertThat(parameters).hasSize(1); + assertHasParamValue(parameters, isin, EQUALS, isinValue); + } + + @Test + @DisplayName("producing the same parameter as `is`") + void matchIs() { + var isinValue = "JP 3496600002"; + var viaIs = queryManufacturer() + .where(isin).is(isinValue) + .predicate() + .parameters(); + var viaIsEqualTo = queryManufacturer() + .where(isin).isEqualTo(isinValue) + .predicate() + .parameters(); + assertThat(viaIsEqualTo).isEqualTo(viaIs); + } + } + @Nested @DisplayName("prevent") final class Prevent { From 809ff3e85d0447ad4772c7eb31d353c99dc56575 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 22 Jun 2026 23:56:28 +0100 Subject: [PATCH 3/8] Bump version -> `2.0.0-SNAPSHOT.421` --- version.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle.kts b/version.gradle.kts index 118dfb538f..3254c54509 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,4 +24,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -val versionToPublish: String by extra("2.0.0-SNAPSHOT.420") +val versionToPublish: String by extra("2.0.0-SNAPSHOT.421") From d525245dd304e761cf2da2841f09583f29bf3e5b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 23 Jun 2026 01:07:28 +0100 Subject: [PATCH 4/8] Update dependency reports --- docs/dependencies/dependencies.md | 16 ++++++++-------- docs/dependencies/pom.xml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/dependencies/dependencies.md b/docs/dependencies/dependencies.md index bc26d6d8ab..fd604e743e 100644 --- a/docs/dependencies/dependencies.md +++ b/docs/dependencies/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.420` +# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.421` ## Runtime 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.1.0. @@ -760,14 +760,14 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using +This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.420` +# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.421` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -1604,14 +1604,14 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using +This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.420` +# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.421` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -2430,14 +2430,14 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using +This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.420` +# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.421` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0. @@ -3336,6 +3336,6 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using +This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/docs/dependencies/pom.xml b/docs/dependencies/pom.xml index 684cb71e6c..8179771bf9 100644 --- a/docs/dependencies/pom.xml +++ b/docs/dependencies/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine base-libraries -2.0.0-SNAPSHOT.420 +2.0.0-SNAPSHOT.421 2015 From 6bc4c64343ec9bbc565efbb93b17c370289c249e Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Tue, 23 Jun 2026 01:18:00 +0100 Subject: [PATCH 5/8] Fix doc language Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- base/src/main/java/io/spine/query/QueryCriterion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/src/main/java/io/spine/query/QueryCriterion.java b/base/src/main/java/io/spine/query/QueryCriterion.java index 61f11ee090..b8f30a1697 100644 --- a/base/src/main/java/io/spine/query/QueryCriterion.java +++ b/base/src/main/java/io/spine/query/QueryCriterion.java @@ -86,7 +86,7 @@ abstract class QueryCriterionThe shorter {@link #is(Object) is()} alias has the same effect and reads more * fluently from Java. Prefer this method in Kotlin, where {@code is} is a reserved From 45626e6fec0e409c5c0a7b7815bdf0f11dee8bd3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 23 Jun 2026 03:29:41 +0100 Subject: [PATCH 6/8] Opt proto generation out of the build cache to fix `KnownTypes` flakiness The `generateProto`/`generateTestProto` tasks delete `com.google` files from their own output directory in a `doLast` action. That mutation is not reproduced when a task is restored from the Gradle build cache, so a cached restoration leaves an inconsistent descriptor set on the test classpath and `io.spine.type.KnownTypes` loads an incomplete set of types. This intermittently failed ~30-80 tests unrelated to the change under test, in `io.spine.type`, `io.spine.base`, `io.spine.protobuf`, and `io.spine.code` (e.g. PR #949's Ubuntu CI), depending on whether the build cache had a hit for these tasks. It is why `master` (cache miss, executed) stayed green while a branch that restored the cache entry went red. Marking the tasks non-cacheable makes them always execute, so the deletion is always applied and the descriptor set is consistent. Verified: with the build cache enabled, `clean build` now passes 3/3 with `generateTestProto` always executed; previously it failed deterministically when the task was restored from cache. Co-Authored-By: Claude Opus 4.8 --- base/build.gradle.kts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/base/build.gradle.kts b/base/build.gradle.kts index 25102bee35..6be73a1bd4 100644 --- a/base/build.gradle.kts +++ b/base/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,6 @@ tasks { excludeGoogleProtoFromArtifacts() } - // For generating test fixtures. See `src/test/proto`. protobuf { configurations.excludeProtobufLite() @@ -99,6 +98,15 @@ protobuf { } generateProtoTasks.all().configureEach { + // The `doLast` action below deletes files from this task's own output + // directory, which is not reproduced when the task is restored from the + // Gradle build cache. A cached restoration yields an output (and a + // downstream descriptor set on the test classpath) that differs from a + // fresh run, intermittently leaving `io.spine.type.KnownTypes` with an + // incomplete set of types. Opt this task out of the build cache so it + // always executes and the deletion is always applied. + outputs.cacheIf { false } + // Delete files generated in `com.google` packages because // we add `protobuf(Protobuf.protoSrcLib)` dependency above. doLast { From 7cc36b2afc8049991774610dbb6f70f717dddd94 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 23 Jun 2026 03:34:20 +0100 Subject: [PATCH 7/8] Fix doc language in the `is` method Apply the same `equals to` -> `equals` correction to `is` that was made for `isEqualTo`, so the two duplicated summary sentences stay consistent. Co-Authored-By: Claude Opus 4.8 --- base/src/main/java/io/spine/query/QueryCriterion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/src/main/java/io/spine/query/QueryCriterion.java b/base/src/main/java/io/spine/query/QueryCriterion.java index b8f30a1697..120c70d12e 100644 --- a/base/src/main/java/io/spine/query/QueryCriterion.java +++ b/base/src/main/java/io/spine/query/QueryCriterion.java @@ -105,7 +105,7 @@ public B isEqualTo(V value) { /** * Appends an associated query builder with a criterion checking that the value - * of the associated column equals to the one provided. + * of the associated column equals the one provided. * *

This method is a short form of {@link #isEqualTo(Object) isEqualTo()}. * It is a convenience wrapper for working with a {@code QueryCriterion} from Java. From 757119e015eb0d31cda8b679bfb7c0a4e61e76b9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 23 Jun 2026 03:40:26 +0100 Subject: [PATCH 8/8] Address review feedback on the `isEqualTo` tests - Rename the nested test class `IsEqualToAlias` to `IsEqualTo`. - Class display name -> "support filtering by given values". - `matchIs` display name -> "providing `is` alias for `isEqualTo`". Co-Authored-By: Claude Opus 4.8 --- .../test/java/io/spine/query/RecordQueryBuilderTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java b/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java index 2a755f3cac..02d1f6dd80 100644 --- a/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java +++ b/base/src/test/java/io/spine/query/RecordQueryBuilderTest.java @@ -255,8 +255,8 @@ void returnSameBuilder() { } @Nested - @DisplayName("treat `is` as a short form of `isEqualTo`") - final class IsEqualToAlias { + @DisplayName("support filtering by given values") + final class IsEqualTo { @Test @DisplayName("appending an `EQUALS` parameter via `isEqualTo`") @@ -271,7 +271,7 @@ void appendEqualsParameter() { } @Test - @DisplayName("producing the same parameter as `is`") + @DisplayName("providing `is` alias for `isEqualTo`") void matchIs() { var isinValue = "JP 3496600002"; var viaIs = queryManufacturer()