Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2763

Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 3.5.2
    • None
    • jute
    • Patch

    Description

      org.apache.jute.Utils.toCsvBuffer(), which converts a byte array to a string containing the hex representation of that byte array, omits the leading zero for any byte less than 0x10, due to its use of Integer.toHexString, which has the same behavior.

      https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/jute/Utils.java#L234

      One consequence of this is that the hex strings printed by ClientCnxn.Packet.toString(), used in the debug logging for ClientCnxn.readResponse(), cannot be parsed to determine the result of a Zookeeper request from client debug logs.

      Utils.toXmlBuffer() appears to have the same issue.

      
      

      Attachments

        Activity

          People

            weitang Alburt Hoffman
            bberg Brandon Berg
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h