Fix bug in getCounterValue() to extraction byte correctly
This commit addresses a bug in the ApfCounterTracker.getCounterValue()
function where counter bytes were not being properly extracted prior to
a bitwise OR (|) operation. The fix reintroduces the &ff mask to ensure
proper byte extraction.
Example program that cause the issue:
byte b = -1;
long x = 0;
System.out.println("With 0xff: " + (x << 8 | b & 0xff));
System.out.println("Without &0xff: " + (x << 8 | b ));
Output:
With 0xff: 255
Without &0xff: -1
Test: TH
Change-Id: I997cdcf27e56d10d0d971e275d0561f0aef869a7
2 files changed