| Summary: | Converting project to modeling project may fail to create the aird file | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre Guilet <pierre.guilet> |
| Component: | Core | Assignee: | Pierre Guilet <pierre.guilet> |
| Status: | CLOSED FIXED | QA Contact: | Maxime Porhel <maxime.porhel> |
| Severity: | normal | ||
| Priority: | P3 | CC: | julien.dupont, maxime.porhel, pierre-charles.david, romain.guider |
| Version: | 5.1.0 | Keywords: | triaged |
| Target Milestone: | 5.1.3 | ||
| Hardware: | PC | ||
| OS: | Windows NT | ||
| See Also: |
https://git.eclipse.org/r/126327 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bac023110798111100de5f1bc1233a87f99ce285 https://git.eclipse.org/r/126789 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2fe4add651af8847888248dc9ae6d81ffa9b9993 |
||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 537187, 537188 | ||
|
Description
Pierre Guilet
The problem is hardly reproducible. I could not reproduce it anymore. To reproduce: - Open Modeling perspective - In the model Explorer view create a General Project. - Convert it to Modeling Project. Does not create a representation file(aird) - Create a Java Project. - Convert it to Modeling Project. Create a representation file (aird). KO Ignore previous comment To reproduce: - Open Modeling perspective - In the model Explorer view create a General Project. - Convert it to Modeling Project. Does not create a representation file(aird) KO - Create a Java Project. - Convert it to Modeling Project. Create a representation file (aird). I can't reproduce. I tried the scenario 10 successive times and it always work. I don't know if it can make a difference but I'm under Linux. I manage to reproduce it with two different scenarios (on windows 10): whatever perspective you're in (plug-in, java or modeling) : - create a plug-in project (not a java project, but a plug-in project) - right clic on the project - select the menu 'Configure>Convert to modeling project' the result of this scenario seems to be : - the modeling nature is added to the project (according to the M decorating the project's icon in the project explorer) - the aird file isn't added to the project. When creating a java project and converting it to modeling nature right away, there's no problem. However, the following scenario allows to reproduce on a java project : - create a java project, - create a plug-in project, - try to convert the java project in modeling project the last operation fails the same way it fails on the plug-in project of the first scenario. I tried other scenarios and it seems that the direct proximity of the plug-in project creation is at the origin of the problem: - create a plug-in project, - create a java project, - convert the plug-in project in modeling project In this scenario, the last operation works like a charm. (In reply to Romain Guider from comment #5) > I manage to reproduce it with two different scenarios (on windows 10): > > whatever perspective you're in (plug-in, java or modeling) : > - create a plug-in project (not a java project, but a plug-in project) > - right clic on the project > - select the menu 'Configure>Convert to modeling project' > > the result of this scenario seems to be : > - the modeling nature is added to the project (according to the M decorating > the project's icon in the project explorer) > - the aird file isn't added to the project. > > When creating a java project and converting it to modeling nature right > away, there's no problem. However, the following scenario allows to > reproduce on a java project : > - create a java project, > - create a plug-in project, > - try to convert the java project in modeling project > > the last operation fails the same way it fails on the plug-in project of the > first scenario. > > I tried other scenarios and it seems that the direct proximity of the > plug-in project creation is at the origin of the problem: > > - create a plug-in project, > - create a java project, > - convert the plug-in project in modeling project > > In this scenario, the last operation works like a charm. One additional information : these scenarios works perfectly well on a linux box that we tried. The problem comes from bad thread synchronization between org.eclipse.sirius.ui.tools.api.views.modelexplorerview.resourcelistener.DefaultModelingProjectResourceListener org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager.ModelingProjectManagerImpl Both are called when converting in a separate thread. And both call ModelingProject.getMainRepresentationsFileURI() The call order depends on unknown variable and can differ from one environment to another. In both case getMainRepresentationsFileURI is called whereas the representation is not created yet. So it set the valid boolean to false and throw an exception. ModelingProjectManagerImpl needs the valid boolean to true to have the exception to create the representation when converting. So if DefaultModelingProjectResourceListener comes first then nothing is done. New Gerrit change created: https://git.eclipse.org/r/126327 Gerrit change https://git.eclipse.org/r/126327 was merged to [v5.1.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bac023110798111100de5f1bc1233a87f99ce285 Steps to reproduce: 1-Do a remote debug on the Sirius bundle 2-Activate a breakpoint at the beginning of org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager.ModelingProjectManagerImpl.doAddModelingNature(IProject, IProgressMonitor) 3-Create a plugin project 4-convert it to modeling project 5-the breakpoint hit. Resume 6-The aird should be created. On MacOs at least, when I create a plugin project and then convert it to a modeling project, the aird is well created but I have an error marker on the project "Zero representations file found in "mysampleproject". Note that the issue seems not always reproductible as the initial issue of this ticket. New Gerrit change created: https://git.eclipse.org/r/126789 Gerrit change https://git.eclipse.org/r/126789 was merged to [v5.1.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2fe4add651af8847888248dc9ae6d81ffa9b9993 Validated on Sirius 5.1.3-N20180731-035556 Available in Sirius 5.1.3, see https://wiki.eclipse.org/Sirius/5.1.3 for details. |