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

Bug 526258

Summary: SAX Parsing of AIRD files does not succeed when no viewpoint is activated
Product: [Modeling] Sirius Reporter: Stéphane Thibaudeau <stephane.thibaudeau>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact: Maxime Porhel <maxime.porhel>
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david, pierre.guilet
Version: 4.1.1Keywords: triaged
Target Milestone: 5.1.1   
Hardware: PC   
OS: Windows NT   
See Also: https://git.eclipse.org/r/110513
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6d06707b28d31a84125d5544ee66e7a3741a4523
https://git.eclipse.org/r/114741
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2da114f896d8ad761c9653d5e909109878529ab9
Whiteboard:
Attachments:
Description Flags
Sample project to reproduce the issue none

Description Stéphane Thibaudeau CLA 2017-10-19 06:02:20 EDT
The SAX parsing used to count the main aird files relies on the presence of a "ownedViews" tag.
An exception is thrown when this tag is encountered and the caollected data are stored only when this exception occurs.
If an AIRD file does not contain this tag, the referenced analyses won't be collected and the error "Found X main representations files" will occur.

The interesting classes are :
org.eclipse.sirius.business.internal.session.parser.RepresentationsFileSaxParser
and 
org.eclipse.sirius.business.internal.session.parser.RepresentationsFileHandler

The easiest way to fix this bug is probably adding an "endDocument()" method in RepresentationsFileHandler which could throw a SiriusSaxParserNormalAbortException.
Comment 1 Pierre Guilet CLA 2017-10-23 07:42:44 EDT
Technical issue
Comment 2 Eclipse Genie CLA 2017-10-23 08:58:47 EDT
New Gerrit change created: https://git.eclipse.org/r/110513
Comment 3 Pierre-Charles David CLA 2017-10-23 09:03:14 EDT
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/110513

Untested draft corresponding to Stéphane idea for fixing this.
Comment 4 Pierre-Charles David CLA 2017-12-21 04:12:36 EST
Created attachment 272001 [details]
Sample project to reproduce the issue

Steps to reproduce:
1. File > Import > Existing project into workspace...
2. Select the attached zip file, which contains 3 projects. Import all.
3. testEcore is imported correctly, but testEcore2 & testEcore3 raise errors (both in the error log and in an error dialog) with a message:

One modeling project is invalid.
Found 2 main representations files (that means not referenced by another) in "testEcore2": representations.airdand My_.aird. A modeling project must contain only one.

They should both be imported/opened without errors, and the sessions correctly detect the referenced analyses.
Comment 6 Eclipse Genie CLA 2017-12-26 05:15:18 EST
New Gerrit change created: https://git.eclipse.org/r/114741
Comment 8 Pierre-Charles David CLA 2017-12-26 08:20:00 EST
Test added by 2da114f896d8ad761c9653d5e909109878529ab9.
Comment 9 Maxime Porhel CLA 2018-01-09 04:53:11 EST
Verified on Sirius 5.1.1-rc2
Comment 10 Pierre-Charles David CLA 2018-02-01 03:25:49 EST
Available in Sirius 5.1.1. See https://wiki.eclipse.org/Sirius/5.1.1 for details.