ivandika3 commented on code in PR #955:
URL: https://github.com/apache/ratis/pull/955#discussion_r1376893101
##########
ratis-common/src/main/java/org/apache/ratis/util/ReferenceCountedObject.java:
##########
@@ -81,8 +86,11 @@ static <V> ReferenceCountedObject<V> wrap(V value, Runnable
retainMethod, Runnab
@Override
public V get() {
- if (count.get() < 0) {
+ final int previous = count.get();
+ if (previous < 0) {
throw new IllegalStateException("Failed to get: object has already
been completely released.");
+ } else if (previous == 0) {
Review Comment:
Thank you, yes I think this should resolve the issue, ran the unit tests in
local.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]