kwin commented on a change in pull request #9:
URL: 
https://github.com/apache/sling-org-apache-sling-scripting-sightly-runtime/pull/9#discussion_r678285787



##########
File path: 
src/main/java/org/apache/sling/scripting/sightly/render/ObjectModel.java
##########
@@ -308,12 +306,7 @@ public static String toString(Object object) {
             Iterable<Object> iterable = (Iterable<Object>) object;
             return fromIterator(iterable.iterator());
         }
-        if (object instanceof String || object instanceof Number) {
-            Collection<Object> list = new ArrayList<>();
-            list.add(object);
-            return list;
-        }
-        return Collections.emptyList();
+        return Collections.singletonList(object);

Review comment:
       The empty list being returned before was also immutable. 




-- 
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: commits-unsubscr...@sling.apache.org

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


Reply via email to