code: protected Class resolveProxyClass(String[] interfaces) throws IOException,
  			ClassNotFoundException {
  		if (interfaces.length == 0) {
  			throw new ClassNotFoundException("zero-length interfaces array");
  		}
  
  		Class nonPublicClass = null;
  
  		Class[] classes = new Class[interfaces.length];
  		for (int i = 0; i < interfaces.length; i++) {
  			classes[i] = resolveClass(interfaces[i]);
  
  			if ((classes[i].getModifiers() & Modifier.PUBLIC) == 0) {
  				// "if more than one non-public interface class loader is
  				// encountered, an IllegalAccessError is thrown"
  				if (nonPublicClass != null) {
  					throw new IllegalAccessError(nonPublicClass + " and "
  							+ classes[i] + " both declared non-public");
  				}
  
  				nonPublicClass = classes[i];
  			}
  		}
  
  		// The javadocs for this method say:
  		//
  		// "Unless any of the resolved interfaces are non-public, this same
  		// value of loader is also the class loader passed to
  		// Proxy.getProxyClass; if non-public interfaces are present, their
  		// class loader is passed instead"
  		//
  		// Unfortunately, we don't have a single classloader that we can use.
  		// Call getClassLoader() on either the non-public class (if any) or the
  		// first class.
  		proxyClass = nonPublicClass != null ? nonPublicClass : classes[0];
  		ClassLoader loader = (ClassLoader) AccessController
  				.doPrivileged(proxyClassLoaderAction);
  
  		// "If Proxy.getProxyClass throws an IllegalArgumentException,
  		// resolveProxyClass will throw a ClassNotFoundException containing the
  		// IllegalArgumentException."
  		try {
  			return Proxy.getProxyClass(loader, classes);
  		} catch (IllegalArgumentException ex) {
  			throw new ClassNotFoundException(ex.getMessage(), ex);
  		}
  	}
docs: begin PK29198