error-prone
error-prone copied to clipboard
Incorrect IdentityBinaryExpression message?
errorprone version 2.15.0
For binary logical operations with multiple decrements on an array index like this
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?