Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
NightlyNexus committed May 8, 2024
1 parent e9f73cd commit 34d41b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion moshi/src/main/java/com/squareup/moshi/JsonUtf8Reader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ internal class JsonUtf8Reader : JsonReader {
'}' -> {
if (peekStack == JsonScope.NONEMPTY_OBJECT && !lenient) {
throw syntaxError(
"Expected name. Use JsonReader.setLenient(true) to accept malformed JSON"
"Expected name. Use JsonReader.setLenient(true) to accept " +
"malformed JSON",
)
}
buffer.readByte() // consume the '}'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,10 @@ public void trailingCommaInJsonObject() throws Exception {
reader.endObject();
fail();
} catch (JsonEncodingException expected) {
assertThat(expected.getMessage()).isEqualTo(
"Expected name. Use JsonReader.setLenient(true) to accept malformed JSON at path $.a");
assertThat(expected.getMessage())
.isEqualTo(
"Expected name. Use JsonReader.setLenient(true) to accept malformed "
+ "JSON at path $.a");
}
reader = newReader("{\"a\": 1, }");
reader.beginObject();
Expand All @@ -1374,7 +1376,7 @@ public void trailingCommaInJsonArray() throws Exception {
fail();
} catch (JsonEncodingException expected) {
assertThat(expected.getMessage())
.isEqualTo("Use JsonReader.setLenient(true) to accept malformed JSON at path $[1]");
.isEqualTo("Use JsonReader.setLenient(true) to accept malformed JSON at path $[1]");
}
reader = newReader("[1,]");
reader.beginArray();
Expand Down

0 comments on commit 34d41b7

Please sign in to comment.