Incorrect IdentityBinaryExpression message?
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
errorprone version 2.15.0
For binary logical operations with multiple decrements on an array index like this
```java
if (((sieveArray[x--] | sieveArray[x--] | sieveArray[x--] | sieveArray[x--]) & 0x80) != 0) {
...
...
}
```
errorprone prints a `IdentityBinaryExpression` message:
```
[IdentityBinaryExpression] A binary expression where both operands are the same is usually incorrect; the value of this expression is equivalent to `sieveBlock[x--]`.
```
https://errorprone.info/bugpattern/IdentityBinaryExpression
The message is propably wrong?
Contributor guide
Assessment
This issue has not been assessed yet.