{"record":{"id":"b54a731319dea485","repo":"quarkusio/quarkus","slug":"the-set-of-bean-types-must-not-be-empty","errorCode":null,"errorMessage":"The set of bean types must not be empty","messagePattern":"The set of bean types must not be empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/ArcContainerImpl.java","lineNumber":927,"sourceCode":"            Set<Annotation> transitive = registeredInterceptorBindings.getTransitive(binding.annotationType());\n            if (transitive != null) {\n                bindings.addAll(transitive);\n            }\n        }\n        for (InjectableInterceptor<?> interceptor : this.interceptors) {\n            if (interceptor.intercepts(type) && hasAllInterceptionBindings(interceptor, bindings)) {\n                interceptors.add(interceptor);\n            }\n        }\n        return interceptors;\n    }\n\n    List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers) {\n        if (decorators.isEmpty()) {\n            return Collections.emptyList();\n        }\n        if (Objects.requireNonNull(types).isEmpty()) {\n            throw new IllegalArgumentException(\"The set of bean types must not be empty\");\n        }\n        if (qualifiers == null || qualifiers.length == 0) {\n            qualifiers = new Annotation[] { Default.Literal.INSTANCE };\n        } else {\n            registeredQualifiers.verify(qualifiers);\n        }\n        List<Decorator<?>> decorators = new ArrayList<>();\n        for (InjectableDecorator<?> decorator : this.decorators) {\n            if (decoratorMatches(decorator.getDelegateType(), decorator.getDelegateQualifiers(), types, Set.of(qualifiers))) {\n                decorators.add(decorator);\n            }\n        }\n        return decorators;\n    }\n\n    private boolean hasAllInterceptionBindings(InjectableInterceptor<?> interceptor, Iterable<Annotation> bindings) {\n        // The method or constructor has all the interceptor bindings of the interceptor\n        for (Annotation binding : interceptor.getInterceptorBindings()) {","sourceCodeStart":909,"sourceCodeEnd":945,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/ArcContainerImpl.java#L909-L945","documentation":"resolveDecorators requires a non-empty set of bean types to match decorators against. Passing a null or empty Set gives decorators nothing to compare assignability with, so Arc throws IllegalArgumentException. Qualifiers default to @Default when omitted.","triggerScenarios":"Calling beanManager.resolveDecorators(Collections.emptySet(), qualifiers) or resolveDecorators(null, ...); building the types set from an object whose getTypes() returned empty due to an earlier resolution failure.","commonSituations":"Extension/tooling code computing decorator matches dynamically; a refactor that changed how the bean types set is assembled and accidentally yields an empty set.","solutions":["Populate the set with at least one Type (the bean class or interface) before calling","Null/empty-check the types set in your calling code and short-circuit to an empty decorator list","If deriving types from a bean, use bean.getTypes() which never returns empty for valid beans"],"exampleFix":"// before\nmanager.resolveDecorators(Set.of(), Default.Literal.INSTANCE);\n\n// after\nmanager.resolveDecorators(Set.of(MyService.class), Default.Literal.INSTANCE);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(types, \"types\");\nif (types.isEmpty()) {\n    return List.of(); // or throw with a clearer message\n}\nList<Decorator<?>> decorators = bm.resolveDecorators(types, qualifiers);","typeGuard":null,"tryCatchPattern":"try {\n    return bm.resolveDecorators(types, quals);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"bean types must not be empty\")) {\n        return List.of();\n    } else throw e;\n}","preventionTips":["Source the types set from bean.getTypes() rather than computing it manually","Assert non-empty types before any decorator resolution call","Add a regression test when refactoring code that builds type sets"],"tags":["cdi","decorators","illegal-argument"],"backgroundTag":"empty-collection-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}