snuyanzin commented on code in PR #1908:
URL: https://github.com/apache/fluss/pull/1908#discussion_r2478487285


##########
fluss-client/src/main/java/org/apache/fluss/client/converter/PojoType.java:
##########
@@ -143,32 +159,68 @@ private static Map<String, Field> 
discoverAllInstanceFields(Class<?> clazz) {
         return fields;
     }
 
-    private static Map<String, Method> discoverGetters(Class<?> clazz) {
-        Map<String, Method> getters = new HashMap<>();
+    private static Map<String, Method> discoverGetters(
+            Class<?> clazz, Map<String, Field> fieldMap) {
+        final Map<String, Method> getters = new HashMap<>();
         for (Method m : clazz.getMethods()) { // public methods incl. inherited
-            if (m.getParameterCount() == 0
-                    && m.getName().startsWith("get")
-                    && !m.getReturnType().equals(void.class)) {
-                String prop = decapitalize(m.getName().substring(3));
+            final String prop = getGetterProp(m);
+            if (fieldMap.containsKey(prop)) {

Review Comment:
   no need to store in map any data not matching field names.
   
   E.g. if for some reason a POJO has  a number of methods like 
`getSomethingBlaBlaBla` which is not related to fields



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