cmccabe commented on code in PR #18845:
URL: https://github.com/apache/kafka/pull/18845#discussion_r1953117041


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1652,9 +1652,7 @@ private void registerWriteNoOpRecord(long 
maxIdleIntervalNs) {
         periodicControl.registerTask(new PeriodicTask("writeNoOpRecord",
             () -> {
                 ArrayList<ApiMessageAndVersion> records = new ArrayList<>(1);
-                if (featureControl.metadataVersion().isNoOpRecordSupported()) {
-                    records.add(new ApiMessageAndVersion(new NoOpRecord(), 
(short) 0));
-                }
+                records.add(new ApiMessageAndVersion(new NoOpRecord(), (short) 
0));

Review Comment:
   @ijuma , we do not mutate the records list that gets returned from these 
functions later on. @chia7712 is correct that we return immutable objects in 
many other cases. Unfortunately, due to Java's lack of `const` I guess that 
isn't obvious.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to