Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
update documentation for VariableDeclarationUsageDistance with allowedDistance = 0 #3665
Given this check is activated:
<module name="VariableDeclarationUsageDistance"> <property name="allowedDistance" value="0"/> </module>
it'll fail on this code:
long result = dateTime != null ? dateTime.hashCode() : 0L; result = 31L * result + (shift != null ? shift.hashCode() : 0L); return result;
with this error message:
Is this really wanted? I'd expect it not to fail since the next usage is really one line below it.
@vanniktech I believe 0 is an invalid value. It basically says all variables can only reference itself. See example below.
in scope of this bug, documentation need to be updated.