jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1463953 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Wed, 03 Apr 2013 12:16:28 GMT
Author: jukka
Date: Wed Apr  3 12:16:27 2013
New Revision: 1463953

URL: http://svn.apache.org/r1463953
Log:
OAK-509: Item names starting with '{X}' cause RepositoryException

Fix assertion. Add test case.

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java?rev=1463953&r1=1463952&r2=1463953&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java
Wed Apr  3 12:16:27 2013
@@ -40,8 +40,8 @@ public abstract class LocalNameMapper ex
     @Override @CheckForNull
     public String getJcrName(String oakName) {
         checkNotNull(oakName);
-        checkArgument(!oakName.startsWith(":")); // hidden name
-        checkArgument(isExpandedName(oakName));  // expanded name
+        checkArgument(!oakName.startsWith(":"), oakName); // hidden name
+        checkArgument(!isExpandedName(oakName), oakName); // expanded name
 
         if (hasSessionLocalMappings()) {
             int colon = oakName.indexOf(':');

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1463953&r1=1463952&r2=1463953&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Wed Apr  3 12:16:27 2013
@@ -2163,6 +2163,15 @@ public class RepositoryTest extends Abst
         assertTrue(c2.hasProperty("pc2"));
     }
 
+    @Test
+    public void expandedName() throws RepositoryException {
+        Session session = getAdminSession();
+        session.setNamespacePrefix("foo", "http://example.com/");
+        session.getRootNode().addNode("{0} test");
+        session.save();
+        assertTrue(session.nodeExists("/{0} test"));
+    }
+
     //------------------------------------------------------------< private >---
 
     private Node getNode(String path) throws RepositoryException {



Mime
View raw message