Skip to main content



      Home
Home » Eclipse Projects » GEF » FWD: what can cause removeNotify to be called twice
FWD: what can cause removeNotify to be called twice [message #81993] Wed, 04 June 2003 10:25
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Forwarded Question:

I've noticed a bug where an editpart gets its removeNotify called twice. The
first time seems to be when its parent is removed, the second time seems to
be when it is removed from its parent. The second time its called result in
a stack like this...
java.lang.NullPointerException
at
org.eclipse.gef.editparts.AbstractEditPart.getRoot(AbstractE ditPart.java:575
)
at
org.eclipse.gef.editparts.AbstractEditPart.getRoot(AbstractE ditPart.java:575
)
at
org.eclipse.gef.editparts.AbstractEditPart.getViewer(Abstrac tEditPart.java:6
27)
at
org.eclipse.gef.editparts.AbstractEditPart.unregisterModel(A bstractEditPart.
java:1073)
at
org.eclipse.gef.editparts.AbstractEditPart.unregister(Abstra ctEditPart.java:
1055)
at
org.eclipse.gef.editparts.AbstractEditPart.removeNotify(Abst ractEditPart.jav
a:882)
I'm able to avoid this NPE by overiding removeNofify and calling
super.removeNofify () only when its called the 1st time. Are you aware of
such a bug?

RESPONSE:

When an editpart's parent is deleted, it and all of its children are
deactivated and should no longer be listening to the model. So, if for some
reason the editpart is also removed from the parent, the parent should not
receive notification, and should not refreshChildren(). Removing children
from a container that was deleted seems like it might not be necessary.
Previous Topic:Left Click on EditParts
Next Topic:using an external jar in runtime workbench
Goto Forum:
  


Current Time: Thu Nov 06 17:10:34 EST 2025

Powered by FUDForum. Page generated in 0.02754 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top