Bug 428745 - Empty border size computation expression leads to NullPointerException
Summary: Empty border size computation expression leads to NullPointerException
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0M5   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 3.0.0M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-02-21 09:26 EST by Stéphane Thibaudeau CLA
Modified: 2016-01-25 05:02 EST (History)
4 users (show)

See Also:


Attachments
Example viewpoint specification project (5.86 KB, application/x-zip-compressed)
2014-02-21 09:26 EST, Stéphane Thibaudeau 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 2014-02-21 09:26:02 EST
Created attachment 240198 [details]
Example viewpoint specification project

On a container mapping, delete default contents in "Border Size Computation Expression" :
- validation is OK
- when trying to create a diagram, a NullPointerException is thrown.

Steps to reproduce :
- import the provided viewpoint specification project
- create a diagram on the root EPackage of model 'model/My.ecore'
Comment 1 Alex Lagarde CLA 2014-02-21 09:36:57 EST
Issue reproduced with Sirius 1.0 M5

Setting a Border Size Computation Expression allows to avoid the exception
Comment 2 Stéphane Thibaudeau CLA 2014-02-21 09:51:10 EST
Then the validation should not be OK when this field is not specified.
Comment 3 Maxime Porhel CLA 2014-04-14 08:00:33 EDT
A null/empty border size computation expression should lead to a 0 (or 1 regarding the current styles behaviors) pixel margin.
Comment 4 Maxime Porhel CLA 2014-11-21 08:41:41 EST
I see two area requiring corrections:
 . VSM editor: 
     . validation rule to check that no border expression is null (could be generalized to all interpreted expression) 
     . customize the border size expr property section to replace a null value by the default MM value (0) during edition
 . Sirius core: 
     . clean the actual code (see borderStyle/BorderStyleDescription#getBordersizeExpression call) and try to remove duplicated code
     . correctly handle the empty/null expression by setting the default style value and never null.
Comment 5 Maxime Porhel CLA 2014-11-21 08:56:46 EST
I see two area requiring corrections:
 . VSM editor: 
     . validation rule to check that no border expression is null (could be generalized to all interpreted expression) 
     . customize the border size expr property section to replace a null value by the default MM value (0) during edition
 . Sirius core: 
     . clean the actual code (see borderStyle/BorderStyleDescription#getBordersizeExpression call) and try to remove duplicated code
     . correctly handle the empty/null expression by setting the default style value and never null.
Comment 6 Belqassim Djafer CLA 2014-12-03 09:27:25 EST
I propose the fix : https://git.eclipse.org/r/#/c/36900/
Comment 7 Pierre-Charles David CLA 2015-01-26 05:28:39 EST
Fixed by 5d8d34ffaeeb8408bfc1715481c9b83943da1478.
Comment 8 Eclipse Genie CLA 2015-03-24 12:52:00 EDT
New Gerrit change created: https://git.eclipse.org/r/44505
Comment 10 Eclipse Genie CLA 2015-03-30 04:18:32 EDT
New Gerrit change created: https://git.eclipse.org/r/44816
Comment 12 Belqassim Djafer CLA 2015-04-09 09:06:36 EDT
Verified on Sirius 3.0.0M6
Comment 13 Eclipse Genie CLA 2015-04-10 04:32:35 EDT
New Gerrit change created: https://git.eclipse.org/r/45618
Comment 15 Pierre-Charles David CLA 2015-06-24 11:14:47 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.