Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 91657 invoked from network); 17 Sep 2007 11:38:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2007 11:38:41 -0000 Received: (qmail 2946 invoked by uid 500); 17 Sep 2007 11:38:33 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 2913 invoked by uid 500); 17 Sep 2007 11:38:32 -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 2904 invoked by uid 99); 17 Sep 2007 11:38:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2007 04:38:32 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jukka.zitting@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2007 11:38:32 +0000 Received: by fk-out-0910.google.com with SMTP id b27so2050843fka for ; Mon, 17 Sep 2007 04:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=1MCS+bNRVPi/br32WsDgNyREo/HLePas4mw/wRT55vA=; b=tdO8yyc3Ltx+I3+s2aJR/uX50fmCpZa0pri22u6roBjEabbc3CRGiIJrKvFAHRZKrSAh04Ik4vIFG2S9RbFsN+NfArXLWimRGEFQgAPRZxMH1BKPtEomAQET1ZPqKv6A2X38ae88AQ0wu5B3Hly3o/1J2UijCrRo95bhBYklyKM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rA1Jv9RiiQKkyWQ6aiebKIBciKPtIAB8wid0d6UZ/05R0aoUz6NNdMh6bf5YfzHB4KyPt5UuDBxzpi/wW/H6RCrzhnON5ue0BZYH2EfWenvW0nSmm9zuR6WrIR25Nytz7sKi3cnaqNqXNVQxMpgLugwggYwnZxF+RP7ViGWFAy0= Received: by 10.82.174.20 with SMTP id w20mr5217487bue.1190029090680; Mon, 17 Sep 2007 04:38:10 -0700 (PDT) Received: by 10.82.189.15 with HTTP; Mon, 17 Sep 2007 04:38:10 -0700 (PDT) Message-ID: <510143ac0709170438w216e2287p83d21cf07c25ef48@mail.gmail.com> Date: Mon, 17 Sep 2007 14:38:10 +0300 From: "Jukka Zitting" To: dev@jackrabbit.apache.org Subject: Re: Validation in QName class In-Reply-To: <34B0CDC6176518459F3A96E8C09196B8064C507C@darth-vader.nijmegen.gx.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <34B0CDC6176518459F3A96E8C09196B8064C4EEE@darth-vader.nijmegen.gx.nl> <90a8d1c00709170218t3e33d44fr94c8009e0d9a518b@mail.gmail.com> <90a8d1c00709170219q5f8cfd38h15206379228c4d3f@mail.gmail.com> <34B0CDC6176518459F3A96E8C09196B8064C4F39@darth-vader.nijmegen.gx.nl> <510143ac0709170255q57520f19k520bf5c191057733@mail.gmail.com> <34B0CDC6176518459F3A96E8C09196B8064C507C@darth-vader.nijmegen.gx.nl> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 9/17/07, Martijn Hendriks wrote: > > 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? I see the logic in adding more robustness, but so far the basic assumption about QNames has been that they are all valid once constructed. I wouldn't want to start eroding that assumption by allowing some clients to feed invalid QNames to internal Jackrabbit methods and expecting the repository to do the validation for them. If you do need the extra functionality from NodeTypeRegistry, how about if we exposed it on the JackrabbitNodeTypemanager level together with proper name validation? This solution would be cleaner design-wise and would allow you to drop one direct jackrabbit-core dependency. BR, Jukka Zitting