{"record":{"id":"d4e9d62314a76cd8","repo":"quarkusio/quarkus","slug":"not-an-array","errorCode":null,"errorMessage":"Not an array: ","messagePattern":"Not an array: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Annotations.java","lineNumber":377,"sourceCode":"            return boxedArray;\n        } else if (value instanceof double[]) {\n            double[] primitiveArray = (double[]) value;\n            Object[] boxedArray = new Double[primitiveArray.length];\n            for (int i = 0; i < primitiveArray.length; i++) {\n                boxedArray[i] = primitiveArray[i];\n            }\n            return boxedArray;\n        } else if (value instanceof char[]) {\n            char[] primitiveArray = (char[]) value;\n            Object[] boxedArray = new Character[primitiveArray.length];\n            for (int i = 0; i < primitiveArray.length; i++) {\n                boxedArray[i] = primitiveArray[i];\n            }\n            return boxedArray;\n        } else if (value instanceof Object[]) {\n            return (Object[]) value;\n        } else {\n            throw new IllegalArgumentException(\"Not an array: \" + value);\n        }\n    }\n}\n","sourceCodeStart":359,"sourceCodeEnd":381,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Annotations.java#L359-L381","documentation":"Annotations.boxArray() boxes primitive array values (boolean[], int[], etc.) so they can be converted into Jandex array AnnotationValues. If the input is neither a primitive array nor an Object[], it throws IllegalArgumentException('Not an array: ...'). It is a defensive check inside annotation value conversion.","triggerScenarios":"Calling the value-conversion path with a value whose class is not an array at all — e.g. a Collection, a String where an array was expected, or a generic Object that skipped earlier type checks.","commonSituations":"Programmatic AnnotationInstance construction passing collections instead of arrays; mis-typed members when synthesizing annotations in extensions or tests; reflection maps with wrong value types.","solutions":["Pass a real Java array (primitive or Object[]) instead of a List/Collection","Convert collections first: list.toArray(new String[0])","Ensure earlier branches (String, primitives) are matched before reaching boxArray by checking value.getClass().isArray() first","Fix the annotation member type so values arrive as arrays"],"exampleFix":"// before\njandexValue(name, List.of(\"a\"));\n// after\njandexValue(name, List.of(\"a\").toArray(new String[0]));","handlingStrategy":"validation","validationCode":"if (value == null || !value.getClass().isArray()) throw new IllegalArgumentException(\"Expected array, got \" + (value == null ? \"null\" : value.getClass()));","typeGuard":"static boolean isArrayValue(Object v) { return v != null && v.getClass().isArray(); }","tryCatchPattern":"try { Object[] boxed = boxArray(value); }\ncatch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Provide a Java array, not \" + value.getClass(), e); }","preventionTips":["Call value.getClass().isArray() before array handling paths","Use toArray(new T[0]) for collections","Keep conversion entry points typed so non-arrays can't reach boxArray"],"tags":["cdi","arc","jandex","arrays"],"backgroundTag":"unsupported-annotation-member-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"}