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

David Jacot resolved KAFKA-13752.
---------------------------------
    Fix Version/s: 3.2.0
                   3.1.1
                   3.3.0
       Resolution: Fixed

> Using `equals` instead of `==` when Uuid compare in Java
> --------------------------------------------------------
>
>                 Key: KAFKA-13752
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13752
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: Xiaobing Fang
>            Priority: Minor
>             Fix For: 3.2.0, 3.1.1, 3.3.0
>
>
> {code:java}
> Uuid.ZERO_UUID == new Uuid(0L, 0L){code}
> is true in scala, but in java is false.
>  
> So this test run sccessfully. Is this the expected situation??
> {code:java}
> @Test
> public void testTopicIdAndNullTopicNameRequests() {
>     // Construct invalid MetadataRequestTopics. We will build each one 
> separately and ensure the error is thrown.
>     List<MetadataRequestData.MetadataRequestTopic> topics = Arrays.asList(
>             new 
> MetadataRequestData.MetadataRequestTopic().setName("topic").setTopicId(new 
> Uuid(0L, 0L)));
>     // if version is 10 or 11, the invalid topic metadata should return an 
> error
>     List<Short> invalidVersions = Arrays.asList((short) 10, (short) 11);
>     invalidVersions.forEach(version ->
>         topics.forEach(topic -> {
>             MetadataRequestData metadataRequestData = new 
> MetadataRequestData().setTopics(Collections.singletonList(topic));
>             MetadataRequest.Builder builder = new 
> MetadataRequest.Builder(metadataRequestData);
>             assertThrows(UnsupportedVersionException.class, () -> 
> builder.build(version));
>         })
>     );
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to