Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355742 - Implement nullability language changes
Summary: Implement nullability language changes
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jeff Douglas CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 12:27 EDT by Matt Heitz CLA
Modified: 2017-02-23 14:17 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Heitz CLA 2011-08-24 12:27:54 EDT
This work needs to be completed in Iteration 13.  Prioritize it ahead of other enhancements, even if they'll have to be pushed out of the iteration.

[The following is the section on Nullability from http://wiki.eclipse.org/EDT:EGL_Language_Statements.]

Variable declarations, function parameters, and function return types may end with a question mark to indicate that they're nullable. Nullability means that a variable may really be null. It's not an "I'm null" flag like in RBD.  Even reference variables can be nullable.

A NullValueException will be thrown if you try to access a field or function of a null variable, even a record. A NullValueException will be thrown if a null variable is an operand to a math operator, an array access, a substring access, a comparison, or a bitwise operator. The string concatenation operators will work the same as in RBD with respect to nulls. :: treats null as the empty string, and ?: results in null if either operand is null. A question mark won't be allowed on the second operand of the AS and ISA operators (the name of the type).

A validation check will ensure that things which can't be instantiated (interfaces, and types with private default constructors) must be declared nullable. Constructors can be defined in ExternalTypes and handlers.

You can't assign null to something that's not nullable.  We'll give a validation error on notNullableVariable = null; and a runtime error on notNullableVariable = nullableVariable; when the nullableVariable is null.
Comment 1 Matt Heitz CLA 2011-09-02 12:32:21 EDT
Before making changes to the generator or runtime, we should review the egl type definitions.  Make sure everything that should be nullable has a question mark on it.
Comment 2 Matt Heitz CLA 2011-09-02 12:37:48 EDT
If the work in comment 1 results in any changes, be sure to let Scott know.
Comment 3 Matt Heitz CLA 2011-09-19 08:23:42 EDT
Changing the target milestone since we're in I-15 now.  This is probably done, but the testcase is currently blocked by bug 358102.
Comment 4 Matt Heitz CLA 2011-09-26 21:50:16 EDT
This is done.
Comment 5 Matt Heitz CLA 2011-09-27 10:16:52 EDT
Closing all JavaGen enhancements that are in the Resolved state.