kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix Embedded ConfigDef Validator toString issue (#6339)
Date Mon, 29 Apr 2019 19:55:44 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 626fbc6  MINOR: Fix Embedded ConfigDef Validator toString issue (#6339)
626fbc6 is described below

commit 626fbc60dd546166f953d83f6ab1c29de31f764b
Author: Chase Walden <chase_walden@me.com>
AuthorDate: Mon Apr 29 13:55:29 2019 -0600

    MINOR: Fix Embedded ConfigDef Validator toString issue (#6339)
    
    `ConfigDef.embeddedValidator` should return an Anonymous Object instead of lambda so that
we can have a useful `toString()` for methods such as `toRst`.
    
    Reviewers: Jason Gustafson <jason@confluent.io>
---
 .../main/java/org/apache/kafka/common/config/ConfigDef.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
index 9f28b56..bccc6f1 100644
--- a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
@@ -1318,7 +1318,16 @@ public class ConfigDef {
      */
     private static Validator embeddedValidator(final String keyPrefix, final Validator base)
{
         if (base == null) return null;
-        return (name, value) -> base.ensureValid(name.substring(keyPrefix.length()), value);
+        return new Validator() {
+            public void ensureValid(String name, Object value) {
+                base.ensureValid(name.substring(keyPrefix.length()), value);
+            }
+
+            @Override
+            public String toString() {
+                return base.toString();
+            }
+        };
     }
 
     /**


Mime
View raw message