diff --git a/src/main/org/hjson/JsonValue.java b/src/main/org/hjson/JsonValue.java index 856facb..3cb7f8d 100644 --- a/src/main/org/hjson/JsonValue.java +++ b/src/main/org/hjson/JsonValue.java @@ -46,6 +46,8 @@ * Instances that represent JSON numbers, strings and * boolean values can be created using the static factory methods * {@link #valueOf(String)}, {@link #valueOf(long)}, {@link #valueOf(double)}, etc. + * {@link #valueOf(float)} and {@link #valueOf(double)} throw a NumberFormatException + * if the input is Inf or NaN. *
*
* In order to find out whether an instance of this class is of a certain type, the methods
@@ -224,6 +226,9 @@ public static JsonValue valueOf(long value) {
/**
* Returns a JsonValue instance that represents the given float value.
*
+ * Throws a NumberFormatException if the input parameter
+ * is Inf or NaN.
+ *
* @param value the value to get a JSON representation for
* @return a JSON value that represents the given value
*/
@@ -234,6 +239,9 @@ public static JsonValue valueOf(float value) {
/**
* Returns a JsonValue instance that represents the given double value.
*
+ * Throws a NumberFormatException if the input parameter
+ * is Inf or NaN.
+ *
* @param value the value to get a JSON representation for
* @return a JSON value that represents the given value
*/