michael-o commented on code in PR #812:
URL: https://github.com/apache/maven/pull/812#discussion_r1334483743


##########
maven-core/src/main/java/org/apache/maven/plugin/ReflectionValueExtractor.java:
##########
@@ -261,22 +265,14 @@ private static Object getPropertyValue(Object value, 
String property) throws Int
 
         ClassMap classMap = getClassMap(value.getClass());
         String methodBase = Character.toTitleCase(property.charAt(0)) + 
property.substring(1);
-        String methodName = "get" + methodBase;
         try {
-            Method method = classMap.findMethod(methodName);
-
-            if (method == null) {
-                // perhaps this is a boolean property??
-                methodName = "is" + methodBase;
-
-                method = classMap.findMethod(methodName);
+            for (String prefix : Arrays.asList("get", "is", "to", "as")) {
+                Method method = classMap.findMethod(prefix + methodBase);
+                if (method != null) {
+                    return method.invoke(value, OBJECT_ARGS);
+                }

Review Comment:
   Shouldn't this be a separate, preceding PR?



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