Commons Lang
  1. Commons Lang
  2. LANG-637

There should be a DifferenceBuilder with a ReflectionDifferenceBuilder implementation

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor 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.

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

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development