Invalid proxy URI after unloading a resource [message #1067947] |
Thu, 11 July 2013 11:54 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi,
I have an issue with the EMF Proxy URI when unloading a resource. The initial URI uses an XMI ID. When I unload the resource, the EObjects contained in this resource receive a proxy URI, which is different of their initial URI. The proxy URI is based on their "name" instead of their XMI ID.
When debugging a little bit, it seems that the eObjectToIDMap (And idToEObjectMap) are cleared *before* the proxy URI is set.
I'm not sure whether I'm missing an EMF Option or if this actually a bug.
The initial URI is:
platform:/resource/sample.emf.resource/model.uml#_nFcp4uofEeKtHNSvVQJLCA
And the Proxy URI for the same instance, after unloading the resource:
platform:/resource/sample.emf.resource/model.uml#//Package1/ModelClass
This becomes a problem when reloading a resource after an external change, because if the change was a Name modification, the proxy URI cannot be resolved anymore.
I'm working on a reproducible test case.
Thanks,
Camille
Camille Letavernier
|
|
|
Re: Invalid proxy URI after unloading a resource [message #1067954 is a reply to message #1067947] |
Thu, 11 July 2013 12:18 |
Ed Merks Messages: 33136 Registered: July 2009 |
Senior Member |
|
|
Camille,
Yes, please open a bugzilla. I had a quick glance at the code, and
indeed, I'm concerned that
org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList.inverseRemove(E,
NotificationChain) would remove the entries from the map. So likely
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doUnload() needs to make
a copy of the map and
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.getID(EObject) should
check if there is such a temporary copy much like
org.eclipse.emf.ecore.resource.impl.ResourceImpl.unloadingContents
tracks a temporary copy of the contents.
On 11/07/2013 1:54 PM, Camille Letavernier wrote:
> Hi,
>
>
> I have an issue with the EMF Proxy URI when unloading a resource. The
> initial URI uses an XMI ID. When I unload the resource, the EObjects
> contained in this resource receive a proxy URI, which is different of
> their initial URI. The proxy URI is based on their "name" instead of
> their XMI ID.
>
> When debugging a little bit, it seems that the eObjectToIDMap (And
> idToEObjectMap) are cleared *before* the proxy URI is set.
>
> I'm not sure whether I'm missing an EMF Option or if this actually a bug.
>
> The initial URI is:
>
> platform:/resource/sample.emf.resource/model.uml#_nFcp4uofEeKtHNSvVQJLCA
>
> And the Proxy URI for the same instance, after unloading the resource:
>
> platform:/resource/sample.emf.resource/model.uml#//Package1/ModelClass
>
>
> This becomes a problem when reloading a resource after an external
> change, because if the change was a Name modification, the proxy URI
> cannot be resolved anymore.
>
>
> I'm working on a reproducible test case.
>
>
> Thanks,
> Camille
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02072 seconds