Bug 526258 - SAX Parsing of AIRD files does not succeed when no viewpoint is activated
Summary: SAX Parsing of AIRD files does not succeed when no viewpoint is activated
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 4.1.1   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 5.1.1   Edit
Assignee: Pierre-Charles David CLA
QA Contact: Maxime Porhel CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-10-19 06:02 EDT by Stéphane Thibaudeau CLA
Modified: 2018-02-01 03:25 EST (History)
3 users (show)

See Also:


Attachments
Sample project to reproduce the issue (8.02 KB, application/zip)
2017-12-21 04:12 EST, Pierre-Charles David CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.