Bug 1127329
Summary: | [GSS] (6.4.0) Invalid boolean values are set to 'false' instead of null | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Kyle Lape <klape> | |
Component: | XML Frameworks | Assignee: | Jason T. Greene <jason.greene> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Pavel Slavicek <pslavice> | |
Severity: | unspecified | Docs Contact: | eap-docs <eap-docs> | |
Priority: | unspecified | |||
Version: | 6.3.0 | CC: | jbliznak, kkhan | |
Target Milestone: | DR1 | |||
Target Release: | EAP 6.4.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1127332 (view as bug list) | Environment: | ||
Last Closed: | Type: | Bug | ||
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1127326, 1127332 |
Description
Kyle Lape
2014-08-06 16:40:41 UTC
Upstream Jira: https://java.net/jira/browse/JAXB-1019 Spec references: ------------------------------------------------------------------------ JAXB 2.2 spec, section B.3.8.1: Unparseable Data for Simple Types (p312) If simple type data cannot be parsed into a java datatype, then the value of the java datatype must not change the current set value. An access to the datatype must return the value as specified in Section B.3.8.2, “Missing element information item”. If the conversion of lexical representation into a value results in an exception, then the exception must be caught and a validation event reported. This is to ensure that such conversion errors do not terminate unmarshalling. B.3.8.2 Missing element information item Property or field access must return the value specified in Section B.3.8.4, “Value for missing elements/attributes” B.3.8.4 Value for missing elements/attributes If an attribute or an element is missing from an XML instance, then unmarshal will not change the current set value. An access to the property will return the set value or if unset, the uninitialized value. The uninitialized value of the property or field depends upon it's type. If the type is 1. int-valueis0 2. boolean - value is false 3. a reference (must be mapped to a simple type) - value is null. ... ------------------------------------------------------------------------ XML Schema, part 2, secion 3.2.2: Primitive Datatypes: boolean 3.2.2.1 Lexical representation An instance of a datatype that is defined as ·boolean· can have the following legal literals {true, false, 1, 0}. ------------------------------------------------------------------------ So I interpret the above specs like this: - The valid boolean values are {true, false, 1, 0}, excluding whitespace around the values - If it's not one of those values, then: - If the type is a primitive "boolean", the value is false (default) - If the type is "java.lang.Boolean" (i.e. an object reference), then the value is null (default) (Of course the invalid value should throw an exception if schema validation is enabled; we are only talking about the default unmarshalling value with schema validation disabled.) Should be fixed by jaxb upgrade to 2.2.5-redhat-9: https://bugzilla.redhat.com/show_bug.cgi?id=1127326 Verified on 6.4.0.DR1 |