[JAVA-1192] BasicBSONObject.equals method broken for BasicDBList of BasicDBObject Created: 29/Apr/14  Updated: 31/Mar/15  Resolved: 01/May/14

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.12.0
Fix Version/s: 2.12.2, 3.0.0

Type: Bug Priority: Major - P3
Reporter: Niklas Nebel Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Major Change

 Description   

The changed "equals" in 2.12.0 (fix for JAVA-416) calls canonicalize for nested objects, but not for objects in lists.
Example in Scala:

val one = com.mongodb.util.JSON.parse("""{"list": [{"x":1, "y":2}]}""")
val two = com.mongodb.util.JSON.parse("""{"list": [{"y":2, "x":1}]}""")
one == two

Result is false in 2.12.0, true in 2.11.4.



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1192: Handle Map and List in BasicBSONObject.equals and hashCode
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/5461ad500cd572ffc2303f3d9d1bfa1981b3c452

Comment by Githook User [ 01/Aug/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1192: Handle Map and List in BasicBSONObject.equals and hashCode
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/b718ddc5105c97c5b7c8572c364de75d2a15f28e

Comment by Githook User [ 01/May/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1192: Handle Map and List in BasicBSONObject.equals and hashCode
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/5461ad500cd572ffc2303f3d9d1bfa1981b3c452

Comment by Githook User [ 01/May/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1192: Handle Map and List in BasicBSONObject.equals and hashCode
Branch: 2.12.x
https://github.com/mongodb/mongo-java-driver/commit/b718ddc5105c97c5b7c8572c364de75d2a15f28e

Comment by Jeffrey Yemin [ 29/Apr/14 ]

Sorry, this just missed the 2.12.1 train. Will look at it for 2.12.2.

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