{"record":{"id":"e164daadf0ae3b8d","repo":"quarkusio/quarkus","slug":"unsupported-object-of-type-object-getclass-s","errorCode":null,"errorMessage":"Unsupported object of type ${object.getClass()}. Supported types are Type, String and Class","messagePattern":"Unsupported object of type (.+?)\\. Supported types are Type, String and Class","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/utils/TypeUtils.java","lineNumber":41,"sourceCode":"    private TypeUtils() {\n\n    }\n\n    public static Object primitiveToClass(String type) {\n        Class<?> clazz = PRIMITIVE_TO_CLASS_MAPPING.get(type);\n        return clazz != null ? clazz : type;\n    }\n\n    public static Type toGizmoType(Object object) {\n        if (object instanceof Type) {\n            return (Type) object;\n        } else if (object instanceof String) {\n            return Type.classType((String) object);\n        } else if (object instanceof Class) {\n            return Type.classType((Class<?>) object);\n        }\n\n        throw new IllegalArgumentException(\"Unsupported object of type \" + object.getClass()\n                + \". Supported types are Type, String and Class\");\n    }\n\n}\n","sourceCodeStart":23,"sourceCodeEnd":46,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/utils/TypeUtils.java#L23-L46","documentation":"TypeUtils.toGizmoType converts an object representing a Java type (Gizmo Type, class name String, or Class literal) into a Gizmo Type for bytecode generation. If the argument is none of those three types, an IllegalArgumentException naming the actual type is thrown during augmentation.","triggerScenarios":"Deployment time, when internal code (or custom code reusing this util) passes something other than org.objectweb.asm Type, String, or Class to toGizmoType — e.g. a java.lang.reflect.Type, ParameterizedType, or null-derived wrapper from schema resolution.","commonSituations":"Developer extending/patching the resource generator passes a reflection Type or generic type token instead of a Class/String; refactor swapped an argument order; a custom method implementor feeds an OpenAPI Schema type object into the utility.","solutions":["Pass a Class object, a fully-qualified class name String, or a Gizmo/ASM Type instead of the unsupported object.","If you have a java.lang.reflect.Type, unwrap it: for Class use it directly; for ParameterizedType call getRawType().","Convert a class name to Class via Class.forName(...)/loadClass before calling the utility."],"exampleFix":"// before\ntypeUtils.toGizmoType(genericReflectType); // ParameterizedType\n// after\nClass<?> raw = (Class<?>) ((ParameterizedType) genericReflectType).getRawType();\ntypeUtils.toGizmoType(raw);","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static boolean isGizmoConvertible(Object o) {\n    return o instanceof org.objectweb.asm.Type\n        || o instanceof String\n        || o instanceof Class;\n}\n// call site:\nif (!isGizmoConvertible(obj)) {\n    throw new IllegalArgumentException(\"Expected Type/String/Class, got \" + obj.getClass());\n}\nType t = toGizmoType(obj);","tryCatchPattern":null,"preventionTips":["Always pass Class<?>, String FQN, or ASM Type into type-conversion utilities.","Unwrap java.lang.reflect.ParameterizedType via getRawType() first.","Never pass OpenAPI Schema model objects or reflection Types directly.","Unit-test converters with each accepted input type."],"tags":["quarkus","build-time","rest-data-panache","gizmo","illegal-argument"],"backgroundTag":"unsupported-argument-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}