Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-637

There should be a DifferenceBuilder with a ReflectionDifferenceBuilder implementation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: lang.builder.*
    • Labels:
      None

      Description

      The ToStringBuilder and ReflectionToStringBuilder are great tools for everyday development.
      We use them to show all the properties in an object, which comes handy especially for testing.

      However, JUnit with its assertEquals() just outputs the toString() of the two compared objects. For complex objects, this becomes unreadable.

      So, it would be great to have a DifferenceBuilder with a ReflectionDifferenceBuilder implementation to be able to get only the differing properties of two objects. The question is whether the two objects would have to be of the same type or not.

        Attachments

        1. DiffBuilderTest.java
          17 kB
          Duncan Jones
        2. DiffListTest.java
          5 kB
          Duncan Jones
        3. DiffTest.java
          2 kB
          Duncan Jones
        4. Diff.java
          3 kB
          Duncan Jones
        5. Diffable.java
          2 kB
          Duncan Jones
        6. DiffBuilder.java
          23 kB
          Duncan Jones
        7. DiffList.java
          5 kB
          Duncan Jones
        8. commons-lang3-LANG-637.patch
          66 kB
          Duncan Jones
        9. commons-lang3-LANG-637-complete.patch
          90 kB
          Duncan Jones

          Activity

            People

            • Assignee:
              dmjones500 Duncan Jones
              Reporter:
              ericlewis Eric Lewis
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: