{"record":{"id":"d681a99cc623e577","repo":"quarkusio/quarkus","slug":"unknown-item-type-otheritem-getclass","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/ConfigRoot.java","lineNumber":90,"sourceCode":"    public void merge(ConfigRoot other) {\n        this.qualifiedNames.addAll(other.getQualifiedNames());\n\n        Map<String, ConfigSection> existingConfigSections = new HashMap<>();\n        collectConfigSections(existingConfigSections, this);\n\n        for (AbstractConfigItem otherItem : other.getItems()) {\n            if (otherItem instanceof ConfigSection otherConfigSection) {\n                ConfigSection similarConfigSection = existingConfigSections.get(otherConfigSection.getPath().property());\n\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    private void collectConfigSections(Map<String, ConfigSection> configSections, ConfigItemCollection configItemCollection) {\n        for (AbstractConfigItem item : configItemCollection.getItems()) {\n            if (item instanceof ConfigSection configSection) {\n                configSections.put(item.getPath().property(), configSection);\n\n                collectConfigSections(configSections, configSection);\n            }\n        }\n    }\n\n    public boolean hasDurationType() {\n        for (AbstractConfigItem item : items) {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/model/ConfigRoot.java#L72-L108","documentation":"During ConfigRoot.merge, an item in the other config root was neither a ConfigSection nor a ConfigProperty, so the merge loop hit the else branch and threw. The documentation model only supports these two item types; this indicates an internal model inconsistency (a new/unknown item subtype, or a corrupted/deserialized model) rather than user configuration being wrong per se.","triggerScenarios":"mergeModel merging two ConfigRoots whose items list contains an object that is not ConfigSection or ConfigProperty — e.g. a new item type added to the model without updating merge logic, or a hand-edited/custom-deserialized model JSON containing an unexpected item.","commonSituations":"Running a snapshot/dev Quarkus version where the model format changed between modules; mixing processor versions across a multi-module build so one jar contributes a model the other's merge code doesn't understand; programmatically constructing or patching config doc models.","solutions":["Rebuild all modules with the same Quarkus version (mvn clean install) so model and merge logic match.","Delete regenerated config-docs model JSON files and rebuild to rule out stale mixed-version models.","If you maintain a fork or custom item type, update ConfigRoot.merge to handle it explicitly.","Inspect the printed class name (otherItem.getClass()) to identify which item type leaked into the model and where it was created."],"exampleFix":"// before: custom item not handled\nthis.items.add(new MyCustomItem()); // -> Unknown item type: ...MyCustomItem\n\n// after: extend the model properly or use a supported type\nthis.items.add(new ConfigProperty(...));","handlingStrategy":"validation","validationCode":"// ensure consistent processor artifacts across modules\nassert sameVersion(\"io.quarkus:quarkus-core\", \"io.quarkus:quarkus-annotation-processor\");\n// avoid hand-crafted ConfigRoot items\nitemMustBeOneOf(configRoot.getItems(), ConfigSection.class, ConfigProperty.class);","typeGuard":"static boolean isMergeable(ConfigItem item) {\n    return item instanceof ConfigSection || item instanceof ConfigProperty;\n}","tryCatchPattern":null,"preventionTips":["Do not manually construct or edit ConfigDoc model objects/JSON.","Rebuild all modules together so model format and merge code match.","When extending the model in a fork, update every merge/visit site in the same change."],"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"}