commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Mickey (JIRA)" <>
Subject [jira] Commented: (LANG-628) Javadoc for HashCodeBuilder.append(boolean) does not match implementation.
Date Sun, 04 Jul 2010 00:49:50 GMT


Sean Mickey commented on LANG-628:

Here is a copy of the javadoc I included in the hashCode patch I created for LANG-411 to include
information about the java.lang.Boolean handling:

* This is in contrast to out-of-the-box <code>java.lang.Boolean.hashCode</code>
handling, which computes
* a <code>hashCode</code> value of <code>1231</code> for <code>java.lang.Boolean</code>
* that represent <code>true</code> or <code>1237</code> for <code>java.lang.Boolean</code>
* that represent <code>false</code>.
* </p>

It doesn't seem to warrant reopening the issue, however, if you agree that this added javadoc
is useful, I guess it would be a quick reopen and close to add this bit of content. I will
be happy to reopen the issue and create a patch with the additional javadoc if you like.

> Javadoc for HashCodeBuilder.append(boolean) does not match implementation.
> --------------------------------------------------------------------------
>                 Key: LANG-628
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>            Reporter: Sean Mickey
>            Priority: Minor
>             Fix For: 3.0
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> The Javadoc description for HashCodeBuilder.append(boolean) says that it "adds iConstant
* 1 to the hashCode," however, the code is actually:
> iTotal = iTotal * iConstant + (value ? 0 : 1). It is probably just a typo, but it easy
to correct.
> And the reference to hashCode handling in java.lang.Boolean:  "not a 1231 or 1237 as
done in java.lang.Boolean" could be clarified with more detail. Otherwise, it requires going
to the java.lang Javadoc and finding the java.lang.Boolean.hashCode Javadoc description.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message