From 7124b989d65ed6372d893ba85701bb72ece294d7 Mon Sep 17 00:00:00 2001 From: Alexander Shustanov Date: Tue, 6 Oct 2020 12:00:44 +0400 Subject: [PATCH] closed leaked streams --- src/main/kotlin/com/haulmont/cuba/cli/Messages.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt b/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt index 57e72bd..88910a2 100644 --- a/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt +++ b/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt @@ -33,7 +33,7 @@ class Messages(clazz: Class<*>, messagesFileName: String = "messages.properties" }.let { clazz.getResource(it)?.openStream()?.reader() ?: throw RuntimeException("Unable to find messages file $messagesFileName for $clazz") - }.let { reader -> + }.use { reader -> Properties().apply { load(reader) }