Bug 520254 - Remove unnecessary activator from org.eclipse.ua.tests.doc

Change-Id: Iaa47315b12356159312d2ac04ba44ac89c2f3b2c
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF b/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF
index 5794ba3..26ce7d9 100644
--- a/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF
+++ b/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
 Bundle-Name: Doc
 Bundle-SymbolicName: org.eclipse.ua.tests.doc;singleton:=true
 Bundle-Version: 1.0.400.qualifier
-Bundle-Activator: org.eclipse.ua.tests.doc.internal.Activator
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.equinox.http.registry;bundle-version="1.0.200",
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/Activator.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/Activator.java
deleted file mode 100644
index d119f6a..0000000
--- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/Activator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.ua.tests.doc.internal;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.eclipse.ua.tests.doc";
-
-	// The shared instance
-	private static Activator plugin;
-
-	/**
-	 * The constructor
-	 */
-	public Activator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	@Override
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	@Override
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static Activator getDefault() {
-		return plugin;
-	}
-
-}
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/ApiDocTest.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/ApiDocTest.java
index ece48b7..e9e8b2f 100644
--- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/ApiDocTest.java
+++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/ApiDocTest.java
@@ -40,10 +40,10 @@
 import org.eclipse.osgi.service.resolver.ExportPackageDescription;
 import org.eclipse.osgi.service.resolver.PlatformAdmin;
 import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.ua.tests.doc.internal.Activator;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -187,7 +187,7 @@
 			@Override
 			public BundleInfo[] call() throws Exception {
 				if (bundleInfos == null) {
-					BundleContext context = Activator.getDefault().getBundle().getBundleContext();
+					BundleContext context = FrameworkUtil.getBundle(ApiDocTest.class).getBundleContext();
 					ServiceReference<SimpleConfiguratorManipulator> serviceReference = context.getServiceReference(SimpleConfiguratorManipulator.class);
 					SimpleConfiguratorManipulator manipulator = context.getService(serviceReference);
 					bundleInfos = manipulator.loadConfiguration(context, SimpleConfiguratorManipulator.SOURCE_INFO);
@@ -275,8 +275,7 @@
 
 		exportedPackageIds.add("org.eclipse.core.runtime.adaptor"); // not exported, but makes sense to document since accessible from outside of OSGi framework
 		exportedPackageIds.add("org.eclipse.swt.ole.win32"); // somehow missing from State#getExportedPackages(), maybe because it's declared in the fragment only
-
-		BundleContext context = Activator.getDefault().getBundle().getBundleContext();
+		BundleContext context = FrameworkUtil.getBundle(ApiDocTest.class).getBundleContext();
 		ServiceReference<PlatformAdmin> platformAdminReference = context.getServiceReference(PlatformAdmin.class);
 		PlatformAdmin service = context.getService(platformAdminReference);
 		State state = service.getState(false);