diff options
author | Lars Vogel | 2017-07-27 11:12:54 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-08-08 16:36:17 +0000 |
commit | b3a1e25e6446174ee200988aad78075129e2f94b (patch) | |
tree | 776e4c4d9652f6cd88fdafe33056f9ca8ae2789e | |
parent | 4fdc365e8773eb6fc498b428ecaee5f436878bb7 (diff) | |
download | eclipse.platform.ua-b3a1e25e6446174ee200988aad78075129e2f94b.tar.gz eclipse.platform.ua-b3a1e25e6446174ee200988aad78075129e2f94b.tar.xz eclipse.platform.ua-b3a1e25e6446174ee200988aad78075129e2f94b.zip |
Bug 520254 - Remove unnecessary activator from org.eclipse.ua.tests.docI20170808-2000
Change-Id: Iaa47315b12356159312d2ac04ba44ac89c2f3b2c
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
3 files changed, 3 insertions, 68 deletions
diff --git a/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF b/org.eclipse.ua.tests.doc/META-INF/MANIFEST.MF index 5794ba38a..26ce7d948 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-ManifestVersion: 2 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 d119f6aa3..000000000 --- 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 ece48b74a..e9e8b2f8c 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.help.internal.toc.TocFileParser; 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 @@ public class ApiDocTest { @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 @@ public class ApiDocTest { 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); |