Use careful byte-masking/shifting in Mg Input 98/85098/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Oct 2019 08:16:02 +0000 (10:16 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Oct 2019 08:26:45 +0000 (10:26 +0200)
commit51c8d31e676b50d26f9abb9b17b4f66d7b06178b
treec077c6e0e8bc72f9e132b259a9570d2dcd3ec362
parent1be865aa2ccc60a4d0c9a84dadb0237b0c6502f3
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