From 53a11cb1d115eb58db1f1d22dc29a50368153205 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 7 Dec 2017 09:51:56 +0900 Subject: [PATCH] InvalidLongObjectIdException: Fix formatting of message The message is formatted as: Invalid id: : abcde... but should be: Invalid id: abcde... Change-Id: Ie15cacdcf2f168edaee262e6cf8061ebfe9d998d Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java | 2 +- .../eclipse/jgit/lfs/errors/InvalidLongObjectIdException.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java index 69d1a0480..64cecd8cb 100644 --- a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java +++ b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java @@ -97,7 +97,7 @@ public class DownloadTest extends LfsServerTest { getContent(id, f); fail("expected RuntimeException"); } catch (RuntimeException e) { - String error = String.format("Invalid id: : %s", id); + String error = String.format("Invalid id: %s", id); assertEquals(formatErrorMessage(SC_UNPROCESSABLE_ENTITY, error), e.getMessage()); } diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/InvalidLongObjectIdException.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/InvalidLongObjectIdException.java index 1f6e2d174..44ac317a1 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/InvalidLongObjectIdException.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/InvalidLongObjectIdException.java @@ -80,7 +80,7 @@ public class InvalidLongObjectIdException extends IllegalArgumentException { private static String asAscii(byte[] bytes, int offset, int length) { try { - return ": " + new String(bytes, offset, length, "US-ASCII"); //$NON-NLS-1$ //$NON-NLS-2$ + return new String(bytes, offset, length, "US-ASCII"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e2) { return ""; //$NON-NLS-1$ } catch (StringIndexOutOfBoundsException e2) {