Skip to content

Commit d53b3ea

Browse files
authored
Clarify doc about non-finite numbers for non-lenient JsonReader (#1723)
1 parent a4bc6c1 commit d53b3ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gson/src/main/java/com/google/gson/stream/JsonReader.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ public void nextNull() throws IOException {
890890
*
891891
* @throws IllegalStateException if the next token is not a literal value.
892892
* @throws NumberFormatException if the next literal value cannot be parsed
893-
* as a double, or is non-finite.
893+
* as a double.
894+
* @throws MalformedJsonException if the next literal value is NaN or Infinity
895+
* and this reader is not {@link #setLenient(boolean) lenient}.
894896
*/
895897
public double nextDouble() throws IOException {
896898
int p = peeked;

0 commit comments

Comments
 (0)