Skip to content

Commit

Permalink
[fix](gson) Fix GSON pretty printting setting (#37211)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored Jul 3, 2024
1 parent 0416b10 commit 156d926
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,12 @@ public boolean shouldSkipClass(Class<?> clazz) {
}
});

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;
public static final Gson GSON_PRETTY_PRINTING = GSON_BUILDER_PRETTY_PRINTING.create();

/*
Expand Down

0 comments on commit 156d926

Please sign in to comment.