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

There should be a DifferenceBuilder with a ReflectionDifferenceBuilder implementation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.3
    • lang.builder.*
    • 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. commons-lang3-LANG-637-complete.patch
          90 kB
          Duncan Jones
        2. commons-lang3-LANG-637.patch
          66 kB
          Duncan Jones
        3. DiffList.java
          5 kB
          Duncan Jones
        4. DiffBuilder.java
          23 kB
          Duncan Jones
        5. Diffable.java
          2 kB
          Duncan Jones
        6. Diff.java
          3 kB
          Duncan Jones
        7. DiffTest.java
          2 kB
          Duncan Jones
        8. DiffListTest.java
          5 kB
          Duncan Jones
        9. DiffBuilderTest.java
          17 kB
          Duncan Jones

        Activity

          People

            dmjones500 Duncan Jones
            ericlewis Eric Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: