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

BSONObject et al.: wrong return value in JavaDoc for put(k,v)

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.13.0, 3.0.0
    • 2.12.3
    • Documentation
    • None

    Description

      BSONObject, BasicBSONObject, etc. claim to return the value passed to it, but they appear to rely on java.util.HashMap which returns the previous value: http://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html#put(K,%20V)

      example of JavaDoc of BSONObject, BasicBSONObject, ...:
      {{
      @return <tt>v</tt>
      @return the <code>val</code> parameter
      }}

      P.s.: I was actually hoping it would return the BSONObject itself so I could chain put() operations together

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jgrivolla Jens Grivolla
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: