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

Bug 362930

Summary: Appending NULL to a list of non-nullable elements should throw a NVE
Product: z_Archived Reporter: Paul Harmon <pharmon>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, jqian
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Paul Harmon CLA 2011-11-04 13:57:29 EDT
For the testcase below, when the go() function on the library is invoked, it should print 2 "success" messages. Currently the test for moving a null to a list of non-nullables is failing. Once this problem is resolved for JavaGen, please route this bug to JSGen, as it is failing as well.



package pkg1;

// basic library
library NonNullableListTest

	nullableList int?[] = [1,2,3];
	nonnullableList int[] = [1,2,3];
	
	myNull int? = null;
	
	function go()
		nullableList.appendElement(myNull);
		if (nullableList.getSize() == 4)
			SysLib.writeStdout("Appending null to nullable list works!");
		else
			SysLib.writeStdout("Appending null to nullable list fails!");
		end
		
		gotException boolean = false;

		try
			nonnullableList.appendElement(myNull);
					
		onException(exception NullValueException)
			gotException = true;
		onException(exception AnyException)
		end
		
		if (gotException && nonnullableList.getSize() == 3)
			SysLib.writeStdout("Appending null to non-nullable list works!");
		else
			SysLib.writeStdout("Appending null to non-nullable list fails!");
		end
		
		
		
	end
	
end
Comment 1 Jeff Douglas CLA 2011-11-07 16:25:10 EST
Fixed for javagen. Passing it over to JSGen.
Comment 2 Jing Qian CLA 2011-11-21 14:13:11 EST
verified on 201111210901's build