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
Thanks for the report! This is the relevant code of JsonParser.parseReader(Reader):
JsonReaderjsonReader = newJsonReader(reader);
JsonElementelement = parseReader(jsonReader);
if (!element.isJsonNull() && jsonReader.peek() != JsonToken.END_DOCUMENT) {
thrownewJsonSyntaxException("Did not consume the entire document.");
}
returnelement;
The second line calls JsonParser.parseReader(JsonReader), which does not have a similar check for END_DOCUMENT. It really does return the next value, as its documentation says. It's certainly regrettable that two methods with the same name have such different behaviour, but the javadoc does appear to be correct.
It appears to me that you've made a mistake on the description of the
parseReader(Reader reader)
method of the JsonObject class.You can check said method's doc yourself here
I believe it should be "Parses the specified stream/reader into a parse tree".
I hope that my lack of English/Java knowledge isn't the problem here and I'm not wasting your time.
The text was updated successfully, but these errors were encountered: