[JAVA-1502] BSONObject et al.: wrong return value in JavaDoc for put(k,v) Created: 16/Oct/14 Updated: 30/Jan/15 Resolved: 27/Oct/14 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Documentation |
| Affects Version/s: | 2.12.3 |
| Fix Version/s: | 2.13.0, 3.0.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jens Grivolla | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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, ...: P.s.: I was actually hoping it would return the BSONObject itself so I could chain put() operations together |
| Comments |
| 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: Fixed documentation of return value for BSONObject.put to indicate that it returns the previous value associated with the given key. |
| Comment by Githook User [ 27/Oct/14 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: Fixed documentation of return value for BSONObject.put to indicate that it returns the previous value associated with the given key. |
| Comment by Githook User [ 27/Oct/14 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: Fixed documentation of return value for BSONObject.put to indicate that it returns the previous value associated with the given key. |
| Comment by Jeffrey Yemin [ 16/Oct/14 ] |
|
Yep, this is plain wrong. Thanks for catching it. |