Skip to content

Which JSONParserConfiguration to use in JSONObject/JSONArray constructors #945

Description

@stleary

From #927:

What is the purpose of JSONParserConfiguration parameter in JSONArray/JSONObject constructors? Is it not enough to use JSONTokener's JSONParserConfiguration? For example, when calling "JSONArray(JSONTokener x, JSONParserConfiguration jsonParserConfiguration)" constructor the array syntax is checked according to jsonParserConfiguration parameter, but nested objects/arrays syntax is checked according to JSONTokener's configuration. It seems a bit inconsistent.

Both the JSONArray/JSONObject instance and the JSONTokener parameter already have a JSONParserConfiguration. Only one of these should be used. I am leaning towards replacing the JSONTokener config instance with the config param. This should also be called out in the JavaDocs for the corresponding constructors.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions