You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Jukka Zitting <ju...@gmail.com> on 2012/06/01 12:16:03 UTC

Re: svn commit: r1344262 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/name/NameValidator.java plugins/type/TypeValidator.java spi/commit/Validator.java

Hi,

On Wed, May 30, 2012 at 3:54 PM,  <md...@apache.org> wrote:
> Validator.childNodeDeleted should have void return type since there is nothing to validated on a deleted node

Actually, contrary to our earlier discussion, I did now remember why
it's a good idea for the childNodeDeleted() method to return a
Validator to be used for descending into the removed subtree.

See the NamespaceValidator class that I added in revision 1345006 for
validating changes to the /jcr:system/jcr:namespaces subtree. It's
easier to write that code if I can rely on the ValidatingCommitHook
calling the propertyDeleted() methods on the removed namespace mapping
properties instead of also interpreting childNodeDeleted() calls on
/jcr:system or /jcr:system/jcr:namespaces.

In that revision I adjusted all the relevant code to reflect the
restored childNodeDeleted() return value. I also did some further
cleanup on the exception handling in ValidatingCommitHook (using a
member variable instead of an array reference from the surrounding
class).

BR,

Jukka Zitting

Re: svn commit: r1344262 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/name/NameValidator.java plugins/type/TypeValidator.java spi/commit/Validator.java

Posted by Michael Dürig <md...@apache.org>.

On 1.6.12 11:16, Jukka Zitting wrote:
> Actually, contrary to our earlier discussion, I did now remember why
> it's a good idea for the childNodeDeleted() method to return a
> Validator to be used for descending into the removed subtree.
>
> See the NamespaceValidator class that I added in revision 1345006 for
> validating changes to the /jcr:system/jcr:namespaces subtree. It's
> easier to write that code if I can rely on the ValidatingCommitHook
> calling the propertyDeleted() methods on the removed namespace mapping
> properties instead of also interpreting childNodeDeleted() calls on
> /jcr:system or /jcr:system/jcr:namespaces.

Ack, makes sense.

>
> In that revision I adjusted all the relevant code to reflect the
> restored childNodeDeleted() return value. I also did some further
> cleanup on the exception handling in ValidatingCommitHook (using a
> member variable instead of an array reference from the surrounding
> class).

Ok yes this looks better now. I further cleaned it up a bit in revision 
1345233. It seemed odd to me that you had to pass in the validator to 
the constructor of ValidatorDiff and to its validate method. It should 
only be a member of ValidatorDiff.

Michael

>
> BR,
>
> Jukka Zitting