Use careful byte-masking/shifting in Mg Input 99/85099/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Oct 2019 08:16:02 +0000 (10:16 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 14 Oct 2019 12:20:26 +0000 (12:20 +0000)
commit683170bee30d6938fbaac9ad422d664259fc1bba
treeb93337b732046c17c0d1909b405ce44f2766db09
parent2a6aa1775604906755883f810ee9ea6d5f286135
Use careful byte-masking/shifting in Mg Input

We really want to operate on byte and not int, the bytes are to
be treated as unsigned, which gets wrecked by sign extension.

Introduce an explicit mask(byte, byte) method and use it where
we are potentially sign-extending.

JIRA: CONTROLLER-1919
Change-Id: I0484f440c1589859fb268947f5a80a2b4969451e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java