From 2b393699bf65266c3066f2e983dc9a2d2f24e0a8 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Mon, 13 Nov 2023 19:39:39 +0100 Subject: [PATCH] [Bluetooth] re-fix ArrayStoreException (#15891) Signed-off-by: Leo Siepel --- .../java/org/openhab/binding/bluetooth/BluetoothUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothUtils.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothUtils.java index 33c9e8b32783e..456c35e7369b1 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothUtils.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothUtils.java @@ -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; }