hangc0276 commented on a change in pull request #12310:
URL: https://github.com/apache/pulsar/pull/12310#discussion_r725493690



##########
File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
##########
@@ -573,8 +573,13 @@ void run() throws PulsarAdminException {
                             "Possible values: (partitioned, non-partitioned)");
                 }
 
-                if (TopicType.PARTITIONED.toString().equals(type) && 
!(defaultNumPartitions > 0)) {
-                    throw new ParameterException("Must specify num-partitions 
> 0 for partitioned topic type.");
+                if (TopicType.PARTITIONED.toString().equals(type)) {

Review comment:
       We'd better merge the two check, just like
   ```Java
   if (TopicType.PARTITIONED.toString().equals(type)
                       && (defaultNumPartitions == null || 
!(defaultNumPartitions > 0))) {
                       throw new ParameterException("Must specify 
num-partitions or num-partitions > 0 for partitioned topic type.");
                   }
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to