protected Class<?> resolveClass(String name) throws ClassNotFoundException {
        // ClassLoader.loadClass is not guaranteed to support array classes:
        // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4976356
        // ...so we must handle them ourselves.
        if (name.length() > 0 && name.charAt(0) == '[') {
            int numComponents = 0;
            do {
                numComponents++;
                if (numComponents == name.length()) {
                    throw new ClassNotFoundException(name);
                }
            } while (name.charAt(numComponents) == '[');

            if (name.charAt(numComponents) != 'L') {
                // Primitive array class expected.
                return resolveClassWithCL(name);
            }

            if (name.charAt(name.length() - 1) != ';') {
                // Unexpected erroneous class name.
                throw new ClassNotFoundException(name);
            }

            if (name.regionMatches(numComponents + 1, "java.", 0, 5)) {
                // Path for "java." classes.
                return resolveClassWithCL(name);
            }

            // Load the actual class, and then use that class' loader to load
            // the desired array class.
            String className = name.substring(numComponents + 1, name.length() - 1);
            Class<?> klass = loadClass(className);
            return Class.forName(name, false, getClassLoader(klass));
        }

        if (name.startsWith("java.")) {
            // Path for "java." classes.
            return resolveClassWithCL(name);
        }

        return loadClass(name);
    }
protected Class < ? > resolveClass ( String name ) throws ClassNotFoundException { if ( name . length ( ) > 0 && name . charAt ( 0 ) == '[' ) { int numComponents = 0 ; do { numComponents ++ ; if ( numComponents == name . length ( ) ) { throw new ClassNotFoundException ( name ) ; } } while ( name . charAt ( numComponents ) == '[' ) ; if ( name . charAt ( numComponents ) != 'L' ) { return resolveClassWithCL ( name ) ; } if ( name . charAt ( name . length ( ) - 1 ) != ';' ) { throw new ClassNotFoundException ( name ) ; } if ( name . regionMatches ( numComponents + 1 , "java." , 0 , 5 ) ) { return resolveClassWithCL ( name ) ; } String className = name . substring ( numComponents + 1 , name . length ( ) - 1 ) ; Class < ? > klass = loadClass ( className ) ; return Class . forName ( name , false , getClassLoader ( klass ) ) ; } if ( name . startsWith ( "java." ) ) { return resolveClassWithCL ( name ) ; } return loadClass ( name ) ; }
Resolves array class names ("[B" or "[Ljava.lang.Object;"), delegating
to {@link #loadClass} to load non-array or non-primitive array classes.