You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2023/09/22 14:49:10 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #812: [MNG-6437] Better support for path and uri in property interpolation

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: issues-unsubscribe@maven.apache.org

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