Mercurial > jhg
diff src/com/tmate/hgkit/ll/Nodeid.java @ 41:858d1b2458cb
Check integrity for bundle changelog. Sort nodeids when calculating hash
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 14 Jan 2011 04:14:08 +0100 |
parents | 51bc56c0addd |
children | 4022c34a4804 |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/Nodeid.java Fri Jan 14 03:37:06 2011 +0100 +++ b/src/com/tmate/hgkit/ll/Nodeid.java Fri Jan 14 04:14:08 2011 +0100 @@ -75,6 +75,12 @@ return true; } + // primary purpose is to give DigestHelper access to internal structure. Despite it's friends-only (package visibility), it's still makes sense to + // return a copy, to avoid any accidental modification (same reason field is not made visible, nor any callback, e.g. Output.write(byte[]) was introduced) + /*package-local*/byte[] cloneData() { + return binaryData.clone(); + } + // primary difference with cons is handling of NULL id (this method returns constant) // always makes a copy of an array passed public static Nodeid fromBinary(byte[] binaryRepresentation, int offset) {