Skip to content

Commit d4c5d59

Browse files
author
yevhenii-nadtochii
committed
Add more details to docs
1 parent a0b82ca commit d4c5d59

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

java/src/main/kotlin/io/spine/validation/java/DistributingGenerator.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ internal class DistributingGenerator(
9999
returns(violationsType)
100100
addCode(body)
101101
}
102-
.toString() // `MethodSpec` cannot be directly added to `CodeBloc`.
103-
.replace("$", "$$") // We need to escape `$` symbols,
104-
// which can be present in error templates.
102+
// `MethodSpec` cannot be added to `CodeBlock`, so we have to convert it to `String`.
103+
// We also need to escape `$` symbols because they are part of JavaPoet templates.
104+
// These symbols can be present in our own error message templates.
105+
.toString()
106+
.replace("$", "$$")
105107

106108
return otherMembers.toBuilder()
107109
.add(groupingMethod)

0 commit comments

Comments
 (0)