Fix broken Kotlin examples in reference documentation #46064
+51
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are multiple issues related to the Kotlin examples included in the Antora docs of the
spring-boot-docs
module.org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.devtools
instead oforg.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.devtools
. As a result, none of the Kotlin examples from this page are picked up by Antora:The
MyContainers.kt
example file is empty, unlike its Java counterpart:spring-boot/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt
Lines 17 to 20 in af926e2
The Advanced Native Images Topics page contains an
include-code::Nested[]
block:spring-boot/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/packaging/native-image/advanced-topics.adoc
Lines 9 to 17 in 4aff06a
The Java version of the
Nested
class is used directly as an example. However, the Kotlin version of the same class was added in the Kotlin 2.1.0 migration PR only to make the code compile, as it is required byMyPropertiesKotlin.kt
.Since both classes share the same fully qualified name, Antora also picks up the Kotlin version and displays it on the page:
This is what it looks like when the Kotlin version is shown:
This PR fixes these issues by:
org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.devtools
toorg.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.devtools
.Nested.kt
file to anested
subpackage to prevent it from being picked up by Antora.MyContainers.kt
file.SomeController.kt
file, since it's unused (anotherSomeController.kt
exists in the parent package and is the one actually referenced).