Skip to content

Commit

Permalink
Propagate the pretty printer from the writer to the generator in Prov…
Browse files Browse the repository at this point in the history
…iderBase.writeTo().
  • Loading branch information
motlin committed Jan 4, 2025
1 parent 1242dd8 commit e768537
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ public void writeTo(Object value, Class<?> type, Type genericType, Annotation[]
try {
// Want indentation?
if (writer.isEnabled(SerializationFeature.INDENT_OUTPUT)) {
g.useDefaultPrettyPrinter();
PrettyPrinter defaultPrettyPrinter = writer.getConfig().getDefaultPrettyPrinter();
if (defaultPrettyPrinter != null) {
g.setPrettyPrinter(defaultPrettyPrinter);
} else {
g.useDefaultPrettyPrinter();
}
}
JavaType rootType = null;

Expand Down

0 comments on commit e768537

Please sign in to comment.