diff options
author | Carsten Hammer | 2019-05-25 13:30:13 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2019-06-14 09:13:39 +0000 |
commit | 84f85561d3a506b14f72c48bbc8cf1bfa4b42143 (patch) | |
tree | 7878f5d341b762d00ad2b537e6acf3f3b7d5ee78 | |
parent | ec774ae5b0e9989299dc7daad7b657949cd66f28 (diff) | |
download | eclipse.platform.debug-84f85561d3a506b14f72c48bbc8cf1bfa4b42143.tar.gz eclipse.platform.debug-84f85561d3a506b14f72c48bbc8cf1bfa4b42143.tar.xz eclipse.platform.debug-84f85561d3a506b14f72c48bbc8cf1bfa4b42143.zip |
Use try-with-resources
Convert try finally block to try-with-resources
Change-Id: Ie1c7a18c07e60600405e5beba0ff4ae573568fe3
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java index b5910846b..ecd60220f 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java @@ -310,14 +310,8 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen added = true; updateMonitor(lmonitor, 1); } - BufferedOutputStream stream = null; - try { - stream = new BufferedOutputStream(file.openOutputStream(EFS.NONE, null)); + try (BufferedOutputStream stream = new BufferedOutputStream(file.openOutputStream(EFS.NONE, null))) { stream.write(xml.getBytes(StandardCharsets.UTF_8)); - } finally { - if(stream != null) { - stream.close(); - } } //notify file saved updateMonitor(lmonitor, 1); |