From 5eba0b9f7d50c6cf6f1c91cb3a9936cd73a9ab93 Mon Sep 17 00:00:00 2001 From: roimenashe Date: Tue, 5 Dec 2023 12:13:36 +0200 Subject: [PATCH] Handle byte[] case when constructing a list of objects --- .../springframework/data/aerospike/core/TemplateUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/aerospike/core/TemplateUtils.java b/src/main/java/org/springframework/data/aerospike/core/TemplateUtils.java index a75e78fa7..0e8129749 100644 --- a/src/main/java/org/springframework/data/aerospike/core/TemplateUtils.java +++ b/src/main/java/org/springframework/data/aerospike/core/TemplateUtils.java @@ -29,7 +29,10 @@ public static List getIdValue(Qualifier qualifier) { private static List idObjectToList(Object ids) { List result; Assert.notNull(ids, "Ids must not be null"); - if (ids.getClass().isArray()) { + + if (ids instanceof byte[]) { + result = List.of(ids); + } else if (ids.getClass().isArray()) { result = Arrays.stream(((Object[]) ids)).toList(); } else if (ids instanceof Collection) { result = new ArrayList<>((Collection) ids);