Improve ReferenceUpdater

Issue #161 resolved
Matthias Schoettle created an issue

The ReferenceUpdater should be changed to use a switch and be called by using an iterator over all contents (visitor-based). I.e., EcoreUtil.getAllContents(...) and RamSwitch.

This way, no instanceof checks and casts are necessary due to the polyphormism limitations of Java.

More specifically: The ReferenceUpdater should contain a method updateReferences(EObject, WeavingInformation), which should use the iterator and for each object call doSwitch(...) of the switch. All required updates are then performed in the corresponding caseXXX(XXX) methods that can be overridden.

This way, any class of RAM can be updated using weaving information.

Comments (5)

  1. Matthias Schoettle reporter

    References #161: Fixes an issue where updating the direct containment hierarchy of the object to be updated stops after the hierarchy level. Instead, update will recursively call itself to ensure that the complete hierarchy is updated.

    → <<cset 8c0c489a9ba2>>

  2. Log in to comment