Skip to content

Commit 0ac1c56

Browse files
authored
Fixed resource leak (#123)
2 parents ea0df1a + aab7003 commit 0ac1c56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

jdbc/src/main/java/tech/ydb/jdbc/common/JdbcDriverVersion.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ private static class Holder {
4343
int major = -1;
4444
int minor = -1;
4545
String version = "1.0.development";
46-
try {
46+
try (InputStream in = Version.class.getResourceAsStream(PROPERTIES_PATH)) {
4747
Properties prop = new Properties();
48-
InputStream in = Version.class.getResourceAsStream(PROPERTIES_PATH);
4948
prop.load(in);
5049
version = prop.getProperty("version");
5150
} catch (IOException e) { }

0 commit comments

Comments
 (0)