joeCarf commented on code in PR #7217: URL: https://github.com/apache/rocketmq/pull/7217#discussion_r1301389441
########## 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: Gotcha!there are tests failures, plz fix it :) <img width="1270" alt="image" src="https://github.com/apache/rocketmq/assets/52153761/5489eb96-f0a9-4bd1-943d-452642772770"> ########## 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: Gotcha!there are tests failures, plz fix it :) <img width="1270" alt="image" src="https://github.com/apache/rocketmq/assets/52153761/5489eb96-f0a9-4bd1-943d-452642772770"> -- 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