Skip to content

Commit 2e6ec50

Browse files
Merge pull request #184 from SpineEventEngine/take-latest-protodata
Adjust the library to the latest ProtoData
2 parents d681c35 + 6331736 commit 2e6ec50

File tree

13 files changed

+152
-143
lines changed

13 files changed

+152
-143
lines changed

buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object ProtoData {
7373
* The version of ProtoData dependencies.
7474
*/
7575
val version: String
76-
private const val fallbackVersion = "0.90.1"
76+
private const val fallbackVersion = "0.91.1"
7777

7878
/**
7979
* The distinct version of ProtoData used by other build tools.
@@ -82,7 +82,7 @@ object ProtoData {
8282
* transitional dependencies, this is the version used to build the project itself.
8383
*/
8484
val dogfoodingVersion: String
85-
private const val fallbackDfVersion = "0.90.1"
85+
private const val fallbackDfVersion = "0.91.1"
8686

8787
/**
8888
* The artifact for the ProtoData Gradle plugin.

dependencies.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
# Dependencies of `io.spine.validation:spine-validation-java:2.0.0-SNAPSHOT.187`
3+
# Dependencies of `io.spine.validation:spine-validation-java:2.0.0-SNAPSHOT.188`
44

55
## Runtime
66
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -848,12 +848,12 @@
848848

849849
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
850850

851-
This report was generated on **Thu Jan 09 10:27:12 CET 2025** 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).
851+
This report was generated on **Tue Jan 14 13:54:25 CET 2025** 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).
852852

853853

854854

855855

856-
# Dependencies of `io.spine.validation:spine-validation-java-bundle:2.0.0-SNAPSHOT.187`
856+
# Dependencies of `io.spine.validation:spine-validation-java-bundle:2.0.0-SNAPSHOT.188`
857857

858858
## Runtime
859859
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1.
@@ -1448,12 +1448,12 @@ This report was generated on **Thu Jan 09 10:27:12 CET 2025** using [Gradle-Lice
14481448

14491449
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
14501450

1451-
This report was generated on **Thu Jan 09 10:27:13 CET 2025** 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).
1451+
This report was generated on **Tue Jan 14 13:54:25 CET 2025** 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).
14521452

14531453

14541454

14551455

1456-
# Dependencies of `io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.187`
1456+
# Dependencies of `io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.188`
14571457

14581458
## Runtime
14591459
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -2110,12 +2110,12 @@ This report was generated on **Thu Jan 09 10:27:13 CET 2025** using [Gradle-Lice
21102110

21112111
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
21122112

2113-
This report was generated on **Thu Jan 09 10:27:13 CET 2025** 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).
2113+
This report was generated on **Tue Jan 14 13:54:25 CET 2025** 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).
21142114

21152115

21162116

21172117

2118-
# Dependencies of `io.spine.validation:spine-validation-java-tests:2.0.0-SNAPSHOT.187`
2118+
# Dependencies of `io.spine.validation:spine-validation-java-tests:2.0.0-SNAPSHOT.188`
21192119

21202120
## Runtime
21212121
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -3031,12 +3031,12 @@ This report was generated on **Thu Jan 09 10:27:13 CET 2025** using [Gradle-Lice
30313031

30323032
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
30333033

3034-
This report was generated on **Thu Jan 09 10:27:13 CET 2025** 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).
3034+
This report was generated on **Tue Jan 14 13:54:26 CET 2025** 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).
30353035

30363036

30373037

30383038

3039-
# Dependencies of `io.spine.validation:spine-validation-model:2.0.0-SNAPSHOT.187`
3039+
# Dependencies of `io.spine.validation:spine-validation-model:2.0.0-SNAPSHOT.188`
30403040

30413041
## Runtime
30423042
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -3895,12 +3895,12 @@ This report was generated on **Thu Jan 09 10:27:13 CET 2025** using [Gradle-Lice
38953895

38963896
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
38973897

3898-
This report was generated on **Thu Jan 09 10:27:13 CET 2025** 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).
3898+
This report was generated on **Tue Jan 14 13:54:26 CET 2025** 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).
38993899

39003900

39013901

39023902

3903-
# Dependencies of `io.spine.validation:spine-validation-proto:2.0.0-SNAPSHOT.187`
3903+
# Dependencies of `io.spine.validation:spine-validation-proto:2.0.0-SNAPSHOT.188`
39043904

39053905
## Runtime
39063906
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -4785,12 +4785,12 @@ This report was generated on **Thu Jan 09 10:27:13 CET 2025** using [Gradle-Lice
47854785

47864786
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
47874787

4788-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
4788+
This report was generated on **Tue Jan 14 13:54:27 CET 2025** 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).
47894789

47904790

47914791

47924792

4793-
# Dependencies of `io.spine.validation:spine-validation-consumer:2.0.0-SNAPSHOT.187`
4793+
# Dependencies of `io.spine.validation:spine-validation-consumer:2.0.0-SNAPSHOT.188`
47944794

47954795
## Runtime
47964796
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -5657,12 +5657,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
56575657

56585658
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
56595659

5660-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
5660+
This report was generated on **Tue Jan 14 13:54:27 CET 2025** 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).
56615661

56625662

56635663

56645664

5665-
# Dependencies of `io.spine.validation:spine-validation-consumer-dependency:2.0.0-SNAPSHOT.187`
5665+
# Dependencies of `io.spine.validation:spine-validation-consumer-dependency:2.0.0-SNAPSHOT.188`
56665666

56675667
## Runtime
56685668
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -6410,12 +6410,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
64106410

64116411
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
64126412

6413-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
6413+
This report was generated on **Tue Jan 14 13:54:27 CET 2025** 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).
64146414

64156415

64166416

64176417

6418-
# Dependencies of `io.spine.validation:spine-validation-extensions:2.0.0-SNAPSHOT.187`
6418+
# Dependencies of `io.spine.validation:spine-validation-extensions:2.0.0-SNAPSHOT.188`
64196419

64206420
## Runtime
64216421
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -7308,12 +7308,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
73087308

73097309
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
73107310

7311-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
7311+
This report was generated on **Tue Jan 14 13:54:27 CET 2025** 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).
73127312

73137313

73147314

73157315

7316-
# Dependencies of `io.spine.validation:spine-validation-runtime:2.0.0-SNAPSHOT.187`
7316+
# Dependencies of `io.spine.validation:spine-validation-runtime:2.0.0-SNAPSHOT.188`
73177317

73187318
## Runtime
73197319
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -8064,12 +8064,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
80648064

80658065
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
80668066

8067-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
8067+
This report was generated on **Tue Jan 14 13:54:28 CET 2025** 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).
80688068

80698069

80708070

80718071

8072-
# Dependencies of `io.spine.validation:spine-validation-validating:2.0.0-SNAPSHOT.187`
8072+
# Dependencies of `io.spine.validation:spine-validation-validating:2.0.0-SNAPSHOT.188`
80738073

80748074
## Runtime
80758075
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -8824,12 +8824,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
88248824

88258825
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
88268826

8827-
This report was generated on **Thu Jan 09 10:27:14 CET 2025** 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).
8827+
This report was generated on **Tue Jan 14 13:54:28 CET 2025** 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).
88288828

88298829

88308830

88318831

8832-
# Dependencies of `io.spine.validation:spine-validation-vanilla:2.0.0-SNAPSHOT.187`
8832+
# Dependencies of `io.spine.validation:spine-validation-vanilla:2.0.0-SNAPSHOT.188`
88338833

88348834
## Runtime
88358835
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -9575,12 +9575,12 @@ This report was generated on **Thu Jan 09 10:27:14 CET 2025** using [Gradle-Lice
95759575

95769576
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
95779577

9578-
This report was generated on **Thu Jan 09 10:27:15 CET 2025** 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).
9578+
This report was generated on **Tue Jan 14 13:54:28 CET 2025** 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).
95799579

95809580

95819581

95829582

9583-
# Dependencies of `io.spine.validation:spine-validation-configuration:2.0.0-SNAPSHOT.187`
9583+
# Dependencies of `io.spine.validation:spine-validation-configuration:2.0.0-SNAPSHOT.188`
95849584

95859585
## Runtime
95869586
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -10449,12 +10449,12 @@ This report was generated on **Thu Jan 09 10:27:15 CET 2025** using [Gradle-Lice
1044910449

1045010450
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1045110451

10452-
This report was generated on **Thu Jan 09 10:27:15 CET 2025** 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).
10452+
This report was generated on **Tue Jan 14 13:54:28 CET 2025** 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).
1045310453

1045410454

1045510455

1045610456

10457-
# Dependencies of `io.spine.validation:spine-validation-context:2.0.0-SNAPSHOT.187`
10457+
# Dependencies of `io.spine.validation:spine-validation-context:2.0.0-SNAPSHOT.188`
1045810458

1045910459
## Runtime
1046010460
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -11323,4 +11323,4 @@ This report was generated on **Thu Jan 09 10:27:15 CET 2025** using [Gradle-Lice
1132311323

1132411324
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1132511325

11326-
This report was generated on **Thu Jan 09 10:27:15 CET 2025** 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).
11326+
This report was generated on **Tue Jan 14 13:54:28 CET 2025** 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).

java-runtime/src/main/java/io/spine/validate/Validate.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
import static com.google.common.base.Preconditions.checkNotNull;
4949
import static com.google.common.collect.ImmutableSet.toImmutableSet;
5050
import static io.spine.protobuf.AnyPacker.unpack;
51-
import static io.spine.validate.ErrorPlaceholder.FIELD_NAME;
52-
import static io.spine.validate.ErrorPlaceholder.PARENT_TYPE;
51+
import static io.spine.validate.RuntimeErrorPlaceholder.FIELD_PATH;
52+
import static io.spine.validate.RuntimeErrorPlaceholder.PARENT_TYPE;
5353
import static io.spine.validate.WorkaroundKt.requiresRuntimeValidation;
5454
import static java.lang.String.format;
5555

@@ -60,7 +60,7 @@ public final class Validate {
6060

6161
private static final String SET_ONCE_ERROR_MESSAGE =
6262
"Attempted to change the value of the field " +
63-
"`${" + PARENT_TYPE + "}.${" + FIELD_NAME + "}` which has " +
63+
"`${" + PARENT_TYPE + "}.${" + FIELD_PATH + "}` which has " +
6464
"`(set_once) = true` and already has a non-default value.";
6565
private static final Logger<?> logger = LoggingFactory.forEnclosingClass();
6666

@@ -293,7 +293,7 @@ private static ConstraintViolation violatedSetOnce(FieldDeclaration declaration)
293293
var message = TemplateString.newBuilder()
294294
.setWithPlaceholders(SET_ONCE_ERROR_MESSAGE)
295295
.putPlaceholderValue(PARENT_TYPE.toString(), declaringTypeName)
296-
.putPlaceholderValue(FIELD_NAME.toString(), fieldName)
296+
.putPlaceholderValue(FIELD_PATH.toString(), fieldName)
297297
.build();
298298
var violation = ConstraintViolation.newBuilder()
299299
.setMessage(message)

java-runtime/src/main/java/io/spine/validate/option/IfInvalid.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

java-runtime/src/main/java/io/spine/validate/option/ValidateConstraint.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ public final class ValidateConstraint extends FieldConstraint<Boolean> {
4242
}
4343

4444
@Override
45-
@SuppressWarnings("deprecation") /* Old validation won't migrate to the new error messages. */
4645
public String formattedErrorMessage(FieldContext field) {
47-
var option = new IfInvalid();
48-
var ifInvalid = option.valueOrDefault(field.target());
49-
return ViolationText.errorMessage(ifInvalid, ifInvalid.getMsgFormat());
46+
// This option does not have an error message anymore.
47+
return "";
5048
}
5149

5250
@Override

java-runtime/src/main/kotlin/io/spine/validate/ErrorPlaceholder.kt renamed to java-runtime/src/main/kotlin/io/spine/validate/RuntimeErrorPlaceholder.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ package io.spine.validate
3232
* Enumerates placeholder names that can be used within Protobuf definitions.
3333
* Each validation option declares the supported placeholders within `options.proto`.
3434
*
35+
* Important Note: this enum is an exact copy of `io.spine.validation.java.ErrorPlaceholder`.
36+
* Please keep them in sync. Take a look at docs to the original enum for details.
37+
*
3538
* @see TemplateString
3639
*/
37-
public enum class ErrorPlaceholder(public val value: String) {
40+
public enum class RuntimeErrorPlaceholder(public val value: String) {
3841

3942
// Common placeholders.
40-
FIELD_NAME("field.name"),
43+
FIELD_PATH("field.path"),
4144
FIELD_VALUE("field.value"),
4245
FIELD_TYPE("field.type"),
4346
PARENT_TYPE("parent.type"),

0 commit comments

Comments
 (0)