{"record":{"id":"fbc93630ef09b4b9","repo":"quarkusio/quarkus","slug":"our-supertype-instance-does-not-match-supertype-d","errorCode":null,"errorMessage":"Our supertype instance  does not match supertype declared arguments: ","messagePattern":"Our supertype instance  does not match supertype declared arguments: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/JandexUtil.java","lineNumber":211,"sourceCode":"\n        // we passed them explicitly\n        if (appliedType.kind() == Kind.PARAMETERIZED_TYPE) {\n            appliedArguments = appliedType.asParameterizedType().arguments();\n        } else {\n            // raw supertype: use bounds\n            appliedArguments = new ArrayList<>(superType.typeParameters().size());\n            for (TypeVariable typeVariable : superType.typeParameters()) {\n                if (!typeVariable.bounds().isEmpty()) {\n                    appliedArguments.add(typeVariable.bounds().get(0));\n                } else {\n                    appliedArguments.add(ClassType.create(DOTNAME_OBJECT, Kind.CLASS));\n                }\n            }\n        }\n\n        // it's a problem if we got different arguments to the parameters declared\n        if (appliedArguments.size() != superType.typeParameters().size()) {\n            throw new IllegalArgumentException(\"Our supertype instance \" + appliedType\n                    + \" does not match supertype declared arguments: \" + superType.typeParameters());\n        }\n        // build the mapping\n        Map<String, Type> mapping = new HashMap<>();\n        for (int i = 0; i < superType.typeParameters().size(); i++) {\n            TypeVariable typeParameter = superType.typeParameters().get(i);\n            mapping.put(typeParameter.identifier(), appliedArguments.get(i));\n        }\n        // and map\n        return mapGenerics(typeArgumentsFromSupertype, mapping);\n    }\n\n    private static boolean containsTypeParameters(List<Type> typeArgumentsFromSupertype) {\n        for (Type type : typeArgumentsFromSupertype) {\n            if (containsTypeParameters(type)) {\n                return true;\n            }\n        }","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/JandexUtil.java#L193-L229","documentation":"JandexUtil.mapTypeArguments maps type arguments returned from a supertype traversal back down onto the applied (parameterized) type. If the number of applied arguments collected does not match the number of type parameters declared on the supertype, the hierarchy is inconsistent (e.g. raw type vs parameterized mismatch) and it throws IllegalArgumentException(\"Our supertype instance X does not match supertype declared arguments: Y\").","triggerScenarios":"Calling JandexUtil.resolveTypeParameters where the class hierarchy contains a raw or malformed parameterized supertype reference — a class extending a generic class without type arguments whose bounds cannot supply a full argument list, or corrupted/edge-case Jandex type data (e.g. generic signatures with fewer type arguments than declared parameters).","commonSituations":"Libraries compiled with unusual generics usage (raw types in bytecode) that Jandex models without arguments; bytecode processed by tools that drop generic signatures; edge cases with inner classes and owners.","solutions":["Fix the offending class hierarchy so the generic supertype is properly parametrized (e.g. class Foo extends Bar<String> instead of raw Bar)","Identify the class via the appliedType in the message and check its generic signature with javap -v","Work around by resolving the type arguments yourself via Jandex superClassType().asParameterizedType().arguments() and custom mapping logic","Report upstream if caused by a Jandex parsing edge case (include the class and its signature)"],"exampleFix":"// before\nclass MyRepo extends BaseRepo { }        // raw supertype\n// after\nclass MyRepo extends BaseRepo<User> { }  // explicit type arguments","handlingStrategy":"try-catch","validationCode":"// verify applied supertype is fully parameterized before resolving\nif (supertype.kind() != org.jboss.jandex.Type.Kind.PARAMETERIZED_TYPE) {\n    throw new IllegalStateException(\"Raw supertype cannot map generic arguments: \" + supertype);\n}\n","typeGuard":"static boolean isFullyParameterized(org.jboss.jandex.Type t) {\n    return t.kind() == org.jboss.jandex.Type.Kind.PARAMETERIZED_TYPE;\n}\n","tryCatchPattern":"try {\n    List<Type> args = JandexUtil.resolveTypeParameters(input, target, index);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Our supertype instance\")) {\n        // hierarchy has a raw/mismatched parameterized supertype — inspect superClassType()\n        throw new IllegalStateException(\"Raw supertype in hierarchy of \" + input, e);\n    }\n    throw e;\n}\n","preventionTips":["Always parametrize generic superclasses/interfaces explicitly (class Foo extends Bar<String>)","Check superClassType().kind() == PARAMETERIZED_TYPE before generic resolution in build steps","Keep Jandex/Quarkus versions in sync with compiled classes to avoid signature-parsing gaps"],"tags":["jandex","generics","type-hierarchy","deployment"],"backgroundTag":"generic-type-mapping-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}