From 626fbc60dd546166f953d83f6ab1c29de31f764b Mon Sep 17 00:00:00 2001 From: Chase Walden Date: Mon, 29 Apr 2019 13:55:29 -0600 Subject: [PATCH] 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 --- .../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 9f28b56e8fd..bccc6f120e7 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(); + } + }; } /**