File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 * Instances that represent JSON <strong>numbers</strong>, <strong>strings</strong> and
4747 * <strong>boolean</strong> values can be created using the static factory methods
4848 * {@link #valueOf(String)}, {@link #valueOf(long)}, {@link #valueOf(double)}, etc.
49+ * {@link #valueOf(float)} and {@link #valueOf(double)} throw a <strong>NumberFormatException
50+ * </strong> if the input is <strong>Inf</strong> or <strong>NaN</strong>.
4951 * </p>
5052 * <p>
5153 * 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) {
224226 /**
225227 * Returns a JsonValue instance that represents the given <code>float</code> value.
226228 *
229+ * Throws a <strong>NumberFormatException</strong> if the input parameter
230+ * is <strong>Inf</strong> or <strong>NaN</strong>.
231+ *
227232 * @param value the value to get a JSON representation for
228233 * @return a JSON value that represents the given value
229234 */
@@ -234,6 +239,9 @@ public static JsonValue valueOf(float value) {
234239 /**
235240 * Returns a JsonValue instance that represents the given <code>double</code> value.
236241 *
242+ * Throws a <strong>NumberFormatException</strong> if the input parameter
243+ * is <strong>Inf</strong> or <strong>NaN</strong>.
244+ *
237245 * @param value the value to get a JSON representation for
238246 * @return a JSON value that represents the given value
239247 */
You can’t perform that action at this time.
0 commit comments