{"record":{"id":"1822e17db0b8d3b9","repo":"hibernate/hibernate-orm","slug":"implementingtype-gettypename-is-not-a-subtyp","errorCode":null,"errorMessage":"implementingType.getTypeName() + \" is not a subtype of \" + genericType.getName()","messagePattern":"implementingType\\.getTypeName\\(\\) \\+ \" is not a subtype of \" \\+ genericType\\.getName\\(\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/util/GenericsHelper.java","lineNumber":165,"sourceCode":"\t\t}\n\t}\n\n\t/**\n\t * Get the type argument of the instantiation of the given generic\n\t * type constructor which is a supertype of the given type expression.\n\t * @param genericType A generic type constructor\n\t * @param implementingType A type expression\n\t * @return The type arguments assigned to parameters of the generic type constructor\n\t */\n\tpublic static Type[] typeArguments(Class<?> genericType, Type implementingType) {\n\t\tif ( genericType.getTypeParameters().length == 0 ) {\n\t\t\treturn EMPTY_TYPE_ARRAY;\n\t\t}\n\t\telse {\n\t\t\tfinal var instantiation =\n\t\t\t\t\tsupertypeInstantiation( genericType, implementingType );\n\t\t\tif ( instantiation == null ) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\timplementingType.getTypeName()\n\t\t\t\t\t\t+ \" is not a subtype of \"\n\t\t\t\t\t\t+ genericType.getName() );\n\t\t\t}\n\t\t\treturn instantiation.getActualTypeArguments();\n\t\t}\n\t}\n\n\tprivate static final Type[] EMPTY_TYPE_ARRAY = new Type[0];\n\n\t/**\n\t * A supertype of the given type which is an instantiation of the\n\t * given generic type constructor.\n\t * @param genericType A generic type constructor\n\t * @param base A type which is assignable to some instantiation of\n\t *             the given generic type constructor\n\t * @return An instantiation of the generic type constructor which\n\t *         is a supertype of the given type, or null if none exists","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/util/GenericsHelper.java#L147-L183","documentation":"Error \"implementingType.getTypeName() + \" is not a subtype of \" + genericType.getName()\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/util/GenericsHelper.java:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the implementing class actually extends/implements the generic type being inspected; correct the class hierarchy or the lookup call."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}