[
https://issues.apache.org/jira/browse/NIFI-15678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077840#comment-18077840
]
David Handermann commented on NIFI-15678:
-----------------------------------------
Thanks for asking [~dstiegli1]. As mentioned in the issue description, the
exhaustive switch is problematic when attempting to introduce new enumerated
values from the NiFi API. Although the suppression approaches could work, it
would require covering all possible references, which becomes challenging to
manage across the repository. Given the relative value and available options,
removing the rule provides the more maintainable approach.
> Remove PMD rules related to switch statements
> ---------------------------------------------
>
> Key: NIFI-15678
> URL: https://issues.apache.org/jira/browse/NIFI-15678
> Project: Apache NiFi
> Issue Type: Task
> Reporter: Kevin Doran
> Assignee: Kevin Doran
> Priority: Minor
> Fix For: 2.9.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> We have some rules that are tricky to adhere to such as
> ExhaustiveSwitchHasDefault because the enums they operate on come from
> upstream nifi-api repository, which should be decoupled from nifi. If a
> developer wants to add a default to an exhaustive switch, it is good
> defensive programming because a bump in dependency for nifi-api could result
> in a switch statement that was previously exhaustive no longer being
> exhaustive, and if there is a reasonable default, that is preferable to
> having to make code changes in nifi in order to build nifi-api RCs.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)