Arnaud Cogoluègnes created PROTON-2869:
------------------------------------------

             Summary: Decoding of smalllong is broker for negative values
                 Key: PROTON-2869
                 URL: https://issues.apache.org/jira/browse/PROTON-2869
             Project: Qpid Proton
          Issue Type: Bug
          Components: protonj2
    Affects Versions: protonj2-1.0.0-M22
            Reporter: Arnaud Cogoluègnes
            Assignee: Timothy A. Bish


The current code {{ANDs}} the byte value of the {{smalllong}} with {{0xFF}}. 
This is not necessary for a byte. Moreover {{0xFF}} is an {{int}} in Java, so 
the {{smalllong}} value is first converted to an {{int}} as well, making it 
positive (e.g. {{(byte) -1 & 0xFF = 255}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to