It’s a good point. But as far as I know, opt-functions return non-null value.

For example:

public String optString (String name, 
String fallback)

returns fallback if there’s no key name in JSONObject, but sometimes you need null.

optString without second argument is the same as optString(key, "").

Please correct me if I’m missing something.

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.