From e54243278ff810ef95e26b8a15bf3aa8505a2161 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 25 Feb 2019 08:50:03 +0900 Subject: [PATCH] SHA1: Use externalized message in log The non-externalized warning message says there is a "possible SHA-1 collision" but then the Sha1CollisionException is always thrown. Replace the message with the existing externalised string that does not say "possible". Change-Id: I9773ec76b416c356e234a658fb119f98d33eac83 Signed-off-by: David Pursehouse --- org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java index 9fe01f1d8..1ad6602fc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java @@ -48,8 +48,10 @@ import static java.lang.Integer.numberOfTrailingZeros; import static java.lang.Integer.rotateLeft; import static java.lang.Integer.rotateRight; +import java.text.MessageFormat; import java.util.Arrays; +import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.MutableObjectId; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.util.NB; @@ -497,7 +499,8 @@ public class SHA1 { if (foundCollision) { ObjectId id = h.toObjectId(); - LOG.warn("possible SHA-1 collision " + id.name()); //$NON-NLS-1$ + LOG.warn(MessageFormat.format(JGitText.get().sha1CollisionDetected, + id.name())); throw new Sha1CollisionException(id); } }