diff options
author | 2016-07-04 11:34:09 +0000 | |
---|---|---|
committer | 2016-07-04 14:02:31 +0000 | |
commit | a4d48540865c6886b52dd153673d854c94adb85e (patch) | |
tree | be9ef9afffbf85620250e141358ee34a47e34f22 /src/main/java/com/google/devtools/build/lib/util/Fingerprint.java | |
parent | 030e7b45c1a209dfa7162416ef3df3a208b16e20 (diff) |
Remove Fingerprint.toString() to avoid relying on MessageDigest.clone().
--
MOS_MIGRATED_REVID=126566280
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/util/Fingerprint.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/util/Fingerprint.java | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/util/Fingerprint.java b/src/main/java/com/google/devtools/build/lib/util/Fingerprint.java index eb053f9be6..a461041c3d 100644 --- a/src/main/java/com/google/devtools/build/lib/util/Fingerprint.java +++ b/src/main/java/com/google/devtools/build/lib/util/Fingerprint.java @@ -28,8 +28,7 @@ import java.util.UUID; import javax.annotation.Nullable; /** - * Simplified wrapper for MD5 message digests. See also - * com.google.math.crypto.MD5HMAC for a similar interface. + * Simplified wrapper for MD5 message digests. * * @see java.security.MessageDigest */ @@ -67,7 +66,6 @@ public final class Fingerprint { * <p>This method has the side-effect of resetting the underlying digest computer. * * @return the MD5 digest as a 32-character string of hexadecimal digits - * @see com.google.math.crypto.MD5HMAC#toString() */ public String hexDigestAndReset() { return hexDigest(digestAndReset()); @@ -90,25 +88,6 @@ public final class Fingerprint { } /** - * Override of Object.toString to return a string for the MD5 digest without - * finalizing the digest computation. Calling hexDigest() instead will - * finalize the digest computation. - * - * @return the string returned by hexDigest() - */ - @Override - public String toString() { - try { - // MD5 does support cloning, so this should not fail - return hexDigest(((MessageDigest) md.clone()).digest()); - } catch (CloneNotSupportedException e) { - // MessageDigest does not support cloning, - // so just return the toString() on the MessageDigest. - return md.toString(); - } - } - - /** * Updates the digest with 0 or more bytes. * * @param input the array of bytes with which to update the digest |