Hi,

> really need to use #equals() ...
> checking for identity equality should be OK too

I've just tried with an IdentityHashMap and all tests passed (except SerializableCheckerTest#runtimeExceptionTolerance() of course).

Sven


On 07/11/2014 11:39 AM, Martin Grigorov wrote:
Hi,

I agree that using the primary key should be enough for #equals() but
does 
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream#check()
really need to use #equals() (via Stack#contains()) ?
I think checking for identity equality should be OK too. Java Serialization
is not the simplest part of Java and I may miss something...

On Fri, Jul 11, 2014 at 10:51 AM, Sven Meier <s...@meiers.net> wrote:

Hi,


detachable models should never use getObject() in their implementation of
equals()?

generally this is a good advice: there are several places in Wicket
checking for model equality (e.g. ReuseIfModelsEqualStrategy).
A detachable model should have enough information to decide equality
without loading the model object.

Regards
Sven



On 07/11/2014 01:52 AM, Boris Goldowsky wrote:

I’ve started using CheckingObjectOutputStream to test for models of
database objects that are not properly detached, and find it very useful.

However I just diagnosed (after many hours of frustration) that it can
also cause problems rather than solve them.   CheckingObjectOutputStream
causes the equals() method of models to be called, and in the case of our
models the equals() implementation loads the database object (models of the
same object being considered equal to each other).  Since it’s doing this
during serialization and thus after the detach process, the checker
actually causes the exact problem that it’s supposed to prevent (and
doesn’t generate any warnings in this case).

Is it a general rule, that I was just not aware of, that detachable
models should never use getObject() in their implementation of equals()?
Or should CheckingObjectOutputStream be changed to avoid calling equals() ?

Bng


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to