Answer the ClassDescriptor for itemClass for an ObjectReferenceDescriptor
check optional hint. The returned Class is to highest superclass contained in the hint list.
TODO: add super ClassDescriptor
969393
private ClassDescriptor getItemClassDescriptor(ObjectReferenceDescriptor ord, List hintClasses)
    {   
        DescriptorRepository repo = ord.getClassDescriptor().getRepository();

        if (hintClasses == null || hintClasses.isEmpty())
        {
            return repo.getDescriptorFor(ord.getItemClass()); 
        }
        
        Class resultClass = (Class) hintClasses.get(0);
        
        for (Iterator iter = hintClasses.iterator(); iter.hasNext();)
        {
            Class clazz = (Class) iter.next();
            Class superClazz = clazz.getSuperclass();

            if (superClazz != null && resultClass.equals(superClazz.getSuperclass()))
            {
                continue; // skip if we already have a super superclass 
            }
           
            if (hintClasses.contains(superClazz))
            {
                resultClass = superClazz;   // use superclass if it's in the hints
            }
        }

        return repo.getDescriptorFor(resultClass);
    }
1301264
def getItemType(self, itemID):
        

        collections = self.getAllItemTypes()

        for coll in collections:
            note = self.noteDB[coll].find_one({"ID": itemID})
            if note is not None:
                return coll
657103
protected ClassDescriptor getClassDescriptor()
    {
        ClassDescriptor cld = (ClassDescriptor) m_classDescriptor.get();
        if(cld == null)
        {
            throw new OJBRuntimeException("Requested ClassDescriptor instance was already GC by JVM");
        }
        return cld;
    }
1194564
private int getItemViewType(Class prototypeClass) {
    int itemViewType = -1;
    for (Renderer renderer : prototypes) {
      if (renderer.getClass().equals(prototypeClass)) {
        itemViewType = getPrototypeIndex(renderer);
        break;
      }
    }
    if (itemViewType == -1) {
      throw new PrototypeNotFoundException(
          "Review your RendererBuilder implementation, you are returning one"
              + " prototype class not found in prototypes collection");
    }
    return itemViewType;
  }
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);
    }
572422
private ClassDescriptor getNullnessAnnotationClassDescriptor(NullnessAnnotation n) {
        if (n == NullnessAnnotation.CHECK_FOR_NULL) {
            return JSR305NullnessAnnotations.CHECK_FOR_NULL;
        } else if (n == NullnessAnnotation.NONNULL) {
            return JSR305NullnessAnnotations.NONNULL;
        } else if (n == NullnessAnnotation.NULLABLE) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else if (n == NullnessAnnotation.UNKNOWN_NULLNESS) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else {
            throw new IllegalArgumentException("Unknown NullnessAnnotation: " + n);
        }
    }
453461
public Set<ClassDescriptor> getSubtypes(ClassDescriptor classDescriptor) throws ClassNotFoundException {
        Set<ClassDescriptor> result = subtypeSetMap.get(classDescriptor);
        if (result == null) {
            result = computeKnownSubtypes(classDescriptor);
            subtypeSetMap.put(classDescriptor, result);
        }
        return result;
    }
1075453
private <T extends Describable<T>>
    Descriptor<T> findDescriptor(String shortClassName, Collection<? extends Descriptor<T>> descriptors) {
        String name = '.'+shortClassName;
        for (Descriptor<T> d : descriptors) {
            if(d.clazz.getName().endsWith(name))
                return d;
        }
        return null;
    }
280639
function isStage1ClassDescriptor(possibleDesc) {
  let [target] = possibleDesc;

  return (
    possibleDesc.length === 1 &&
    typeof target === 'function' &&
    'prototype' in target &&
    !target.__isComputedDecorator
  );
}
128938
public Set<ClassDescriptor> getDirectSubtypes(ClassDescriptor classDescriptor) throws ClassNotFoundException {

        ClassVertex startVertex = resolveClassVertex(classDescriptor);

        Set<ClassDescriptor> result = new HashSet<>();
        Iterator<InheritanceEdge> i = graph.incomingEdgeIterator(startVertex);
        while (i.hasNext()) {
            InheritanceEdge edge = i.next();
            result.add(edge.getSource().getClassDescriptor());
        }

        return result;
    }
230506
def _onClassAttribute(self, name, line, pos, absPosition, level):
        """"""
        # A class must be on the top of the stack
        attributes = self.objectsStack[level].classAttributes
        for item in attributes:
            if item.name == name:
                return
        attributes.append(ClassAttribute(name, line, pos, absPosition))
1079228
public boolean isDescriptorOf(Class<? extends Describable> c) {
        return instance instanceof Descriptor && ((Descriptor)instance).isSubTypeOf(c);
    }
668678
protected static String getTypeDescriptor(Object type) {
        if (type instanceof Class) {
            return Type.getDescriptor((Class) type);
        } else if (type instanceof Type) {
            return ((Type) type).getDescriptor();
        } else {
            String className = type.toString();
            return getTypeDescriptor(className, new String[0]);
        }
    }
483802
private ItemDetail getItemDetail(Gson gson, JsonElement itemType, JsonElement detail) {
		if (itemType == null || detail == null) return null;

		Item.Type type = gson.fromJson(itemType, Item.Type.class);
		Class<? extends ItemDetail> detailType;

		switch (type) {
			case Armor:
				detailType = Armor.class;
				break;
			case Back:
				detailType = Back.class;
				break;
			case Bag:
				detailType = Bag.class;
				break;
			case Consumable:
				detailType = Consumable.class;
				break;
			case MiniPet:
				detailType = Mini.class;
				break;
			case Trinket:
				detailType = Trinket.class;
				break;
			case UpgradeComponent:
				detailType = UpgradeComponent.class;
				break;
			case Weapon:
				detailType = Weapon.class;
				break;
			default:
				detailType = Utility.class;
		}

		return gson.fromJson(detail, detailType);
	}
1194670
@Nonnull
    public Descriptor getDescriptorOrDie(Class<? extends Describable> type) {
        Descriptor d = getDescriptor(type);
        if (d==null)
            throw new AssertionError(type+" is missing its descriptor");
        return d;
    }
248105
@Nullable
  private static ObjectType getSuperClassInstanceIfFinal(@Nullable JSType type) {
    if (type == null) {
      return null;
    }

    ObjectType obj = type.toObjectType();
    FunctionType ctor = (obj == null) ? null : obj.getSuperClassConstructor();
    JSDocInfo doc = (ctor == null) ? null : ctor.getJSDocInfo();
    if (doc != null && doc.isFinal()) {
      return ctor.getInstanceType();
    }

    return null;
  }
1131527
private ClassDescriptor getClassDescriptor(int index) throws InvalidClassFileFormatException {
        @SlashedClassName
        String className = getClassName(index);
        return className != null ? DescriptorFactory.instance().getClassDescriptor(className) : null;
    }