[ 
https://issues.apache.org/jira/browse/KAFKA-21669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai updated KAFKA-21669:
-----------------------------------
    Description: 
The lowest version is v2, so the version == 0 and version() >= 2 checks are 
redundant.

 
{code:java}
            if (data.validateOnly() && version == 0)
                throw new UnsupportedProtocolFieldException("validateOnly", 
apiKey().name(), version, 1);


        if (version() >= 2) {
            response.setThrottleTimeMs(throttleTimeMs);
        }
{code}
 

  was:
The lowest version is v2, so the {{version <= 0}} check is redundant.

 
{code:java}
            if (data.validateOnly() && version == 0)
                throw new UnsupportedProtocolFieldException("validateOnly", 
apiKey().name(), version, 1);


        if (version() >= 2) {
            response.setThrottleTimeMs(throttleTimeMs);
        }
{code}
 


> Drop CreateTopicsRequest.Builder#build version check
> ----------------------------------------------------
>
>                 Key: KAFKA-21669
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21669
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Chia-Ping Tsai
>            Assignee: Chia-Ping Tsai
>            Priority: Minor
>
> The lowest version is v2, so the version == 0 and version() >= 2 checks are 
> redundant.
>  
> {code:java}
>             if (data.validateOnly() && version == 0)
>                 throw new UnsupportedProtocolFieldException("validateOnly", 
> apiKey().name(), version, 1);
>         if (version() >= 2) {
>             response.setThrottleTimeMs(throttleTimeMs);
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to