[ 
https://issues.apache.org/jira/browse/CURATOR-608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Ruel updated CURATOR-608:
------------------------------
    Description: 
ZPaths support parameters, which are special path elements in parenthesis 
(i.e., \{one}) that may be substituted with values at runtime.

ZPaths also have a resolved state, which checks if a ZPath parsed with 
`parseWithIds()` still contains any parameters left to be substituted.

Additionally, ZPaths may be created with `parse()` which contain string 
elements which appear to be parameters (elements in parenthesis) but are not 
treated as such, always resulting in a path which is considered fully-resolved.

The documentation for these methods should be updated to better indicate this 
behavior difference, clearly stating what "resolved" state indicates based on 
the method that generated the ZPath.

 

 

  was:
ZPath's "isParameter()" method checks to see if an element of the path is a 
parameter which make be substituted (i.e, "\{param}"). 

Today, the check merely looks to see if the string contains "/" and then some 
characters.

Instead, it should check for the full parameter pattern.

The check that is in place now can lead to ZPath's which appear fully resolved, 
but when isResolved() is called on the path are indicated as NOT resolved.  
This causes failures with certain ModeledFramework operations.

For example:

ZPath rootPath = ZPath.from("/root");

ZPath path = 
ZPath.parseWithIds("\{root}/\{one}/two/\{three}").resolved(rootPath, "one", 
"three");

This produces a fully resolved path: /root/one/two/three

But calling "isResolved()" on the created path returns false.


> ZPath resolved state documentation improvements
> -----------------------------------------------
>
>                 Key: CURATOR-608
>                 URL: https://issues.apache.org/jira/browse/CURATOR-608
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 5.1.0
>            Reporter: Ryan Ruel
>            Priority: Major
>             Fix For: 5.2.1
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> ZPaths support parameters, which are special path elements in parenthesis 
> (i.e., \{one}) that may be substituted with values at runtime.
> ZPaths also have a resolved state, which checks if a ZPath parsed with 
> `parseWithIds()` still contains any parameters left to be substituted.
> Additionally, ZPaths may be created with `parse()` which contain string 
> elements which appear to be parameters (elements in parenthesis) but are not 
> treated as such, always resulting in a path which is considered 
> fully-resolved.
> The documentation for these methods should be updated to better indicate this 
> behavior difference, clearly stating what "resolved" state indicates based on 
> the method that generated the ZPath.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to