Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328537 - Add a b3 equivalence to NPE
Summary: Add a b3 equivalence to NPE
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: b3 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-23 19:41 EDT by Henrik Lindberg CLA
Modified: 2017-09-13 11:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2010-10-23 19:41:46 EDT
If a "NPE" is the result of evaluating b3 code it is not very valuable to get a java NPE as user wants to know where in the b3 code the error occurred, not where in java.

Consider
var a = [<String, (Integer)=>Integer)> myfunc : { x| x.bitwiseAnd(2) } ];
assertEquals("invoke on func in map", 2, a["myXXX"].invoke(2));

(With static analysis it could also be inferred that a["myXXX"] can not be anything but null at the point invoke is called - but that is a different issue).

Currently invoke, and other functions may throw either a NPE, or some IllegalArgumentException.