[JAVA-3964] Improve the documentation of the ReferenceCounted interface Created: 26/Jan/21  Updated: 28/Oct/23  Resolved: 01/Feb/21

Status: Closed
Project: Java Driver
Component/s: Internal
Affects Version/s: None
Fix Version/s: 4.3.0

Type: Improvement Priority: Major - P3
Reporter: Valentin Kavalenka Assignee: Valentin Kavalenka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from JAVA-3907 AsyncQueryBatchCursor does not releas... Closed
Related
is related to JAVA-3978 Introduce self-managing reference cou... Backlog
Backwards Compatibility: Fully Compatible
Documentation Changes: Not Needed

 Description   

Currently the documentation of the ReferenceCounted.getCount method is not very clear, especially in stating that reference count starts at 0. We need to explain that the count values ∈ [0, +∞), but a new ReferenceCounted object must always be created as retained, i.e., with the count equal to 1.



 Comments   
Comment by Valentin Kavalenka [ 01/Feb/21 ]

The commit Make implementations of AsyncAggregateResponseBatchCursor more responsive to close signals in the PR#654 gives more details and explains why we cannot reconcile the release-early and structured reference-counting.

Comment by Githook User [ 27/Jan/21 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Improve the documentation of the ReferenceCounted interface

JAVA-3964
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/fbf09e215eb85ce2f7eda2f99131e44d2dc1c3df

Generated at Thu Feb 08 09:00:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.