Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354882

Summary: Null array not throwing a NullValueException
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: greer
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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