diff options
author | Ian Bull | 2013-09-03 18:59:59 +0000 |
---|---|---|
committer | Ian Bull | 2013-09-03 18:59:59 +0000 |
commit | accb0483a52f49f393d25f866504b00e2cc2fa50 (patch) | |
tree | 4974d97ce0d95095d340a8c3bbc75639d4f31658 /bundles/org.eclipse.equinox.p2.tests | |
parent | 6223b0efce1380e5540af374e74df821f163dbbd (diff) | |
download | rt.equinox.p2-accb0483a52f49f393d25f866504b00e2cc2fa50.tar.gz rt.equinox.p2-accb0483a52f49f393d25f866504b00e2cc2fa50.tar.xz rt.equinox.p2-accb0483a52f49f393d25f866504b00e2cc2fa50.zip |
Bug 381673 - 16 compile warnings in official build
Close the FrameworkClassLoader
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java index 6dc33c0fe..3eea18a57 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java @@ -37,8 +37,9 @@ public class EmbeddedEquinox { public BundleContext startFramework() { System.setProperty("osgi.framework.useSystemProperties", "false"); + URLClassLoader frameworkLoader = null; try { - URLClassLoader frameworkLoader = new FrameworkClassLoader(frameworkClassPath, this.getClass().getClassLoader()); + frameworkLoader = new FrameworkClassLoader(frameworkClassPath, this.getClass().getClassLoader()); eclipseStarterClazz = frameworkLoader.loadClass("org.eclipse.core.runtime.adaptor.EclipseStarter"); Method setInitialProperties = eclipseStarterClazz.getMethod("setInitialProperties", new Class[] {Map.class}); //$NON-NLS-1$ @@ -50,6 +51,14 @@ public class EmbeddedEquinox { if (t instanceof RuntimeException) throw (RuntimeException) t; throw new RuntimeException(t); + } finally { + if (frameworkLoader != null) { + try { + frameworkLoader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } return context; } |