Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-01-29 09:04:49 +0000
committerLars Vogel2019-01-31 18:56:00 +0000
commit5e839868c2e2099f055ea9dcf40c303e4b71cb2e (patch)
tree99db2ff253544d7bf38dc066f1721baeeb58989e
parentc0ca4c0ecd6b2b30234bbcbae4d502be4f8a3b34 (diff)
downloadrt.equinox.p2-5e839868c2e2099f055ea9dcf40c303e4b71cb2e.tar.gz
rt.equinox.p2-5e839868c2e2099f055ea9dcf40c303e4b71cb2e.tar.xz
rt.equinox.p2-5e839868c2e2099f055ea9dcf40c303e4b71cb2e.zip
Bug 543927 - Remove Activator from org.eclipse.equinox.p2.metadataY20190201-0030I20190202-1800I20190201-1800I20190201-0600I20190131-1800
Change-Id: I4b9e5bb4041045ed71c8a4c707a36ecb40709a3d Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/MetadataActivator.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java4
4 files changed, 6 insertions, 45 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
index 4cf89b8d7..4ac2b1ea3 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.metadata;singleton:=true
Bundle-Version: 2.4.300.qualifier
-Bundle-Activator: org.eclipse.equinox.internal.p2.metadata.MetadataActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.internal.p2.metadata;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/MetadataActivator.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/MetadataActivator.java
deleted file mode 100644
index d6763f4ec..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/MetadataActivator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2017 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.metadata;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class MetadataActivator implements BundleActivator {
- public static final String PI_METADATA = "org.eclipse.equinox.p2.metadata"; //$NON-NLS-1$
-
- public static MetadataActivator instance;
-
- private BundleContext context;
-
- public static BundleContext getContext() {
- MetadataActivator activator = instance;
- return activator == null ? null : activator.context;
- }
-
- @Override
- public void start(BundleContext aContext) throws Exception {
- context = aContext;
- instance = this;
- }
-
- @Override
- public void stop(BundleContext aContext) throws Exception {
- instance = null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
index 5de74e419..32b2ee46d 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
@@ -54,6 +54,9 @@ import org.eclipse.osgi.service.localization.LocaleProvider;
public class TranslationSupport {
// TODO: these constants should come from API, eg. IInstallableUnit or ???
static final Locale DEFAULT_LOCALE = new Locale("df", "LT"); //$NON-NLS-1$//$NON-NLS-2$
+
+ public static final String PI_METADATA = "org.eclipse.equinox.p2.metadata"; //$NON-NLS-1$
+
private static TranslationSupport instance;
static final String NAMESPACE_IU_LOCALIZATION = "org.eclipse.equinox.p2.localization"; //$NON-NLS-1$
@@ -251,7 +254,7 @@ public class TranslationSupport {
if (fragmentSource == null) {
if (!loggedMissingSource) {
loggedMissingSource = true;
- LogHelper.log(new Status(IStatus.INFO, MetadataActivator.PI_METADATA, "No translation source unavailable. Default language will be used.")); //$NON-NLS-1$
+ LogHelper.log(new Status(IStatus.INFO, PI_METADATA, "No translation source unavailable. Default language will be used.")); //$NON-NLS-1$
}
return Collector.emptyCollector();
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
index 19f8dd549..822df547e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java
@@ -18,8 +18,8 @@ import java.lang.reflect.Constructor;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Comparator;
-import org.eclipse.equinox.internal.p2.metadata.MetadataActivator;
import org.eclipse.equinox.p2.metadata.Version;
+import org.osgi.framework.FrameworkUtil;
/**
* A comparator that performs coercion if needed before comparison.
@@ -69,7 +69,7 @@ public abstract class CoercingComparator<T> {
return (Class<?>) v;
if (v instanceof String) {
try {
- return MetadataActivator.getContext().getBundle().loadClass(((String) v).trim());
+ return FrameworkUtil.getBundle(CoercingComparator.class).loadClass(((String) v).trim());
} catch (Exception e) {
//
}

Back to the top