When an xsd defines an optional boolean field, if the optionalProperty attribute is set to "primitive", it should bind as it did in 1.0, according to the spec, but it doesn't.
For example, given the following xsd:
and specifying optionalProperty="primitive" in the binding xml, the generated class looks like this:
this method returns Boolean, not boolean as per the spec.
The problem is that although boxing will work, if the supplied xml doesn't contain a value for pricepoint_custom_fields_required, the class's Boolean field is null, instead of false. So a NullPointerException will be seen when doing something like this:
In the spec, it says the following:
optionalProperty controls how a JAXB property with a primitive base type that represents an optional non-nillable element/attribute is bound. If the attribute has the value "wrapper", then the base type of the JAXB property is the wrapper class for the primitive type. A user can indicate that this optional property is not set by calling the setter with "null" value. If the attribute's value is "primitive", it binds as it did in JAXB 1.0. If the attribute's value is "isSet", it binds the optional property using the primitive base type and also the isSet/unset methods are generated for the optional property. The attribute's default value is "wrapper".
If you bind the above xml with jaxb1.0, you get generated objects with a method getDisplay() which returns boolean (primitive).
If you use jaxb 2.0 with optionalProperty set to "primitive" you should get exactly the same thing - that's what the spec says.
In JAXB 1.0, if minOccurs="0", and the xsd contains no default value for the boolean, booleans are set to false by default.
NB This is a duplicate of 926 which was raised against an older version of the code. This bug affects 2.2.6.