[
https://issues.apache.org/jira/browse/ZOOKEEPER-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980749#comment-15980749
]
ASF GitHub Bot commented on ZOOKEEPER-2763:
-------------------------------------------
GitHub user alburthoffman opened a pull request:
https://github.com/apache/zookeeper/pull/238
ZOOKEEPER-2763: Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
1. fix toCsvBuffer() and toXMLBuffer()
2. reduce duplicate code
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/alburthoffman/zookeeper ZOOKEEPER_2763
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/238.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #238
----
commit a1461e47e89878f8772b2136f1f2ff978b1f6f4b
Author: wtang3 <[email protected]>
Date: 2017-04-24T05:46:57Z
fix https://issues.apache.org/jira/browse/ZOOKEEPER-2763
----
> Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
> ----------------------------------------------------
>
> Key: ZOOKEEPER-2763
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2763
> Project: ZooKeeper
> Issue Type: Bug
> Components: jute
> Affects Versions: 3.5.2
> Reporter: Brandon Berg
> Assignee: Alburt Hoffman
> Priority: Minor
>
> 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.
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)