From 2cdbeb9384e9621cbdc294d3c7f0a0dfcf9e3e9a Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Tue, 3 Sep 2013 12:02:28 -0700 Subject: Bug 381673 - 16 compile warnings in official build Close the BundleJar resource.--- .../simpleconfigurator/AbstractSimpleConfiguratorTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bundles') 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(";"); -- cgit v1.2.3