You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Daneel S. Yaitskov (JIRA)" <ji...@apache.org> on 2012/12/23 19:42:12 UTC

[jira] [Created] (LANG-863) Method returns number of inheritance hops between parent and subclass

Daneel S. Yaitskov created LANG-863:
---------------------------------------

             Summary: Method returns number of inheritance hops between parent and subclass
                 Key: LANG-863
                 URL: https://issues.apache.org/jira/browse/LANG-863
             Project: Commons Lang
          Issue Type: New Feature
          Components: lang.reflect.*
            Reporter: Daneel S. Yaitskov
             Fix For: 4.0


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);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira