From 6e7c3f2893db75d935ff80895f2def3ac687bb9a Mon Sep 17 00:00:00 2001 From: Ryan Scheidter Date: Fri, 15 Feb 2019 09:08:55 -0600 Subject: [PATCH 1/3] Fix a typo in RouterFunctionDsl Javadoc Closes gh-22419 --- .../web/reactive/function/server/RouterFunctionDsl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/server/RouterFunctionDsl.kt b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/server/RouterFunctionDsl.kt index 1672c434a89..cf471db1fd7 100644 --- a/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/server/RouterFunctionDsl.kt +++ b/spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/server/RouterFunctionDsl.kt @@ -26,7 +26,7 @@ import java.net.URI /** * Allow to create easily a `RouterFunction` from a Kotlin router DSL based - * on the same building blocks than the Java one ([RouterFunction], [RequestPredicate], + * on the same building blocks as the Java one ([RouterFunction], [RequestPredicate], * [HandlerFunction]). * * Example: @@ -554,4 +554,4 @@ open class RouterFunctionDsl(private val init: RouterFunctionDsl.() -> Unit) : ( } } -} \ No newline at end of file +} From 6089ec11611c6192944f75e2c19e406de16cbd67 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Sun, 17 Feb 2019 10:08:11 +0100 Subject: [PATCH 2/3] Add a warning in Kotlin Script Templates documentation --- src/docs/asciidoc/languages/kotlin.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/docs/asciidoc/languages/kotlin.adoc b/src/docs/asciidoc/languages/kotlin.adoc index 3721608b440..c3dba7da4a7 100644 --- a/src/docs/asciidoc/languages/kotlin.adoc +++ b/src/docs/asciidoc/languages/kotlin.adoc @@ -340,11 +340,14 @@ refactoring support in a supported IDE, as the following example shows: ---- ==== +NOTE: Kotlin Script Templates are not compatible yet with Spring Boot fatjar mechanism, see related +https://youtrack.jetbrains.com/issue/KT-21443[KT-21443] and https://youtrack.jetbrains.com/issue/KT-27956[KT-27956] +issues. + See the https://github.com/sdeleuze/kotlin-script-templating[kotlin-script-templating] example project for more details. - [[kotlin-spring-projects-in-kotlin]] == Spring Projects in Kotlin From ab32dc893785c7cb89eeb3263d9a70253efb70d4 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Sun, 17 Feb 2019 10:37:11 +0100 Subject: [PATCH 3/3] Document checked exceptions with proxies in Kotlin Closes gh-22412 --- src/docs/asciidoc/languages/kotlin.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/docs/asciidoc/languages/kotlin.adoc b/src/docs/asciidoc/languages/kotlin.adoc index c3dba7da4a7..a74519b8ad0 100644 --- a/src/docs/asciidoc/languages/kotlin.adoc +++ b/src/docs/asciidoc/languages/kotlin.adoc @@ -528,6 +528,16 @@ and https://github.com/spring-projects/spring-boot/issues/1254[`@ConfigurationPr for more details. +=== Checked Exceptions + +Java and https://kotlinlang.org/docs/reference/exceptions.html[Kotlin exception handling] are pretty close, with the main +difference being that Kotlin treats all exceptions as unchecked exceptions. However, when using proxied objects +(for example classes or methods annotated with `@Transactional`), checked exceptions thrown will be wrapped by default in +an `UndeclaredThrowableException`. + +To get the original exception thrown like in Java, methods should be annotated with https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-throws/index.html[`@Throws`] +to specify explicitly the checked exceptions thrown (for example `@Throws(IOException::class)`). + === Annotation Array Attributes