This is an automated email from the ASF dual-hosted git repository.
w41ter pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new b6faf3910ea [fix](gson) Fix GSON pretty printting setting #37211
(#39135)
b6faf3910ea is described below
commit b6faf3910eabf50c21522636a2ff8addc565f9fe
Author: walter <[email protected]>
AuthorDate: Fri Aug 9 15:06:48 2024 +0800
[fix](gson) Fix GSON pretty printting setting #37211 (#39135)
cherry pick from #37211
---
fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java
index f65e34f4760..9a19989f025 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/GsonUtils.java
@@ -341,11 +341,12 @@ public class GsonUtils {
}
});
- private static final GsonBuilder GSON_BUILDER_PRETTY_PRINTING =
GSON_BUILDER.setPrettyPrinting();
// this instance is thread-safe.
public static final Gson GSON = GSON_BUILDER.create();
+ // ATTN: the order between creating GSON and GSON_PRETTY_PRINTING is very
important.
+ private static final GsonBuilder GSON_BUILDER_PRETTY_PRINTING =
GSON_BUILDER.setPrettyPrinting();
public static final Gson GSON_PRETTY_PRINTING =
GSON_BUILDER_PRETTY_PRINTING.create();
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]