/** * {@link #findClass(String)} except the classloader punch-in hack. */ /*package*/ synchronized Class findClassDirect(String name) throws ClassNotFoundException { Class c = findLoadedClass(name); if(c!=null) return c; try { return super.findClass(name); } catch (NoClassDefFoundError e) { throw new ClassNotFoundException(e.getMessage()); } }
/** * {@link #findClass(String)} except the classloader punch-in hack. */ /*package*/ synchronized Class findClassDirect(String name) throws ClassNotFoundException { Class c = findLoadedClass(name); if(c!=null) return c; try { return super.findClass(name); } catch (NoClassDefFoundError e) { throw new ClassNotFoundException(e.getMessage()); } }
protected Class<?> loadClass(String name, boolean resolve, boolean followImports) throws ClassNotFoundException { // First, check if the class has already been loaded Class c = findLoadedClass(name); if (c == null) { try { if (getParent() != null) { c = getParent().loadClass(name); } } catch (ClassNotFoundException e) { } if (c == null) { c = findClass(name, followImports); } if (resolve) { resolveClass(c); } } else { if (c.getClassLoader() == this) { return c; } else throw new ClassNotFoundException(name); } return c; }
protected Class<?> loadClass(String name, boolean resolve, boolean followImports) throws ClassNotFoundException { // First, check if the class has already been loaded Class c = findLoadedClass(name); if (c == null) { try { if (getParent() != null) { c = getParent().loadClass(name); } } catch (ClassNotFoundException e) { } if (c == null) { c = findClass(name, followImports); } if (resolve) { resolveClass(c); } } else { if (c.getClassLoader() == this) { return c; } else throw new ClassNotFoundException(name); } return c; }