Skip to content

Unable to find generic type of class... for an interface #183

Closed
@yukchan

Description

@yukchan

Hi,

SchemaParserBuilder throws IllegalStateException "Unable to find generic type of class ..." when it is trying to load an interface method from parent. I guess the function relativeToPotentialParent should be revised to handle the case for interface:

fun relativeToPotentialParent(declaringType: JavaType): RelativeTo {
    if(declaringType !is Class<*> || declaringType.isInterface) {
        return relativeToType(declaringType)
    }

    val type = getGenericSuperType(mostSpecificType, declaringType)
    if(type == null) {
        error("Unable to find generic type of class ${TypeUtils.toString(declaringType)} relative to ${TypeUtils.toString(mostSpecificType)}")
    } else {
        return relativeToType(type)
    }
}

Regards,
Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions