Skip to content

Commit 274766f

Browse files
Release 1.3.2: Properly handle inputStream resource management
1 parent 1f3f307 commit 274766f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/com/teragrep/jla_04/RelpConfig.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ private void initLogger() {
7070
System.out.println("Can't find properties file at " + configpath);
7171
return;
7272
}
73-
FileInputStream inputStream = null;
74-
try {
75-
inputStream = new FileInputStream(configpath);
73+
try(FileInputStream inputStream = new FileInputStream(configpath)) {
7674
LogManager.getLogManager().readConfiguration(inputStream);
77-
inputStream.close();
7875
} catch (Exception e) {
7976
e.printStackTrace();
8077
}

0 commit comments

Comments
 (0)