| Summary: | SavingEMFResource casts to XMLResource to obtain the EObject ID without checking the resource type first | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] GMF-Runtime | Reporter: | Wayne <wdiu> | ||||||||
| Component: | General | Assignee: | Aurelien Pupier <apupier> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | ahunter.eclipse, apupier | ||||||||
| Version: | unspecified | Flags: | apupier:
review+
|
||||||||
| Target Milestone: | 1.5.1 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Wayne
Created attachment 195137 [details]
Patch to resolve the problem
The attached patch checks whether the resource is an instance of XMLResource before casting. If not, it attempts to obtain the ID from the intrinsic ID to EObject map. Although doing so may not be as efficient as using the default getID() implementation of XMLResource, the second way of obtaining the ID will only be used when the XMLResource is unavailable, which was previously throwing an exception.
Hi, To improve performance in the case that it is not a XMLResource, we can use an EntrySet in order to avoid a search in the map. Regards, Created attachment 195231 [details]
Patch to resolve the problem
Good point, Aurelien. I've revised the patch.
Created attachment 196181 [details]
Patch using Genericity
Patch using genericity.
Please check that I correct it correctly and test it.
Thanks
Looks good! patch applied The patch we applied on 5/29 is not going to make it into indigo 1.5.0 GA. We are following http://wiki.eclipse.org/Modeling_Project_Ramp_Down_Policy/Galileo This missed the IP Log, committer and PMC approvals This automatically rolls over the 1.5.1 |