HScarb commented on a change in pull request #3856:
URL: https://github.com/apache/rocketmq/pull/3856#discussion_r810467877



##########
File path: 
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
##########
@@ -292,12 +292,7 @@ public void shutdown(final boolean shutdownFactory) {
 
     @Override
     public Set<String> getPublishTopicList() {
-        Set<String> topicList = new HashSet<String>();
-        for (String key : this.topicPublishInfoTable.keySet()) {
-            topicList.add(key);
-        }
-
-        return topicList;
+        return new HashSet<>(this.topicPublishInfoTable.keySet());

Review comment:
       Diamond types are not supported at language level '6'.
   It should be like
   ```java
   return new HashSet<String>(this.topicPublishInfoTable.keySet());
   ```




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