You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Kotlin is enabled in a project it causes current language filtering fail because an empty Kotlin-based set is still passed to a JavaPrinter.
It can be reproduced in protodata-extension/.../UuidJavaRenderer.java class. The PR #87 added a forced check to quit the printing if a file isn't found. If you remove the check the tests would fail with the following diagnostics:
> Task :consumer:launchProtoDataMain FAILED
Exception in thread "main" java.lang.IllegalArgumentException: File not found: `io/spine/protodata/test/ProjectId.java`.
Source root: `/Users/sanders/Projects/Spine/ProtoData/tests/consumer/build/generated-proto/main/kotlin`.
Target root: `/Users/sanders/Projects/Spine/ProtoData/tests/consumer/generated/main/kotlin`.
at io.spine.protodata.renderer.SourceFileSet.file$lambda$2(SourceFileSet.kt:131)
at java.base/java.util.Optional.orElseThrow(Optional.java:408)
at io.spine.protodata.renderer.SourceFileSet.file(SourceFileSet.kt:130)
at io.spine.protodata.test.uuid.UuidJavaRenderer.render(UuidJavaRenderer.java:93)
at io.spine.protodata.renderer.Renderer.renderSources$compiler(Renderer.kt:54)
As you can see from the above error, the file which is attempted to be found is .java, while source- and target roots are under main/kotlin.
This happens because UuiRenderer attempts to find ProjectId.java (which name it calculates from a proto type name) under a directory with generated Kotlin code.
Presumably, the root cause is that Renderer.renderSources() creates an empty set (when all .kt files are not matched to .java), and then the empty set is passed to UuidJavaRenderer.render().
The text was updated successfully, but these errors were encountered:
I've added the check for the empty set in Renderer.renderSource(). But it did not work work inside #87 (as currently integration tests don't seem to use the latest code).
More, it failed one of the tests of Pipeline, so I had to remove it.
If Kotlin is enabled in a project it causes current language filtering fail because an empty Kotlin-based set is still passed to a
JavaPrinter
.It can be reproduced in
protodata-extension/.../UuidJavaRenderer.java
class. The PR #87 added a forced check to quit the printing if a file isn't found. If you remove the check the tests would fail with the following diagnostics:As you can see from the above error, the file which is attempted to be found is
.java
, while source- and target roots are undermain/kotlin
.This happens because
UuiRenderer
attempts to findProjectId.java
(which name it calculates from a proto type name) under a directory with generated Kotlin code.Presumably, the root cause is that
Renderer.renderSources()
creates an empty set (when all.kt
files are not matched to.java
), and then the empty set is passed toUuidJavaRenderer.render()
.The text was updated successfully, but these errors were encountered: