Community
Participate
Working Groups
It is useful to determine when resources are copied so that additional actions may be taken (for example copying other related resources). A patch will be provided that implements COPIED_FROM in a low overhead fashion using a HashMap in Workspace to track the linkage. No other fields are added to other classes.
Created attachment 88619 [details] Patch for I20071213-1500 This is for M4, let me know if you need it moved up to M5. Essentially, this adds a Map (copyMap) to Workspace. The key is the node Id (as a Long) and the value is the source Resource. In the various places where a Resource is copied, an entry is recorded in this map. When the endOperation() at the top level is done, the copyMap pointer is reset. In preparing the ResourceDelta events, the map is consulted with the nodeId (only for ADD events) and if present the ResourceDelta.oldInfo is added. Later, when setting the REsourceDelta flags, if there is an oldInfo and it's not a move it must be a copy. Tests were added for both APIs for copying projects, and the existing copy tests were modified to expect the proper COPIED_FROM notification. This work might also be useful in support of bug 109166.
We are not planning to address this issue in 3.4.
Created attachment 289030 [details] Updated patch Previous patch was using deprecated code and was not compiling anymore (missing generics in Map)
(In reply to Arnaud MERGEY from comment #3) > Created attachment 289030 [details] > Updated patch > > Previous patch was using deprecated code and was not compiling anymore > (missing generics in Map) Please create issue at https://github.com/eclipse-platform/eclipse.platform/issues and provide a PR with the patch. Project development moved to github.