commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wim Deblauwe <wim.debla...@gmail.com>
Subject Re: [betwixt] Only use idref for == objects, not for equal objects
Date Sun, 23 Oct 2005 12:05:37 GMT
ok, thanks. This will be in the 0.8 release then I guess? Any idea when this
will happen?

regards,

Wim

2005/10/22, robert burrell donkin <robertburrelldonkin@blueyonder.co.uk>:
>
> On Mon, 2005-10-17 at 10:12 +0200, Wim Deblauwe wrote:
> > Hi,
> >
> > Betwixt outputs idref attributes for objects that are equal. It would be
> > better if it only used idref for objects that are the same reference
> (==).
> > Because when you use Betwixt now to serialize 2 equal objects, they turn
> > into the same object after deserialization. So you have a different
> > situation.
>
> betwixt is a bean mapping (not an xml serializer). using equals is
> therefore a reasonable default.
>
> > This problem can easily be solved by replacing the use of HashMap in
> > AbstractBeanWriter with IdentityHashMap.
>
> since the 0.7 release, this has been factored out into IdStoringStrategy
> but as wim rightly says, using an implementation which is backed by
> IdentityHashMap will give the behaviour required. i've added a
> convenience constructor to DefaultIdStoringStrategy to make this a
> little easier.
>
> - robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message