Open glassfishrobot opened 15 years ago
Reported by ozgwei
ozgwei said: Created an attachment (id=5) eager initializing collection properties
ozgwei said: Attached is a patch to allow users to optionally specifies whether eager initialization of list properties are preferred.
Alex
ozgwei said: Created an attachment (id=6) a newer patch with null check in setter method, overwriting the previous submitted patch
ozgwei said: When user specifies the option of eager initialization, the collection setter methods generated will also check whether the parameter is null or not. If the parameter is null, a newly created ArrayList will be assigned to the collection property.
lexi said: The plugin was not ported after cvs->svn move, dead at the moment.
File: collection-setter-injector-patch-20081015-1641.txt Attached By: ozgwei
File: collection-setter-injector-patch.txt Attached By: ozgwei
Was assigned to lexi
This issue was imported from java.net JIRA JAXB2_COMMONS-13
If the List implementation is the default java.util.ArrayList, it will be lazily initialized. This can cause a problem when using the EqualsBuilder.reflectionEquals(obj, obj) method, as implemented by commons-lang-plugin, if the expected object holds a null for a collection property while the actual object holds an empty ArrayList simply because the getter method has been called, which has a side effect. Note that the lazy initialization is implemented for performance reason.
Environment
Operating System: All Platform: All
Affected Versions
[current]