[ 
https://issues.apache.org/jira/browse/LANG-1677?focusedWorklogId=753600&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753600
 ]

ASF GitHub Bot logged work on LANG-1677:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Apr/22 18:52
            Start Date: 06/Apr/22 18:52
    Worklog Time Spent: 10m 
      Work Description: debae commented on code in PR #838:
URL: https://github.com/apache/commons-lang/pull/838#discussion_r844287142


##########
src/test/java/org/apache/commons/lang3/builder/ReflectionDiffBuilderTest.java:
##########
@@ -48,10 +48,14 @@
         private final Object[] objectArrayField = {null};
         private static int staticField;
         private transient String transientField;
+        @DiffExclude
+        private String annotatedField = "a";
+        private String excludedField = "a";

Review Comment:
   There is already a testcase `test_transient_field_difference` that validates 
this, there is no specific or new logic for transient fields that get excluded.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 753600)
    Time Spent: 2.5h  (was: 2h 20m)

> It should be possible to exclude fields in ReflectionDiffBuilder
> ----------------------------------------------------------------
>
>                 Key: LANG-1677
>                 URL: https://issues.apache.org/jira/browse/LANG-1677
>             Project: Commons Lang
>          Issue Type: Wish
>          Components: lang.builder.*
>    Affects Versions: 3.12.0
>            Reporter: Dennis Baerten
>            Priority: Major
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> When using ReflectionDiffBuilder to make a diff between two object it will be 
> default include all fields. As stated in the documentation static and 
> transient fields are excluded.
> Using the transient modifier in combination with other frameworks ( such as 
> Hibernate ) also has a side affect that those fields are not persisted.
> The use case I'm trying to solve it making a diff of an object that get's 
> updated and has a LastModificationDate and LastModificationUser and thus will 
> always be a field in the diff.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to