Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354882 - Null array not throwing a NullValueException
Summary: Null array not throwing a NullValueException
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-16 15:25 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:14 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-08-16 15:25:04 EDT
try
	a int[];
	a.getSize();
onexception(e NullValueException)
	syslib.writestderr(e.message);
end

The code does not go into the onexception block because it's not an EGL exception - instead it's a core NPE.

The generated code is: a.getSize();
In RBD we would wrap anything on a reference type with egl.checkNull() so that our own exception type would be thrown (and therefore caught).
Comment 1 Scott Greer CLA 2011-09-11 13:12:55 EDT
Justin,

After the recent language changes, I think this would probably work as-is;  a can never be null.   However, there is still an issue here because if a is nullable, then the RT null check should be generated....
Comment 2 Justin Spadea CLA 2011-09-12 09:17:07 EDT
Yes, the declaration should now be "a aint[]?;" to cause this problem.
Comment 3 Scott Greer CLA 2011-09-26 16:40:23 EDT
Fixed;  the array type template wasn't respecting / enforcing nullable.
Comment 4 Justin Spadea CLA 2011-11-04 14:08:39 EDT
Verified