Skip to content

Commit 99e421e

Browse files
Tobias Knellmichaelklishin
authored andcommitted
close InputStream of version.properties in ClientVersion after reading
1 parent 23bf6fd commit 99e421e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/java/com/rabbitmq/client/impl/ClientVersion.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.rabbitmq.client.impl;
1717

1818
import java.io.IOException;
19+
import java.io.InputStream;
1920
import java.util.Properties;
2021

2122
/**
@@ -28,10 +29,18 @@ public class ClientVersion {
2829

2930
static {
3031
version = new Properties();
32+
InputStream inputStream = ClientVersion.class.getClassLoader()
33+
.getResourceAsStream("version.properties");
3134
try {
32-
version.load(ClientVersion.class.getClassLoader()
33-
.getResourceAsStream("version.properties"));
35+
version.load(inputStream);
3436
} catch (IOException e) {
37+
} finally {
38+
try {
39+
if(inputStream!=null) {
40+
inputStream.close();
41+
}
42+
} catch (IOException e) {
43+
}
3544
}
3645

3746
VERSION = version.getProperty("com.rabbitmq.client.version",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy