static final int inheritanceLevels(Class baseclass,Class subclass){
  if (subclass == null)   return SCORE_UNCOERCIBLE;
  if (baseclass == subclass)   return 0;
  int min=Math.min(SCORE_UNCOERCIBLE,inheritanceLevels(baseclass,subclass.getSuperclass()) + 1);
  Class[] ifaces=subclass.getInterfaces();
  for (int i=0; i < ifaces.length; i++)   min=Math.min(min,inheritanceLevels(baseclass,ifaces[i]) + 1);
  return min;
}

static final int inheritanceLevels ( Class baseclass , Class subclass ) { if ( subclass == null ) return SCORE_UNCOERCIBLE ; if ( baseclass == subclass ) return 0 ; int min = Math . min ( SCORE_UNCOERCIBLE , inheritanceLevels ( baseclass , subclass . getSuperclass ( ) ) + 1 ) ; Class [ ] ifaces = subclass . getInterfaces ( ) ; for ( int i = 0 ; i < ifaces . length ; i ++ ) min = Math . min ( min , inheritanceLevels ( baseclass , ifaces [ i ] ) + 1 ) ; return min ; }
determine levels of inheritance between a base class and a subclass
