idegen: Migrate try-finally to try-with-resources for Configuration.java

Test: run idegen.sh to generate files for IntelliJ without error

Signed-off-by: utzcoz <utzcoz@gmail.com>
Change-Id: If1066d236ef44aff6b9f73a40751ad232a80f6f9
This commit is contained in:
utzcoz
2022-10-01 12:08:50 +08:00
parent d6c9ae2806
commit e381c93d13

View File

@@ -276,8 +276,7 @@ public class Configuration {
*/ */
public static void parseFile(File file, Collection<Pattern> patterns) public static void parseFile(File file, Collection<Pattern> patterns)
throws IOException { throws IOException {
BufferedReader in = new BufferedReader(new FileReader(file)); try (BufferedReader in = new BufferedReader(new FileReader(file))) {
try {
String line; String line;
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
String trimmed = line.trim(); String trimmed = line.trim();
@@ -285,8 +284,6 @@ public class Configuration {
patterns.add(Pattern.compile(trimmed)); patterns.add(Pattern.compile(trimmed));
} }
} }
} finally {
in.close();
} }
} }
} }