Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      I have modified reflectionEquals. The new signature adds the ability to exclude
      a list of fields from testing.

      reflectionEquals(Object lhs, Object rhs, String[] excludeFields)

      This is useful when the occasional field is to be excluded when many fields need
      to be tested. The alternative is to hard-code each field in the equals method
      and hope that if an additional field is added, the equals method is updated.

        Activity

        Pete Gieser created issue -
        Hide
        Pete Gieser added a comment -

        Created an attachment (id=18101)
        Add new reflectionEquals signatures

        Show
        Pete Gieser added a comment - Created an attachment (id=18101) Add new reflectionEquals signatures
        Hide
        Pete Gieser added a comment -

        Created an attachment (id=18102)
        junit test for new reflectionEquals behavior

        Show
        Pete Gieser added a comment - Created an attachment (id=18102) junit test for new reflectionEquals behavior
        Hide
        Pete Gieser added a comment -

        Created an attachment (id=18139)
        New reflectionHashCode signature with excludeFields

        Corresponding reflectionHashCode signature

        Show
        Pete Gieser added a comment - Created an attachment (id=18139) New reflectionHashCode signature with excludeFields Corresponding reflectionHashCode signature
        Hide
        Pete Gieser added a comment -

        Created an attachment (id=18140)
        junit test for new reflectionHashCode behavior

        Show
        Pete Gieser added a comment - Created an attachment (id=18140) junit test for new reflectionHashCode behavior
        Hide
        Henri Yandell added a comment -

        Valueable addition, and perusing the diffs I can't see anything wrong with
        Pete's code.

        svn ci -m "Adding new excludeFields functionality for EqualsBuilder and
        HashCodeBuilder, as submitted by Pete Gieser, Bugzilla: #39315"
        Sending src/java/org/apache/commons/lang/builder/EqualsBuilder.java
        Sending src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
        Sending src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
        Sending src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java
        Transmitting file data ....
        Committed revision 396461.

        Show
        Henri Yandell added a comment - Valueable addition, and perusing the diffs I can't see anything wrong with Pete's code. svn ci -m "Adding new excludeFields functionality for EqualsBuilder and HashCodeBuilder, as submitted by Pete Gieser, Bugzilla: #39315" Sending src/java/org/apache/commons/lang/builder/EqualsBuilder.java Sending src/java/org/apache/commons/lang/builder/HashCodeBuilder.java Sending src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java Sending src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java Transmitting file data .... Committed revision 396461.
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 39315 12343026
        Henri Yandell made changes -
        Affects Version/s unspecified [ 12311647 ]
        Component/s Lang [ 12311121 ]
        Fix Version/s 2.2 [ 12311686 ]
        Project Commons [ 12310458 ] Commons Lang [ 12310481 ]
        Key COM-2874 LANG-198
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Henri Yandell made changes -
        Fix Version/s 2.2 [ 12311702 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12371931 ] Default workflow, editable Closed status [ 12602375 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        297d 22h 54m 1 Henri Yandell 06/Feb/07 23:47

          People

          • Assignee:
            Unassigned
            Reporter:
            Pete Gieser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development