]> git.basschouten.com Git - openhab-addons.git/commitdiff
[Bluetooth] re-fix ArrayStoreException (#15891)
authorlsiepel <leosiepel@gmail.com>
Mon, 13 Nov 2023 18:39:39 +0000 (19:39 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Nov 2023 18:39:39 +0000 (19:39 +0100)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothUtils.java

index 33c9e8b32783e376ca3d8ad0ab3fc7c7a1b05c7e..456c35e7369b1147fd4c49da5e9aa5a3340b66c3 100644 (file)
@@ -47,7 +47,10 @@ public class BluetoothUtils {
      */
     public static int[] toIntArray(byte[] value) {
         int[] ret = new int[value.length];
-        System.arraycopy(value, 0, ret, 0, value.length);
+        // System.arraycopy cannot be used as it throws ArrayStoreException
+        for (int i = 0; i < value.length; i++) {
+            ret[i] = value[i];
+        }
         return ret;
     }