rombert commented on code in PR #81:
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/81#discussion_r2758104396


##########
src/main/java/org/apache/sling/models/impl/ModelConfigurationPrinter.java:
##########
@@ -54,6 +54,39 @@ public class ModelConfigurationPrinter {
         this.adapterImplementations = adapterImplementations;
     }
 
+    /**
+     * Converts an arbitrary property value to its string representation.
+     * Properly handles arrays, nulls, and various types.
+     *
+     * @param value the property value to convert (can be null, array, or any 
object)
+     * @return a string representation of the value, or "null" if value is null
+     */
+    private String propertyToString(Object value) {
+        if (value == null) {
+            return "null";
+        }
+
+        // Handle arrays
+        if (value.getClass().isArray()) {

Review Comment:
   I wonder if you can use Arrays.toString here. Then method can be drastically 
reduced to something like
   
   ```
   if ( isArray) 
     return Arrays.toString((Object[]) value);
   
   return String.valueOf(value);
   ```
   
   Otherwise LGTM.



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