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