Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346202 - [serializer] for model-copies, allow delegation to original model to access nodemodel
Summary: [serializer] for model-copies, allow delegation to original model to access n...
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 05:32 EDT by Moritz Eysholdt CLA
Modified: 2012-11-21 05:11 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2011-05-18 05:32:40 EDT
For refactoring-operations, the serializer might not be invoked on the original model, but on a smaller *copied* version of a subtree of the model. This is reasonable to have a fast an robust mechanism to calculate the text-changes that will eventually be applied by the refactoring.

serializer 1.0 (ParseTreeConstructor) has no API to support this.

in serializer 2.0, the SemanticNodeProvider could need a mechanism to supply a copiedEObject-to-originalEObject mapping.

workaround: subclass the SemanticNodeProvider. Furthermore it needs to be ensured that all other components of the serializer only traverse the node model but don't access the node adapters or node.getSemanticObject().
Comment 1 Sebastian Zarnekow CLA 2011-05-18 05:38:09 EDT
Since EObject's equality is based on identity, this sounds like a very errorprone approach to me. Utilities such as NodeModelUtils make assumptions on the invariants of the node model such as the node is an adapter for the EObject that's returned by #getSemanticEObject if #hasDirectSemanticElement is true etc.

I think the approach that is followed by the refactoring framework is more promising. That is, perform the modification on an own resource set.
Comment 2 Sven Efftinge CLA 2012-11-21 05:11:21 EST
See comment 1 also IMHO this kind of problem should be handled specifically.