Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356249 - Arithmetic operators +,-,* with nullable smallInt produces invalid Java code
Summary: Arithmetic operators +,-,* with nullable smallInt produces invalid Java code
Status: CLOSED DUPLICATE of bug 355754
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-30 15:56 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:18 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 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 ***