joeCarf commented on code in PR #7217:
URL: https://github.com/apache/rocketmq/pull/7217#discussion_r1300974924


##########
common/src/main/java/org/apache/rocketmq/common/MixAll.java:
##########
@@ -518,4 +520,25 @@ public static boolean 
isSysConsumerGroupForNoColdReadLimit(String consumerGroup)
         }
         return false;
     }
+
+    public static Set<String> invalidProperties(Properties properties, 
Object... objects) {
+        if (objects == null || objects.length == 0) {
+            return null;
+        }
+        Set<String> propertyNames = properties.stringPropertyNames();
+
+        Set<String> fieldNames = new HashSet<>();
+        for (Object obj : objects) {
+            Method[] methods = obj.getClass().getMethods();
+            for (Method method : methods) {
+                String mn = method.getName();
+                if (mn.startsWith("get")) {
+                    // get getter's field name and to camel name.
+                    fieldNames.add(mn.substring(3, 4).toLowerCase() +  
mn.substring(4));
+                }
+            }
+        }
+
+        return Sets.difference(propertyNames, fieldNames);

Review Comment:
   I think it may miss logging when propertyNames not contains all fieldNames



-- 
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: commits-unsubscr...@rocketmq.apache.org

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

Reply via email to