False positive: UnusedVariable for methods that unconditionally throw
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
### Description of the problem / feature request:
*UnusedVariable* triggers for a method like this:
```java
private static boolean compare(int left, int right)
{
throw new AssertionError("this method should not be called");
}
```
We can rename the parameters to `unusedLeft` and `unusedRight`, which is often a good way to signal intent to readers of the code, but that is redundant in this case, since it's immediately obvious that this method will not use the parameters.
### What version of Error Prone are you using?
2.4.0
Contributor guide
Assessment
This issue has not been assessed yet.