{"record":{"id":"620112d446086e4d","repo":"quarkusio/quarkus","slug":"unknown-item-type-otheritem-getclass-620112","errorCode":null,"errorMessage":"Unknown item type: ${otherItem.getClass()}","messagePattern":"Unknown item type: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/model/ConfigSection.java","lineNumber":87,"sourceCode":"\n    /**\n     * This is used to merge ConfigRoot when generating the AsciiDoc output.\n     */\n    public void merge(ConfigSection other, Map<String, ConfigSection> existingConfigSections) {\n        this.generated = this.generated || other.generated;\n\n        for (AbstractConfigItem otherItem : other.getItems()) {\n            if (otherItem instanceof ConfigSection otherConfigSection) {\n                ConfigSection similarConfigSection = existingConfigSections.get(otherConfigSection.getPath().property());\n                if (similarConfigSection == null) {\n                    this.items.add(otherConfigSection);\n                } else {\n                    similarConfigSection.merge(otherConfigSection, existingConfigSections);\n                }\n            } else if (otherItem instanceof ConfigProperty configProperty) {\n                this.items.add(configProperty);\n            } else {\n                throw new IllegalStateException(\"Unknown item type: \" + otherItem.getClass());\n            }\n        }\n\n        Collections.sort(this.items);\n    }\n\n    @Override\n    public boolean hasDurationType() {\n        for (AbstractConfigItem item : items) {\n            if (item.hasDurationType() && !item.isDeprecated()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    @Override\n    public boolean hasMemorySizeType() {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/model/ConfigSection.java#L69-L105","documentation":"Identical to the ConfigRoot.merge failure but inside ConfigSection.merge: while merging a nested section's items, an item was neither a ConfigSection nor a ConfigProperty, so the exhaustive pattern-match chain fell through and threw. Signals an invalid item inside a config section's item list.","triggerScenarios":"mergeModel -> ConfigRoot.merge -> ConfigSection.merge where a section's items contain an object of an unrecognized class — new model item subtype not handled in merge, or a model JSON deserialized into an unexpected item type.","commonSituations":"Version-skew across modules in a multi-module Quarkus build (one module's processor wrote a newer model format); custom subclasses of model items; corrupted regenerated docs models.","solutions":["Align Quarkus versions across all modules and run a clean build.","Remove stale generated quarkus-config-docs models and rebuild.","Use the class name in the message to find the unexpected item's origin and fix its construction site.","If extending the model in a fork, add the matching instanceof branch to ConfigSection.merge."],"exampleFix":"// before\n} else {\n    throw new IllegalStateException(\"Unknown item type: \" + otherItem.getClass());\n}\n\n// after (fork with a new item type)\n} else if (otherItem instanceof ConfigDeprecation deprecation) {\n    this.items.add(deprecation);\n} else {\n    throw new IllegalStateException(\"Unknown item type: \" + otherItem.getClass());\n}","handlingStrategy":"validation","validationCode":"// validate every section's items before merging\nfor (ConfigSection s : root.getSections()) {\n    if (!s.getItems().stream().allMatch(i -> i instanceof ConfigSection || i instanceof ConfigProperty))\n        throw new IllegalArgumentException(\"unexpected item in section \" + s.getName());\n}","typeGuard":"static boolean isMergeable(ConfigItem item) {\n    return item instanceof ConfigSection || item instanceof ConfigProperty;\n}","tryCatchPattern":null,"preventionTips":["Never subclass ConfigItem with custom types in application code.","Pin one Quarkus version across the whole reactor build.","Delete regenerated docs models after upgrading Quarkus."],"tags":["quarkus","annotation-processing","config-docs","merge","internal"],"backgroundTag":"unknown-type-discriminator","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"}