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

Bug 475834

Summary: Corrupted aird files when retrieving a project from SCM after an uncontrol
Product: [Modeling] Sirius Reporter: Stéphane Thibaudeau <stephane.thibaudeau>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact: Laurent Redor <laurent.redor>
Severity: normal    
Priority: P3 CC: esteban.dugueperoux, laurent.redor, pierre-charles.david
Version: 2.0.5Keywords: triaged
Target Milestone: 2.0.7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/54763
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=36e28c09b9232b5201aa4508f375fd21496162a4
Whiteboard:
Bug Depends on:    
Bug Blocks: 477046    
Attachments:
Description Flags
Example project none

Description Stéphane Thibaudeau CLA 2015-08-25 11:24:23 EDT
Created attachment 256101 [details]
Example project

2 users share a same modeling project using a SCM.
At first, the project contains controlled resources (both semantic and graphical).
When one of the users uncontrols the resources, the other users gets errors when retrieving the project from the SCM.


Steps to reproduce :
- in a first workspace (WS1), import the provided project
- in a second workspace (WS2), import the same provided project
- in WS1, select "newPackage1" in fragments/My_newPackage1.ecore and right-click on "uncontrol". Answer "yes" when Sirius asks whether the graphical resource should be uncontrolled too. => everything is OK in WS1 (2 files have been deleted, 2 files have been modified)
- using the filesystem (not inside eclipse), copy the project from WS1 to WS2. I personnally delete everything except the .project file in WS2, select the whole contents except the .project file in WS1 and copy these files into WS2
- in Eclipse/WS2, refresh the project
=> a first dialog displays a warning about the deleted aird (it's not very useful...)
=> click yes : an error occurs while loading the models (Sirius considers there are 2 main aird files even if one of them is deleted)
=> the deleted aird is still present but empty
=> the main aird is empty.
Comment 1 Esteban DUGUEPEROUX CLA 2015-08-27 09:41:28 EDT
I reproduce and get the following exception :

java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:192)
	at org.eclipse.sirius.business.api.session.AbstractSavingPolicy.<init>(AbstractSavingPolicy.java:48)
	at org.eclipse.sirius.business.internal.session.IsModifiedSavingPolicy.<init>(IsModifiedSavingPolicy.java:117)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.getSavingPolicy(DAnalysisSessionImpl.java:885)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl$1.run(DAnalysisSessionImpl.java:785)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.doSave(DAnalysisSessionImpl.java:797)
	at org.eclipse.sirius.business.internal.session.danalysis.Saver.wrappedSave(Saver.java:144)
	at org.eclipse.sirius.business.internal.session.danalysis.Saver.access$0(Saver.java:133)
	at org.eclipse.sirius.business.internal.session.danalysis.Saver$1.run(Saver.java:121)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2242)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2226)
	at org.eclipse.sirius.business.internal.session.danalysis.Saver.saveNow(Saver.java:118)
	at org.eclipse.sirius.business.internal.session.danalysis.Saver.save(Saver.java:94)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.save(DAnalysisSessionImpl.java:759)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.save(DAnalysisSessionImpl.java:754)
	at org.eclipse.sirius.business.internal.session.danalysis.SaveSessionJob.run(SaveSessionJob.java:67)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 2 Eclipse Genie CLA 2015-08-28 08:36:27 EDT
New Gerrit change created: https://git.eclipse.org/r/54763
Comment 4 Laurent Redor CLA 2017-01-04 03:47:47 EST
The initial scenario is fixed, except for the dialog displaying a warning about the deleted aird (considered as not very useful).
Comment 5 Pierre-Charles David CLA 2017-01-31 08:49:46 EST
Available in Sirius 2.0.7, see https://wiki.eclipse.org/Sirius/2.0.7.