Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

"null" Strings handling

Help
Anonymous
2010-08-18
2013-04-29

  • Anonymous
    2010-08-18

    I've noticed that JSONObject toString serialization with "null" value String properties (not null references but "null" values) are handled in invalid way:

        JSONObject obj = new JSONObject();
        obj.put("key", "null");
        System.out.println(obj);

    returns

    {"key":null}

    where it should return

    {"key":"null"}

    Can it be bypassed somehow?