@Nonnull
	default NavigableSet<String> getReferencedClasses() {
		NavigableSet<String> classes = ReferencedClassesProperty.get(this);
		if (classes != null)
			return classes;

		Set<String> classNames = new HashSet<>();
		ClassReader reader = getClassReader();

		// Iterate over pool entries. Supe fast way to discover most of the referenced types.
		int itemCount = reader.getItemCount();
		char[] buffer = new char[reader.getMaxStringLength()];
		for (int i = 1; i < itemCount; i++) {
			int offset = reader.getItem(i);
			if (offset >= 10) {
				try {
					int itemTag = reader.readByte(offset - 1);
					if (itemTag == ConstantPoolConstants.CLASS) {
						String className = reader.readUTF8(offset, buffer);
						if (className.isEmpty())
							continue;
						addName(className, classNames);
					} else if (itemTag == ConstantPoolConstants.NAME_TYPE) {
						String desc = reader.readUTF8(offset + 2, buffer);
						if (desc.isEmpty())
							continue;
						if (desc.charAt(0) == '(') {
							addMethodType(Type.getMethodType(desc), classNames);
						} else {
							Type type = Type.getType(desc);
							addType(type, classNames);
						}
					} else if (itemTag == ConstantPoolConstants.METHOD_TYPE) {
						String methodDesc = reader.readUTF8(offset, buffer);
						if (methodDesc.isEmpty() || methodDesc.charAt(0) != '(')
							continue;
						addMethodType(Type.getMethodType(methodDesc), classNames);
					}
				} catch (Throwable ignored) {
					// Exists only to catch situations where obfuscators put unused junk pool entries
					// with malformed descriptors, which cause ASM's type parser to crash.
				}
			}
		}

		// In some cases like interface classes, there may be UTF8 pool entries outlining method descriptors which
		// are not directly linked in NameType or MethodType pool entries. We need to iterate over fields and methods
		// to get the descriptors in these cases.
		reader.accept(new TypeVisitor(t -> {
			if (t.getSort() == Type.METHOD)
				addMethodType(t, classNames);
			else
				addType(t, classNames);
		}), ClassReader.SKIP_DEBUG | ClassReader.SKIP_CODE);

		ReferencedClassesProperty.set(this, classNames);
		return Objects.requireNonNull(ReferencedClassesProperty.get(this));
	}
@return Set of all classes referenced in the constant pool.
recaf-core/src/main/java/software/coley/recaf/info/JvmClassInfo.java