We're still mixing merging and parsing logic, which to me looks like an unsolvable
puzzle.
What's the function of the override
(NamedMetaDataWithDescriptionGroupWithOverride.data)?
Either it's for holding data from the jboss xml parse or it's for referring to the
override. IMHO it can't be both.
The code now creates a StackOverflow in JBossEnterpriseBean.setDescriptionGroup.
(ensureOverride returns a new instance of the same class and calls setDescriptionGroup.)
I have changed this part, but as long as the above question is unanswered the solution is
by definition wrong.
Another thing is the merge method: the current use of the merge is contradicting the
implementation.
MergeUtil.merge:
JBossMetaData merged = new JBossMetaData();
| merged.merge(jboss, spec);
| merged.setOverridenMetaData(spec);
| return merged;
vs for example IdMetaDataImpl:
public void merge(IdMetaDataImpl merged, IdMetaDataImpl original)
| {
| ...
| if (id != null)
| merged.setId(id);
| else if (original.id != null)
| merged.setId(original.id);
| }
where merged is the target. I would rather see this as target (as in MergeUtil) and have
the following signature:
interface Mergable<M>
| void merge(M original, M override);
Or maybe only a one-way merge:
interface Mergable<M>
| void merge(M override);
Because the default (non-performant) code is always:
void merge(M original, M override)
| {
| merge(original);
| merge(override);
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097391#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...