{"record":{"id":"80d608d7d7196952","repo":"quarkusio/quarkus","slug":"extension-extension-was-configured-to-provide-a","errorCode":null,"errorMessage":"Extension ${extension} was configured to provide a capability with an empty name: ${providesStr}","messagePattern":"Extension (.+?) was configured to provide a capability with an empty name: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/CapabilityContract.java","lineNumber":33,"sourceCode":"\n    /**\n     * @deprecated in favor of {@link #of(String, String, String)}\n     *\n     * @param extension extension id\n     * @param commaSeparatedList provided capabilities as a command-separated string\n     * @return capability contract\n     */\n    @Deprecated(forRemoval = true)\n    public static CapabilityContract providesCapabilities(String extension, String commaSeparatedList) {\n        return of(extension, commaSeparatedList, null);\n    }\n\n    public static CapabilityContract of(String extension, String providesStr, String requiresStr) {\n\n        final Collection<String> provides = parseCapabilities(providesStr);\n        for (String name : provides) {\n            if (name.isEmpty()) {\n                throw new IllegalArgumentException(\"Extension \" + extension\n                        + \" was configured to provide a capability with an empty name: \" + providesStr);\n            }\n        }\n        final Collection<String> requires = parseCapabilities(requiresStr);\n        for (String name : requires) {\n            if (name.isEmpty()) {\n                throw new IllegalArgumentException(\"Extension \" + extension\n                        + \" was configured to require a capability with an empty name: \" + requiresStr);\n            }\n        }\n\n        return new CapabilityContract(extension, provides, requires);\n    }\n\n    private static Collection<String> parseCapabilities(String s) {\n        return s == null || s.isBlank() ? List.of() : Arrays.asList(capabilitiesPattern.split(s));\n    }\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/CapabilityContract.java#L15-L51","documentation":"CapabilityContract.of() parses the comma-separated 'provides' capability list of an extension and rejects any empty capability name. Extensions must declare non-empty capability identifiers, so an empty name is treated as invalid extension metadata (IllegalArgumentException).","triggerScenarios":"Calling CapabilityContract.of(extension, providesStr, requiresStr) where providesStr contains an empty entry, e.g. a trailing comma ('a,b,'), an empty string segment, or a property like quarkus.provides-capabilities with stray whitespace-only entries.","commonSituations":"Typo in an extension's build-time capability declaration in its pom.xml / CapabilityProvider, trailing comma in a hand-edited list, string concatenation producing double commas.","solutions":["Fix the provides string: remove empty segments and trailing commas (e.g. 'a,b' not 'a,b,').","Trim and filter entries before calling of().","Check the offending extension's capability declarations in its build configuration."],"exampleFix":"// before\nCapabilityContract.of(\"my-ext\", \"io.quarkus.rest,,io.quarkus.jpa\", \"\");\n// after\nCapabilityContract.of(\"my-ext\", \"io.quarkus.rest,io.quarkus.jpa\", \"\");","handlingStrategy":"validation","validationCode":"boolean valid = Arrays.stream(providesStr.split(\",\"))\n        .map(String::trim)\n        .allMatch(s -> !s.isEmpty());\nif (!valid) throw new IllegalArgumentException(\"provides contains empty capability name: \" + providesStr);","typeGuard":null,"tryCatchPattern":"try {\n    return CapabilityContract.of(ext, provides, requires);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Malformed capability declaration in \" + ext, e);\n}","preventionTips":["Never build capability lists with String concatenation that can yield empty segments.","Use List.of(...) plus String.join(\",\", ...) instead of hand-written comma strings.","Lint extension descriptors for trailing commas."],"tags":["capabilities","application-model","configuration"],"backgroundTag":"empty-capability-name","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"}