We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b642623 + f36de03 commit 74f3799Copy full SHA for 74f3799
execute-around/src/main/java/com/iluwatar/execute/around/SimpleFileWriter.java
@@ -37,11 +37,8 @@ public class SimpleFileWriter {
37
* Constructor
38
*/
39
public SimpleFileWriter(String filename, FileWriterAction action) throws IOException {
40
- FileWriter writer = new FileWriter(filename);
41
- try {
+ try (FileWriter writer = new FileWriter(filename)) {
42
action.writeFile(writer);
43
- } finally {
44
- writer.close();
45
}
46
47
0 commit comments