diff options
author | Ian Bull | 2013-09-03 19:02:28 +0000 |
---|---|---|
committer | Ian Bull | 2013-09-03 19:02:28 +0000 |
commit | 2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a (patch) | |
tree | 835a1909e1d78ec1d291229be5236eb15ff7dce2 | |
parent | accb0483a52f49f393d25f866504b00e2cc2fa50 (diff) | |
download | rt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.tar.gz rt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.tar.xz rt.equinox.p2-2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a.zip |
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.java | 11 |
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(";"); |