Browse Source

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 <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
e54243278f
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java

5
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);
}
}

Loading…
Cancel
Save