Merge branch 'CURATOR-3.0' into CURATOR-351

Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/da7f18c6
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/da7f18c6
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/da7f18c6

Branch: refs/heads/CURATOR-397
Commit: da7f18c618eb51e6aaaff7b10f79240cefaf0183
Parents: e3fec5b 00ffe77
Author: randgalt <[email protected]>
Authored: Mon Apr 17 19:08:15 2017 -0500
Committer: randgalt <[email protected]>
Committed: Mon Apr 17 19:08:15 2017 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/recipes/nodes/PersistentNode.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/da7f18c6/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------
diff --cc 
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
index a45d0a8,6c0c22c..0cda2a1
--- 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
+++ 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
@@@ -435,12 -419,9 +435,10 @@@ public class PersistentNode implements 
              CreateModable<ACLBackgroundPathAndBytesable<String>> 
localCreateMethod = createMethod.get();
              if ( localCreateMethod == null )
              {
 -                CreateModable<ACLBackgroundPathAndBytesable<String>> 
tempCreateMethod = useProtection ? 
client.create().creatingParentContainersIfNeeded().withProtection() : 
client.create().creatingParentContainersIfNeeded();
 +                CreateBuilderMain createBuilder = mode.isTTL() ? 
client.create().withTtl(ttl) : client.create();
 +                CreateModable<ACLBackgroundPathAndBytesable<String>> 
tempCreateMethod = useProtection ? 
createBuilder.creatingParentContainersIfNeeded().withProtection() : 
createBuilder.creatingParentContainersIfNeeded();
-                 if ( createMethod.compareAndSet(null, tempCreateMethod) )
-                 {
-                     localCreateMethod = tempCreateMethod;
-                 }
+                 createMethod.compareAndSet(null, tempCreateMethod);
+                 localCreateMethod = createMethod.get();
              }
              localCreateMethod.withMode(getCreateMode(existingPath != 
null)).inBackground(backgroundCallback).forPath(createPath, data.get());
          }

Reply via email to