ECrossreferenceAdapter and removing elements from content tree [message #1753061] |
Wed, 01 February 2017 08:52  |
Eclipse User |
|
|
|
Hi,
I found some behavior that quite surprised me when having a tree that is adapted with an ECrossReferenceAdapter:
If I have an element A that references B, then I remove A from the content tree, and ask for inverse references to B, a setting for the A -> B reference is returned. I was about 100% sure that this wouldn't happen, but looking at the code, there is no case for REMOVE/REMOVE_MANY notifications in the handleContainment() method of ECrossReferenceAdapter.
I'm confused. Is this really intended behavior? Do I miss something, or does one really need to handle the returned settings with care since they possibly involve objects that have been deleted?
Thanks,
Felix
|
|
|
|
Re: ECrossreferenceAdapter and removing elements from content tree [message #1753145 is a reply to message #1753081] |
Thu, 02 February 2017 03:33  |
Eclipse User |
|
|
|
Ok that's good to know. I still find the behavior a bit unexpected though. Looking slightly closer, I found out that the ECrossReferenceAdapter that I'm working with is a customized subclass, which has handleContainment() overridden to also handle the remove case, unfortunately only REMOVE notifications are handlet whereas REMOVE_MANY is just ignored which yes, leads to nasty bugs.
|
|
|
Powered by
FUDForum. Page generated in 0.44514 seconds