aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat@beresnev.me>2022-01-24 15:56:19 +0300
committerGitHub <noreply@github.com>2022-01-24 15:56:19 +0300
commitd884fa7ce3088ac9ae0ca1bbad70e698888610fa (patch)
treeb4c22debbc93849d438e4dd7d8b82551a634d744 /plugins/javadoc
parentcdebe4038580564fc45ef507303c334b94fbb7eb (diff)
downloaddokka-d884fa7ce3088ac9ae0ca1bbad70e698888610fa.tar.gz
dokka-d884fa7ce3088ac9ae0ca1bbad70e698888610fa.tar.bz2
dokka-d884fa7ce3088ac9ae0ca1bbad70e698888610fa.zip
Close Input/Output streams (#2319)
* Close Input/Output streams
Diffstat (limited to 'plugins/javadoc')
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
index 91e8189b..1d721611 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
@@ -189,8 +189,12 @@ class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) :
private class ResourceTemplateProvider(val basePath: String) : TemplateProvider {
override suspend fun get(template: String): String =
- javaClass.classLoader.getResourceAsStream("$basePath/$template")?.bufferedReader()?.lines()?.toArray()
- ?.joinToString("\n") ?: throw IllegalStateException("Template not found: $basePath/$template")
+ javaClass.classLoader.getResourceAsStream("$basePath/$template")?.use { stream ->
+ stream.bufferedReader()
+ .lines()
+ .toArray()
+ .joinToString("\n")
+ } ?: throw IllegalStateException("Template not found: $basePath/$template")
}
}