Build {@link Class} by name
the build opt have init class static region

@param name class full name
@return {@link Class}
@throws ReflectException
@see Class#forName(String)
167375
private static Class<?> getClassForName(String name) throws ReflectException {
        try {
            return Class.forName(name);
        } catch (Exception e) {
            throw new ReflectException(e);
        }
    }
163074
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setName(final String name) {
        pathBuilder.setName(name);
        return (T) this;
    }
863489
public static Class forName(String className, boolean initialize) {
        try {
            return Class.forName(className, initialize, getCurrentClassLoader());
        } catch (Exception e) {
            throw new SofaRpcRuntimeException(e);
        }
    }
765414
public static Class<?> classFind(String name) {
        try {
            return Class.forName(name);
        } catch (ClassNotFoundException e) {
            return findType(name).type;
        }
    }
557008
public JClass forName(String name)
  {
    SoftReference<JClass> jClassRef = _classMap.get(name);

    JClass jClass = jClassRef != null ? jClassRef.get() : null;

    if (jClass == null) {
      jClass = _staticClassMap.get(name);

      if (jClass == null) {
        if (name.startsWith("[")) {
          JClass subClass = descriptorToClass(name, 1);
          jClass = new JClassArray(subClass);
        }
        else
          jClass = loadClass(name);
      }
      
      _classMap.put(name, new SoftReference<JClass>(jClass));
    }

    return jClass;
  }
189747
public final Cache2kBuilder<K, V> name(Class<?> _class, String _fieldName) {
    if (_fieldName == null) {
      throw new NullPointerException();
    }
    config().setName(_class.getName() + "." + _fieldName);
    return this;
  }
991984
private Class loadClass(final String name) {

		ClassLoader loader = NodeExtender.getClassLoader();
		Class loadedClass  = null;

		if (loader == null) {
			loader = getClass().getClassLoader();
		}

		try {

			loadedClass = Class.forName(name, true, loader);

		} catch (Throwable ignore) {}

		if (loadedClass == null) {

			try {

				loadedClass = Class.forName(name);

			} catch (Throwable ignore) {}
		}

		return loadedClass;
	}
304077
public static Class compileClass(String name, String code, List<Class> classPath) throws Exception {
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();
        MemoryJavaFileManager fileManager = new MemoryJavaFileManager(compiler.getStandardFileManager(null, null, null));

        List<JavaFileObject> javaFileObjects = new ArrayList<JavaFileObject>();
        javaFileObjects.add(new MemoryJavaFileObject(name, code));

        File tempDir = new File(System.getProperty("java.io.tmpdir"), name);
        List<String> options = new ArrayList<String>();
        if (classPath.size() > 0) {
            options.add("-classpath");
            options.add(tempDir.getAbsolutePath());

            for (Class c : classPath) {
                String classRelativePath = c.getName().replace('.', '/') + ".class";
                URL classInputLocation = c.getResource('/' + classRelativePath);

                File outputFile = new File(tempDir, classRelativePath);
                outputFile.getParentFile().mkdirs();
                InputStream input = classInputLocation.openStream();
                FileOutputStream output = new FileOutputStream(outputFile);
                IOUtils.copy(input, output);
                input.close();
                output.close();
            }
        }

        Boolean success = compiler.getTask(null, fileManager, diagnostics, options, null, javaFileObjects).call();
        if (success) {
            return fileManager.getClassLoader(null).loadClass(name);
        } else {
            StringBuilder stringBuilder = new StringBuilder();
            for (Diagnostic diagnostic : diagnostics.getDiagnostics()) {
                stringBuilder.append(diagnostic.getMessage(null)).append("\n");
            }
            throw new Exception(stringBuilder.toString());
        }
    }
52737
public static Predicate<Class<?>> named(final String name) {
        return clazz -> clazz.getName().equals(name);
    }
66638
public static Class forName(String className) {
        try {
            return Class.forName(className);
        } catch (ClassNotFoundException e) {
            if (aliasClassMap.containsKey(className)) {
                return aliasClassMap.get(className);
            }

            throw new BeanMappingException("forName class[" + className + "] is error!", e);
        }
    }
678320
public <T> T get(Class<T> clazz, final String name)
	{
		JAXBNamedResourceFactory<T> cached = cachedReferences.get(name);

		if (cached == null)
		{
			cached = new JAXBNamedResourceFactory<T>(this.config, this.factory, name, clazz);
			cachedReferences.put(name, cached);
		}

		return cached.get();
	}
224405
public static Builder v1Builder(String name) {
        return new Builder(name, V1MarshallerSet.marshallers(), V1MarshallerSet.setMarshallers(),
                           StandardUnmarshallerSet.unmarshallers(),
                           StandardUnmarshallerSet.setUnmarshallers());
    }
800257
public static Class classForName(String name) throws ClassNotFoundException {
		try {
			return Thread.currentThread().getContextClassLoader().loadClass(name);
		}
		catch (Exception e) {
			return Class.forName(name);
		}
	}
873777
public <T extends CacheSpec<K, V>> T name(String name) {
      this.name = name;
      return Cast.as(this);
   }
247606
public Class<?> forName(final String name) throws ClassNotFoundException {
        if (System.getSecurityManager() == null)
            return Class.forName(name);
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
                @Override
                public Class<?> run() throws Exception {
                    return Class.forName(name);
                }
            }, controlContext);
        } catch (PrivilegedActionException e) {
            if (e.getException() instanceof ClassNotFoundException)
                throw (ClassNotFoundException) e.getException();
            throw (RuntimeException) e.getException();
        }
    }
159542
protected final Class findClass(final String name)
			throws ClassNotFoundException {
		try {
			if (name == null) {
				return null;
			}

			if (name.startsWith("java.") || name.startsWith("sun.reflect")) {
				return ClassLoader.getSystemClassLoader().loadClass(name);
			}

			final String searchClass = name.replace('.', '/') + ".class";
			final CThreadContext context = CThreadContext.getInstance();
			final String cpName = CClassLoader.CCLASSLOADER_NAMESPACE + name;

			List lPriorLoader = (List) context.get(cpName);

			if (lPriorLoader == null) {
				lPriorLoader = new Vector();
				context.set(cpName, lPriorLoader);
			}

			if (lPriorLoader.contains(this.toString())) {
				return null;
			}

			lPriorLoader.add(this.toString());

			if (CClassLoader.sl(CClassLoader.DEBUG)) {
				CClassLoader.log("Searching " + name + " in " + this.getPath(),
						CClassLoader.DEBUG);
			}

			final WeakReference cache = (WeakReference) this.cacheMap.get(name);
			if (cache != null) {
				final Class c = (Class) cache.get();
				if (c != null) {
					return c;
				}
			}

			// first check if this class as a mandatory loader
			if (!this.booAlone) {
				CClassLoader loader = null;

				for (final Iterator it = CClassLoader.mandatoryLoadersMap
						.entrySet().iterator(); it.hasNext();) {
					final Entry entry = (Entry) it.next();
					loader = (CClassLoader) entry.getValue();

					if (loader.classesMap.containsKey(searchClass)) {
						if (loader != this) {
							break;
						}
						loader = null;
						break;
					}
					loader = null;
				}

				if (loader != null) {
					final Class c = loader.findClass(name);
					if (c != null) {
						return c;
					}
				}
			}

			// second search in this repository
			byte buffer[] = null;

			final URL urlToResource = (URL) this.classesMap.get(searchClass);

			if (urlToResource != null) {
				buffer = CClassLoader.loadByteArray(urlToResource);
			}

			if (buffer != null) {
				if (CClassLoader.sl(CClassLoader.DEBUG)) {
					CClassLoader.log(
							"Loaded " + name + " in " + this.getPath(),
							CClassLoader.DEBUG);
				}

				Class c = null;
				c = this.findLoadedClass(name);

				if (c == null) {
					try {
						c = this.defineClass(name, buffer, 0, buffer.length);
					} catch (final LinkageError e) {
						c = this.findLoadedClass(name);

						if (c == null) {
							throw new ClassNotFoundException(name
									+ " was not found !");
						}
					}
				}

				if (c != null) {
					return c;
				}
			}

			// then search in each children
			final List tmpLoader = new ArrayList();

			for (final Iterator it = this.childrenMap.entrySet().iterator(); it
					.hasNext();) {
				final Entry entry = (Entry) it.next();
				final CClassLoader child = (CClassLoader) entry.getValue();

				if (lPriorLoader.contains(child.toString())) {
					continue;
				}

				tmpLoader.add(child);
			}

			for (final Iterator it = tmpLoader.iterator(); it.hasNext();) {
				final Object element = it.next();
				final CClassLoader child = (CClassLoader) element;
				final Class c = child.findClass(name);

				if (c != null) {
					return c;
				}
			}

			// then follow to parents
			if ((this != CClassLoader.getRootLoader())
					&& !this.booDoNotForwardToParent) {
				if (lPriorLoader.contains(this.getParent().toString())) {
					return null;
				} else {
					if (this.getParent() instanceof CClassLoader) {
						return ((CClassLoader) this.getParent())
								.findClass(name);
					} else {
						return this.getParent().loadClass(name);
					}
				}
			} else {
				try {
					ClassLoader contextLoader = CClassLoader.getContextLoader();
					if (contextLoader == null) {
						contextLoader = CClassLoader.getRootLoader()
								.getParent();
					}
					final Class c = contextLoader.loadClass(name);
					if (c != null) {
						return c;
					}
				} catch (Throwable e) {
					final Class c = CClassLoader.getRootLoader().getParent()
							.loadClass(name);
					if (c != null) {
						return c;
					}
				}
				throw new ClassNotFoundException(name);
			}
		} catch (ClassNotFoundException e) {
			throw e;
		} catch (NoClassDefFoundError e) {
			throw e;
		} catch (Throwable e) {
			throw new ClassNotFoundException(name, e);
		}
	}
1072175
@SuppressWarnings("rawtypes")
	public static Class loadClass(Class loadClass, String name)
			throws ClassNotFoundException {
		return loadClass(loadClass, name, false);
	}