[JAVA-672] JSON.parse should throw an exception if the input string is not fully consumed Created: 22/Oct/12  Updated: 25/Nov/15  Resolved: 25/Nov/15

Status: Closed
Project: Java Driver
Component/s: JSON
Affects Version/s: 2.9.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-446 Possible bug with JSON parser Closed
Related
is related to JAVA-671 Geospatial Query with implied and ret... Closed

 Description   

This:

        String str = "{x : 1}, y : 1";
        DBObject parsedJSON = (DBObject) JSON.parse(str);

produces a DBObject equivalent to:

        new BasicDBObject(x, 1)

It should throw an exception instead



 Comments   
Comment by Jeffrey Yemin [ 25/Nov/15 ]

Closing this, as the JSON class is effectively replaced by JsonReader and JsonWriter in 3.0, and we don't want to spend any more effort on the JSON class.

Generated at Thu Feb 08 08:52:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.