Currently the lifecycle metadata is a simple array. This does not work for merges as you end up with repeated elements. It should be a map keyed by a possibly null class name which indicates 'the current' class in question. In the metadata layer this is not known generally (parsing an xml file that has no class). That is going to have to be handled by the runtime code that invokes the lifecycle callbacks. I have already done this in the client container.
So do we want to change this to a map(class-name,callback) to avoid duplicates or just update the merge logic to deal with the duplicates better?
I left it as an array and just fixed the duplicates from the merging for now.