Bug 481888 - Free org.eclipse.e4.core.di from Equinox Specific APIs

Change-Id: I9a372ebe8b8747d8c670719e246fa254916afc0e
Signed-off-by: Tom Schindl <tom.schindl@bestsolution.at>
diff --git a/bundles/org.eclipse.e4.core.di/.options b/bundles/org.eclipse.e4.core.di/.options
index 5c43129..0960847 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 dfae498..80cc96e 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 @@
 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 6b24e8c..4b0af13 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.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$