You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT in DataConverter
Fixed SpotBugs issue where unsigned right shift operations were being cast
directly to byte without proper masking. Added 0xFF mask to ensure only
the lower 8 bits are preserved when casting from int/long to byte.
- Modified intToBytes() to mask with 0xFF after right shift
- Modified longToBytes() to mask with 0xFF after right shift
- Added comprehensive tests for negative values to verify fix
This resolves potential issues with sign extension when casting the result
of unsigned right shift operations to smaller types.
0 commit comments