Open glassfishrobot opened 16 years ago
Reported by ozgwei
ozgwei said: Created an attachment (id=3) A patch for the improvement
ozgwei said: Attached is a patch that allows the combination of 3 different types of constructors: 1) constructor with only mandatory/required elements/attributes with no default value 2) constructor with only mandatory/required elements/attributes 3) the original fully initializing constructor (which can be generated being annotated by @deprecated)
See the test target in the build.xml for usage.
Alex
File: value-constructor-patch.txt Attached By: ozgwei
Issue-Links: blocks JAXB2_COMMONS-14
Was assigned to lexi
This issue was imported from java.net JIRA JAXB2_COMMONS-11
Currently, the value constructor plugin generates a fully initializing constructor with all elements and attributes.
Client codes that use these constructors will break when a new optional element or attribute is added to the schema.
A better solution is to generate a partially initializing constructors with only elements that have minOccurs greater than 0 and with no default value and required attributes.
It'd be better to use the default-value-plugin to provide default values.
Alex Wei
Environment
Operating System: All Platform: All
Affected Versions
[current]