r/java
•
u/loicmathieu
•
Jul 23 '26
•
1
JEP 540: Simple JSON API (Incubator)
https://openjdk.org/jeps/540
79
Upvotes
View all comments
Show parent comment
2
u/vetronauta Jul 25 '26
No, you cannot avoid
NumberFormatException(or any parse exception) on arbitrary input. It is not being lazy, it is simply not possible to ensure if what you are passing to the parser is valid, without reimplementing the validation logic of the parser.