commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-780) Add HashCodeBuilder.append(Enum value)
Date Sun, 22 Mar 2015 09:33:10 GMT

    [ https://issues.apache.org/jira/browse/LANG-780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14374851#comment-14374851
] 

Benedikt Ritter commented on LANG-780:
--------------------------------------

I don't understand this. Are we trying to be smarter then the hash code implementation of
enums?

> Add HashCodeBuilder.append(Enum value)
> --------------------------------------
>
>                 Key: LANG-780
>                 URL: https://issues.apache.org/jira/browse/LANG-780
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.builder.*
>    Affects Versions: 2.5
>            Reporter: Alex Pokotilo
>             Fix For: Review Patch
>
>         Attachments: LANG-780.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Since Enum's hashCode return different values between calls this can cause different
values if enum appended to HashCodeBuilder 
> IMHO adding append for enum would be enough to solve this entirely
> {code:java}
> public org.apache.commons.lang.builder.HashCodeBuilder append(Enum value)
> {
>  append(value.name().hashCode());
>  return this;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message