Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-02-28 09:55:26 -0500
committerChristian W. Damus2013-02-28 09:57:35 -0500
commite395b11c8abe2b7fd3c18a3196c52c76b166267a (patch)
treebb66e4de6260fee6713a6da0321d45503bc0184d
parentef83ed9342e3f2f852bbdfef3592ef3b35b48d49 (diff)
downloadcdo-e395b11c8abe2b7fd3c18a3196c52c76b166267a.tar.gz
cdo-e395b11c8abe2b7fd3c18a3196c52c76b166267a.tar.xz
cdo-e395b11c8abe2b7fd3c18a3196c52c76b166267a.zip
[381395] [Legacy] NPE when removing an adapter after CDO view closed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381395
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java
index c3ed1f748d..75b3b0309a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java
@@ -9,6 +9,7 @@
* Eike Stepper - initial API and implementation
* Martin Fluegge - bug 247226: Transparently support legacy models
* Christian W. Damus (CEA) - bug 397822: handling of REMOVE_MANY notifications
+ * Christian W. Damus (CEA) - bug 381395: don't notify closed view of adapter changes
*/
package org.eclipse.emf.internal.cdo.object;
@@ -313,7 +314,7 @@ public class CDOLegacyAdapter extends CDOLegacyWrapper implements Adapter.Intern
}
/**
- * @author Martin Flügge
+ * @author Martin Fluegge
* @since 3.0
*/
protected class AdapterListListener implements
@@ -336,7 +337,10 @@ public class CDOLegacyAdapter extends CDOLegacyWrapper implements Adapter.Intern
if (!FSMUtil.isTransient(CDOLegacyAdapter.this))
{
InternalCDOView view = cdoView();
- view.handleAddAdapter(CDOLegacyAdapter.this, adapter);
+ if (view != null && view.isActive())
+ {
+ view.handleAddAdapter(CDOLegacyAdapter.this, adapter);
+ }
}
}
@@ -350,7 +354,10 @@ public class CDOLegacyAdapter extends CDOLegacyWrapper implements Adapter.Intern
if (!FSMUtil.isTransient(CDOLegacyAdapter.this))
{
InternalCDOView view = cdoView();
- view.handleRemoveAdapter(CDOLegacyAdapter.this, adapter);
+ if (view != null && view.isActive())
+ {
+ view.handleRemoveAdapter(CDOLegacyAdapter.this, adapter);
+ }
}
}
}

Back to the top