quarkusio/quarkus · error · UnsupportedOperationException

Array component kind is

Error message

Array component kind is 

What it means

In loadValue's ARRAY handling, Arc switches on the component kind; the default branch should be unreachable because nested-arrays of arrays are not valid annotation values. Hitting it throws UnsupportedOperationException 'Array component kind is ...' — a defensive guard indicating an internal invariant violation.

Source

Thrown at independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java:319

                        } else if (ConstantDescs.CD_long.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_LONG_ARRAY);
                        } else if (ConstantDescs.CD_float.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_FLOAT_ARRAY);
                        } else if (ConstantDescs.CD_double.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_DOUBLE_ARRAY);
                        } else if (ConstantDescs.CD_char.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_CHAR_ARRAY);
                        } else if (ConstantDescs.CD_String.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_STRING_ARRAY);
                        } else if (ConstantDescs.CD_Class.equals(componentType)) {
                            yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_CLASS_ARRAY);
                        } else {
                            yield bc.newEmptyArray(componentType, Const.of(0));
                        }
                    }
                    default -> {
                        // at this point, the only possible component kind is "array"
                        throw new UnsupportedOperationException("Array component kind is " + componentKind
                                + ", this should never happen");
                    }
                };
            }
            default -> throw new UnsupportedOperationException("Unsupported value: " + annotationMemberValue);
        };
    }

    private static ClassDesc componentTypeOf(MethodInfo annotationMember) {
        assert annotationMember.returnType().kind() == Type.Kind.ARRAY;
        return classDescOf(annotationMember.returnType().asArrayType().componentType());
    }

    // ---

    private static String componentType(MethodInfo method) {
        return componentTypeName(method).toString();
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Upgrade/align Jandex versions to a release consistent with Arc
  2. Rebuild the index (clean) to eliminate stale metadata
  3. Reduce the annotation to valid (non-array-of-array) types; report a bug if reproducible

Example fix

// before
public @interface Conf { String[][] values(); } // invalid annotation member type
// after
public @interface Conf { String[] values(); }
Defensive patterns

Strategy: try-catch

Validate before calling

if (v.componentKind() == AnnotationValue.Kind.ARRAY) throw new IllegalStateException("nested arrays invalid");

Try / catch

try { expr = processor.create(bc, cls, ann); } catch (UnsupportedOperationException e) { /* invalid nested array */ }

Prevention

When it happens

Trigger: An annotation member value of array kind whose componentKind is itself array (array-of-array) or otherwise falls through all known component kinds.

Common situations: Rarely hit by users; typically indicates corrupted/invalid Jandex metadata, a Jandex version mismatch producing unexpected AnnotationValue kinds, or a compiler/tooling bug writing malformed annotation values.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/c41e2c3420ec0fec. Report an issue: GitHub.