Skip to content

Commit aab7003

Browse files
committed
Fixed resource leak
1 parent ea0df1a commit aab7003

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)