You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ti...@apache.org on 2022/07/14 03:01:10 UTC

[curator] branch master updated: CURATOR-458. Fix Schema constructor validation (#257)

This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git


The following commit(s) were added to refs/heads/master by this push:
     new c1b6d86a CURATOR-458. Fix Schema constructor validation (#257)
c1b6d86a is described below

commit c1b6d86a4a7503b2a6dbc825a951a6aabcbb71b1
Author: Roman Leventov <le...@gmail.com>
AuthorDate: Thu Jul 14 07:01:05 2022 +0400

    CURATOR-458. Fix Schema constructor validation (#257)
---
 .../src/main/java/org/apache/curator/framework/schema/Schema.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/curator-framework/src/main/java/org/apache/curator/framework/schema/Schema.java b/curator-framework/src/main/java/org/apache/curator/framework/schema/Schema.java
index bcb35d3d..d86fdb5a 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/schema/Schema.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/schema/Schema.java
@@ -105,7 +105,7 @@ public class Schema
 
     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.checkArgument((pathRegex != null) || (path != null), "pathRegex and path cannot both be null");
         this.pathRegex = pathRegex;
         this.fixedPath = fixPath(path);
         this.metadata = ImmutableMap.copyOf(Preconditions.checkNotNull(metadata, "metadata cannot be null"));