Skip to content

Commit 8590492

Browse files
committed
Convert to try-with-resources
1 parent 33da585 commit 8590492

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/org/netbeans/modules/php/wordpress/commands/WordPressCli.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,8 @@ public List<FrameworkCommand> getCommands(boolean isForce) {
335335
File temp = File.createTempFile("nb-wpcli-tmp", ".xml"); // NOI18N
336336
try {
337337
FileOutputStream outputStream = new FileOutputStream(temp);
338-
PrintWriter pw = new PrintWriter(new OutputStreamWriter(outputStream, "UTF-8")); // NOI18N
339-
try {
338+
try (PrintWriter pw = new PrintWriter(new OutputStreamWriter(outputStream, "UTF-8"))) { // NOI18N
340339
pw.println(commandList);
341-
} finally {
342-
pw.close();
343340
}
344341

345342
// parse

0 commit comments

Comments
 (0)