summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2012-03-13 17:19:53 (EDT)
committerKarsten Thoms2012-03-13 17:19:53 (EDT)
commit7c78e8fe0bc2ea8cf752cc65ef7f96a8a6e97706 (patch)
tree9eb937309d42ab2acf622776c1b58b4bf7b0df98
parentc2ba203dbd1ed6897588059d502b79e106aac7f2 (diff)
downloadorg.eclipse.mwe-7c78e8fe0bc2ea8cf752cc65ef7f96a8a6e97706.zip
org.eclipse.mwe-7c78e8fe0bc2ea8cf752cc65ef7f96a8a6e97706.tar.gz
org.eclipse.mwe-7c78e8fe0bc2ea8cf752cc65ef7f96a8a6e97706.tar.bz2
registerGenModel: avoided NPE when GenPackage is an unresolved proxyv2.3.0M6
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/GenModelHelper.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/GenModelHelper.java b/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/GenModelHelper.java
index bf226de..7473ab0 100644
--- a/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/GenModelHelper.java
+++ b/plugins/org.eclipse.emf.mwe.utils/src/org/eclipse/emf/mwe/utils/GenModelHelper.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.mwe.core.ConfigurationException;
/**
@@ -61,6 +62,10 @@ public class GenModelHelper {
public void registerGenModel(GenModel genModel) {
Map<String, URI> registry = EcorePlugin.getEPackageNsURIToGenModelLocationMap();
for (GenPackage pkg : collectGenPackages(genModel)) {
+ if (pkg.eIsProxy()) {
+ log.debug("Unresolved proxy for GenPackage "+EcoreUtil.getURI(pkg));
+ continue;
+ }
String nsURI = pkg.getEcorePackage().getNsURI();
if (nsURI != null) {
URI newUri = pkg.eResource().getURI();