Community
Participate
Working Groups
Created attachment 267711 [details] Log entry of the exception thrown when trying to open an unknown file When opening an unknown file with the Sirius diagram editor, it fails to open, which is to be expected, but it also overwrites the contents of the opened file, which most certainly should not happen. It doesn't matter what kind of file is opened (I tried different text files). This is with Sirius version 4.1.3 on Neon.3. Attached is an exception that is logged when trying to open an Ecore model (I know this is not supposed to work, just for demonstration), as well as the changed file after the editor failed to open. Please ask if you need any more information.
Created attachment 267712 [details] The resulting file after attempting to open with Sirius diagram editor
Hello, Is it possible to have a sample to reproduce this issue? With a modeling project containing an ecore model and a .txt file, i tried to open both files and the .aird with the Sirius Diagram Editor and only had a Null Pointer Exception in org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor$1.run(DiagramDocumentEditor.java:130). The file themselves remained untouched and I could still open them with their matching editor afterward. Regards, Steve
I tried to reproduce with Sirius 4.1.3 and with the master branch.
So I tried again with a text file and even an XML file, and I also got the NPE you mentioned. It only seems so "work" when Eclipse knows the file will contain XML content or something like that. I got it to work by copying an Ecore model into the project or creating a new one. It works whether the project has the modeling nature or not. I'll attach the test file.
Created attachment 267739 [details] Ecore file that gets corrupted
In case you still can't reproduce it, the original case where I first encountered this was in an example project from Epsilon. In the example titled "Implement a GMF editor with image nodes using EuGENia" there is a file `model/friends.ecorediag` that when opened gets corrupted.
Hi Peter, I tried with Eclipse Modeling (Neon.3, macOS) + Epsilon 1.2 installed from the MarketPlace. I get the same log than you and I also have a corruption. The "Sirius Diagram Editing" editor is not proposed by Eclipse, users has to go in "open with > other" and look for it. Note that the Sirius Diagram Editor is not intended to be used to open files (except .aird files in some cases). Bug 510040 will soon bring a proper Eclipse editor for .aird files with direct access to session operations. Regards
I do realize that it's not meant to open files directly, nonetheless it shouldn't overwrite files without warning when used this way. I only tried it because I couldn't find an editor for the .ecorediag file (I still haven't found one BTW).
(In reply to Peter Feichtinger from comment #8) > I do realize that it's not meant to open files directly, nonetheless it > shouldn't overwrite files without warning when used this way. > I only tried it because I couldn't find an editor for the .ecorediag file (I > still haven't found one BTW). ".ecorediag" are legacy diagrams created with old versions of Ecore Tools 1.x, before Ecore Tools was rewritten based on Sirius (starting from 2.0). To open them you'll need to install an old version of Ecore Tools (which does not use Sirius at all). I think the last was 1.2, which seems still available at http://download.eclipse.org/ecoretools/updates/1.2/ (but not maintained).
On master I have the same NPE than Steve but no file corruption.
New Gerrit change created: https://git.eclipse.org/r/95196
Peter, thank you for your detailed bug report. We have reproduced this issue and we reckon it is valid. Nevertheless it's not yet in the scope of a release, I'm marking it so that we also consider it for inclusion for a future maintenance release.
(In reply to Maxime Porhel from comment #10) > On master I have the same NPE than Steve but no file corruption. On master but without any addtional SessionFactory, I have the ClassCastException and the file corruption. Tester must check that the SessionFactory.INSTANCE is org.eclipse.sirius.business.internal.session.SessionFactoryImpl
New Gerrit change created: https://git.eclipse.org/r/102407
Gerrit change https://git.eclipse.org/r/102407 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ab7bcb88e97bab8abd1eaf8c758aa86b93275dbf
I think were're done here. For validation purposes, here are explicit reproduction steps: 1. Create a plain project in the workspace, and copy the attached test.ecore inside. 2. Right-click on the ecore, select Open With... > Other... and then choose "Sirius Diagram Editing". Close the dialog with "OK". 3. An error editor appears, which is not ideal in terms of user feedback, but acceptable for now. Close the editor. 4. Right-click on the ecore again, and now select Open With > Text Editor. Before the fix, the ecore was replaced by an empty DAnalysis, completely overwriting the original semantic model in the file (KO). With the fix in ab7bcb88e97bab8abd1eaf8c758aa86b93275dbf, we still have the error opening the editor, but the semantic model has not been touched (OK).
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.