You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/06/06 03:25:18 UTC

[jira] [Commented] (ZOOKEEPER-2763) Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16038046#comment-16038046 ] 

ASF GitHub Bot commented on ZOOKEEPER-2763:
-------------------------------------------

Github user alburthoffman commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/238#discussion_r120258026
  
    --- Diff: src/java/main/org/apache/jute/Utils.java ---
    @@ -190,19 +190,32 @@ static String fromCSVString(String s) throws IOException {
         }
         
         /**
    +     * convert byte array to a string in hex format
          * 
    -     * @param s 
    -     * @return 
    +     * @param barr
    +     * @return
          */
    -    static String toXMLBuffer(byte barr[]) {
    --- End diff --
    
    @afine I belive it's the testing environment, because the tests for datatypeconverter will fail. here is what I found from their jenkins job console:
    java version "1.7.0_80"
    Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
    Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) 


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