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

Bug 364517

Summary: String + operator does not throw a NVE
Product: z_Archived Reporter: Brian Svihovec <svihovec>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, jqian
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Brian Svihovec CLA 2011-11-22 15:55:11 EST
Given the following EGL Source:

decimalType decimal?;
syslib.writeStdout("decimalType " + decimalType);

The following is printed at runtime for Java:

decimalType 


The + operator for EString does not support null values:

/**
 * {@Operation +} Concatenates two strings.
 */
static function $Plus(lvalue EString in, rvalue EString in) returns(EString) {@Operation{"+"}};

I believe this should throw an NVE at runtime.
Comment 1 Jeff Douglas CLA 2011-12-22 14:44:40 EST
We need to know what this scenario is supposed to do, before we can fix the one you mention below.

stringType string?;
syslib.writeStdout("stringType " + stringType);

Does this also throw an exception, because I recall from discussions with Tim, that when we concatenate a null to a string, that this is acceptable. If it is, then we need to modify the runtime for the asString (and others) methods to throw a NVE when the value is null. Right now it just passes the null along as a string value, which is allowed.
Comment 2 Jeff Douglas CLA 2012-01-11 15:39:40 EST
The eglar's are being updated to allow nulls to be used with plus for string ... there is nothing that needs to be changed for javagen.
Comment 3 Brian Svihovec CLA 2012-01-16 21:58:22 EST
Invalid.