private Class findClassPrivileged()

in src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoader.java [252:284]


    private Class<?> findClassPrivileged(final String name) throws ClassNotFoundException {

        // prepare the name of the class
        logger.debug("findClassPrivileged: Try to find path {class {}",
            name);

        final String path = this.repositoryPath + '/' + name.replace('.', '/') + (".class");

         // try defining the class, error aborts
         try {
             final byte[] data = this.findClassLoaderClass(path);
             if (data != null) {

                 logger.debug("findClassPrivileged: Loading class from {} bytes", data.length);

                 final Class<?> c = defineClass(name, data);
                 if (c == null) {
                     logger.warn("defineClass returned null for class {}", name);
                     throw new ClassNotFoundException(name);
                 }
                 return c;
             }

         } catch (final IOException ioe) {
             logger.debug("defineClass failed", ioe);
             throw new ClassNotFoundException(name, ioe);
         } catch (final Throwable t) {
             logger.debug("defineClass failed", t);
             throw new ClassNotFoundException(name, t);
         }

        throw new ClassNotFoundException(name);
     }