jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: svn commit: r1298002 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java
Date Wed, 07 Mar 2012 21:19:00 GMT

On Wed, Mar 7, 2012 at 9:45 PM, Michael Dürig <michid@gmail.com> wrote:
> Regarding equals in the abstract base classes: I'd make the equals methods
> in the abstract base classes final.

No, the current non-final implementation is by design.

See the followup patch I attached to OAK-3 for what I'm aiming at
here. Basically I want to decouple the task of diffing node states
from the underlying storage model (so far the diff() method has been
an integral part of the .mk.model.Node interface).

To do that efficiently, we need a fast way to compare potentially huge
subtrees for equality. The underlying storage model can do that for
example when the states point to the same storage location or have the
same content hash, which is why they should be able to override the
equals() method. Otherwise an equals() check could end up traversing
the entire subtree.

> Overriding them in a concrete subclass will most likely break symmetry.

If it does, it breaks the API contract and should be fixed.


Jukka Zitting

View raw message