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

Method returns number of inheritance hops between parent and subclass

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2
    • lang.reflect.*
    • None

    Description

      For example.

      class A {
      }
      class B extends A {
      }
      class C extends B {
      }

      int d;
      d = InheritanceUtils.distance(A.class, A.class);
      Assert.assertEquals(0, d);
      d = InheritanceUtils.distance(B.class, A.class);
      Assert.assertEquals(1, d);
      d = InheritanceUtils.distance(C.class, A.class);
      Assert.assertEquals(2, d);

      Attachments

        1. LANG-863.patch
          9 kB
          J. Taylor Mayfield
        2. LANG-863.patch
          8 kB
          J. Taylor Mayfield

        Activity

          People

            Unassigned Unassigned
            d.yaitskov Daneel S. Yaitskov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified