Skip to content

Commit

Permalink
[fix](gson) Fix GSON pretty printting setting (apache#37211)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter committed Aug 9, 2024
1 parent e2f4522 commit 1de129e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,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 1de129e

Please sign in to comment.