Return-Path: X-Original-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE612D2B4 for ; Thu, 12 Jul 2012 14:52:19 +0000 (UTC) Received: (qmail 82003 invoked by uid 500); 12 Jul 2012 14:52:19 -0000 Delivered-To: apmail-jackrabbit-oak-commits-archive@jackrabbit.apache.org Received: (qmail 81945 invoked by uid 500); 12 Jul 2012 14:52:18 -0000 Mailing-List: contact oak-commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-commits@jackrabbit.apache.org Delivered-To: mailing list oak-commits@jackrabbit.apache.org Received: (qmail 81914 invoked by uid 99); 12 Jul 2012 14:52:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 14:52:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 14:52:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3122D23888D2; Thu, 12 Jul 2012 14:51:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1360708 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java Date: Thu, 12 Jul 2012 14:51:54 -0000 To: oak-commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120712145154.3122D23888D2@eris.apache.org> Author: jukka Date: Thu Jul 12 14:51:53 2012 New Revision: 1360708 URL: http://svn.apache.org/viewvc?rev=1360708&view=rev Log: OAK-182: Support for "invisible" internal content Pass the ":name" pattern through the name validator Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java?rev=1360708&r1=1360707&r2=1360708&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NameValidator.java Thu Jul 12 14:51:53 2012 @@ -36,7 +36,7 @@ class NameValidator implements Validator protected void checkValidName(String name) throws CommitFailedException { int colon = name.indexOf(':'); - if (colon != -1) { + if (colon > 0) { String prefix = name.substring(0, colon); if (prefix.isEmpty() || !prefixes.contains(prefix)) { throw new CommitFailedException( Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java?rev=1360708&r1=1360707&r2=1360708&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java (original) +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/NameValidatorTest.java Thu Jul 12 14:51:53 2012 @@ -35,10 +35,10 @@ public class NameValidatorTest { @Test(expected = CommitFailedException.class) public void testParentPath() throws CommitFailedException { - validator.childNodeAdded(".", MemoryNodeState.EMPTY_NODE); + validator.childNodeAdded("..", MemoryNodeState.EMPTY_NODE); } - @Test(expected = CommitFailedException.class) + @Test // valid as of OAK-182 public void testEmptyPrefix() throws CommitFailedException { validator.childNodeAdded(":name", MemoryNodeState.EMPTY_NODE); }