cmccabe commented on a change in pull request #9032:
URL: https://github.com/apache/kafka/pull/9032#discussion_r472498809



##########
File path: 
clients/src/test/java/org/apache/kafka/common/protocol/ProtoUtilsTest.java
##########
@@ -26,11 +26,18 @@
     public void testDelayedAllocationSchemaDetection() throws Exception {
         //verifies that schemas known to retain a reference to the underlying 
byte buffer are correctly detected.
         for (ApiKeys key : ApiKeys.values()) {
-            if (key == ApiKeys.PRODUCE || key == ApiKeys.JOIN_GROUP || key == 
ApiKeys.SYNC_GROUP || key == ApiKeys.SASL_AUTHENTICATE
-                || key == ApiKeys.EXPIRE_DELEGATION_TOKEN || key == 
ApiKeys.RENEW_DELEGATION_TOKEN) {
-                assertTrue(key + " should require delayed allocation", 
key.requiresDelayedAllocation);
-            } else {
-                assertFalse(key + " should not require delayed allocation", 
key.requiresDelayedAllocation);
+            switch (key) {
+                case PRODUCE:
+                case JOIN_GROUP:
+                case SYNC_GROUP:
+                case SASL_AUTHENTICATE:
+                case EXPIRE_DELEGATION_TOKEN:
+                case RENEW_DELEGATION_TOKEN:
+                case ALTER_USER_SCRAM_CREDENTIALS:
+                    assertTrue(key + " should require delayed allocation", 
key.requiresDelayedAllocation);
+                    break;
+                default:
+                    assertFalse(key + " should not require delayed 
allocation", key.requiresDelayedAllocation);

Review comment:
       I know it's not strictly necessary, but it would be nice to have a 
"break" after the default clause too




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