google / google/error-prone

Unwanted execution of ImmutableEnumChecker by enabling Immutable check

Open
#4,718 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

Hi,

there is most likely some mistake in how these two checks are configured leading to false activation of unintended checks:

**Immutable**

* Type declaration annotated with `@Immutable` is not immutable
* https://errorprone.info/bugpattern/Immutable
* Severity: ERROR by default

**ImmutableEnumChecker**

* Enums should always be immutable
* https://errorprone.info/bugpattern/ImmutableEnumChecker
* Severity: WARNING by default
* ⚠ Alternate names: **Immutable**

The `ImmutableEnumChecker` warning declares the same name as the `Immutable` error.

Given a code that has `-XepDisableAllChecks -XepDisableAllWarnings -Xep:Immutable:ERROR`, trying to enable the former `Immutable` error for checking the `@Immutable` annotated types, it mistakenly activates the `ImmutableEnumChecker` at an ERROR level leading to unwanted failures.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.