Closed glassfishrobot closed 16 years ago
Reported by kflorian
@pavelbucek said: Fixed in 2.1.10.
setLifeCycleFlags() now traverses thru class hierarchy (from last child to Object) and looks for lifecycle methods. Only first found method is saved (and called afterwards).
Was assigned to jaxb-issues
This issue was imported from java.net JIRA JAXB-477
Marked as fixed on Wednesday, November 12th 2008, 1:14:09 am
Currently, setLifecycleFlags() in JaxBeanInfo searches the array returned by jaxbType.getDeclaredMethods() for lifecycle methods. This does not include methods inherited from super-classes, though. So, if I have a common super-class for several of my JAXB beans, lifecycle-methods implemented in the super-class are not called for any of the sub-classes when they are instantiated. FIX: Either call jaxbType.getMethods() instead (which returns public methods only, but includes inherited methods), or call getDeclaredMethods() for super-class of jaxbType recursively. A cleaner long-term solution (in my opinion) would be to declare an Interface for livecycle methods that must be implemented by classes requiring call-backs. Thanks!
Environment
Operating System: All Platform: All
Affected Versions
[2.1.6]