You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Lars Francke <la...@gmail.com> on 2013/04/30 18:13:09 UTC

[digester] Annotations handled multiple times

Hi,

I'm using the Digester Annotations and everything works pretty well
(looking forward to 3.3 for DIGESTER-174).

We have a model where we share a "contact" class and have that
annotated with an @ObjectCreate.List because it can live under
multiple different elements and a tree-like structure where the top
level element contains other elements that in turn have "contacts".

Here's a simplified version of the schema:
A(/a) has B(/a/b)
A(/a) has C(/a/c)

B has D(/a/b/d + /a/c/d)
C has D(/a/b/d + /a/c/d)

The problem now is that the AnnotationHandler processes the D element
multiple times because it's being reached through multiple branches of
the "tree", thus creating multiple instances of the ObjectCreateRule
which are all fired and obviously screw up the stack.

To me this seems like a bug and the AnnotationHandlers should check if
they have already visited an element. I'm happy to file a JIRA but I
wasn't sure if this might not be intended behavior for some reason I
don't understand yet. Also: I might be completely wrong in my
diagnosis of this problem.

Any help is greatly appreciated.

Cheers,
Lars

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [digester] Annotations handled multiple times

Posted by Simone Tripodi <si...@apache.org>.
Hi Lars,

please apologize for the late reply - could you please submit a
testcase that proves the bug and fill an issue on JIRA?

Many thanks in advance, all the best!
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/


On Tue, Apr 30, 2013 at 6:13 PM, Lars Francke <la...@gmail.com> wrote:
> Hi,
>
> I'm using the Digester Annotations and everything works pretty well
> (looking forward to 3.3 for DIGESTER-174).
>
> We have a model where we share a "contact" class and have that
> annotated with an @ObjectCreate.List because it can live under
> multiple different elements and a tree-like structure where the top
> level element contains other elements that in turn have "contacts".
>
> Here's a simplified version of the schema:
> A(/a) has B(/a/b)
> A(/a) has C(/a/c)
>
> B has D(/a/b/d + /a/c/d)
> C has D(/a/b/d + /a/c/d)
>
> The problem now is that the AnnotationHandler processes the D element
> multiple times because it's being reached through multiple branches of
> the "tree", thus creating multiple instances of the ObjectCreateRule
> which are all fired and obviously screw up the stack.
>
> To me this seems like a bug and the AnnotationHandlers should check if
> they have already visited an element. I'm happy to file a JIRA but I
> wasn't sure if this might not be intended behavior for some reason I
> don't understand yet. Also: I might be completely wrong in my
> diagnosis of this problem.
>
> Any help is greatly appreciated.
>
> Cheers,
> Lars
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org