jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn Hendriks" <marti...@gx.nl>
Subject RE: Validation in QName class
Date Mon, 17 Sep 2007 11:17:27 GMT

> On 9/17/07, Martijn Hendriks <martijnh@gx.nl> wrote:
> > Performance is a good argument of course. For this 
> particular problem, 
> > however, I think that some check inside Jackrabbit is 
> needed because 
> > the whole repository may become unusable by one wrong QName. The 
> > NodeTypeRegistry.validateNodeTypeDef method could be used for that. 
> > What do you think about adding some checks for invalid QNames there?
> Sounds like a patch? :-)

Well, yes :).

> However, the officially supported node type registration 
> methods are the ones in o.a.j.api.JackrabbitNodeTypeManager, 
> and there we do validate all the QNames. If you are using 
> NodeTypeRegistry directly, then I think it should be your 
> responsibility to do the validation before constructing the 
> QName instances.

Ok, that's fair. We use the NodeTypeRegistry directly because we need to
re-register nodetypes sometimes. The NodeTypeRegistry already has a
method checkNamespace to check that the URI of a QName has been
registered. Wouldn't adding a check with the NameFormat.checkFormat on
the local name of the QName only make the registry more robust?

Best wishes,


> BR,
> Jukka Zitting

View raw message