Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-11-11 14:59:07 +0000
committerAlexander Kurtakov2017-11-11 14:59:07 +0000
commitcacd6d9d1d85adb919af8c12beb22643e76ce17d (patch)
tree66fd1e3c4719189a547f1073cc82d083f9174c80 /bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java
parent19752d9abc811e3593f031d2e8aa42290191909d (diff)
downloadrt.equinox.bundles-cacd6d9d1d85adb919af8c12beb22643e76ce17d.tar.gz
rt.equinox.bundles-cacd6d9d1d85adb919af8c12beb22643e76ce17d.tar.xz
rt.equinox.bundles-cacd6d9d1d85adb919af8c12beb22643e76ce17d.zip
Bug 527146 - Move equinox.console to Java 8I20171111-1500
Modernize the codebase with Java 8 constructs. Update console.tests bundle too. Change-Id: Id3c9ec868e6526fc9c3298138317d578db4c834c Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java')
-rwxr-xr-xbundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java b/bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java
index 91540a13f..e79a9d462 100755
--- a/bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java
+++ b/bundles/archived/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/completion/FileNamesCompleterTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 SAP AG
+ * Copyright (c) 2011, 2017 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -89,9 +89,9 @@ public class FileNamesCompleterTests {
private void createFile(File parentDir, String filename) throws IOException {
File file = new File(parentDir.getAbsolutePath() + File.separator + filename);
- PrintWriter out = new PrintWriter(new FileOutputStream(file));
- out.write(filename);
- out.flush();
- out.close();
+ try (PrintWriter out = new PrintWriter(new FileOutputStream(file))) {
+ out.write(filename);
+ out.flush();
+ }
}
}

Back to the top