Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2841

BasicBSONObject and BasicDBObject not equal in 3.8.0-beta1

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Environment:
      OS X
      Oracle Hotspot Java 8u161
      Java Driver versions: 3.7.0-rc0 and 3.8.0-beta1

      Example:

        @Test
        public void bsonObjectVsDBObject() throws Exception {
          assertEquals(
              new BasicDBObject("_id", new ObjectId("5adf5c14ac34ea1322706a06")),
              new BasicBSONObject("_id", new ObjectId("5adf5c14ac34ea1322706a06")));
        }
      

      Test fails on both 3.7.0-rc0 and 3.8.0-beta1 while passes on 3.6.3:

      java.lang.AssertionError: 
      Expected :{ "_id" : { "$oid" : "5adf5c14ac34ea1322706a06" } }
      Actual   :{_id=5adf5c14ac34ea1322706a06}
      

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            john.morales@mongodb.com John Morales (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: