# HG changeset patch # User Artem Tikhomirov # Date 1296788727 -3600 # Node ID e93101b97e4ab0a3f3402ec0e80b6e559237c7c8 # Parent b1d6208fb5178552727a86f550fd1ab340eddefa Subtle defect: long & int constant gives wrong results for i2 > 32000+ diff -r b1d6208fb517 -r e93101b97e4a src/org/tmatesoft/hg/internal/DataAccess.java --- 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();