Community
Participate
Working Groups
Currently, when a model from an older schema is converted to the latest schema, proxies are resolved and the resulting model does not retain containment proxies (i.e., all content gets serialized to a single resource). I'm not sure exactly how the conversion is being done (haven't looked at the code), but one way to avoid loading proxies is to use the (non-resolving flavours of) the iterators provided in EcoreUtil when traversing the model. The getAllProperContents(Resource, boolean) method, for example, will return an iterator over just the objects serialize in the given resource. If proxy resolution during model conversion can't be avoided, another way to preserve detached resources would be to detect and remember them will traversing the model, e.g., by calling eDirectResource() on each object and comparing it to the root resource, and then re-create the containment proxies (by setting the resource on the same objects) when done converting.
The model transformation will now retain all proxies unless it's absolutely necessary to resolve them. The only time that happens is when a new name is entered for the transformed master file. This is because many references are bidirectional in nature and the reference itself contains the filename. The current behavior is thus: - Retain the file name during conversion also means retain all proxies - Change the file name also means resolve all proxies (all contributions must be detached again) Fixed in rev. 1548
I added a section explaining the legacy model conversion to the b3 aggregator documentation: http://wiki.eclipse.org/Eclipse_b3/aggregator/manual#Legacy_format_support
[Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI. No change to assignee for resolved and verified bugs.]