{"record":{"id":"dd7a1225d7c286ce","repo":"quarkusio/quarkus","slug":"unknown-primitive-type","errorCode":null,"errorMessage":"Unknown primitive type: ","messagePattern":"Unknown primitive type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/AsmUtil.java","lineNumber":325,"sourceCode":"                    unbox(mv, \"java/lang/Character\", \"charValue\", \"C\");\n                    break;\n                case DOUBLE:\n                    unbox(mv, \"java/lang/Double\", \"doubleValue\", \"D\");\n                    break;\n                case FLOAT:\n                    unbox(mv, \"java/lang/Float\", \"floatValue\", \"F\");\n                    break;\n                case INT:\n                    unbox(mv, \"java/lang/Integer\", \"intValue\", \"I\");\n                    break;\n                case LONG:\n                    unbox(mv, \"java/lang/Long\", \"longValue\", \"J\");\n                    break;\n                case SHORT:\n                    unbox(mv, \"java/lang/Short\", \"shortValue\", \"S\");\n                    break;\n                default:\n                    throw new IllegalArgumentException(\"Unknown primitive type: \" + jandexType);\n            }\n        }\n    }\n\n    /**\n     * Calls the right unboxing method for the given Jandex Type if it is a primitive.\n     *\n     * @param mv The MethodVisitor on which to visit the unboxing instructions\n     * @param type The Jandex Type to unbox if it is a primitive.\n     */\n    public static void unboxIfRequired(MethodVisitor mv, org.objectweb.asm.Type type) {\n        if (type.getSort() <= org.objectweb.asm.Type.DOUBLE) {\n            switch (type.getSort()) {\n                case org.objectweb.asm.Type.BOOLEAN:\n                    unbox(mv, \"java/lang/Boolean\", \"booleanValue\", \"Z\");\n                    break;\n                case org.objectweb.asm.Type.BYTE:\n                    unbox(mv, \"java/lang/Byte\", \"byteValue\", \"B\");","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/AsmUtil.java#L307-L343","documentation":"AsmUtil.unboxIfRequired emits the correct unboxing call for a Jandex primitive Type (e.g. Integer.intValue). If the type is a primitive not handled by the switch (VOID), it throws IllegalArgumentException(\"Unknown primitive type: ...\").","triggerScenarios":"Calling AsmUtil.unboxIfRequired(MethodVisitor, Type) with a Jandex Type of Kind.PRIMITIVE whose primitive() is VOID, e.g. unboxing a method's void return value.","commonSituations":"Bytecode generators in extensions that route every method return or annotation value through unboxIfRequired without skipping void methods; misparsed descriptors marking VOID as a value type.","solutions":["Skip the unboxing call when the Jandex Type is VOID — void values cannot be unboxed","Guard with type.kind() == Kind.PRIMITIVE && primitive() != VOID before calling","If boxing/unboxing a wrapper, pass the wrapper ClassType rather than the primitive VOID type"],"exampleFix":"// before\nAsmUtil.unboxIfRequired(mv, returnType);\n// after\nif (!isVoid(returnType)) {\n    AsmUtil.unboxIfRequired(mv, returnType);\n}\n// where isVoid checks kind==PRIMITIVE && primitive()==VOID","handlingStrategy":"type-guard","validationCode":"static boolean isUnboxable(org.jboss.jandex.Type t) {\n    return t.kind() == org.jboss.jandex.Type.Kind.PRIMITIVE\n        && t.asPrimitiveType().primitive() != org.jboss.jandex.Primitive.VOID;\n}\n","typeGuard":"if (type.kind() == Type.Kind.PRIMITIVE && type.asPrimitiveType().primitive() != Primitive.VOID) {\n    AsmUtil.unboxIfRequired(mv, type);\n}\n","tryCatchPattern":"try {\n    AsmUtil.unboxIfRequired(mv, type);\n} catch (IllegalArgumentException e) {\n    // skip unboxing for non-value primitives such as void\n}\n","preventionTips":["Skip unboxing entirely for void returns","Prefer the ASM Type overload of unboxIfRequired, which silently ignores non-value sorts","Cover every Primitive constant in tests of bytecode generators"],"tags":["bytecode","jandex","asm","unboxing"],"backgroundTag":"unknown-primitive-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"}