Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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