From ddeaa6b3c4df61e89fd2f8d020924c981a2c27cc Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 2 Jun 2020 12:05:21 +0200 Subject: [PATCH] KEYCLOAK-14359 Close InputStream in org.keycloak.common.Version --- common/src/main/java/org/keycloak/common/Version.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/org/keycloak/common/Version.java b/common/src/main/java/org/keycloak/common/Version.java index 1f34522dec..5766ca3a0b 100755 --- a/common/src/main/java/org/keycloak/common/Version.java +++ b/common/src/main/java/org/keycloak/common/Version.java @@ -37,9 +37,8 @@ public class Version { public static String DEFAULT_PROFILE; static { - Properties props = new Properties(); - InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties"); - try { + try (InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties")) { + Properties props = new Properties(); props.load(is); Version.NAME = props.getProperty("name"); Version.NAME_FULL = props.getProperty("name-full");