@@ -175,7 +175,8 @@ public class JsonOutput implements Closeable {
175175 Collection .class ::isAssignableFrom ,
176176 (obj , depth ) -> {
177177 if (depth < 1 ) {
178- throw new JsonException ("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
178+ throw new JsonException (
179+ "Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
179180 }
180181 beginArray ();
181182 ((Collection <?>) obj )
@@ -189,7 +190,8 @@ public class JsonOutput implements Closeable {
189190 Map .class ::isAssignableFrom ,
190191 (obj , depth ) -> {
191192 if (depth < 1 ) {
192- throw new JsonException ("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
193+ throw new JsonException (
194+ "Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
193195 }
194196 beginObject ();
195197 ((Map <?, ?>) obj )
@@ -206,7 +208,8 @@ public class JsonOutput implements Closeable {
206208 Class ::isArray ,
207209 (obj , depth ) -> {
208210 if (depth < 1 ) {
209- throw new JsonException ("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
211+ throw new JsonException (
212+ "Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
210213 }
211214 beginArray ();
212215 Stream .of ((Object []) obj )
@@ -228,12 +231,15 @@ public class JsonOutput implements Closeable {
228231 });
229232
230233 // Finally, attempt to convert as an object
231- builder .put (cls -> true , (obj , depth ) -> {
232- if (depth < 1 ) {
233- throw new JsonException ("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
234- }
235- mapObject (obj , depth - 1 );
236- });
234+ builder .put (
235+ cls -> true ,
236+ (obj , depth ) -> {
237+ if (depth < 1 ) {
238+ throw new JsonException (
239+ "Reached the maximum depth of " + MAX_DEPTH + " while writing JSON" );
240+ }
241+ mapObject (obj , depth - 1 );
242+ });
237243
238244 this .converters = Collections .unmodifiableMap (builder );
239245 }
0 commit comments