public static Class toClass(ClassFile cf,ClassLoader loader,ProtectionDomain domain) throws CannotCompileException {
  try {
    byte[] b=toBytecode(cf);
    Method method;
    Object[] args;
    if (domain == null) {
      method=defineClass1;
      args=new Object[]{cf.getName(),b,new Integer(0),new Integer(b.length)};
    }
 else {
      method=defineClass2;
      args=new Object[]{cf.getName(),b,new Integer(0),new Integer(b.length),domain};
    }
    return toClass2(method,loader,args);
  }
 catch (  RuntimeException e) {
    throw e;
  }
catch (  java.lang.reflect.InvocationTargetException e) {
    throw new CannotCompileException(e.getTargetException());
  }
catch (  Exception e) {
    throw new CannotCompileException(e);
  }
}

public static Class toClass ( ClassFile cf , ClassLoader loader , ProtectionDomain domain ) throws CannotCompileException { try { byte [ ] b = toBytecode ( cf ) ; Method method ; Object [ ] args ; if ( domain == null ) { method = defineClass1 ; args = new Object [ ] { cf . getName ( ) , b , new Integer ( 0 ) , new Integer ( b . length ) } ; } else { method = defineClass2 ; args = new Object [ ] { cf . getName ( ) , b , new Integer ( 0 ) , new Integer ( b . length ) , domain } ; } return toClass2 ( method , loader , args ) ; } catch ( RuntimeException e ) { throw e ; } catch ( java . lang . reflect . InvocationTargetException e ) { throw new CannotCompileException ( e . getTargetException ( ) ) ; } catch ( Exception e ) { throw new CannotCompileException ( e ) ; } }
loads a class file by a given class loader .
