Use try-with-resources in some places

This commit is contained in:
tonymanou
2017-01-12 02:02:52 +01:00
committed by topjohnwu
parent 57e6f3080c
commit 21b00ac6ca
5 changed files with 27 additions and 33 deletions

View File

@@ -182,14 +182,10 @@ public class LogFragment extends Fragment {
List<String> in = Utils.readFile(MAGISK_LOG);
try {
FileWriter out = new FileWriter(targetFile);
try (FileWriter out = new FileWriter(targetFile)) {
for (String line : in) {
out.write(line + "\n");
}
out.close();
return true;
} catch (IOException e) {
e.printStackTrace();