summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMavlushechka <mavlushechka@gmail.com>2022-01-23 10:12:54 +0500
committerMavlushechka <mavlushechka@gmail.com>2022-01-23 10:12:54 +0500
commit3a0f1db90755dac3be6a0a5f569aa44fe3245fef (patch)
tree3d5866dc900b3674ff60bb3b640750f2f846d1d8 /src
parent8788c207f206d5f98740a22b7c72df810c7dc622 (diff)
Use try-with-resources instead of try-catch-finally
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/mavlushechka/animarfo/App.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/main/java/com/mavlushechka/animarfo/App.java b/src/main/java/com/mavlushechka/animarfo/App.java
index fd27809..a5893c9 100644
--- a/src/main/java/com/mavlushechka/animarfo/App.java
+++ b/src/main/java/com/mavlushechka/animarfo/App.java
@@ -16,22 +16,12 @@ public class App {
private static final Logger LOGGER = Logger.getLogger(App.class.getName());
static {
- FileInputStream fileInputStream = null;
-
- try {
- fileInputStream = new FileInputStream("log.config");
+ try (FileInputStream fileInputStream = new FileInputStream("log.config")) {
LogManager.getLogManager().readConfiguration(fileInputStream);
} catch (IOException ioException) {
ioException.printStackTrace();
- } finally {
- if (fileInputStream != null) {
- try {
- fileInputStream.close();
- } catch (IOException ioException) {
- ioException.printStackTrace();
- }
- }
}
+
LOGGER.setLevel(Level.ALL);
}