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

Bug 367260

Summary: JSON conversion fails for nullable date/timestamp fields on record returned from a service
Product: z_Archived Reporter: Will Smythe <smythew>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: jeffdouglas, jvincens, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 367261    
Attachments:
Description Flags
Project demonstrating the problem none

Description Will Smythe CLA 2011-12-20 21:11:30 EST
See attached project. I have a record that contains a few simple fields:

record Student

	firstName string;
	lastName string;
	hireDate date?;
	active boolean?;

	d decimal(9,2)?;
	t timestamp?;	
	i int?;
	f float?;

end

Note that 'hireDate' is marked as nullable. If I instantiate a new Student and return it from a service function, I get a 'JSON conversion cannot be performed on field:hireDate in common.Student' error in the RUI handler calling this function. If I set hireDate to a non-null value or make the 'hireDate' field not nullable, everything works.

So, there seems to be an issue with JSON conversion of nullable date/timestamp fields. I tried this with a few other primitive types (boolean, decimal, int) and even if the value of the field is null, it works (i.e. my callback function in my RUI handler is invoked).

See attached project.
Comment 1 Will Smythe CLA 2011-12-20 21:13:01 EST
Created attachment 208652 [details]
Project demonstrating the problem
Comment 2 Joseph Vincens CLA 2012-01-19 11:22:14 EST
fixed
Comment 3 Will Smythe CLA 2012-02-21 07:58:10 EST
Verified in 2/20 nightly build.