Menu

#140 ClassCastException and NullPointerException

v1.0 (example)
open
nobody
None
5
2020-11-08
2018-03-16
No

I found very silly validation in net.sf.json.JSONObject class on line 926 and 930 in version 2.4.

I try to create a JSON object using this expression:

JSONArray.fromObject("[null, \"null\"]");

Any JSON validator will accept JSON: [null, "null"]

However those two lines throwing error.

Please can you remove validation on null and "null"
Event developer create JSON object such as
{
"null":"null"
}

is still valid.

Thanks,
David

Discussion

  • David Gofman

    David Gofman - 2018-03-16

    The same validations on lines 1144 and 1148

     
  • aalmiray

    aalmiray - 2020-11-08

    Development of this library has been moved to GitHub since 2010, please report any issues you may find at https://github.com/kordamp/json-lib/issues

     

Log in to post a comment.