diff --git a/gson/src/main/java/com/google/gson/stream/JsonReader.java b/gson/src/main/java/com/google/gson/stream/JsonReader.java index ea738f82..838355cb 100644 --- a/gson/src/main/java/com/google/gson/stream/JsonReader.java +++ b/gson/src/main/java/com/google/gson/stream/JsonReader.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.io.Reader; /** - * Reads a JSON (RFC 4627) + * Reads a JSON (RFC 7159) * encoded value as a stream of tokens. This stream includes both literal * values (strings, numbers, booleans, and nulls) as well as the begin and * end delimiters of objects and arrays. The tokens are traversed in @@ -571,9 +571,6 @@ public class JsonReader implements Closeable { checkLenient(); return peeked = PEEKED_SINGLE_QUOTED; case '"': - if (stackSize == 1) { - checkLenient(); - } return peeked = PEEKED_DOUBLE_QUOTED; case '[': return peeked = PEEKED_BEGIN_ARRAY; @@ -583,10 +580,6 @@ public class JsonReader implements Closeable { pos--; // Don't consume the first character in a literal value. } - if (stackSize == 1) { - checkLenient(); // Top-level value isn't an array or an object. - } - int result = peekKeyword(); if (result != PEEKED_NONE) { return result; diff --git a/gson/src/main/java/com/google/gson/stream/JsonWriter.java b/gson/src/main/java/com/google/gson/stream/JsonWriter.java index 8d3bdb34..9bf2d22a 100644 --- a/gson/src/main/java/com/google/gson/stream/JsonWriter.java +++ b/gson/src/main/java/com/google/gson/stream/JsonWriter.java @@ -30,7 +30,7 @@ import static com.google.gson.stream.JsonScope.NONEMPTY_DOCUMENT; import static com.google.gson.stream.JsonScope.NONEMPTY_OBJECT; /** - * Writes a JSON (RFC 4627) + * Writes a JSON (RFC 7159) * encoded value to a stream, one token at a time. The stream includes both * literal values (strings, numbers, booleans and nulls) as well as the begin * and end delimiters of objects and arrays. @@ -130,7 +130,7 @@ import static com.google.gson.stream.JsonScope.NONEMPTY_OBJECT; public class JsonWriter implements Closeable, Flushable { /* - * From RFC 4627, "All Unicode characters may be placed within the + * From RFC 7159, "All Unicode characters may be placed within the * quotation marks except for the characters that must be escaped: * quotation mark, reverse solidus, and the control characters * (U+0000 through U+001F)." @@ -222,7 +222,7 @@ public class JsonWriter implements Closeable, Flushable { /** * Configure this writer to relax its syntax rules. By default, this writer * only emits well-formed JSON as specified by RFC 4627. Setting the writer + * href="http://www.ietf.org/rfc/rfc7159.txt">RFC 7159. Setting the writer * to lenient permits the following: *