jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1181712 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Date Tue, 11 Oct 2011 11:11:05 GMT
Author: reschke
Date: Tue Oct 11 11:11:04 2011
New Revision: 1181712

URL: http://svn.apache.org/viewvc?rev=1181712&view=rev
Log:
JCR-3105 - fix potential NPE on concurrent versioning operations

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1181712&r1=1181711&r2=1181712&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Tue Oct 11 11:11:04 2011
@@ -546,12 +546,13 @@ abstract class InternalVersionManagerBas
         NodeStateEx n = parent;
         for (int i = 0; i < 3; i++) {
             Name name = getName(uuid.substring(i * 2, i * 2 + 2));
-            if (n.hasNode(name)) {
-                n = n.getNode(name, 1);
+            NodeStateEx childn = n.getNode(name, 1);
+            if (childn != null) {
+                n = childn;
             } else if (interNT != null) {
-                n.addNode(name, interNT, null, false);
+                childn = n.addNode(name, interNT, null, false);
                 n.store();
-                n = n.getNode(name, 1);
+                n = childn;
             } else {
                 return null;
             }



Mime
View raw message