jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1365064 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
Date Tue, 24 Jul 2012 14:00:07 GMT
Author: reschke
Date: Tue Jul 24 14:00:06 2012
New Revision: 1365064

URL: http://svn.apache.org/viewvc?rev=1365064&view=rev
Log:
OAK-61: make name mapper aware of session prefix optimization as well

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java?rev=1365064&r1=1365063&r2=1365064&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
Tue Jul 24 14:00:06 2012
@@ -24,6 +24,8 @@ public abstract class AbstractNameMapper
 
     protected abstract String getOakPrefixFromURI(String uri);
 
+    public abstract boolean hasSessionLocalMappings();
+
     @Override
     public String getOakName(String jcrName) {
         if (jcrName == null || jcrName.isEmpty()) {
@@ -56,13 +58,17 @@ public abstract class AbstractNameMapper
 
             // otherwise: not an expanded name
 
-            String pref = jcrName.substring(0, pos);
-            String name = jcrName.substring(pos + 1);
-            String oakPrefix = getOakPrefix(pref);
-            if (oakPrefix == null) {
-                return null; // not a mapped name
+            if (!hasSessionLocalMappings()) {
+                return jcrName;
             } else {
-                return oakPrefix + ':' + name;
+                String pref = jcrName.substring(0, pos);
+                String name = jcrName.substring(pos + 1);
+                String oakPrefix = getOakPrefix(pref);
+                if (oakPrefix == null) {
+                    return null; // not a mapped name
+                } else {
+                    return oakPrefix + ':' + name;
+                }
             }
         }
     }



Mime
View raw message