You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (Jira)" <ji...@apache.org> on 2020/11/05 23:56:03 UTC

[jira] [Resolved] (KAFKA-10624) [Easy] FeatureZNodeStatus should use sealed trait instead of Enumeration

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

Jun Rao resolved KAFKA-10624.
-----------------------------
    Fix Version/s: 2.8.0
       Resolution: Fixed

merged the PR to trunk.

> [Easy] FeatureZNodeStatus should use sealed trait instead of Enumeration
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-10624
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10624
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Kowshik Prakasam
>            Assignee: Kowshik Prakasam
>            Priority: Minor
>             Fix For: 2.8.0
>
>
> In Scala, we prefer sealed traits over Enumeration since the former gives you exhaustiveness checking. With Scala Enumeration, you don't get a warning if you add a new value that is not handled in a given pattern match.
> This Jira tracks refactoring enum [FeatureZNodeStatus|https://github.com/apache/kafka/blob/fb4f297207ef62f71e4a6d2d0dac75752933043d/core/src/main/scala/kafka/zk/ZkData.scala#L801] from an enum to a sealed trait. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)