diff options
author | Ignat Beresnev <ignat@beresnev.me> | 2022-01-24 15:56:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 15:56:19 +0300 |
commit | d884fa7ce3088ac9ae0ca1bbad70e698888610fa (patch) | |
tree | b4c22debbc93849d438e4dd7d8b82551a634d744 /plugins/javadoc | |
parent | cdebe4038580564fc45ef507303c334b94fbb7eb (diff) | |
download | dokka-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.kt | 8 |
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") } } |