Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-05-27 12:44:13 +0000
committerChristian W. Damus2014-05-27 12:44:37 +0000
commit6c8f8b103d5819898304d80285d39392ba99ff8b (patch)
tree4333378bbe8c175c78e7aef25ee01f4dff67e801 /plugins/views
parent95539f6754acddc819de5ecf4d1662d2063a28d1 (diff)
downloadorg.eclipse.papyrus-6c8f8b103d5819898304d80285d39392ba99ff8b.tar.gz
org.eclipse.papyrus-6c8f8b103d5819898304d80285d39392ba99ff8b.tar.xz
org.eclipse.papyrus-6c8f8b103d5819898304d80285d39392ba99ff8b.zip
435103: Profile definition info reported for Bug 415211 is broken
https://bugs.eclipse.org/bugs/show_bug.cgi?id=435103 Add better diagnostic message than an NPE when a model-element factory descriptor is an unresolved proxy and restore the deleted descriptor in the UML Properties model.
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
index f9892c788bf..0a36400fdf8 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSourceFactory.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 435103
+ *
*****************************************************************************/
package org.eclipse.papyrus.views.properties.modelelement;
@@ -15,6 +17,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
import org.eclipse.papyrus.infra.widgets.Activator;
@@ -142,6 +145,10 @@ public class DataSourceFactory {
Activator.log.warn("No ModelElementFactory is attached to DataContextElement " + getQualifiedName(context)); //$NON-NLS-1$
return null;
}
+ if(factoryDescriptor.eIsProxy()) {
+ Activator.log.warn("Unresolved reference to the ModelElementFactory: " + EcoreUtil.getURI(factoryDescriptor)); //$NON-NLS-1$
+ return null;
+ }
String factoryName = factoryDescriptor.getFactoryClass();
ModelElementFactory factory = ClassLoaderHelper.newInstance(factoryName, ModelElementFactory.class);

Back to the top