public Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  int i=name.lastIndexOf('.');
  if (i != -1) {
    SecurityManager sm=System.getSecurityManager();
    if (sm != null) {
      sm.checkPackageAccess(name.substring(0,i));
    }
  }
  if (ucp.knownToNotExist(name)) {
    Class<?> c=findLoadedClass(name);
    if (c != null) {
      if (resolve) {
        resolveClass(c);
      }
      return c;
    }
    throw new ClassNotFoundException(name);
  }
  return (super.loadClass(name,resolve));
}

public Class < ? > loadClass ( String name , boolean resolve ) throws ClassNotFoundException { int i = name . lastIndexOf ( '.' ) ; if ( i != - 1 ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPackageAccess ( name . substring ( 0 , i ) ) ; } } if ( ucp . knownToNotExist ( name ) ) { Class < ? > c = findLoadedClass ( name ) ; if ( c != null ) { if ( resolve ) { resolveClass ( c ) ; } return c ; } throw new ClassNotFoundException ( name ) ; } return ( super . loadClass ( name , resolve ) ) ; }
override loadclass so we can checkpackageaccess .
