This is an automated email from the ASF dual-hosted git repository.

w41ter pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 0bf92325551 [fix](gson) Fix GSON pretty printting setting #37211 
(#39138)
0bf92325551 is described below

commit 0bf9232555179d997f147408cc612cb3c09a54d3
Author: walter <[email protected]>
AuthorDate: Fri Aug 9 15:08:14 2024 +0800

    [fix](gson) Fix GSON pretty printting setting #37211 (#39138)
    
    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 2c7c32caa0a..d169e42d94c 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
@@ -259,11 +259,12 @@ public class GsonUtils {
             .registerTypeAdapter(PartitionKey.class, new 
PartitionKey.PartitionKeySerializer())
             .registerTypeAdapter(Range.class, new 
RangeUtils.RangeSerializer());
 
-    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]

Reply via email to