Mercurial > jhg
diff src/org/tmatesoft/hg/internal/DataAccess.java @ 122:e93101b97e4a
Subtle defect: long & int constant gives wrong results for i2 > 32000+
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 04 Feb 2011 04:05:27 +0100 |
parents | a3a2e5deb320 |
children | d5268ca7715b |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DataAccess.java Fri Feb 04 03:37:09 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/DataAccess.java Fri Feb 04 04:05:27 2011 +0100 @@ -53,7 +53,7 @@ readBytes(b, 0, 8); int i1 = b[0] << 24 | (b[1] & 0xFF) << 16 | (b[2] & 0xFF) << 8 | (b[3] & 0xFF); int i2 = b[4] << 24 | (b[5] & 0xFF) << 16 | (b[6] & 0xFF) << 8 | (b[7] & 0xFF); - return ((long) i1) << 32 | ((long) i2 & 0xFFFFFFFF); + return ((long) i1) << 32 | ((long) i2 & 0xFFFFFFFFl); } public void readBytes(byte[] buf, int offset, int length) throws IOException { throw new UnsupportedOperationException();