JDK 9 RFR of JDK-8078136: Incorrect figure number in reference to Hacker's Delight book in Long.bitCount() method (original) (raw)

Lance @ Oracle lance.andersen at oracle.com
Sun May 17 17:42:38 UTC 2015


Go for it joe��

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPad

On May 17, 2015, at 12:53 PM, joe darcy <joe.darcy at oracle.com> wrote:

Hello, Please review this typo fix for JDK-8078136: Incorrect figure number in reference to Hacker's Delight book in Long.bitCount() method diff -r d40f1245a1f1 src/java.base/share/classes/java/lang/Long.java --- a/src/java.base/share/classes/java/lang/Long.java Wed May 13 14:16:46 2015 -0700 +++ b/src/java.base/share/classes/java/lang/Long.java Sun May 17 09:51:48 2015 -0700 @@ -1708,7 +1708,7 @@ * @since 1.5 */ public static int bitCount(long i) { - // HD, Figure 5-14 + // HD, Figure 5-2 i = i - ((i >>> 1) & 0x5555555555555555L); i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L); i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL; I verified all the other figure references between java.lang.Integer and java.lang.Long were consistent. Thanks, -Joe



More information about the core-libs-dev mailing list