private static boolean isAncestor(ClassLoader first,ClassLoader second){
  ClassLoader acl=first;
  do {
    acl=acl.getParent();
    if (second == acl) {
      return true;
    }
  }
 while (acl != null);
  return false;
}

private static boolean isAncestor ( ClassLoader first , ClassLoader second ) { ClassLoader acl = first ; do { acl = acl . getParent ( ) ; if ( second == acl ) { return true ; } } while ( acl != null ) ; return false ; }
returns true if the second classloader can be found in the first classloader ' s delegation chain . equivalent to the inaccessible : first . isancestor ( second ) .
