Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Honnen2018-11-22 14:16:03 +0000
committerLars Vogel2018-12-13 08:59:45 +0000
commit0a0e44733a94e46826345c7d6be8f75afd4b871a (patch)
treec3cb7e27ccb990d5aa2fbd1f18dc1a525582a504
parentd9a67c59847b18f120ae3bb28d446c56f057e1ab (diff)
downloadeclipse.pde.ui-0a0e44733a94e46826345c7d6be8f75afd4b871a.tar.gz
eclipse.pde.ui-0a0e44733a94e46826345c7d6be8f75afd4b871a.tar.xz
eclipse.pde.ui-0a0e44733a94e46826345c7d6be8f75afd4b871a.zip
Bug 541434 - use try-with-resources
Change-Id: I65910d8093b78548c9e3e456d06f0e91370f753b Signed-off-by: Julian Honnen <julian.honnen@vector.com>
-rw-r--r--ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java
index e4ef55b298..44b766418a 100644
--- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java
+++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java
@@ -106,27 +106,17 @@ public abstract class LaunchValidationOperation implements IWorkspaceRunnable {
}
private static Properties getPropertiesFromURL(URL profileURL) {
- InputStream is = null;
try {
profileURL = FileLocator.resolve(profileURL);
URLConnection openConnection = profileURL.openConnection();
openConnection.setUseCaches(false);
- is = openConnection.getInputStream();
- if (is != null) {
+ try (InputStream is = openConnection.getInputStream()) {
Properties profile = new Properties();
profile.load(is);
return profile;
}
} catch (IOException e) {
PDELaunchingPlugin.log(e);
- } finally {
- try {
- if (is != null) {
- is.close();
- }
- } catch (IOException e) {
- PDELaunchingPlugin.log(e);
- }
}
return null;
}

Back to the top