MCPcopy Index your code
hub / github.com/processing/processing / testValidity

Method testValidity

core/src/processing/data/JSONObject.java:1532–1546  ·  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

1530 * @throws RuntimeException If o is infinite or NaN.
1531 */
1532 static protected void testValidity(Object o) {
1533 if (o != null) {
1534 if (o instanceof Double) {
1535 if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
1536 throw new RuntimeException(
1537 "JSON does not allow non-finite numbers.");
1538 }
1539 } else if (o instanceof Float) {
1540 if (((Float)o).isInfinite() || ((Float)o).isNaN()) {
1541 throw new RuntimeException(
1542 "JSON does not allow non-finite numbers.");
1543 }
1544 }
1545 }
1546 }
1547
1548
1549// /**

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected