[Fix] Fixed implicit cast to long in ByteHelper

This commit is contained in:
Robert von Burg 2023-04-06 14:29:54 +02:00
parent 19c7fe1088
commit 78ac6e524c
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ public class ByteHelper {
public static long setBit(long data, int position) {
if (position > 63)
throw new IllegalStateException("Position " + position + " is not available in a long!");
return (data | (1 << position));
return (data | (1L << position));
}
public static byte clearBit(byte data, int position) {
@ -113,7 +113,7 @@ public class ByteHelper {
public static long clearBit(long data, int position) {
if (position > 63)
throw new IllegalStateException("Position " + position + " is not available in a long!");
return (data & ~(1 << position));
return (data & ~(1L << position));
}
public static int countSetBits(byte data) {