Bug 509556 - [OCL] OCL Console statement w/ select( oclIsKindOf(xx) ) causes NPE and UnsupportedOperationException if Package contains Enumeration elements.
Summary: [OCL] OCL Console statement w/ select( oclIsKindOf(xx) ) causes NPE and Unsup...
Status: UNCONFIRMED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-20 19:32 EST by Jim Albers CLA
Modified: 2017-08-02 13:11 EDT (History)
1 user (show)

See Also:


Attachments
demonstration model and documentation of issue (179.18 KB, application/zip)
2016-12-20 19:32 EST, Jim Albers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Albers CLA 2016-12-20 19:32:36 EST
Created attachment 265996 [details]
demonstration model and documentation of issue

This issue could involve interaction between Papyrus Core, Interactive OCL Console, and /or the RSA Import feature.

In a large model imported from RSA, otherwise correct allOwnedElements() OCL queries fail if any package contains an offending BadEnumerations Package in its subtree.

See the attached .zip file with a Papyrus model project with model stripped down to the minimal model that exhibits the symptoms.

There is also a document (docx and pdf) showing the exact OCL query, sequence of user actions, and OCL query NPE and UnsupportedOperationException output.

The doc also includes details of the Papyrus installation.  

I've spent over a day trying to diagnose by experiment, since I haven't yet set up a developer / debug config.

Since workflow is requiring regular migration from RSA with large packages containing Enumerations like this, a manual workaround of recreating the packages within Papyrus isn't feasible.

Thanks!
Comment 1 Jim Albers CLA 2016-12-20 20:28:34 EST
Confirmed issue per attached model and documentation for the latest Papyrus 2.0.1 distro for Mac 64bit.

Also, note that either the NPE issue or the UnsupportedOperationException issue are now showing up for all three packages of enumerations: BadEnumerations, GoodEnumerations, and Save, in the attached sample model.
Comment 2 Jim Albers CLA 2016-12-27 11:04:44 EST
Issue appears to be related to how profiles are imported.  If the RSA .epx files are not removed from the project directory when the main model .emx file is imported, the RSA import will default to using the .epx files rather than the newly imported Papyrus profile.uml files.   We added a step to the work flow to remove the .epx files from the project directory after import and that seems to have resolved the problem.
Comment 3 Peter Cigehn CLA 2016-12-28 03:41:20 EST
(In reply to Jim Albers from comment #2)
> Issue appears to be related to how profiles are imported.  If the RSA .epx
> files are not removed from the project directory when the main model .emx
> file is imported, the RSA import will default to using the .epx files rather
> than the newly imported Papyrus profile.uml files.   We added a step to the
> work flow to remove the .epx files from the project directory after import
> and that seems to have resolved the problem.

Yes, I can also just confirm that the original .epx file needs to be removed from the workspace after importing a profile into Papyrus format. Otherwise, as you have concluded, there will be issues when importing .emx models which have this profile applied, since references to the original .epx file will be possible to be resolved during import and the profile switch to the profile on Papyrus format will not work as expected. See for example my comments related to this aspect in Bug 505330 Comment 5.
Comment 4 Jim Albers CLA 2017-01-05 22:14:47 EST
We have a workaround visible to those can find this issue in bugzilla.

For the OCL Pivot / Xtext Console team and the RSA import team, there appear to be a couple of opportunities to make both plugins more robust.

Not sure best way to bump this onto the respective radars.