diff options
author | Tom Schindl | 2015-11-10 21:43:06 +0000 |
---|---|---|
committer | Dani Megert | 2017-02-17 14:42:39 +0000 |
commit | 7a406cf5be105f723c9278398130bf0f87117100 (patch) | |
tree | 0791c84c9433b806167090f4fe94608204bc7d49 | |
parent | 2855a7d98361b68d9813a8742784d6ec317c4f3a (diff) | |
download | eclipse.platform.runtime-7a406cf5be105f723c9278398130bf0f87117100.tar.gz eclipse.platform.runtime-7a406cf5be105f723c9278398130bf0f87117100.tar.xz eclipse.platform.runtime-7a406cf5be105f723c9278398130bf0f87117100.zip |
Bug 481888 - Free org.eclipse.e4.core.di from Equinox Specific APIsY20170223-1000I20170222-2000I20170221-2000I20170220-2000I20170219-2000I20170218-2000I20170217-2000
Change-Id: I9a372ebe8b8747d8c670719e246fa254916afc0e
Signed-off-by: Tom Schindl <tom.schindl@bestsolution.at>
3 files changed, 3 insertions, 31 deletions
diff --git a/bundles/org.eclipse.e4.core.di/.options b/bundles/org.eclipse.e4.core.di/.options index 5c43129d4..09608473d 100644 --- a/bundles/org.eclipse.e4.core.di/.options +++ b/bundles/org.eclipse.e4.core.di/.options @@ -1,4 +1,4 @@ # Turn on debugging for the bundle org.eclipse.e4.core.di/debug=false -# Turn on debugging of the Injector -org.eclipse.e4.core.di/debug/injector=false + +# NOTE: You can turn on debugging of the Injector by setting the Java system property org.eclipse.e4.core.di.debug=true diff --git a/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF index dfae49868..80cc96ef2 100644 --- a/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF @@ -24,6 +24,5 @@ Require-Bundle: org.eclipse.e4.core.di.annotations;bundle-version="[1.4.0,2.0.0) Import-Package: javax.annotation, javax.inject;version="1.0.0", org.eclipse.osgi.framework.log;version="1.1.0", - org.eclipse.osgi.service.debug;version="1.2.0", org.osgi.framework;version="1.8.0", org.osgi.util.tracker;version="1.5.1" diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java index 6b24e8cc1..4b0af1357 100644 --- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java +++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java @@ -48,42 +48,15 @@ import org.eclipse.e4.core.di.suppliers.IObjectDescriptor; import org.eclipse.e4.core.di.suppliers.IRequestor; import org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier; import org.eclipse.e4.core.internal.di.osgi.LogHelper; -import org.eclipse.osgi.service.debug.DebugOptions; import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; /** * Reflection-based dependency injector. */ public class InjectorImpl implements IInjector { - final static private String DEBUG_INJECTION = "org.eclipse.e4.core.di/debug/injector"; //$NON-NLS-1$ - final static private boolean shouldDebug = getBooleanOption(DEBUG_INJECTION, false); - - private static boolean getBooleanOption(String option, boolean defaultValue) { - try { - Bundle bundle = FrameworkUtil.getBundle(InjectorImpl.class); - BundleContext context = bundle == null ? null : bundle.getBundleContext(); - ServiceReference<DebugOptions> ref = context == null ? null - : context.getServiceReference(DebugOptions.class); - if (ref == null) { - return false; - } - try { - DebugOptions options = context.getService(ref); - if (options == null) { - return false; - } - return options.getBooleanOption(option, defaultValue); - } finally { - context.ungetService(ref); - } - } catch (Throwable t) { - return false; - } - } + final static private boolean shouldDebug = Boolean.getBoolean("org.eclipse.e4.core.di.debug"); //$NON-NLS-1$ final static private String JAVA_OBJECT = "java.lang.Object"; //$NON-NLS-1$ |