From 5c936a23968ad4307cccc36504e86ef874526bf5 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 25 Oct 2022 10:29:51 +0200 Subject: [PATCH] [jOOQ/jOOQ#14131] Improve Val.getName() for array values --- jOOQ/src/main/java/org/jooq/impl/AbstractParam.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractParam.java b/jOOQ/src/main/java/org/jooq/impl/AbstractParam.java index 4a5c20226c..6285e68dd4 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractParam.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractParam.java @@ -118,11 +118,14 @@ abstract class AbstractParam extends AbstractParamX implements SimpleQuery private final static String name(Object value) { - // [#13392] The generated name of a byte[] value shouldn't depend on the - // identity of the value, but on the value itself + // [#13392] [##14131] The generated name of an array value shouldn't + // depend on the identity of the value, but on the value itself if (value instanceof byte[] b) { return "b_" + Internal.hash0(Arrays.hashCode(Arrays.copyOf(b, 16))); } + else if (value instanceof Object[] o) { + return "a_" + Internal.hash0(Arrays.hashCode(Arrays.copyOf(o, 16))); + } else return String.valueOf(value); }