Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2021-06-18 07:00:28 +0000
committerEd Merks2021-06-18 07:00:28 +0000
commit0104066699230e7015fb016d07ee476e44e510ef (patch)
treef25266658a4bf1a2e89487cca90c78bc1322cb61 /plugins
parent7c76e8231ff9b35b304901869dfe0b18f9b07a6e (diff)
downloadorg.eclipse.emf-master.tar.gz
org.eclipse.emf-master.tar.xz
org.eclipse.emf-master.zip
[574049] Improve the detection of OSGi for determining the packageHEADmaster
registry implementation
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.common/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java28
-rw-r--r--plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.ecore/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EPackageRegistryImpl.java2
6 files changed, 29 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.common/META-INF/MANIFEST.MF
index a5aba8886..4edda7f34 100644
--- a/plugins/org.eclipse.emf.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.common/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.common;singleton:=true
-Bundle-Version: 2.22.0.qualifier
+Bundle-Version: 2.23.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.emf.common.CommonPlugin$Implementation$Activator
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.emf.common/pom.xml b/plugins/org.eclipse.emf.common/pom.xml
index 483ecab9f..fb734194a 100644
--- a/plugins/org.eclipse.emf.common/pom.xml
+++ b/plugins/org.eclipse.emf.common/pom.xml
@@ -12,7 +12,7 @@
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
- <version>2.22.0-SNAPSHOT</version>
+ <version>2.23.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java
index a3e71f07b..e85619569 100644
--- a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java
+++ b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java
@@ -21,21 +21,21 @@ import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import java.util.jar.Manifest;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
-
import org.eclipse.emf.common.util.DelegatingResourceLocator;
import org.eclipse.emf.common.util.Logger;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkUtil;
/**
@@ -57,6 +57,24 @@ import org.eclipse.emf.common.util.WrappedException;
*/
public abstract class EMFPlugin extends DelegatingResourceLocator implements ResourceLocator, Logger
{
+ /**
+ * @since 2.27
+ */
+ public static final boolean IS_OSGI_RUNNING;
+ static
+ {
+ boolean result = false;
+ try
+ {
+ result = FrameworkUtil.getBundle(EMFPlugin.class) != null;
+ }
+ catch (Throwable exception)
+ {
+ // Assume that we aren't running.
+ }
+ IS_OSGI_RUNNING = result;
+ }
+
public static final boolean IS_ECLIPSE_RUNNING;
static
{
diff --git a/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
index 809532254..10dc68669 100644
--- a/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.ecore;singleton:=true
-Bundle-Version: 2.24.0.qualifier
+Bundle-Version: 2.25.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation$Activator
Bundle-Vendor: %providerName
@@ -22,7 +22,7 @@ Export-Package: org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xml.type.internal,
org.eclipse.emf.ecore.xml.type.util
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)";resolution:=optional;x-installation:=greedy,
- org.eclipse.emf.common;bundle-version="[2.22.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.common;bundle-version="[2.23.0,3.0.0)";visibility:=reexport,
org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)";resolution:=optional
Import-Package: javax.crypto,
javax.crypto.spec,
diff --git a/plugins/org.eclipse.emf.ecore/pom.xml b/plugins/org.eclipse.emf.ecore/pom.xml
index 6066ecb67..39340caa0 100644
--- a/plugins/org.eclipse.emf.ecore/pom.xml
+++ b/plugins/org.eclipse.emf.ecore/pom.xml
@@ -12,7 +12,7 @@
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
- <version>2.24.0-SNAPSHOT</version>
+ <version>2.25.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EPackageRegistryImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EPackageRegistryImpl.java
index d58afbf07..c2ce4e628 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EPackageRegistryImpl.java
@@ -52,7 +52,7 @@ public class EPackageRegistryImpl extends HashMap<String, Object> implements EPa
{
return EcorePlugin.getDefaultRegistryImplementation();
}
- else if (!EMFPlugin.IS_ECLIPSE_RUNNING)
+ else if (!EMFPlugin.IS_OSGI_RUNNING)
{
try
{

Back to the top