Github user cammckenzie commented on a diff in the pull request: https://github.com/apache/curator/pull/257#discussion_r183254951 --- 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 -- The existing check here seems like it was incorrect, as it would have returned a boolean which would never be null. This change will fix it, but there error messages are now incorrect. They should just be "pathRegex cannot be null" and "path cannot be null" respectively.
---