cammckenzie commented on a change in pull request #380:
URL: https://github.com/apache/curator/pull/380#discussion_r589749063
##########
File path:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
##########
@@ -462,7 +484,12 @@ else if ( existingPath != null && mode.isSequential() )
if ( localCreateMethod == null )
{
CreateBuilderMain createBuilder = mode.isTTL() ?
client.create().withTtl(ttl) : client.create();
- CreateModable<ACLBackgroundPathAndBytesable<String>>
tempCreateMethod = useProtection ?
createBuilder.creatingParentContainersIfNeeded().withProtection() :
createBuilder.creatingParentContainersIfNeeded();
+ CreateModable<ACLBackgroundPathAndBytesable<String>>
tempCreateMethod;
+ if (useParentCreation) {
+ tempCreateMethod = useProtection ?
createBuilder.creatingParentContainersIfNeeded().withProtection() :
createBuilder.creatingParentContainersIfNeeded();
+ } else {
+ tempCreateMethod = useProtection ?
createBuilder.withProtection() : createBuilder;
+ }
createMethod.compareAndSet(null, tempCreateMethod);
Review comment:
@TisonKun, you're suggesting just moving the createMethod to be a member
variable that is initialised in the constructor? I can't see why it's lazily
instantiated currently, possibly for historical reasons.
It can probably be addressed as a different PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]