summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2013-09-03 15:02:28 (EDT)
committerIan Bull2013-09-03 15:02:28 (EDT)
commit2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a (patch)
tree835a1909e1d78ec1d291229be5236eb15ff7dce2
parentaccb0483a52f49f393d25f866504b00e2cc2fa50 (diff)
downloadrt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.zip
rt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.tar.gz
rt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.tar.bz2
Bug 381673 - 16 compile warnings in official build
Close the BundleJar resource.
-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 081c74d..3b61b8e 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(";");