chia7712 commented on a change in pull request #8978:
URL: https://github.com/apache/kafka/pull/8978#discussion_r449675093



##########
File path: clients/src/test/java/org/apache/kafka/test/MockDeserializer.java
##########
@@ -26,17 +26,16 @@
 
 public class MockDeserializer implements ClusterResourceListener, 
Deserializer<byte[]> {
     public static AtomicInteger initCount = new AtomicInteger(0);
-    public static AtomicInteger closeCount = new AtomicInteger(0);
     public static AtomicReference<ClusterResource> clusterMeta = new 
AtomicReference<>();
     public static ClusterResource noClusterId = new 
ClusterResource("no_cluster_id");
     public static AtomicReference<ClusterResource> clusterIdBeforeDeserialize 
= new AtomicReference<>(noClusterId);
 
     public boolean isKey;
     public Map<String, ?> configs;
+    public boolean isClosed = false;

Review comment:
       I did not reuse the atomic count since the count is a static variable. 
Junit, by default, could run different tests on same JVM and hence the static 
variable may be changed by other tests.
   
   
   For another, your point makes sense that the atomic integer is good enough. 
I will revert the Boolean and remove the static modifier to prevent the case I 
described above.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to