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.
---