Closed holubec-petr closed 7 years ago
Agreed, a valid expectation might be to match this thrown exception:
JSONObject jsonObject = new JSONObject("blah");
However, the observed behavior of producing an empty object seems to be a valid design choice as well. I wouldn't want to change the released code just for the sake of being more consistent.
No changes are planned to this code at the present time.
Hi everyone,
when I call
XML.toJSONObject("blah")
I got empty JSONObject without any error even if input is not a valid XML.In my opinion this conversion should throw some parsing error or am I bad?
Thanks, Petr