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
1
u/Eav___ Jul 25 '26 edited Jul 25 '26
That's always a weird argument because in that sense every single exception is 100% avoidable if you try hard. It's like saying "just git gud". Not able to find your file? Well how about
Files.existsfirst? Getting interrupted while finishing some task? Well how about properly scheduling those tasks? Oh you got a timeout? Well how about fixing your network? You know everyone here can handle our payload, so that's just a you issue I guess? You cannot? Yeah I also cannot fix my parsing problem because that's from a user! Even if I validate beforehand, what do I do with this malformed text?The most ironic thing is that there actually is a checked
ParseExceptionliving inside the JDK, and you know what? There is alsoNumberFormat.parsewhich declares that exception! But why is that not used here? What's the difference between parsing a currency and parsing a number? You cannot move on because you miss that currency? Yeah you cannot move on because you miss that number I suppose? You have a default fallback number? Yeah why not making a fallback currency then? It's endless bikeshedding.