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.
1 parent b642623 commit f36de03Copy full SHA for f36de03
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