[JAVA-298] JSON.parse() return type Created: 17/Mar/11  Updated: 23/Mar/11  Resolved: 17/Mar/11

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.5
Fix Version/s: 2.5.1

Type: Improvement Priority: Minor - P4
Reporter: Victor Song Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

According to the JavaDoc, JSON.parse() parses a JSON string into a DBObject. Its return type should be DBObject instead of Object. Would save a type cast in application programs.



 Comments   
Comment by Antoine Girbal [ 17/Mar/11 ]

the return value of Object is correct, because you can actually parse any JSON value.
So it may return a DBObject, or a String, Date, etc
Fixed the doc.

Comment by auto [ 17/Mar/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-298: fixed doc on JSON parse
https://github.com/mongodb/mongo-java-driver/commit/36215930de6a3e2c0367c68680030a99e465abc7

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