{"record":{"id":"680418c354b49097","repo":"apache/dubbo","slug":"unknown-primitive-type","errorCode":null,"errorMessage":"Unknown primitive type: {}","messagePattern":"Unknown primitive type: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java","lineNumber":395,"sourceCode":"            if (cl == Character.TYPE) {\n                return \"((Character)\" + name + \").charValue()\";\n            }\n            if (cl == Double.TYPE) {\n                return \"((Number)\" + name + \").doubleValue()\";\n            }\n            if (cl == Float.TYPE) {\n                return \"((Number)\" + name + \").floatValue()\";\n            }\n            if (cl == Integer.TYPE) {\n                return \"((Number)\" + name + \").intValue()\";\n            }\n            if (cl == Long.TYPE) {\n                return \"((Number)\" + name + \").longValue()\";\n            }\n            if (cl == Short.TYPE) {\n                return \"((Number)\" + name + \").shortValue()\";\n            }\n            throw new RuntimeException(\"Unknown primitive type: \" + cl.getName());\n        }\n        return \"(\" + ReflectUtils.getName(cl) + \")\" + name;\n    }\n\n    private static String args(Class<?>[] cs, String name) {\n        int len = cs.length;\n        if (len == 0) {\n            return \"\";\n        }\n        StringBuilder sb = new StringBuilder();\n        for (int i = 0; i < len; i++) {\n            if (i > 0) {\n                sb.append(',');\n            }\n            sb.append(arg(cs[i], name + \"[\" + i + \"]\"));\n        }\n        return sb.toString();\n    }","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java#L377-L413","documentation":"Thrown by the private arg() helper when a Class is reported as primitive (cl.isPrimitive() true) but does not match any of the eight known primitive types (boolean, byte, char, double, float, int, long, short). On a standard JVM this branch is effectively unreachable; it is a defensive guard against a malformed or non-standard primitive Class object.","triggerScenarios":"A Class object for which isPrimitive() returns true yet is not one of the eight standard TYPE constants. This would require a custom/agent-modified Class or a JVM bug; it should not occur in normal operation.","commonSituations":"Practically never hit in production. If encountered, suspect bytecode manipulation tooling, a JVM instrumentation agent, or a corrupted class definition that produced a non-standard primitive Class.","solutions":["Verify you are running on a standard, unmodified JVM without instrumentation agents that tamper with primitive Class objects.","Ensure no bytecode library (ASM/javassist) has synthesized an invalid primitive Class.","Report as a Dubbo issue if it reproduces on a stock JVM, including the full class name printed in the message."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Wrapper w = Wrapper.getWrapper(c);\n} catch (RuntimeException e) {\n    // unknown primitive type; report JVM/toolchain anomaly\n}","preventionTips":["Run on a standard unmodified JVM without instrumentation agents that tamper with primitive Class objects.","Verify no bytecode library synthesizes invalid primitive Class objects.","Report a reproducer to the Dubbo project if it occurs on a stock JVM."],"tags":["reflection","bytecode","wrapper","primitive","defensive-guard"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}