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

BsonDocument.clone should return a mutable deep copy, or we need a different mechanism of achieving that

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 4.10.0
    • None
    • BSON
    • None
    • Fully Compatible
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      Currently we have at least two places (that I know of) where we rely on BsonDocument.clone returning not only a deep copy, but mutable deep copy:

      1. AbstractConstructibleBson.newMerged
      2. The new method ClientEncryption.createEncryptedCollection introduced in https://github.com/mongodb/mongo-java-driver/pull/1079.

      ross@mongodb.com pointed out that RawBsonDocument breaks the "mutable" part and can come from users.

      Attachments

        Activity

          People

            valentin.kovalenko@mongodb.com Valentin Kavalenka
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: