protected String getCommonSuperClass(final String type1, final String type2) {
        Class<?> class1 = loadClass(type1);

        if (class1 == null) {
            throw new JSONException("class not found " + type1);
        }

        Class<?> class2 = loadClass(type2);

        if (class2 == null) {
            return "java/lang/Object";
        }

        if (class1.isAssignableFrom(class2)) {
            return type1;
        }
        if (class2.isAssignableFrom(class1)) {
            return type2;
        }
        if (class1.isInterface() || class2.isInterface()) {
            return "java/lang/Object";
        } else {
            do {
                class1 = class1.getSuperclass();
            } while (!class1.isAssignableFrom(class2));

            return class1.getName().replace('.', '/');
        }
    }
Returns the common super type of the two given types. The default implementation of this method
<i>loads</i> the two given classes and uses the java.lang.Class methods to find the common
super class. It can be overridden to compute this common super type in other ways, in
particular without actually loading any class, or to take into account the class that is
currently being generated by this ClassWriter, which can of course not be loaded since it is
under construction.

@param type1 the internal name of a class.
@param type2 the internal name of another class.
@return the internal name of the common super class of the two given classes.
core/src/main/java/com/alibaba/fastjson2/internal/asm/ClassWriter.java