gnodet-bot commented on code in PR #13348:
URL: https://github.com/apache/maven/pull/13348#discussion_r4316785336


##########
impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedConfigurationConverter.java:
##########
@@ -183,6 +189,24 @@ public void processConfiguration(
         }
     }
 
+    private static boolean isStringType(Class<?> type) {
+        return type == String.class
+                || type == CharSequence.class
+                || type == StringBuilder.class
+                || type == StringBuffer.class
+                || type == Object.class
+                || type == null;
+    }

Review Comment:
   ⚠️ **`isStringType()` is overly broad — remove `Object.class` and `type == 
null`**
   
   `Object.class` changes behavior: fields declared as `Object` would now 
return `""` for an empty XML element, which is not a string-specific semantic. 
`type == null` is likely unreachable — a `null` type would cause an NPE earlier 
in the call chain before reaching this method.
   
   ```suggestion
       private static boolean isStringType(Class<?> type) {
           return type == String.class
                   || type == CharSequence.class
                   || type == StringBuilder.class
                   || type == StringBuffer.class;
       }
   ```



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