You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `PrettyPrinter` configured for a Jackson `ObjectWriter` is shared between all downstream `JsonGenerator`s. To make this thread-safe (in order to prevent multiple generators from corrupting the shared indentation level), a class derived from `PrettyPrinter` can also inherit from `Instantiable`, which basically turns the `ObjectWriter`-level `PrettyPrinter` into a factory that produces a new `PrettyPrinter` for each generator.
Since `util-jackson`'s `ArrayElementsOnNewLinesPrettyPrinter` inherits from `DefaultPrettyPrinter`, which has state that must be protected from corruption, we need to abide by this factory pattern.
Differential Revision: https://phabricator.twitter.biz/D1167308
0 commit comments