[GitHub] [commons-lang] TranNgocKhoa commented on a change in pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-06-01 Thread GitBox


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



##
File path: src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java
##
@@ -16,10 +16,10 @@
  */
 package org.apache.commons.lang3.builder;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;

Review comment:
   @XenoAmess fixed, thank you!





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




[GitHub] [commons-lang] TranNgocKhoa commented on a change in pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-31 Thread GitBox


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



##
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:
   @swarajsaaj, I added test case for it





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




[GitHub] [commons-lang] TranNgocKhoa commented on a change in pull request #530: LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format for List

2020-05-16 Thread GitBox


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



##
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:
   @garydgregory @swarajsaaj I added some code following your comments. 
Please take a look. Thank you!





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