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/16 23:57:27 UTC

[GitHub] [commons-lang] tisonkun opened a new pull request, #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type

tisonkun opened a new pull request, #951:
URL: https://github.com/apache/commons-lang/pull/951

   This patch should be easy to understand.
   
   Generally, it won't affect user cases as long as the type can be inferred by the recipient or JDK rules. There's a case as shown in `ReflectionDiffBuilder.java` that if the type inference results in ambiguity, it may cause compile error.
   
   Thus, I'm unsure whether this is proper to be included with a minor version bump. I don't think to add another series of methods helps - it causes further confusion.


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r979191073


##########
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java:
##########
@@ -254,23 +254,23 @@ public static List<Field> getFieldsListWithAnnotation(final Class<?> cls, final
     /**
      * Reads an accessible {@code static} {@link Field}.
      *
-     * @param field

Review Comment:
   Reverting...



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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r976556073


##########
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:
   @tisonkun 
   I still don't get it, why is this needed in this PR as it relates to the generics change?



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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1249958768

   I may write something like:
   
   ```diff
   diff --git a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
   index b68a994f3..dcecbca06 100644
   --- a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
   +++ b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
   @@ -480,7 +480,8 @@ public void testReadDeclaredNamedStaticFieldForceAccess() throws Exception {
        @Test
        public void testReadField() throws Exception {
            final Field parentS = FieldUtils.getDeclaredField(parentClass, "s");
   -        assertEquals("s", FieldUtils.readField(parentS, publicChild));
   +        String s = FieldUtils.readField(parentS, publicChild);
   +        assertEquals("s", s);
            assertEquals("s", FieldUtils.readField(parentS, publiclyShadowedChild));
            assertEquals("s", FieldUtils.readField(parentS, privatelyShadowedChild));
            final Field parentB = FieldUtils.getDeclaredField(parentClass, "b", true);
   ```
   
   to prove this change works. But it seems useless.


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r979191525


##########
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java:
##########
@@ -254,23 +254,23 @@ public static List<Field> getFieldsListWithAnnotation(final Class<?> cls, final
     /**
      * Reads an accessible {@code static} {@link Field}.
      *
-     * @param field

Review Comment:
   Oops. I think I should add the `@param <T>` line so adjusting neighbor lines should be OK. Said you're updating the comments, and adjusting a bit the layout should not be a big deal. I don't touch unrelated comments.



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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1250053523

   You need to think about how to avoid regressions in case the change is reverted. IOW, in this case, you should get a compilation 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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r990638585


##########
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:
   Reverted at bc4e02229407a80b1315c8c5f00cad859724aa4e.
   
   Now the compilation failed: https://github.com/apache/commons-lang/actions/runs/3210472599/jobs/5247938888.



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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1272297305

   I'll take a look this weekend...


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r990639185


##########
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:
   > Does that mean that existing call sites in users' applications will also fail?
   
   I already wrote it in the PR description. Please read 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.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-lang] tisonkun closed pull request #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type

Posted by GitBox <gi...@apache.org>.
tisonkun closed pull request #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type
URL: https://github.com/apache/commons-lang/pull/951


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1252289567

   @garydgregory Thanks for your comments. Will push a followup later this week.


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1249957756

   > This PR has no matching tests.
   
   Please read the description:
   
   > * it won't affect user cases as long as the type can be inferred by the recipient or JDK rules
   > * This patch doesn't cause extra class cast exception ...
   
   No existing tests break is fine. I don't know how to add a new effective test.


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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r975248075


##########
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java:
##########
@@ -254,23 +254,23 @@ public static List<Field> getFieldsListWithAnnotation(final Class<?> cls, final
     /**
      * Reads an accessible {@code static} {@link Field}.
      *
-     * @param field

Review Comment:
   In general, please keep cosmetic and stylistic changes out of PRs, it makes PRs noisier, and takes longer to review.



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


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

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1249944308

   # [Codecov](https://codecov.io/gh/apache/commons-lang/pull/951?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#951](https://codecov.io/gh/apache/commons-lang/pull/951?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1720f16) into [master](https://codecov.io/gh/apache/commons-lang/commit/e81855a208c909f46e1bf346d7982bd77be13476?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e81855a) will **increase** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #951   +/-   ##
   =========================================
     Coverage     91.98%   91.98%           
     Complexity     7423     7423           
   =========================================
     Files           189      189           
     Lines         15666    15667    +1     
     Branches       2913     2913           
   =========================================
   + Hits          14411    14412    +1     
     Misses          677      677           
     Partials        578      578           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/commons-lang/pull/951?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/commons/lang3/builder/ReflectionDiffBuilder.java](https://codecov.io/gh/apache/commons-lang/pull/951/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvYnVpbGRlci9SZWZsZWN0aW9uRGlmZkJ1aWxkZXIuamF2YQ==) | `91.30% <100.00%> (+0.39%)` | :arrow_up: |
   | [...a/org/apache/commons/lang3/reflect/FieldUtils.java](https://codecov.io/gh/apache/commons-lang/pull/951/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvcmVmbGVjdC9GaWVsZFV0aWxzLmphdmE=) | `93.33% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r979195492


##########
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:
   <img width="1056" alt="image" src="https://user-images.githubusercontent.com/18818196/192087964-342f0e2d-57ab-4d45-8ade-51aa183c1482.png">
   



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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r979196665


##########
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:
   ```
   [INFO] -------------------------------------------------------------
   [ERROR] COMPILATION ERROR : 
   [INFO] -------------------------------------------------------------
   [ERROR] /Users/chenzili/Brittani/commons-lang/src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java:[113,32] reference to append is ambiguous
     both method append(java.lang.String,short[],short[]) in org.apache.commons.lang3.builder.DiffBuilder and method append(java.lang.String,java.lang.Object[],java.lang.Object[]) in org.apache.commons.lang3.builder.DiffBuilder match
   ```



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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1256904897

   Tests added.


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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r990638932


##########
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:
   If you think it breaks the existing code and should not do it, you can reject the PR. But I'm a bit confused since reverting it obviously causes compile to fail.



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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1272292034

   @garydgregory is there any remaining blocker for this patch?


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


[GitHub] [commons-lang] garydgregory closed pull request #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type

Posted by GitBox <gi...@apache.org>.
garydgregory closed pull request #951: [LANG-1692] Cast FieldUtils.readField result to the recipient type
URL: https://github.com/apache/commons-lang/pull/951


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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r973514167


##########
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:
   Is this change needed for the type changes? Please revert it otherwise.



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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r990637662


##########
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:
   Revert this change, please.



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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #951:
URL: https://github.com/apache/commons-lang/pull/951#discussion_r990638900


##########
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:
   Does that mean that existing call sites in users' applications will also fail?



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


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

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1318434810

   Closed as no response. I'll add wrappers for this changes downstream when necessary.


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


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

Posted by GitBox <gi...@apache.org>.
garydgregory commented on PR #951:
URL: https://github.com/apache/commons-lang/pull/951#issuecomment-1249956745

   This PR has no matching tests.


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