Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 471543 - Sirius should not consider URI as unique ID
Summary: Sirius should not consider URI as unique ID
Status: CLOSED WONTFIX
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Esteban DUGUEPEROUX CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 471456
Blocks:
  Show dependency tree
 
Reported: 2015-07-01 03:37 EDT by Esteban DUGUEPEROUX CLA
Modified: 2015-12-15 05:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteban DUGUEPEROUX CLA 2015-07-01 03:37:45 EDT
+++ This bug was initially created as a clone of Bug #471456 +++

In our Sirius based application in which we don't have workspace but instead have our models stored on a server, we use a InMemoryResourceImpl to store locally DRepresentations loaded from server.

By default in Sirius, with a workspace, a AirdResourceImpl is used which use UUID to have URI of object as unique ID but with InMemoryResourceImpl or even BinaryResourceImpl this is not the case, xpath based URI fragment is used in this case.

This has bad effect of don't opening the correct representation with the following scenario :
1. Have a session with a InMemoryResourceImpl as main sessionResource with URI "memory:data.togafin-memory.aird"
2. Load a DRepresentation r1 in this InMemoryResourceImpl, the URI of this DRepresentation will be "memory:data.togafin-memory.aird#//@ownedViews.0/@ownedRepresentations.0"
3. Open a Sirius editor on this DRepresentation r1
4. Load a DRepresentation r2 in this InMemoryResourceImpl, the URI of this DRepresentation will be "memory:data.togafin-memory.aird#//@ownedViews.0/@ownedRepresentations.1"
5. Open a Sirius editor on this DRepresentation r2
6. Open the Sirius editor of DRepresentation r1
7. Unload the DRepresentation r1 from the InMemoryResourceImpl, the URI of the DRepresentation r2 will become "memory:data.togafin-memory.aird#//@ownedViews.0/@ownedRepresentations.0"
8. Load again DRepresentation r1 in this InMemoryResourceImpl, the URI of this DRepresentation will be "memory:data.togafin-memory.aird#//@ownedViews.0/@ownedRepresentations.1"
9. Open a Sirius editor on this DRepresentation r1 => KO the editor is not opened, instead the editor of the second representation is shown.

It seems comes from use of URIEditorInput through SessionEditorInput, indeed the  URIEditorInput compare only URI. Then to fix that, SessionEditorInput should override URIEditorInput.equals() to test also input equality.
Comment 1 Eclipse Genie CLA 2015-07-01 03:38:41 EDT
New Gerrit change created: https://git.eclipse.org/r/51164
Comment 2 Esteban DUGUEPEROUX CLA 2015-07-01 03:44:55 EDT
Finally will not be backported.
Comment 3 Pierre-Charles David CLA 2015-12-15 05:22:21 EST
Available in Sirius 3.0.1 released on 2015-09-10.