Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Faltermeier2014-10-27 09:29:25 -0400
committerJohannes Faltermeier2014-10-27 09:29:25 -0400
commit4c920e6c5ebc1abd18f6eef8295d9d65f52e83f3 (patch)
tree7f088db8280b880f4c858ef8c630d6fcccbf14ac
parentaac3713be72b524b0399abdcc28a9b4c626f16ff (diff)
downloadorg.eclipse.emf.edapt-4c920e6c5ebc1abd18f6eef8295d9d65f52e83f3.tar.gz
org.eclipse.emf.edapt-4c920e6c5ebc1abd18f6eef8295d9d65f52e83f3.tar.xz
org.eclipse.emf.edapt-4c920e6c5ebc1abd18f6eef8295d9d65f52e83f3.zip
Added some null checks required when executed outside of osgi
-rw-r--r--plugins/org.eclipse.emf.edapt.common/src/org/eclipse/emf/edapt/common/LoggingUtils.java6
-rw-r--r--plugins/org.eclipse.emf.edapt.migration/generated-src/org/eclipse/emf/edapt/spi/migration/MigrationPlugin.java3
-rw-r--r--plugins/org.eclipse.emf.edapt.migration/src/org/eclipse/emf/edapt/internal/migration/FactoryHelper.java3
3 files changed, 9 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.edapt.common/src/org/eclipse/emf/edapt/common/LoggingUtils.java b/plugins/org.eclipse.emf.edapt.common/src/org/eclipse/emf/edapt/common/LoggingUtils.java
index df93560..4d5d97a 100644
--- a/plugins/org.eclipse.emf.edapt.common/src/org/eclipse/emf/edapt/common/LoggingUtils.java
+++ b/plugins/org.eclipse.emf.edapt.common/src/org/eclipse/emf/edapt/common/LoggingUtils.java
@@ -59,12 +59,18 @@ public final class LoggingUtils {
/** Log status. */
public static void log(Plugin plugin, IStatus status) {
+ if (plugin == null) {
+ return;
+ }
plugin.getLog().log(status);
}
/** Create status. */
public static IStatus createStatus(Plugin plugin, int severity, int code,
String message, Throwable exception) {
+ if (plugin == null) {
+ return null;
+ }
String pluginId = plugin.getBundle().getSymbolicName();
return new Status(severity, pluginId, code, message, exception);
}
diff --git a/plugins/org.eclipse.emf.edapt.migration/generated-src/org/eclipse/emf/edapt/spi/migration/MigrationPlugin.java b/plugins/org.eclipse.emf.edapt.migration/generated-src/org/eclipse/emf/edapt/spi/migration/MigrationPlugin.java
index e6a0293..f88e7e1 100644
--- a/plugins/org.eclipse.emf.edapt.migration/generated-src/org/eclipse/emf/edapt/spi/migration/MigrationPlugin.java
+++ b/plugins/org.eclipse.emf.edapt.migration/generated-src/org/eclipse/emf/edapt/spi/migration/MigrationPlugin.java
@@ -67,9 +67,6 @@ public final class MigrationPlugin extends EMFPlugin {
* @generated
*/
public static Implementation getPlugin() {
- if (plugin == null) {
- plugin = new Implementation();
- }
return plugin;
}
diff --git a/plugins/org.eclipse.emf.edapt.migration/src/org/eclipse/emf/edapt/internal/migration/FactoryHelper.java b/plugins/org.eclipse.emf.edapt.migration/src/org/eclipse/emf/edapt/internal/migration/FactoryHelper.java
index 16a884a..7c7d103 100644
--- a/plugins/org.eclipse.emf.edapt.migration/src/org/eclipse/emf/edapt/internal/migration/FactoryHelper.java
+++ b/plugins/org.eclipse.emf.edapt.migration/src/org/eclipse/emf/edapt/internal/migration/FactoryHelper.java
@@ -49,6 +49,9 @@ public final class FactoryHelper {
private void readExtensionPoint() {
final IExtensionRegistry extensionRegistry = Platform
.getExtensionRegistry();
+ if (extensionRegistry == null) {
+ return;
+ }
final IConfigurationElement[] configurationElements = extensionRegistry
.getConfigurationElementsFor(POINT_ID);
for (final IConfigurationElement configurationElement : configurationElements) {

Back to the top