Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 521236

Summary: Improper unload of in-memory resources
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, laurent.fasani, pierre-charles.david, william.piers
Version: 4.1.1Keywords: triaged
Target Milestone: 5.0.2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/103441
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=422ae26154673e565c48cf2ca2c730ff339eb045
Whiteboard:
Bug Depends on: 510893, 510928    
Bug Blocks:    

Description Pierre-Charles David CLA 2017-08-22 05:46:16 EDT
+++ This bug was initially created as a clone of Bug #510928 +++

+++ This bug was initially created as a clone of Bug #510893 +++

Since  https://github.com/pcdavid/org.eclipse.sirius/commit/de35505b28c6c6f5d583f3616950708e36b02b73 optimization, in-memory resources are inproperly loaded.

In
https://github.com/pcdavid/org.eclipse.sirius/blob/master/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/resource/InMemoryResourceImpl.java

the unload calls
   protected void doUnload() {
        super.doUnload();
        URI uri = getURI();
        InMemoryResourceFactoryImpl.IN_MEMORY_BUFFERS.remove(uri);
    }

If the uri is not removed, then the cache returns old closed sessions resources.
Comment 1 Pierre-Charles David CLA 2017-08-22 05:47:23 EDT
Clone to backport the fix in Sirius 5.0.2 (we fixed it in 4.1.3, and will also include the fix in 5.1, so 5.0.x should not have a visible regression).
Comment 2 Eclipse Genie CLA 2017-08-22 05:48:55 EDT
New Gerrit change created: https://git.eclipse.org/r/103441
Comment 4 Pierre-Charles David CLA 2017-08-29 09:16:13 EDT
Fixed by 422ae26154673e565c48cf2ca2c730ff339eb045.
Comment 5 Pierre-Charles David CLA 2017-09-11 10:07:52 EDT
Available in Sirius 5.0.2.