You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/09/17 00:26:13 UTC

[GitHub] [commons-lang] tisonkun commented on a diff in pull request #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type

tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r973514708


##########
src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java:
##########
@@ -110,8 +110,9 @@ private void appendFields(final Class<?> clazz) {
         for (final Field field : FieldUtils.getAllFields(clazz)) {
             if (accept(field)) {
                 try {
-                    diffBuilder.append(field.getName(), readField(field, left, true),
-                            readField(field, right, true));
+                    Object leftObject = readField(field, left, true);

Review Comment:
   Please read the description:
   
   > There's a case as shown in `ReflectionDiffBuilder.java` that if the type inference results in ambiguity, it may cause compile error.



-- 
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: issues-unsubscribe@commons.apache.org

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