Returns an <code>XClass</code> object for the given <code>ClassDescriptor</code> object.

@param classDesc
the class descriptor for which to find the XClass object
@return the class
@throws AssertionError
if the analysis of the class failed
486772
public static XClass getXClass(final ClassDescriptor classDesc) throws AssertionError {
        try {
            return Global.getAnalysisCache().getClassAnalysis(XClass.class, classDesc);
        } catch (CheckedAnalysisException e) {
            AssertionError ae = new AssertionError("Can't find ClassInfo for " + classDesc);
            ae.initCause(e);
            throw (ae);
        }
    }
1131527
private ClassDescriptor getClassDescriptor(int index) throws InvalidClassFileFormatException {
        @SlashedClassName
        String className = getClassName(index);
        return className != null ? DescriptorFactory.instance().getClassDescriptor(className) : null;
    }
227728
Object getDataService(T session, Class cls) throws DataServiceException {
		String dataServiceClassName = cls.getName();
		logger.debug("Looking for dataservice : {}", dataServiceClassName);
		if (cls.isAnnotationPresent(DataService.class)) {
			return _getDataService(session, cls);
		} else {
			throw new DataServiceException(dataServiceClassName + " is not annotated with @" + DataService.class.getSimpleName());
		}
	}
773253
public static String descriptorMethodSource(Class cls) {
        String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
        
        String code = "if (this.descriptor != null) {" + ClassCode.LINE_BREAK  +
                            "return this.descriptor;" + ClassCode.LINE_BREAK  +
                       "}" + ClassCode.LINE_BREAK +
                       "%s descriptor = CodedConstant.getDescriptor(%s);" + ClassCode.LINE_BREAK  +
                       "return (this.descriptor = descriptor);"; 
        
        return String.format(code, descriptorClsName, 
                ClassHelper.getInternalName(cls.getCanonicalName()) + CodeGenerator.JAVA_CLASS_FILE_SUFFIX);
        
    }
1115824
private TestClassResults getResultsForClass(Map<IClass, TestClassResults> flattenedResults,
                                                ITestResult testResult)
    {
        TestClassResults resultsForClass = flattenedResults.get(testResult.getTestClass());
        if (resultsForClass == null)
        {
            resultsForClass = new TestClassResults(testResult.getTestClass());
            flattenedResults.put(testResult.getTestClass(), resultsForClass);
        }
        return resultsForClass;
    }
1118373
public static String getDesc(Class<?> returnType, Class<?>... paramTypes) {
        StringBuilder sb = new StringBuilder();
        sb.append("(");
        for (Class<?> type : paramTypes) {
            sb.append(ByteCodeUtils.getByteCodeType(type));
        }
        sb.append(")");
        //        sb.append(StringUtils.trim(ByteCodeUtils.getByteCodeType(returnType), ";"));
        sb.append(ByteCodeUtils.getByteCodeType(returnType));
        return sb.toString();
    }
1150822
protected Class resolveClass(ObjectStreamClass classDesc)
            throws IOException, ClassNotFoundException {
        String className = classDesc.getName();
        try {
            return loader.loadClass(className);
        } catch (ClassNotFoundException exp) {
            return super.resolveClass(classDesc);
        }
    }
28599
public static ClassLoader getClassLoader(Class<?> cls) {
        ClassLoader cl = cls.getClassLoader();
        if (cl == null) {
            cl = getClassLoader();
        }
        return cl;
    }
1271301
private static <T> EventInterfaceDescriptor<T> getDescriptor(Class<T> t) {
        EventInterfaceDescriptor<T> r = descriptors.get(t);
        if(r==null) {
            r = new EventInterfaceDescriptor<T>(t);
            descriptors.put(t,r);
        }
        return r;
    }
548682
@Override
    protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
        for (ClassLoader loader : classLoaderRegistration) {
            try {
                return resolveClass(classDesc, loader);
            } catch (ClassNotFoundException e) {
                // ignore
            }
        }
        return super.resolveClass(classDesc);
    }
1350995
public static PHPMethodDescriptor findMethod(PHPClassDescriptor desc, String methodName) {
		PHPMethodDescriptor meth;
		meth = desc.getMethod(Helper.formatProcedureName(methodName));
		if (meth != null) {
			return meth;
		}
		meth = desc.getMethod("get" + Helper.formatProcedureName(methodName));
		if (meth != null) {
			return meth;
		}
		return null;
	}
372927
private static Class<?> desc2class(ClassLoader cl, String desc)
			throws ClassNotFoundException {
		switch (desc.charAt(0)) {
		case JVM_VOID:
			return void.class;
		case JVM_BOOLEAN:
			return boolean.class;
		case JVM_BYTE:
			return byte.class;
		case JVM_CHAR:
			return char.class;
		case JVM_DOUBLE:
			return double.class;
		case JVM_FLOAT:
			return float.class;
		case JVM_INT:
			return int.class;
		case JVM_LONG:
			return long.class;
		case JVM_SHORT:
			return short.class;
		case 'L':
			desc = desc.substring(1, desc.length() - 1).replace('/', '.'); // "Ljava/lang/Object;"
																			// ==>
																			// "java.lang.Object"
			break;
		case '[':
			desc = desc.replace('/', '.'); // "[[Ljava/lang/Object;" ==>
											// "[[Ljava.lang.Object;"
			break;
		default:
			throw new ClassNotFoundException("Class not found: " + desc);
		}

		if (cl == null)
			cl = getClassLoader();
		Class<?> clazz = DESC_CLASS_CACHE.get(desc);
		if (clazz == null) {
			clazz = Class.forName(desc, true, cl);
			DESC_CLASS_CACHE.put(desc, clazz);
		}
		return clazz;
	}
749699
public static BeanDesc getBeanDesc(Class<?> clazz) {
		BeanDesc beanDesc = BeanDescCache.INSTANCE.getBeanDesc(clazz);
		if (null == beanDesc) {
			beanDesc = new BeanDesc(clazz);
			BeanDescCache.INSTANCE.putBeanDesc(clazz, beanDesc);
		}
		return beanDesc;
	}
255680
@Override
    public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException {

        if (!checked) {
            checked = true;
            Collection<TypeQualifierValue<?>> allKnownTypeQualifiers = TypeQualifierValue.getAllKnownTypeQualifiers();
            int size = allKnownTypeQualifiers.size();
            if (size == 1) {
                TypeQualifierValue<?> value = Util.first(allKnownTypeQualifiers);
                if (!value.typeQualifier.getClassName().equals(NONNULL_ANNOTATION)) {
                    shouldRunAnalysis = true;
                }

            } else if (size > 1) {
                shouldRunAnalysis = true;
            }
        }

        if (shouldRunAnalysis) {
            super.visitClass(classDescriptor);
        }
    }
1116500
public static This getClassInstanceThis(Object instance, String className) {
        try {
            Object o = getObjectFieldValue(instance, BSHTHIS + className);
            return (This) Primitive.unwrap(o); // unwrap Primitive.Null to null
        } catch (Exception e) {
            throw new InterpreterError("Generated class: Error getting This" + e, e);
        }
    }
1128295
public static <A extends Annotation> A getAnnotation(Object objectOrClass, Class<A> annotationClass) {
    Class<?> initialClass = objectOrClass instanceof Class<?> ? (Class<?>) objectOrClass : objectOrClass.getClass();
    
    for (Class<?> aClass = initialClass; aClass != null; aClass = aClass.getSuperclass()) {
      A result = aClass.getAnnotation(annotationClass);
      if (result != null) {
        return result;
      }
    }

    for (Class<?> anInterface : (List<Class<?>>) ClassUtils.getAllInterfaces(initialClass)) {
      A result = anInterface.getAnnotation(annotationClass);
      if (result != null) {
        return result;
      }
    }

    return null;
  }
858798
public SupertypeQueryResults getSupertypeQueryResults(ClassDescriptor classDescriptor) {
        SupertypeQueryResults supertypeQueryResults = supertypeSetMap.get(classDescriptor);
        if (supertypeQueryResults == null) {
            supertypeQueryResults = computeSupertypes(classDescriptor);
            supertypeSetMap.put(classDescriptor, supertypeQueryResults);
        }
        return supertypeQueryResults;
    }