You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Kowshik Prakasam (Jira)" <ji...@apache.org> on 2020/10/21 18:47:00 UTC

[jira] [Updated] (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 ]

Kowshik Prakasam updated KAFKA-10624:
-------------------------------------
    Summary: [Easy] FeatureZNodeStatus should use sealed trait instead of Enumeration  (was: FeatureZNodeStatus should use sealed trait instead of Enumeration)

> [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
>            Priority: Minor
>
> 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)