[JAVA-3634] Multiple reads of BsonBinary UUID return different results Created: 27/Feb/20 Updated: 28/Oct/23 Resolved: 28/Feb/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON |
| Affects Version/s: | 3.12.1 |
| Fix Version/s: | 3.12.2, 4.0.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron MacKenzie | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Backwards Compatibility: | Minor Change |
| Description |
| Comments |
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: Add comment to BsonBinary#getData indicating that it returns the internal copy of the array
|
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: UuidHelper copies the array before modifying it Previously, the assumption was that the caller owned the array
|
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@mongodb.com'}Message: Add comment to BsonBinary#getData indicating that it returns the internal copy of the array
|
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@mongodb.com'}Message: UuidHelper copies the array before modifying it Previously, the assumption was that the caller owned the array
|
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: Add comment to BsonBinary#getData indicating that it returns the internal copy of the array
|
| Comment by Githook User [ 28/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: UuidHelper copies the array before modifying it Previously, the assumption was that the caller owned the array
|
| Comment by Jeffrey Yemin [ 27/Feb/20 ] |
| Comment by Jeffrey Yemin [ 27/Feb/20 ] |
|
Oh, that's really interesting. The UuidCodec is assuming that it "owns" the BsonBinary returned from BsonReader#readBinaryData. But that contract is not specified, and in fact BsonDocumentReader returns a reference to the instance in the BsonDocument rather than a copy. So we have to decide what the contract is, and then enforce it. Thanks for reporting this. I would actually consider it a major bug, so I'm going to leave the priority alone. |
| Comment by Aaron MacKenzie [ 27/Feb/20 ] |
|
I thought I selected a minor bug but apparently not. You can change the issue to a minor priority as the issue has a workaround. |