From 94f04e0789cf4f3cd7b61c2f364470d2c7257c58 Mon Sep 17 00:00:00 2001 From: Libor Rysavy Date: Sun, 7 Feb 2016 20:54:34 +0100 Subject: [PATCH] Close InputStream after version number loaded --- src/main/java/com/brianmcmichael/sagu/SAGUUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/brianmcmichael/sagu/SAGUUtils.java b/src/main/java/com/brianmcmichael/sagu/SAGUUtils.java index 224ccb6..5dc193c 100644 --- a/src/main/java/com/brianmcmichael/sagu/SAGUUtils.java +++ b/src/main/java/com/brianmcmichael/sagu/SAGUUtils.java @@ -29,8 +29,7 @@ private SAGUUtils() { */ static String loadVersionNumber() { final Properties properties = new Properties(); - final InputStream resourceIS = SAGU.class.getResourceAsStream("/version.properties"); - try { + try(final InputStream resourceIS = SAGU.class.getResourceAsStream("/version.properties")) { properties.load(resourceIS); } catch (IOException e) { e.printStackTrace();