[
https://issues.apache.org/jira/browse/LANG-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286149#comment-13286149
]
Sebb commented on LANG-804:
---------------------------
Huh? 0 % 2 does not result in / 0 error in the Java compilers I have
encountered.
The == 0 checks are redundant, and can just be removed. No other change is
needed.
The only reason for keeping them would be to distinguish 0 as a different kind
of non-odd number, which seems unnecessary. Otherwise we are saying something
like:
"You must use an odd number, and by the way zero is invalid".
> Redundant check for zero in HashCodeBuilder ctor
> ------------------------------------------------
>
> Key: LANG-804
> URL: https://issues.apache.org/jira/browse/LANG-804
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Sebb
> Priority: Minor
>
> The HashCodeBuilder(int, int) ctor checks both parameters for zero, as well
> as checking for an odd number.
> Zero is never odd, so the zero check could be eliminated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira