Finds a descriptor from a collection by the class name of the {@link Describable} it describes.
@param className should match {@link Class#getName} of a {@link #clazz}
@since 1.610
776648
public static @CheckForNull <T extends Descriptor> T findByDescribableClassName(Collection<? extends T> list, String className) {
        for (T d : list) {
            if(d.clazz.getName().equals(className))
                return d;
        }
        return null;
    }
304502
public static String getClassName(EnumDescriptor descriptor, ProtoFlavor flavor) {
    return getClassName(classNameWithoutPackage(descriptor, flavor), descriptor.getFile(), flavor);
  }
1125377
public Class<?> getClassByName(String name) throws ClassNotFoundException {
		Class<?> ret = getClassByNameOrNull(name);
		if (ret == null) {
			throw new ClassNotFoundException("Class " + name + " not found");
		}
		return ret;
	}
209286
public static Class<?> classForName(String name) throws ClassNotFoundException {
		
		ClassLoader cl = getClassLoader();
		try {
			if (cl != null) {
				return cl.loadClass(name);
			}
		} catch (ClassNotFoundException e) {
			// Ignore and try using Class.forName()
		}
		return Class.forName(name);
	}
1200567
public boolean isApplicationClass(@DottedClassName String className) {
        // try {
        // JavaClass javaClass = lookupClass(className);
        // return isApplicationClass(javaClass);
        // } catch (ClassNotFoundException e) {
        // AnalysisContext.reportMissingClass(e);
        // return false;
        // }
        ClassDescriptor classDesc = DescriptorFactory.createClassDescriptorFromDottedClassName(className);
        return getSubtypes2().isApplicationClass(classDesc);
    }
765414
public static Class<?> classFind(String name) {
        try {
            return Class.forName(name);
        } catch (ClassNotFoundException e) {
            return findType(name).type;
        }
    }
277207
@Deprecated
    public Class<?> getClassFromCollection(final String collection) {
        final Set<MappedClass> mcs = mappedClassesByCollection.get(collection);
        if (mcs == null || mcs.isEmpty()) {
            throw new MappingException(format("The collection '%s' is not mapped to a java class.", collection));
        }
        if (mcs.size() > 1) {
            if (LOG.isInfoEnabled()) {
                LOG.info(format("Found more than one class mapped to collection '%s'%s", collection, mcs));
            }
        }
        return mcs.iterator().next().getClazz();
    }
446810
@Override
    protected void findReferencedClassNames(final Set<String> classNames) {
        final TypeSignature methodSig = getTypeSignature();
        if (methodSig != null) {
            methodSig.findReferencedClassNames(classNames);
        }
        final TypeSignature methodDesc = getTypeDescriptor();
        if (methodDesc != null) {
            methodDesc.findReferencedClassNames(classNames);
        }
        if (annotationInfo != null) {
            for (final AnnotationInfo ai : annotationInfo) {
                ai.findReferencedClassNames(classNames);
            }
        }
    }
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;
    }
969088
@Override
    @FFDCIgnore(ClassNotFoundException.class)
    public Class<?> classForName(String className)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            Tr.debug(tc, "Loading class " + className + " using classloader " + delegate);
        }
        try
        {
            return delegate.loadClass(className);
        } catch (ClassNotFoundException e)
        {
            return loadFromWeldBundleCL(className);
        }
    }
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);
		}
	}
999313
def get_collection_for_cls_name(self, cls_name):
        
        for cls in self.classes:
            if cls.__name__ == cls_name:
                return self.classes[cls]['collection']
        raise AttributeError("Unknown class name: %s" % cls_name)
232890
public static Object getClassForName(String className) {
        Object object = null;
        try {
            Class classDefinition = Class.forName(className);
            object = classDefinition.newInstance();
        } catch (ClassNotFoundException e) {
            if (log.isEnabledFor(Level.ERROR)) {
                log.error("ClassNotFoundException", e);
            }
        } catch (InstantiationException e) {
            if (log.isEnabledFor(Level.ERROR)) {
                log.error("InstantiationException " + e.getMessage(), e);
            }
        } catch (IllegalAccessException e) {
            if (log.isEnabledFor(Level.ERROR)) {
                log.error("IllegalAccessException", e);
            }
        }
        return object;
    }
407458
@Override
    public Object find(Class clazz, Object key)
    {
        s = getStatelessSession();

        Object result = null;
        try
        {
            result = s.get(clazz, (Serializable) key);
        }
        catch (ClassCastException ccex)
        {
            log.error("Class can not be serializable, Caused by {}.", ccex);
            throw new KunderaException(ccex);
        }
        catch (Exception e)
        {
            log.error("Error while finding, Caused by {}. ", e);
            throw new KunderaException(e);
        }
        return result;

    }
305323
public static Class<?> findClassFromClassLoaders(final String className, final Iterable<ClassLoader> classLoaders)
        throws ClassNotFoundException, IllegalArgumentException {
        // Delegate
        return ClassLoaderSearchUtil.findClassFromClassLoaders(className, classLoaders);
    }
128344
private boolean isCollection(@SlashedClassName String className) {
        try {
            JavaClass cls = Repository.lookupClass(className);
            return cls.implementationOf(collectionClass) && !exceptionClasses.contains(cls);
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
            return false;
        }
    }
343424
public static Class getClassByName(String clsName,ClassLoader loader)
	{
		try
		{
			return Class.forName(clsName,true,loader);
		}

		catch (ClassNotFoundException e)
		{
			throw new RuntimeException(e);
		}
	}