Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 14684 invoked from network); 28 Apr 2009 14:43:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Apr 2009 14:43:22 -0000 Received: (qmail 1604 invoked by uid 500); 28 Apr 2009 14:43:22 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 1551 invoked by uid 500); 28 Apr 2009 14:43:22 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 1543 invoked by uid 99); 28 Apr 2009 14:43:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 14:43:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 14:43:12 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LyoWJ-00061I-DM for dev@jackrabbit.apache.org; Tue, 28 Apr 2009 07:42:51 -0700 Message-ID: <23278529.post@talk.nabble.com> Date: Tue, 28 Apr 2009 07:42:51 -0700 (PDT) From: Yoav Landman To: dev@jackrabbit.apache.org Subject: Re: Understanding mixins merge logic In-Reply-To: <923C3657-7986-432A-A2AE-697724108524@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ylandman@gmail.com References: <23267598.post@talk.nabble.com> <923C3657-7986-432A-A2AE-697724108524@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Stefan Guggisberg wrote: > > Hi yoav, > > > > On 28.04.2009, at 01:51, Yoav Landman wrote: > >> >> Hi, >> >> I am trying to understand the logic of merging mixing changes - >> I see that the NodeStateMerger is failing a merge due do a >> difference in the >> mixin type names. In practice, however, the content of the mixin type >> namesets is identical between the overlayed state and the modified >> state >> (same *names* references). But since the comparison of the 2 namesets >> themselves is done by reference (NameSet does not override equals()) >> and >> since the *namesets* references are different the merge ends up with a >> StaleItemStateException. >> >> My question is - >> Shouldn't the comparison of the mixin type sets be done by content, >> not by >> the references of the namesets themselves? > > Agreed, seems to be a bug. I'll have a look tomorrow and let you know. > Great. If it is so, I guess it might remove a lot of unnecessary StaleItemStateExceptions. >> The relevant comments in >> NodeStateMerger say: >> "the mixins have been modified but by just looking at the diff we >> can't >> determine where the change happened since the diffs of either >> removing a >> mixin from the overlayed or adding a mixin to the transient state >> would look >> identical..." >> I am trying to understand this and how it applies to the current >> behavior, >> but can't. Could someone shed some light on it? > > I guess the namesets are copied-on-write. The assumption therefore is > that non-equal nameset references mean that they've been modified. > I'll have a look. > > Cheers > Stefan > > In my case I have 2 states with 2 different nameset references. Each nameset contains 2 instances of o.a.j.spi.commons.name.NameFactoryImpl$NameImpl: {http://www.jcp.org/jcr/mix/1.0}referenceable, and {http://www.jcp.org/jcr/mix/1.0}lockable Those 2 name instances are identical (same reference) between the 2 namesets, yet the namesets are considered different. >> >> >> Thanks, >> >> Yoav >> -- >> View this message in context: >> http://www.nabble.com/Understanding-mixins-merge-logic-tp23267598p23267598.html >> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com. >> > > -- View this message in context: http://www.nabble.com/Understanding-mixins-merge-logic-tp23267598p23278529.html Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.