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 <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2017-12-07 09:51:56 +09:00
parent 74bfdcd555
commit 53a11cb1d1
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ public void testDownloadInvalidId()
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());
}

View File

@ -80,7 +80,7 @@ public InvalidLongObjectIdException(String idString) {
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) {