Hi

Someone ran into this in the context of working with TeeSinkTokenFilter -
when the state is cloned for each of the sinks, if you have a
PayloadAttribute on the stream, it's shallow cloned and thus all sinks
share the same byte[].

At first I thought this is just a bug in PA.clone(), and that it should
have been implemented using deepCopyOf, but then I noticed that it's
actually documented that if you require deep cloning, you should implement
your own PA (or at least override .clone()).

But then, CharTermAttribute.clone() documents that it does a shallow clone,
but actually implements a *deep* clone.

So now I think PA.clone() should indeed be implemented as a deep clone...

What do you think?

Shai

Reply via email to