GaiaXAndroidJS/src/main/kotlin/com/alibaba/gaiax/js/support/GXMethod.java [36:119]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.returnType = canonicalize(returnType);
        this.name = name;
        this.parameterTypes = new Type[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
            this.parameterTypes[i] = canonicalize(parameterTypes[i]);
        }
    }

    private static Type canonicalize(Type type) {
        return Types.removeSubtypeWildcard(Types.canonicalize(type));
    }

    private static String getTypeSignature(Type type) {
        // Array
        if (type instanceof Types.GenericArrayTypeImpl) {
            return "[" + getTypeSignature(((Types.GenericArrayTypeImpl) type).getGenericComponentType());
        }

        // Primitive
        if (type instanceof Class && ((Class<?>) type).isPrimitive()) {
            if (type == void.class) return "V";
            if (type == boolean.class) return "Z";
            if (type == byte.class) return "B";
            if (type == char.class) return "C";
            if (type == short.class) return "S";
            if (type == int.class) return "I";
            if (type == long.class) return "J";
            if (type == float.class) return "F";
            if (type == double.class) return "D";
        }

        // Class
        Class<?> clazz = Types.getRawType(type);
        String name = clazz.getName();
        StringBuilder sb = new StringBuilder(name.length() + 2);
        sb.append("L");
        for (int i = 0; i < name.length(); i++) {
            char c = name.charAt(i);
            sb.append(c == '.' ? '/' : c);
        }
        sb.append(";");
        return sb.toString();
    }

    // For jni
    String getSignature() {
        StringBuilder sb = new StringBuilder();

        sb.append("(");
        for (Type parameterType : parameterTypes) {
            sb.append(getTypeSignature(parameterType));
        }
        sb.append(")");
        sb.append(getTypeSignature(returnType));

        return sb.toString();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(returnType);
        sb.append(" ");
        sb.append(name);
        sb.append("(");
        for (int i = 0; i < parameterTypes.length; i++) {
            if (i != 0) sb.append(", ");
            sb.append(parameterTypes[i]);
        }
        sb.append(")");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = 31 * result + returnType.hashCode();
        result = 31 * result + name.hashCode();
        result = 31 * result + Arrays.hashCode(parameterTypes);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



GaiaXAndroidQuickJS/src/main/java/com/alibaba/gaiax/quickjs/Method.java [36:119]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.returnType = canonicalize(returnType);
        this.name = name;
        this.parameterTypes = new Type[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
            this.parameterTypes[i] = canonicalize(parameterTypes[i]);
        }
    }

    private static Type canonicalize(Type type) {
        return Types.removeSubtypeWildcard(Types.canonicalize(type));
    }

    private static String getTypeSignature(Type type) {
        // Array
        if (type instanceof Types.GenericArrayTypeImpl) {
            return "[" + getTypeSignature(((Types.GenericArrayTypeImpl) type).getGenericComponentType());
        }

        // Primitive
        if (type instanceof Class && ((Class<?>) type).isPrimitive()) {
            if (type == void.class) return "V";
            if (type == boolean.class) return "Z";
            if (type == byte.class) return "B";
            if (type == char.class) return "C";
            if (type == short.class) return "S";
            if (type == int.class) return "I";
            if (type == long.class) return "J";
            if (type == float.class) return "F";
            if (type == double.class) return "D";
        }

        // Class
        Class<?> clazz = Types.getRawType(type);
        String name = clazz.getName();
        StringBuilder sb = new StringBuilder(name.length() + 2);
        sb.append("L");
        for (int i = 0; i < name.length(); i++) {
            char c = name.charAt(i);
            sb.append(c == '.' ? '/' : c);
        }
        sb.append(";");
        return sb.toString();
    }

    // For jni
    String getSignature() {
        StringBuilder sb = new StringBuilder();

        sb.append("(");
        for (Type parameterType : parameterTypes) {
            sb.append(getTypeSignature(parameterType));
        }
        sb.append(")");
        sb.append(getTypeSignature(returnType));

        return sb.toString();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(returnType);
        sb.append(" ");
        sb.append(name);
        sb.append("(");
        for (int i = 0; i < parameterTypes.length; i++) {
            if (i != 0) sb.append(", ");
            sb.append(parameterTypes[i]);
        }
        sb.append(")");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = 31 * result + returnType.hashCode();
        result = 31 * result + name.hashCode();
        result = 31 * result + Arrays.hashCode(parameterTypes);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



