diff options
author | Camille Letavernier | 2014-09-25 11:49:12 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-09-25 11:49:12 +0000 |
commit | 01bcc8d2fc38a00baebed7d511dd95729b0824f3 (patch) | |
tree | 5144b95f3695c28f963669a419e7956ccc3457a2 /plugins/uml | |
parent | 9a7762b38eb8eea87bd4495e44b31351ecf61a9d (diff) | |
download | org.eclipse.papyrus-01bcc8d2fc38a00baebed7d511dd95729b0824f3.tar.gz org.eclipse.papyrus-01bcc8d2fc38a00baebed7d511dd95729b0824f3.tar.xz org.eclipse.papyrus-01bcc8d2fc38a00baebed7d511dd95729b0824f3.zip |
445078: [XText editor] NPE when editing an untyped Port via the XText
editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=445078
Diffstat (limited to 'plugins/uml')
-rw-r--r-- | plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java index 719f3f7a827..a132acb2e20 100644 --- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java +++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java @@ -97,9 +97,6 @@ public class PortTypeAdapter extends AdapterImpl { break; } } - - - } /** @@ -110,9 +107,11 @@ public class PortTypeAdapter extends AdapterImpl { * */ private void detachAdapter(Type type) { + if (type == null) { + return; + } EObject source = determineSource(type); source.eAdapters().remove(adapter); - } /** @@ -123,7 +122,6 @@ public class PortTypeAdapter extends AdapterImpl { */ private void attachAdapter(Type oldType, Type newType) { - EObject newSource = determineSource(newType); if (newSource != null) { @@ -136,7 +134,6 @@ public class PortTypeAdapter extends AdapterImpl { } } - // Attach adapter for new type if (adapter == null || !newSource.eAdapters().contains(adapter)) { @@ -150,17 +147,10 @@ public class PortTypeAdapter extends AdapterImpl { } else if (Notification.REMOVE == notification.getEventType()) { port.eNotify(new ENotificationImpl((InternalEObject) port, notification.getEventType(), derivedFeature, notification.getOldValue(), notification.getNewValue())); } - }; - }; - } } - - - - } /** @@ -200,7 +190,5 @@ public class PortTypeAdapter extends AdapterImpl { // Notify observers port.eNotify(new ENotificationImpl((InternalEObject) port, Notification.SET, derivedFeature, null, port.eGet(derivedFeature), true)); - - } } |