jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
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 GMT
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);
     }



Mime
View raw message