Skip to content

[java] Remove special cases from rule EmptyCatchBlock #2893

@oowekyala

Description

@oowekyala

Is your feature request related to a problem? Please describe.

For some reason EmptyCatchBlock special-cases InterruptedException and CloneNotSupportedException. Catch blocks are already ignored if the exception is named ignored or expected, which is nice as it signals to the reader that the empty catch block was not a mistake. I think this holds even for those exception types, and code would be clearer if they were not special-cases. Besides, this particularity was not documented.

Describe the solution you'd like
Remove those special cases and make EmptyCatchBlock flag InterruptedException and CloneNotSupportedException just the same as other exception types

Describe alternatives you've considered
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions