showuon commented on code in PR #12053:
URL: https://github.com/apache/kafka/pull/12053#discussion_r956926934


##########
shell/src/main/java/org/apache/kafka/shell/MetadataNodeManager.java:
##########
@@ -268,7 +269,7 @@ private void handleCommitImpl(MetadataRecordType type, 
ApiMessage message)
                             "Can't handle ConfigResource.Type " + 
record.resourceType());
                 }
                 DirectoryNode configDirectory = data.root.mkdirs("configs").
-                    mkdirs(typeString).mkdirs(record.resourceName());
+                    
mkdirs(typeString).mkdirs(Utils.isBlank(record.resourceName()) ? "<default>" : 
record.resourceName());

Review Comment:
   nit: `Utils.isBlank` will be true when `str == null || 
str.trim().isEmpty()`. Although I don't think the resource name will be null 
here, I think it'd better not to allow null resource name here. So, maybe:
   ```
   record.resourceName().isBlank() ? "<default>" : record.resourceName()
   ```



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