[JAVA-4496] Refactor usages of ReferenceCounted such that the retain method is used in a consistent manner Created: 16/Feb/22  Updated: 14/Sep/23

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

Type: Improvement Priority: Minor - P4
Reporter: Valentin Kavalenka Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-3978 Introduce self-managing reference cou... Backlog

 Description   

ReferenceCounted.retain is supposed to be called each time we store a new reference to a ReferenceCounted object in the process heap. However, for various reasons, including the fact that manual reference counting is difficult, we sometimes

As a result, it is very difficult (at least to me, but maybe I am not the only one) to reason about the code that uses reference counting. To improve the matters, we could

  • refactor all existing usages of ReferenceCounted such that retain is always called immediately before (in the program order) the write action that stores a new reference in the process heap;
  • urge ourselves to follow the approach taken in the aforementioned refactoring.

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