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

Bug 335921

Summary: Valid facets for int type include fractionDigits
Product: z_Archived Reporter: Noopur Gupta <noopur2507>
Component: WTP IncubatorAssignee: Stanislav Nichev <stanislav.nichev>
Status: CLOSED WORKSFORME QA Contact: Dimitar Tenev <dimitar.tenev>
Severity: major    
Priority: P3 CC: dimitar.donchev
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Noopur Gupta CLA 2011-02-01 00:26:47 EST
Hello,

The isTotalDigitsFacetSupported(org.eclipse.xsd.XSDSimpleTypeDefinition) method of org.eclipse.wst.sse.sieditor.model.utils.SimpleTypeFacetsUtils class returns true for the rootType int but the return value should be false. 
The valid facets for int returned by the Eclipse EMF model also include totalDigits and fractionDigits which are not supported for int type.

Thanks,
Noopur Gupta
Comment 1 Stanislav Nichev CLA 2011-02-21 09:16:32 EST
Hi Noopur,

The XSDSimpleTypeDefinition#getValidFacets() method returns the list: [totalDigits, fractionDigits, pattern, whiteSpace, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive].

We are currently checking if the valid facets list contains the XSDConstants.TOTALDIGITS_ELEMENT_TAG facet.

According to the XML Schema specification (http://www.w3.org/TR/xmlschema-2/#int), the fractionDigits facet is allowed, but it's value is restricted to 0. "int" is the derived type of "long" which is the derived type of "integer". The restriction on the fractionDigits is described in http://www.w3.org/TR/xmlschema-2/#integer.

If you try to change the value of the fractionDigits facets, a live validation message is shown on the UI control - to show the described restriction.

I'm currently unable to find a restrinction on the totalDigits facet. Could you please point me to such a restriction in the XML Schema specification?

Since the user can edit the value of the fractionDigits facet through the source, we need to show it in the UI part.

Regards,
Stanislav
Comment 2 Stanislav Nichev CLA 2011-06-05 15:00:56 EDT
Hi Colleagues,

I'm updating the status of this bugzilla since the current one (resolved/invalid) is not correct.
The status should have been closed/worksforme.

Regards,
Stanislav