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

Bug 356249

Summary: Arithmetic operators +,-,* with nullable smallInt produces invalid Java code
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-30 15:56:55 EDT
EDT code

	function main()
		int1 smallint? = 75;
		int2 smallint? = 5;
		result smallint;
		
		result = int1 + int2;
		result = int1 - int2;
		result = int1 * int2;	
	end

Java code

	public void main() {
		Short int1 = null;
		int1 = (short) 75;
		Short int2 = null;
		int2 = (short) 5;
		short result = (short) 0;
		result = (short)((ESmallint.plus(int1, int2)));
		result = (short)((ESmallint.minus(int1, int2)));
		result = (short)((ESmallint.multiply(int1, int2)));
	}

Error msg
Cannot cast from Integer to short
Comment 1 Matt Heitz CLA 2011-08-30 16:13:18 EDT
This hits the same underlying problem as bug 355754.  I'll mention this testcase in that defect so we're sure to fix both.

*** This bug has been marked as a duplicate of bug 355754 ***