Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A reviewer could now recognize that the operation should also be checked for overflow. This might not have been apparent in the original, noncompliant code example. For more information, see guideline rule "INT00-J. Ensure that integer operations do not result in overflow."

...

This noncompliant code example masks off the upper 24 bits of the promoted byte array element before performing the addition. The number of bits required to mask the sizes of byte and int are specified by the JLS. Although this code calculates the correct result, it violates this guideline rule by combining bitwise and arithmetic operations on the same data.

...