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

Equals transitivity is violated in EqualsBuilder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.9
    • None
    • lang.builder.*
    • Ubuntu 18.04

      JDK 1.8.0_221

      Commons Lang 3.9-RC2

      JUnit 5.4

    Description

      EqualsBuilder.reflectionEquals() does not hold transitivity when comparing two subclasses extending a common superclass. For example:

      Given that both class D and E are subclasses of class C, C == D and C == E should imply D == E. However EqualsBuilder.reflectionEquals(D, E) returns false when both EqualsBuilder.reflectionEquals(C, D) and EqualsBuilder.reflectionEquals(C, E) return true.

      A junit test is provided as attachment.

      Attachments

        1. EqualsTransitivityTest.java
          1 kB
          Zhiqiang Zang
        2. EqualTransitivityTest2.java
          1 kB
          Miguel Munoz

        Activity

          People

            Unassigned Unassigned
            Cap_JR Zhiqiang Zang
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: