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

Bug 355749

Summary: Bitwise operation and % on a nullable int results in java compile error
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-24 12:48:07 EDT
EDT Code

program driver type BasicProgram {}
	function main()
		int1 int = 13;
		int2 int = 27;
		int1n int? = 13;
		int2n int? = 27;
		int3 int;
		
		int3 = int1 & int2;
		int3 = int1n & int2n;
	end	
end

First assigment to int3 is fine.  Second statement gets this error:

The method bitand(Integer, Integer) is undefined for the type EInt
Comment 1 Kathy Carroll CLA 2011-08-25 12:55:30 EDT
program driver type BasicProgram {}
	
	int1 int? = 75;
	int5 int? = 2;
	int6 int? = -2;
	intActual int?;
	intExpect int?;
	variation string = "testing";
	
	function main()
		runArithmeticFunction13();
		runArithmeticFunction14();
	end

 	function assertTrue()
	 	success boolean = (intExpect == intActual);
	 	if (!success)
	 		Syslib.writeStdOut(variation);
	 		SysLib.writeStdOut(" actual " + intActual);
	 		SysLib.writeStdOut(" expect " + intExpect);
	 	end
 	end
	
	function runArithmeticFunction13()	
		variation = "operation % with literals";
		intActual = int1 % int5;
		intExpect = 1;
		assertTrue();
	end

	function runArithmeticFunction14()
		variation = "operation % with negative literals";
		intActual = int1 % int6;
		intExpect = 1;
		assertTrue();
	end
end
Comment 2 Matt Heitz CLA 2011-08-27 13:39:54 EDT
I added the missing EInt.bitand (plus its friends, bitor and xor).  The % problem was fixed by updating the generator.  It was generating calls to a method named modulo, but the correct name is remainder.
Comment 3 Kathy Carroll CLA 2011-08-29 10:40:40 EDT
verified
Comment 4 Lisa Lasher CLA 2011-10-11 16:10:26 EDT
Closing this defect.