sijie commented on a change in pull request #3193: [Pulsar-Client] Extends 
ProducerBuilder Validations
URL: https://github.com/apache/pulsar/pull/3193#discussion_r241932672
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##########
 @@ -228,13 +230,16 @@ private ProducerBuilderImpl(PulsarClientImpl client, 
ProducerConfigurationData c
     }
 
     @Override
-    public ProducerBuilder<T> property(@NonNull String key, @NonNull String 
value) {
+    public ProducerBuilder<T> property(String key, String value) {
+        checkArgument(StringUtils.isNotBlank(key), "property key cannot be 
blank");
         conf.getProperties().put(key, value);
         return this;
     }
 
     @Override
     public ProducerBuilder<T> properties(@NonNull Map<String, String> 
properties) {
+        properties.keySet().forEach(key ->
 
 Review comment:
   check `properties` is not null before checking keys?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to