Bug 119255 - Validation of grid spacing is inconsistent
Summary: Validation of grid spacing is inconsistent
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor
Target Milestone: 1.0.1   Edit
Assignee: Tom Macdougall CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-12-05 10:32 EST by Tom Macdougall CLA
Modified: 2010-07-19 12:29 EDT (History)
1 user (show)

See Also:


Attachments
patch for grid unit validation (4.42 KB, patch)
2005-12-06 15:30 EST, Tom Macdougall CLA
no flags Details | Diff
patch for grid spacing validation (2.02 KB, patch)
2006-08-10 10:39 EDT, Tom Macdougall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Macdougall CLA 2005-12-05 10:32:19 EST
You can set the grid spacing to 2 inches, but if you change the units to pixels, 192 pixels is considered 'illegal'.
Comment 1 Tom Macdougall CLA 2005-12-06 15:30:53 EST
Created attachment 31245 [details]
patch for grid unit validation

Enhanced validation to use a consistent base unit for comparisons to the minimum and maximum allowable grid spacings.
Comment 2 Tom Macdougall CLA 2005-12-06 15:49:48 EST
Committed the code
Comment 3 Keith W. Campbell CLA 2006-05-26 14:40:36 EDT
It appears the limit is now 100 inches (which seems excessive) but at least
it's consistent.

It doesn't, however, complain about malformed numbers like '99.9.9.'!
Comment 4 Keith W. Campbell CLA 2006-06-13 11:22:03 EDT
Tom, can you reopen to get the validation is improved? Thanks.
Comment 5 Anthony Hunter CLA 2006-06-30 11:01:50 EDT
Reopen to fix malformed numbers like '99.9.9.' as reported
Comment 6 Tom Macdougall CLA 2006-07-24 15:57:07 EDT
It appears that the ICU4J DecimalFormat parse method that we use to parse the grid spacing field will parse a String like "99.9.9." (or "99.9.", "99.9r") and return 99.9 (i.e. to the first unparsable character). I have posted a question to the newgroup to find out if there is a way to restrict or force an exception out these cases.
Comment 7 Keith W. Campbell CLA 2006-07-25 08:45:28 EDT
The parse method should update the ParsePosition object so that you can
check if position.getIndex() == text.length().
Comment 8 Tom Macdougall CLA 2006-08-10 10:39:03 EDT
Created attachment 47692 [details]
patch for grid spacing validation

The parse position is now tested against the text's length to ensure that the full text has been parsed. This will prevent "99.9." to be validated. Please note that the text "5." is accepted as 5 because the parser will parse the full text.
Comment 9 Linda Damus CLA 2006-08-10 15:33:12 EDT
Committed the second patch (patch for grid spacing validation).
Comment 10 Eclipse Webmaster CLA 2010-07-19 12:29:44 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug