Community
Participate
Working Groups
Build Identifier: org.eclipse.gmf.runtime.emf.clipboard.core_1.4.0.v20100430-1518.jar org.eclipse.gmf.runtime.emf.clipboard.core.internal.SavingEMFResource casts to XMLResource to obtain the EObject ID without checking the resource type first. This could result in a ClassCastException if the resource is not a XMLResource. Reproducible: Always Steps to Reproduce: 1. Load a resource that is not a subclass of XMLResource. 2. Attempt to copy the resource using org.eclipse.gmf.runtime.emf.clipboard.core.CopyOperation.doCopy(). 3. Exception.
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