You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (JIRA)" <ji...@codehaus.org> on 2014/08/18 17:13:10 UTC
[jira] (MCHECKSTYLE-240) add 17, 31 and 37 to ignored MagicNumber
[ https://jira.codehaus.org/browse/MCHECKSTYLE-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Herve Boutemy updated MCHECKSTYLE-240:
--------------------------------------
Description:
these are classical in hash calculations
{code:java} public int hashCode()
{
int hash = 17;
hash = hash * 31 + field1.hashCode();
hash = hash * 31 + field2.hashCode();
return hash;
}{code}
or
{code:java} public int hashCode()
{
int hash = 17;
hash = hash * 37 + field1.hashCode();
hash = hash * 37 + field2.hashCode();
return hash;
}{code}
was:
these are classical in hash calculations
{code:java} public int hashCode()
{
int hash = 17;
hash = hash * 31 + field1.hashCode();
hash = hash * 31 + field2.hashCode();
return hash;
}{code}
> add 17, 31 and 37 to ignored MagicNumber
> ----------------------------------------
>
> Key: MCHECKSTYLE-240
> URL: https://jira.codehaus.org/browse/MCHECKSTYLE-240
> Project: Maven Checkstyle Plugin
> Issue Type: Wish
> Affects Versions: 2.12.1
> Reporter: Herve Boutemy
> Assignee: Herve Boutemy
> Fix For: 2.13
>
>
> these are classical in hash calculations
> {code:java} public int hashCode()
> {
> int hash = 17;
> hash = hash * 31 + field1.hashCode();
> hash = hash * 31 + field2.hashCode();
> return hash;
> }{code}
> or
> {code:java} public int hashCode()
> {
> int hash = 17;
> hash = hash * 37 + field1.hashCode();
> hash = hash * 37 + field2.hashCode();
> return hash;
> }{code}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)