MCPcopy Index your code
hub / github.com/benfry/processing4 / testValidity

Method testValidity

core/src/processing/data/JSONObject.java:1586–1600  ·  view source on GitHub ↗

Throw an exception if the object is a NaN or infinite number. @param o The object to test. If not Float or Double, accepted without exceptions. @throws RuntimeException If o is infinite or NaN.

(Object o)

Source from the content-addressed store, hash-verified

1584 * @throws RuntimeException If o is infinite or NaN.
1585 */
1586 static protected void testValidity(Object o) {
1587 if (o != null) {
1588 if (o instanceof Double) {
1589 if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
1590 throw new RuntimeException(
1591 "JSON does not allow non-finite numbers.");
1592 }
1593 } else if (o instanceof Float) {
1594 if (((Float)o).isInfinite() || ((Float)o).isNaN()) {
1595 throw new RuntimeException(
1596 "JSON does not allow non-finite numbers.");
1597 }
1598 }
1599 }
1600 }
1601
1602
1603// /**

Callers 4

appendMethod · 0.95
setMethod · 0.95
numberToStringMethod · 0.95
putMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected