{"record":{"id":"f08e88ef471b0610","repo":"quarkusio/quarkus","slug":"no-catalogs-provided","errorCode":null,"errorMessage":"No catalogs provided","messagePattern":"No catalogs provided","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/CatalogMergeUtility.java","lineNumber":33,"sourceCode":"import io.quarkus.registry.catalog.ExtensionCatalog;\nimport io.quarkus.registry.catalog.ExtensionOrigin;\nimport io.quarkus.registry.catalog.Platform;\nimport io.quarkus.registry.catalog.PlatformCatalog;\nimport io.quarkus.registry.catalog.PlatformRelease;\nimport io.quarkus.registry.catalog.PlatformStream;\nimport io.quarkus.registry.json.JsonBuilder;\n\n/**\n * Utility for merging catalog data.\n * Shared only within the package (between ExtensionCatalogResolvers)\n */\npublic class CatalogMergeUtility {\n\n    // TODO: should be Package private\n    public static ExtensionCatalog merge(List<? extends ExtensionCatalog> catalogs) {\n\n        if (catalogs.isEmpty()) {\n            throw new IllegalArgumentException(\"No catalogs provided\");\n        }\n        if (catalogs.size() == 1) {\n            return JsonBuilder.buildIfBuilder(catalogs.get(0));\n        }\n\n        final List<ExtensionCatalog> roots = detectRoots(catalogs);\n        if (roots.size() == 1) {\n            return JsonBuilder.buildIfBuilder(roots.get(0));\n        }\n\n        final ExtensionCatalog.Mutable combined = ExtensionCatalog.builder();\n\n        final Map<String, Category> categories = new LinkedHashMap<>();\n        final Map<String, ExtensionOrigin> derivedFrom = new LinkedHashMap<>();\n        final Map<ArtifactKey, Extension.Mutable> extensions = new LinkedHashMap<>();\n        final Map<String, Object> metadata = new HashMap<>();\n\n        final Map<String, ExtensionCatalog> originCatalogs = new HashMap<>();","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/CatalogMergeUtility.java#L15-L51","documentation":"Thrown by CatalogMergeUtility.merge when the provided list of extension catalogs is empty. Merging requires at least one catalog; an empty input is a programming/configuration error, reported via IllegalArgumentException.","triggerScenarios":"Calling merge(List.of()) or merge with a list that ended up empty because all platform resolutions were skipped/filtered before the call.","commonSituations":"Configuring a resolver with no registries/platforms so no catalogs are collected; a filtering bug that removes all catalogs upstream; passing an uninitialized list.","solutions":["Ensure at least one extension catalog is passed to merge()","Check upstream platform/registry configuration so catalogs are actually resolved before merging","Add a guard validating the list size before calling merge","Log the catalog collection step to find where the list becomes empty"],"exampleFix":"// before\nCatalogMergeUtility.merge(catalogs); // catalogs is empty\n// after\nif (catalogs.isEmpty()) {\n    throw new IllegalStateException(\"No platform catalogs were resolved; check registry configuration\");\n}\nCatalogMergeUtility.merge(catalogs);","handlingStrategy":"validation","validationCode":"List<ExtensionCatalog> catalogs = collectCatalogs();\nif (catalogs == null || catalogs.isEmpty()) {\n    throw new IllegalStateException(\"No extension catalogs collected; check registry/platform configuration before merge\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return CatalogMergeUtility.merge(catalogs);\n} catch (IllegalArgumentException e) {\n    if (\"No catalogs provided\".equals(e.getMessage())) {\n        // diagnose why upstream collection produced nothing\n    }\n    throw e;\n}","preventionTips":["Always populate at least one catalog before merging","Log the size of the collected list before merge","Fail early with context at collection time rather than at merge time"],"tags":["validation","argument","merge"],"backgroundTag":"empty-input-collection","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"}