From 311c14202cb2dbc181e56d310f233b91623a68c5 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 2 Nov 2023 14:05:49 +0100 Subject: [PATCH] [jOOQ/jOOQ#15751] Revert JSONB::toString to produce JSONB::data in order to log actual bind value in LoggerListener and elsewhere --- jOOQ/src/main/java/org/jooq/JSONB.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/JSONB.java b/jOOQ/src/main/java/org/jooq/JSONB.java index ca2c8be72f..fa89cda59f 100644 --- a/jOOQ/src/main/java/org/jooq/JSONB.java +++ b/jOOQ/src/main/java/org/jooq/JSONB.java @@ -174,13 +174,16 @@ public final class JSONB implements Serializable { *

*

{@link JSONB} specifics:

*

- * The {@link JSONB} type uses a normalised representation of the JSON - * content, meaning that two equivalent JSON documents are considered equal - * (see {@link JSONB} for details). This impacts both behaviour and - * performance! + * While the {@link JSONB} type uses a normalised representation of the JSON + * content to compare contents with {@link #equals(Object)} or + * {@link #hashCode()}, the {@link #toString()} method is exempt from this + * normalisation as the {@link #data()} value might be different despite two + * values being considered equal. Examples of such differences include + * numeric precision of values 2.0 or 2.00, which + * are considered equal, but aren't the same. */ @Override public String toString() { - return JSONValue.toJSONString(parsed()); + return data(); } }