Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363954 - RUI - MVC does not validate scale or precision for decimal model variable
Summary: RUI - MVC does not validate scale or precision for decimal model variable
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-11-16 13:57 EST by Paul Hoffman CLA
Modified: 2017-02-23 14:17 EST (History)
4 users (show)

See Also:


Attachments
Test program (5.70 KB, application/octet-stream)
2011-11-16 13:57 EST, Paul Hoffman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hoffman CLA 2011-11-16 13:57:36 EST
Created attachment 207110 [details]
Test program

Model variable decimalNumber is declared as decimal(6,2).

MVC does no validation or truncation on input number but assigns it as is to the variable.

Sample test is enclosed.   After starting test, type in a large number like 1234568.48823 in the decimal field view and press validate button.

The input will be accepted and saved in the decimalNumber model variable.

An assignment of the number as a literal would throw an exception because the number would not fit.

Assignment of 1234.56789 would fit but would be rounded or truncated.

This would be major for an app going into production, but may be OK for 7.0 release.
Comment 1 Justin Spadea CLA 2011-11-17 12:08:59 EST
Fixed InternalFormattingUtil.js - in EDT the function is given a boxed value so it must first be unboxed.

There is still the problem where extra decimals are not truncated. That is a riskier change and I've opened bug 364064 to track it for a future release.
Comment 2 Paul Hoffman CLA 2012-03-30 16:35:10 EDT
Verified by Justin in associated fix