pluginPackage = DEFAULT_PACKAGE; pluginWithoutPackage = false;
            public Class<?> loadClass(String className) throws ClassNotFoundException {                if ((pluginWithoutPackage && className.contains("."))                     || (!pluginWithoutPackage && !className.startsWith(pluginPackage))) {                	return getParent().loadClass(className);                } 				String currentClassName = className;             	String classLocation = "/" + className.replace('.','/') + ".class";                URL url = getClass().getResource(classLocation);                                if (url == null && pluginWithoutPackage) {                	// it could be in the default plugin package                	url = getClass().getResource("/" + DEFAULT_PACKAGE.replace('.','/') + classLocation);                }								if (url == null) {					// possibly short hand name?					String simpleClassName;					String packageName;					if (pluginWithoutPackage) {						simpleClassName = className;						packageName = "";					} else {						simpleClassName = className.substring(className.lastIndexOf('.')+1);						packageName =  className.substring(0, className.lastIndexOf('.'));											}					className = packageName + simpleClassName.substring(0, 1).toUpperCase() +								simpleClassName.substring(1) + "Plugin";	            	classLocation = "/" + className.replace('.','/') + ".class";	                url = getClass().getResource(classLocation);	                	                if (url == null && pluginWithoutPackage) {	                	// it could be in the default plugin package	                	url = getClass().getResource("/" + DEFAULT_PACKAGE.replace('.','/') + classLocation);	                	className = DEFAULT_PACKAGE + "." + className;	                }				}				if (url == null) {                	throw new ClassNotFoundException("Cannot find class "                        + currentClassName + ".");									}                try {                    InputStream is = url.openStream();                    byte[] data = new byte[10240];                    int length;                    int total = 0;                    while ((length = is.read(data, total, data.length-total)) != -1) {                        total += length;                        byte[] tmp = new byte[data.length*2];                        System.arraycopy(data, 0, tmp, 0, data.length);                        data = tmp;                    }                    Class<?> c = defineClass(className, data, 0, total);                    return c;                } catch (IOException ioe) {                    ioe.printStackTrace();                }            	throw new ClassNotFoundException("Cannot find class "                    + className + ".");		            }