Class lookup by name, which also accepts primitive type names.

@param name the full name of the class
@return the class object
@throws ClassNotFoundException if the class is not found
550957
public static Class<?> classForName(String name) throws ClassNotFoundException {
        if ("void".equals(name)) return void.class;
        if ("char".equals(name)) return char.class;
        if ("boolean".equals(name)) return boolean.class;
        if ("byte".equals(name)) return byte.class;
        if ("short".equals(name)) return short.class;
        if ("int".equals(name)) return int.class;
        if ("long".equals(name)) return long.class;
        if ("float".equals(name)) return float.class;
        if ("double".equals(name)) return double.class;
        return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
    }
522631
public ClassNode getClassNode(final String name) {
        final ClassNode[] result = new ClassNode[]{null};
        PrimaryClassNodeOperation handler = new PrimaryClassNodeOperation() {
            public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) {
                if (classNode.getName().equals(name)) {
                    result[0] = classNode;
                }
            }
        };

        try {
            applyToPrimaryClassNodes(handler);
        } catch (CompilationFailedException e) {
            if (debug) e.printStackTrace();
        }
        return result[0];
    }
1194017
<T> Class<T> loadClass(String name) throws ClassNotFoundException {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (null == cl) {
            cl = ToHelper.class.getClassLoader();
        }
        return (Class<T>) cl.loadClass(name);
    }
167375
private static Class<?> getClassForName(String name) throws ReflectException {
        try {
            return Class.forName(name);
        } catch (Exception e) {
            throw new ReflectException(e);
        }
    }
1336967
private static Class<?> lookupClass(String elementName) {

        Class<?> clazz = null;
        try {
            clazz = ClassLoaderUtils.getClassLoader().loadClass(elementName);
        } catch (ClassNotFoundException e) {
            return null;
        }

        return clazz;
    }
192293
public ClassNode getFromClassCache(String name) {
        // We use here the class cache cachedClasses to prevent
        // calls to ClassLoader#loadClass. Disabling this cache will
        // cause a major performance hit.
        ClassNode cached = cachedClasses.get(name);
        return cached;
    }
842234
public static Class<?> toClass(final String name) {
		try {
			return Class.forName(name);
		} catch (final ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
	}
237991
public Class<?> lookupType(String name) throws ClassNotFoundException {
        if (name == null) {
            throw new IllegalArgumentException("name must not be null");
        }
        Class<?> type = typeRenames.get(name);
        if (type == null) {
            type = StringConvert.loadType(name);
        }
        return type;
    }
684616
protected Class findClass(String name) throws ClassNotFoundException {
        if (delegatationLoader==null) return super.findClass(name);
        return delegatationLoader.loadClass(name);
    }
1268403
public Class getClassByName(String name)
	{

		if (name.indexOf(".") != -1)
		{
			try
			{
				return Class.forName(name,true,gt.getClassLoader());
			}
			catch (ClassNotFoundException e)
			{
				return null;
			}

		}
		else
		{
			Class cls = map.get(name);
			if (cls == null)
			{
				for (String pkg : pkgList)
				{
					try
					{
						String clsName = pkg.concat(name);
						cls = Class.forName(clsName,true,gt.getClassLoader());
						map.put(name, cls);
						return cls;

					}
					catch (Exception ex)
					{
						// continue;
					}
				}
				return null;
			}
			else
			{
				return cls;
			}

		}

	}
668226
protected ClassEntry getClassEntry(String name, String pathName)
    throws ClassNotFoundException
  {
    // Find the path corresponding to the class
    Path path = getPath(pathName);

    if (path != null && path.length() > 0) {
      return new ClassEntry(_loader, name, path, path,
                            getCodeSource(path));
    }
    else
      return null;
  }
146946
@Override
  public Class<?> classForName(final String name) throws ClassNotFoundException {
    return ReflectionUtilities.classForName(name, loader);
  }
1298568
protected final Class loadClass(final String name, final boolean resolve)
			throws ClassNotFoundException {
		final CThreadContext context = CThreadContext.getInstance();
		try {
			Class c = null;
			final WeakReference cache = (WeakReference) this.cacheMap.get(name);
			if (cache != null) {
				c = (Class) cache.get();
			}

			if (c == null) {
				// First, check if the class has already been loaded
				c = this.findLoadedClass(name);
				if (c == null) {
					c = this.findClass(name);
					this.cacheMap.put(name, new WeakReference(c));
				}
			}
			if (resolve) {
				this.resolveClass(c);
			}

			return c;
		} finally {
			context.set(CClassLoader.CCLASSLOADER_NAMESPACE + name, null);
			try {

			} catch (final Exception ignore) {
			}
		}
	}
82190
public Class<?> getClassForName(String className) {
        if (!StringUtils.hasText(className)) {
            return null;
        }

        for (Class<?> c : allClasses) {
            if (c.getName().equals(className)) {
                return c;
            }
        }
        return null;
    }
770286
public TemplateClass getByClassName(String name) {
        TemplateClass tc = clsNameIdx.get(name);
        checkUpdate(tc);
        return tc;
    }
595050
public static Class<?> getClass(final String className) throws ClassNotFoundException {
        
        final ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
        final ClassLoader loader = 
            (contextCL == null ? Utils.class.getClassLoader() : contextCL);
        
        if (primitiveClassAbbrevs.containsKey(className)) {
            final String clsName = "[" + primitiveClassAbbrevs.get(className);
            return Class.forName(clsName, true, loader).getComponentType();
        }
        return Class.forName(getClassCanonicalName(className), true, loader);

    }
185087
public static Class<?> loadPrimitiveClass(String name) {
		Class<?> result = null;
		if (StrUtil.isNotBlank(name)) {
			name = name.trim();
			if (name.length() <= 8) {
				result = primitiveTypeNameMap.get(name);
			}
		}
		return result;
	}