JDK 9 RFR of JDK-8078136: Incorrect figure number in reference to Hacker's Delight book in Long.bitCount() method
joe darcy
joe.darcy at oracle.com
Sun May 17 16:53:17 UTC 2015
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