/*  Copyright (C) 2003-2015 JabRef contributors.
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package net.sf.jabref.logic.util;

import java.io.IOException;
import java.util.Properties;

public class BuildInfo {

    private final String version;


    public BuildInfo() {
        this("/build.properties");
    }

    public BuildInfo(String path) {
        Properties properties = new Properties();

        try {
            properties.load(getClass().getResourceAsStream(path));
        } catch (IOException | NullPointerException ignored) {
        }
        version = properties.getProperty("version", "dev");
    }

    public String getVersion() {
        return version;
    }
}

@@ -832,16 +832,44 @@
 eption;%0A
+import java.io.InputStream;%0A
 import j
@@ -889,16 +889,16 @@
 erties;%0A
-
 %0Apublic 
@@ -1118,78 +1118,220 @@
     
+S
 tr
-y %7B%0A            properties.load(getClass().getResourceAsStream(path)
+ing versionFromProps = %22%22;%0A%0A        try (InputStream stream = getClass().getResourceAsStream(path)) %7B%0A            properties.load(stream);%0A            versionFromProps = properties.getProperty(%22version%22, %22dev%22
 );%0A 
@@ -1402,16 +1402,17 @@
       %7D%0A
+%0A
         
@@ -1425,48 +1425,24 @@
 n = 
-properties.getProperty(%22version%22, %22dev%22)
+versionFromProps
 ;%0A  

Fix resource leak in BuildInfo