C0urante commented on code in PR #12010: URL: https://github.com/apache/kafka/pull/12010#discussion_r855702727
########## clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java: ########## @@ -604,8 +609,16 @@ protected static Map<String, Object> appendDeserializerToConfig(Map<String, Obje Map<String, Object> newConfigs = new HashMap<>(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); + else { + if (newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG) == null) + throw new ConfigException(KEY_DESERIALIZER_CLASS_CONFIG + " configuration for KafkaConsumer must be non-null."); + } if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); + else { + if (newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG) == null) + throw new ConfigException(VALUE_DESERIALIZER_CLASS_CONFIG + " configuration for KafkaConsumer must be non-null."); + } Review Comment: ```suggestion else if (newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG) == null) throw new ConfigException(VALUE_DESERIALIZER_CLASS_CONFIG, null, "must be non-null."); ``` ########## clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java: ########## @@ -604,8 +609,16 @@ protected static Map<String, Object> appendDeserializerToConfig(Map<String, Obje Map<String, Object> newConfigs = new HashMap<>(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); + else { + if (newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG) == null) + throw new ConfigException(KEY_DESERIALIZER_CLASS_CONFIG + " configuration for KafkaConsumer must be non-null."); + } Review Comment: ```suggestion else if (newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG) == null) throw new ConfigException(KEY_DESERIALIZER_CLASS_CONFIG, null, "must be non-null."); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org