@Override public Class<?> findClass(String className) throws ClassNotFoundException {
  final boolean DBG=false;
  if (!VM.runningVM) {
    return super.findClass(className);
  }
  if (className.startsWith("[")) {
    TypeReference typeRef=TypeReference.findOrCreate(this,Atom.findOrCreateAsciiAtom(className.replace('.','/')));
    RVMType ans=typeRef.resolve();
    loaded.put(className,ans);
    return ans.getClassForType();
  }
 else {
    if (!VM.fullyBooted) {
      VM.sysWrite("Trying to load a class (");
      VM.sysWrite(className);
      VM.sysWrite(") too early in the booting process, before dynamic");
      VM.sysWriteln(" class loading is enabled; aborting.");
      VM.sysFail("Trying to load a class too early in the booting process");
    }
    try {
      if (className.startsWith("L") && className.endsWith(";")) {
        className=className.substring(1,className.length() - 2);
      }
      InputStream is=getResourceAsStream(className.replace('.',File.separatorChar) + ".class");
      if (is == null)       throw new ClassNotFoundException(className);
      DataInputStream dataInputStream=new DataInputStream(is);
      Class<?> cls=null;
      try {
        RVMType type=RVMClassLoader.defineClassInternal(className,dataInputStream,this);
        loaded.put(className,type);
        cls=type.getClassForType();
      }
  finally {
        try {
          dataInputStream.close();
        }
 catch (        IOException e) {
        }
      }
      return cls;
    }
 catch (    ClassNotFoundException e) {
      throw e;
    }
catch (    Throwable e) {
      if (DBG) {
        VM.sysWrite("About to throw ClassNotFoundException(",className,") because we got this Throwable:");
        e.printStackTrace();
      }
      throw new ClassNotFoundException(className,e);
    }
  }
}

@ Override public Class < ? > findClass ( String className ) throws ClassNotFoundException { final boolean DBG = false ; if ( ! VM . runningVM ) { return super . findClass ( className ) ; } if ( className . startsWith ( "[" ) ) { TypeReference typeRef = TypeReference . findOrCreate ( this , Atom . findOrCreateAsciiAtom ( className . replace ( '.' , '/' ) ) ) ; RVMType ans = typeRef . resolve ( ) ; loaded . put ( className , ans ) ; return ans . getClassForType ( ) ; } else { if ( ! VM . fullyBooted ) { VM . sysWrite ( "Trying to load a class (" ) ; VM . sysWrite ( className ) ; VM . sysWrite ( ") too early in the booting process, before dynamic" ) ; VM . sysWriteln ( " class loading is enabled; aborting." ) ; VM . sysFail ( "Trying to load a class too early in the booting process" ) ; } try { if ( className . startsWith ( "L" ) && className . endsWith ( ";" ) ) { className = className . substring ( 1 , className . length ( ) - 2 ) ; } InputStream is = getResourceAsStream ( className . replace ( '.' , File . separatorChar ) + ".class" ) ; if ( is == null ) throw new ClassNotFoundException ( className ) ; DataInputStream dataInputStream = new DataInputStream ( is ) ; Class < ? > cls = null ; try { RVMType type = RVMClassLoader . defineClassInternal ( className , dataInputStream , this ) ; loaded . put ( className , type ) ; cls = type . getClassForType ( ) ; } finally { try { dataInputStream . close ( ) ; } catch ( IOException e ) { } } return cls ; } catch ( ClassNotFoundException e ) { throw e ; } catch ( Throwable e ) { if ( DBG ) { VM . sysWrite ( "About to throw ClassNotFoundException(" , className , ") because we got this Throwable:" ) ; e . printStackTrace ( ) ; } throw new ClassNotFoundException ( className , e ) ; } } }
search the bootstrap class loader ' s classpath for given class .
