OSDN Git Service

Fixed a bug int the new version of Long.reverse introduce in change Id6bd7c81.
authorJoshua Bloch <jjb@google.com>
Thu, 17 Dec 2009 02:01:32 +0000 (18:01 -0800)
committerJoshua Bloch <jjb@google.com>
Thu, 17 Dec 2009 02:01:32 +0000 (18:01 -0800)
commit1efdf68089db048859f659ebf5656da8fad592d9
treeb8936693952aa85b1bc04bea0194dc03f433f002
parentdbd28bbd00d20f3601aeb7aedb49f2cdda17acef
Fixed a bug int the new version of Long.reverse introduce in change Id6bd7c81.
The corresponding code in Hacker's Delight is written in C, which supports
unsigned numbers. In Java, it's essential to use explicit unsigned shifts,
but I neglected to do so.  This bug was caught by jtreg test
java.lang.Long.BitTwiddle (which I wrote in 2003).  This preexisting
test serves as the regression test for this change.
libcore/luni/src/main/java/java/lang/Long.java