swarajsaaj commented on a change in pull request #530:
URL: https://github.com/apache/commons-lang/pull/530#discussion_r426171315



##########
File path: src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
##########
@@ -635,6 +635,14 @@ protected void appendDetail(final StringBuffer buffer, 
final String fieldName, f
      *  {@code toString}, not {@code null}
      */
     protected void appendDetail(final StringBuffer buffer, final String 
fieldName, final Collection<?> coll) {
+        if (coll != null && !coll.isEmpty()) {
+            coll.stream().findFirst()
+                    .map(Object::getClass)
+                    .filter(Class::isEnum)

Review comment:
       This should fix the case I mentioned earlier. I guess, test cases can 
also be updated for non-enum collections, else seems good.




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

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


Reply via email to