The PMD inspector says the following if statement contains "Useless
parentheses."
if ((isEventTimestamp && isLiteralValue) || (isEventTimestamp &&
isPattern) || (isLiteralValue && isPattern)) {
LOGGER.error("The pattern, literal, and isEventTimestamp attributes
are mutually exclusive.");
return null;
}
I'm all for removing useless parentheses; unfortunately, I don't see how these
are useless. The way I see it, if isLiteralValue is false, with parentheses it
will (correctly) continue to evaluate after the first grouped condition but
without parentheses it would (incorrectly) short circuit after the first use of
isLiteralValue.
Am I missing something here? Or is this a PMD bug?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]