From 90ba2819397aee04ec965dbacfb697821ee76ae3 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 2 Apr 2019 21:54:52 +0200 Subject: [PATCH] Cleanup (unneeded nested 'try'; warnings) --- .../openapi/application/PathManager.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/platform/util/src/com/intellij/openapi/application/PathManager.java b/platform/util/src/com/intellij/openapi/application/PathManager.java index f911a60dc366..d4c1f2411f6d 100644 --- a/platform/util/src/com/intellij/openapi/application/PathManager.java +++ b/platform/util/src/com/intellij/openapi/application/PathManager.java @@ -419,17 +419,15 @@ public class PathManager { Properties sysProperties = System.getProperties(); for (String path : paths) { if (path != null && new File(path).exists()) { - try { - try (Reader fis = new BufferedReader(new FileReader(path))) { - Map properties = FileUtil.loadProperties(fis); - for (Map.Entry entry : properties.entrySet()) { - String key = entry.getKey(); - if (PROPERTY_HOME_PATH.equals(key) || PROPERTY_HOME.equals(key)) { - log(path + ": '" + key + "' cannot be redefined"); - } - else if (!sysProperties.containsKey(key)) { - sysProperties.setProperty(key, substituteVars(entry.getValue())); - } + try (@SuppressWarnings("ImplicitDefaultCharsetUsage") Reader reader = new FileReader(path)) { + Map properties = FileUtil.loadProperties(reader); + for (Map.Entry entry : properties.entrySet()) { + String key = entry.getKey(); + if (PROPERTY_HOME_PATH.equals(key) || PROPERTY_HOME.equals(key)) { + log(path + ": '" + key + "' cannot be redefined"); + } + else if (!sysProperties.containsKey(key)) { + sysProperties.setProperty(key, substituteVars(entry.getValue())); } } }