szetszwo commented on code in PR #955:
URL: https://github.com/apache/ratis/pull/955#discussion_r1376632033


##########
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:
   @ivandika3 , Sorry that this change is causing test failures for other code. 
 How about reverting it and changeing this separately.



-- 
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]

Reply via email to