You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sjhajharia (via GitHub)" <gi...@apache.org> on 2024/06/05 05:59:29 UTC

[PR] MINOR: Cleanups in Shell Module [kafka]

sjhajharia opened a new pull request, #16204:
URL: https://github.com/apache/kafka/pull/16204

   Some cleanup in shell module
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Cleanups in Shell Module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on code in PR #16204:
URL: https://github.com/apache/kafka/pull/16204#discussion_r1627866011


##########
shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java:
##########
@@ -99,11 +100,11 @@ public MetadataNode child(String name) {
     }
 
     static class InfoConsumer implements Consumer<Optional<MetadataNodeInfo>> {
-        private Optional<List<MetadataNodeInfo>> infos = null;
+        private Optional<List<MetadataNodeInfo>> infos = Optional.empty();

Review Comment:
   I made that change just for consistency with the variable declaration. We have it defined as `Optional` and I felt `Optional.empty()` made more sense than `null` here. 
   Even the IDE complains here: `Null is used for 'Optional' type in declaration`.
   lmk if it makes sense here.
   Thanks!



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Cleanups in Shell Module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #16204:
URL: https://github.com/apache/kafka/pull/16204#discussion_r1627822996


##########
shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java:
##########
@@ -99,11 +100,11 @@ public MetadataNode child(String name) {
     }
 
     static class InfoConsumer implements Consumer<Optional<MetadataNodeInfo>> {
-        private Optional<List<MetadataNodeInfo>> infos = null;
+        private Optional<List<MetadataNodeInfo>> infos = Optional.empty();

Review Comment:
   not sure why we need `Optional` ... it seems empty collection can be equal to `Optional.empty`



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Cleanups in Shell Module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #16204:
URL: https://github.com/apache/kafka/pull/16204


-- 
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-unsubscribe@kafka.apache.org

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