Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355749 - Bitwise operation and % on a nullable int results in java compile error
Summary: Bitwise operation and % on a nullable int results in java compile error
Status: CLOSED FIXED
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-24 12:48 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:20 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-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.