You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Commented) (JIRA)" <ji...@apache.org> on 2011/12/13 02:53:30 UTC

[jira] [Commented] (LANG-780) add public org.apache.commons.lang.builder.HashCodeBuilder append(Enum value) to HashCodeBuilder

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

Sebb commented on LANG-780:
---------------------------

Are you sure that an Enum's hashCode can vary?

Or do you mean it can vary between different runtimes? 
                
> add  public org.apache.commons.lang.builder.HashCodeBuilder append(Enum value) to HashCodeBuilder 
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-780
>                 URL: https://issues.apache.org/jira/browse/LANG-780
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>    Affects Versions: 2.5
>            Reporter: Alex Pokotilo
>   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
> public org.apache.commons.lang.builder.HashCodeBuilder append(Enum value)
> {
>  append(value.name().hashCode());
>  return this;
> }

--
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