mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-01 23:29:57 +00:00
Use try-with-resources in some places
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user