Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java
index 081c74dfa..3b61b8e75 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java
@@ -147,8 +147,15 @@ public abstract class AbstractSimpleConfiguratorTest extends AbstractProvisionin
value = mf.getMainAttributes().getValue(entry);
os.close();
} else {
- JarFile bundleJar = new JarFile(bundleFile);
- value = bundleJar.getManifest().getMainAttributes().getValue(entry);
+ JarFile bundleJar = null;
+ try {
+ bundleJar = new JarFile(bundleFile);
+ value = bundleJar.getManifest().getMainAttributes().getValue(entry);
+ } finally {
+ if (bundleJar != null) {
+ bundleJar.close();
+ }
+ }
}
if (value.indexOf(";") > -1) {
String[] valueElements = value.split(";");

Back to the top