Bug 458378

Summary: Check should be able to deal with npe in check, ignore, issue, passthrough
Product: [Automotive] Sphinx Reporter: Andreas Graf <graf>
Component: CoreAssignee: Project Inbox <sphinx-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: balazs.grill
Version: 0.9.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andreas Graf CLA 2015-01-26 03:40:58 EST
When writing checks on models, we often have to write code to check for null values. (E.g. if(x.getY() != null && x.getY().getZ())

That is quite annoying and boilerplate. The idea for this extension would be to add some default exception handling around the @Check-Methods that can be configured.

The idea is:

* Default is no exception handling
* We could then add an additional @Check parameter to specify how we would like the framework to deal with NPE:

* Ignore: Ignore any NPE thrown by Check
* Info/Warning/Error: Add an issue with the specified severity, informing the user about the NPE.

Then we could really reduce the Null-Checking within the Check mdethods.
Comment 1 Balazs Grill CLA 2024-05-07 00:27:06 EDT
Closed stale issue before migration