@@ -72,7 +72,7 @@ void toJson_writer() {
72
72
JsonType <Customer > customerType = jsonb .type (Customer .class );
73
73
StringWriter sw = new StringWriter ();
74
74
75
- customerType .toJson (sw , customer );
75
+ customerType .toJson (customer , sw );
76
76
assertThat (sw .toString ()).startsWith (jsonStart );
77
77
}
78
78
@@ -130,7 +130,7 @@ void toJson_pretty() {
130
130
try (JsonWriter writer = jsonb .writer (stringWriter )) {
131
131
writer .pretty (true );
132
132
Customer customer = new Customer ().id (42L ).name ("rob" ).status (Customer .Status .ACTIVE );
133
- jsonb .type (Customer .class ).toJson (writer , customer );
133
+ jsonb .type (Customer .class ).toJson (customer , writer );
134
134
}
135
135
String prettyJson = stringWriter .toString ().replace ("\" : " , "\" : " );
136
136
assertThat (prettyJson ).isEqualTo ("""
@@ -155,7 +155,7 @@ void toJsonStream() {
155
155
try (JsonWriter jsonWriter = jsonb .writer (writer )) {
156
156
jsonWriter .pretty (false );
157
157
for (Customer customer : customers ) {
158
- type .toJson (jsonWriter , customer );
158
+ type .toJson (customer , jsonWriter );
159
159
jsonWriter .writeNewLine ();
160
160
}
161
161
}
@@ -190,10 +190,10 @@ <T> void toStream(Iterator<T> iterator, JsonWriter jsonWriter) {
190
190
jsonWriter .pretty (false );
191
191
T first = iterator .next ();
192
192
JsonType <T > type = jsonb .typeOf (first );
193
- type .toJson (jsonWriter , first );
193
+ type .toJson (first , jsonWriter );
194
194
jsonWriter .writeNewLine ();
195
195
while (iterator .hasNext ()) {
196
- type .toJson (jsonWriter , iterator .next ());
196
+ type .toJson (iterator .next (), jsonWriter );
197
197
jsonWriter .writeNewLine ();
198
198
}
199
199
}
0 commit comments