You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by leventov <gi...@git.apache.org> on 2018/11/30 12:46:35 UTC

[GitHub] curator pull request #257: CURATOR-458: Fix a bug spotted by error-prone com...

Github user leventov commented on a diff in the pull request:

    https://github.com/apache/curator/pull/257#discussion_r237848592
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/schema/Schema.java ---
    @@ -105,7 +105,8 @@ public static SchemaBuilder builderForRecipe(String parentPath)
     
         Schema(String name, Pattern pathRegex, String path, String documentation, SchemaValidator schemaValidator, Allowance ephemeral, Allowance sequential, Allowance watched, boolean canBeDeleted, Map<String, String> metadata)
         {
    -        Preconditions.checkNotNull((pathRegex != null) || (path != null), "pathRegex and path cannot both be null");
    +        Preconditions.checkNotNull(pathRegex, "pathRegex cannot both be null");
    +        Preconditions.checkNotNull(path, "path cannot both be null");
             this.pathRegex = pathRegex;
    --- End diff --
    
    Actually my original fix was wrong logically. What should have been done is just changing `Preconditions.checkNotNull()` call with `Preconditions.checkArgument()`. Fixed now.


---