From b3b8a7fd8a2b82712537cab111abe6c4a05362df Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 23 Dec 2024 10:13:05 +0100 Subject: [PATCH] [jOOQ/jOOQ#17786] Avoid static type registry lookups in DSL::if_ and DSL::iif calls, if possible --- jOOQ/src/main/java/org/jooq/impl/DSL.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index ce98191318..35484a1fb7 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -18402,7 +18402,12 @@ public class DSL { // Java 8 is stricter than Java 7 with respect to generics and overload // resolution (http://stackoverflow.com/q/5361513/521799) static Field iif0(Name name, Condition condition, Field ifTrue, Field ifFalse) { - return new Iif<>(name, condition, Tools.nullSafe(ifTrue), Tools.nullSafe(ifFalse)); + return new Iif<>( + name, + condition, + Tools.nullSafe(ifTrue, ifFalse.getDataType()), + Tools.nullSafe(ifFalse, ifTrue.getDataType()) + ); }