sabi0 commented on code in PR #13068:
URL: https://github.com/apache/lucene/pull/13068#discussion_r1483496509


##########
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:
   I thought of that too. But reckoned that could be too much of a change if 
all BytesRef's start spitting out text.
   
   I guess the format will have to be changed somewhat to avoid the BytesRef's 
text "blending in" with the preceding text:
   ```
   ... previous " + bytesRef;  // ... previous term [ww xx yy zz]
   ```
   
   Also there is an unfortunate side-effect of an exception being thrown for 
"binary" data.



-- 
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

Reply via email to