summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-02-27 09:59:29 (EST)
committerPascal Rapicault2013-02-27 09:59:29 (EST)
commitea7172997438f874cff0116c37648882dfa14616 (patch)
treec6b7e9bec9c088ab3c64a6fce72890b437f20448
parentc0c733c5d98fd970710a9b7839ccd5811c05d9c8 (diff)
downloadrt.equinox.p2-ea7172997438f874cff0116c37648882dfa14616.zip
rt.equinox.p2-ea7172997438f874cff0116c37648882dfa14616.tar.gz
rt.equinox.p2-ea7172997438f874cff0116c37648882dfa14616.tar.bz2
Close input stream
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
index ede92b1..8c60913 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
@@ -220,17 +220,23 @@ public class PreviousConfigurationFinder {
Identifier appVersion = null;
if (eclipseProduct.exists()) {
Properties props = new Properties();
+ FileInputStream is = null;
try {
- props.load(new FileInputStream(eclipseProduct));
- appId = props.getProperty(PRODUCT_SITE_ID);
- if (appId == null || appId.trim().length() == 0)
- appId = ECLIPSE;
- String version = props.getProperty(PRODUCT_SITE_VERSION);
- if (version == null || version.trim().length() == 0)
- appVersion = new Identifier(0, 0, 0);
- else
- appVersion = new Identifier(version);
-
+ try {
+ is = new FileInputStream(eclipseProduct);
+ props.load(is);
+ appId = props.getProperty(PRODUCT_SITE_ID);
+ if (appId == null || appId.trim().length() == 0)
+ appId = ECLIPSE;
+ String version = props.getProperty(PRODUCT_SITE_VERSION);
+ if (version == null || version.trim().length() == 0)
+ appVersion = new Identifier(0, 0, 0);
+ else
+ appVersion = new Identifier(version);
+ } finally {
+ if (is != null)
+ is.close();
+ }
} catch (IOException e) {
return new String[0];
}