mikemccand commented on code in PR #13068: URL: https://github.com/apache/lucene/pull/13068#discussion_r1483269901
########## lucene/core/src/java/org/apache/lucene/util/ToStringUtils.java: ########## @@ -32,11 +32,37 @@ public static void byteArray(StringBuilder buffer, byte[] bytes) { private static final char[] HEX = "0123456789abcdef".toCharArray(); + /** + * Unlike {@link Long#toHexString(long)} returns a String with a "0x" prefix and all the leading + * zeros. + */ public static String longHex(long x) { char[] asHex = new char[16]; for (int i = 16; --i >= 0; x >>>= 4) { asHex[i] = HEX[(int) x & 0x0F]; } return "0x" + new String(asHex); } + + @SuppressWarnings("unused") + public static String brToString(BytesRef b) { Review Comment: Maybe also add a javadoc explaining how this differs from `BytesRef.toString`? E.g. this one does not assume valid UTF-8 but the other one days (I think)? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org