jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1463584 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java oak-jcr/pom.xml oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.java
Date Tue, 02 Apr 2013 15:06:48 GMT
Author: mreutegg
Date: Tue Apr  2 15:06:47 2013
New Revision: 1463584

URL: http://svn.apache.org/r1463584
Log:
OAK-715: Don't share name space map between SessionImpl and LocalNameMapper

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/LocalNameMapper.java
    jackrabbit/oak/trunk/oak-jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.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=1463584&r1=1463583&r2=1463584&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
Tue Apr  2 15:06:47 2013
@@ -62,7 +62,6 @@ public abstract class LocalNameMapper ex
                     for (int i = 2; true; i++) {
                         String jcrPrefix = oakPrefix + i;
                         if (!local.containsKey(jcrPrefix)) {
-                            local.put(jcrPrefix, uri);
                             return jcrPrefix + oakName.substring(colon);
                         }
                     }

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1463584&r1=1463583&r2=1463584&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Tue Apr  2 15:06:47 2013
@@ -35,7 +35,6 @@
 
   <properties>
     <known.issues>
-      org.apache.jackrabbit.test.api.NamespaceRemappingTest#testAutomaticNewLocalPrefix<!--
OAK-715 -->
       org.apache.jackrabbit.test.api.AddNodeTest#testSameNameSiblings<!-- OAK-203 -->
       org.apache.jackrabbit.test.api.SessionTest#testMoveConstraintViolationExceptionSrc<!--OAK-132-->
       org.apache.jackrabbit.test.api.SessionTest#testMoveConstraintViolationExceptionDest<!--OAK-132-->

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.java?rev=1463584&r1=1463583&r2=1463584&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionNamespaces.java
Tue Apr  2 15:06:47 2013
@@ -106,6 +106,12 @@ class SessionNamespaces {
             // Add the new mapping
             namespaces.put(prefix, uri);
         }
+
+        if (snapshot.containsKey(prefix)) {
+            // make sure we have a prefix in case an existing
+            // namespace uri is re-mapped
+            getNamespacePrefix(snapshot.get(prefix));
+        }
     }
 
     /**
@@ -172,7 +178,8 @@ class SessionNamespaces {
 
             // try snapshot
             for (Map.Entry<String, String> entry : snapshot.entrySet()) {
-                if (entry.getValue().equals(uri)) {
+                if (entry.getValue().equals(uri)
+                        && !namespaces.containsKey(entry.getKey())) {
                     return entry.getKey();
                 }
             }



Mime
View raw message