Skip to content

Commit

Permalink
make sure writer is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 11, 2024
1 parent 37ada2f commit 2d73d25
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/Create_Macro.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ private void saveMacro() {
}
}

try {
FileWriter writer = new FileWriter(selectedFile);
try (FileWriter writer = new FileWriter(selectedFile)) {
writer.write(this.codeTextArea.getText());
writer.close();

Expand Down

0 comments on commit 2d73d25

Please sign in to comment.