Skip to content

UnusedException: consistent with UnnamedVariable#5459

Closed
commonquail wants to merge 1 commit intogoogle:masterfrom
commonquail:unusedex-unnamed
Closed

UnusedException: consistent with UnnamedVariable#5459
commonquail wants to merge 1 commit intogoogle:masterfrom
commonquail:unusedex-unnamed

Conversation

@commonquail
Copy link
Contributor

A false positive UnusedException can be suppressed by naming the caught exception /unused.*/. The recently added UnnamedVariable, in the meantime, wants deliberately unused variables to be unnamed with the Java 22 _ character, putting the two checks at odds. Teach UnusedException to also accept _ as a suppression mechanism.

A false positive `UnusedException` can be suppressed by naming the
caught exception `/unused.*/`. `UnnamedVariable`, in the meantime, wants
deliberately unused variables to be unnamed with the Java 22 `_`
character, putting the two checks at odds. Teach `UnusedException` to
also accept `_` as a suppression mechanism.
copybara-service bot pushed a commit that referenced this pull request Jan 28, 2026
A false positive [`UnusedException`](https://errorprone.info/bugpattern/UnusedException) can be suppressed by naming the caught exception `/unused.*/`. The recently added [`UnnamedVariable`](https://errorprone.info/bugpattern/UnnamedVariable), in the meantime, wants deliberately unused variables to be unnamed with the Java 22 `_` character, putting the two checks at odds. Teach `UnusedException` to also accept `_` as a suppression mechanism.

Fixes #5459

FUTURE_COPYBARA_INTEGRATE_REVIEW=#5459 from commonquail:unusedex-unnamed ac5edf7
PiperOrigin-RevId: 862220456
@commonquail commonquail deleted the unusedex-unnamed branch January 31, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants