{"record":{"id":"0e1e6e9a96c6a9b5","repo":"airbnb/epoxy","slug":"attributes-cannot-be-empty","errorCode":null,"errorMessage":"Attributes cannot be empty","messagePattern":"Attributes cannot be empty","errorType":"exception","errorClass":"EpoxyProcessorException","httpStatus":null,"severity":"error","filePath":"epoxy-processor/src/main/java/com/airbnb/epoxy/processor/GeneratedModelInfo.kt","lineNumber":261,"sourceCode":"    }\n\n    fun attributeGroup(attribute: AttributeInfo): AttributeGroup? {\n        return attributeToGroup[attribute]\n    }\n\n    class AttributeGroup internal constructor(\n        groupName: String?,\n        attributes: List<AttributeInfo>,\n        defaultAttribute: AttributeInfo?\n    ) {\n        val name: String?\n        val attributes: List<AttributeInfo>\n        val isRequired: Boolean\n        val defaultAttribute: AttributeInfo?\n\n        init {\n            if (attributes.isEmpty()) {\n                throw buildEpoxyException(\"Attributes cannot be empty\")\n            }\n            if (defaultAttribute != null && defaultAttribute.codeToSetDefault.isEmpty &&\n                !hasDefaultKotlinValue(defaultAttribute)\n            ) {\n                throw buildEpoxyException(\"Default attribute has no default code\")\n            }\n            this.defaultAttribute = defaultAttribute\n            isRequired = defaultAttribute == null\n            name = groupName\n            this.attributes =\n                ArrayList(attributes)\n        }\n    }\n\n    companion object {\n        const val RESET_METHOD = \"reset\"\n        const val GENERATED_CLASS_NAME_SUFFIX = \"_\"\n        const val GENERATED_MODEL_SUFFIX = \"Model$GENERATED_CLASS_NAME_SUFFIX\"","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/airbnb/epoxy/blob/e45bd3a61fe3a1f130e184f5b8dcf172ab99025a/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/GeneratedModelInfo.kt#L243-L279","documentation":"GeneratedModelInfo.AttributeGroup is an internal processor invariant: every attribute group must contain at least one AttributeInfo. An empty attributes list means the processor assembled a group with no attributes, indicating a bug or malformed model input, so it throws 'Attributes cannot be empty' via buildEpoxyException. Reached from addAttributeGroup while generating model info.","triggerScenarios":"addAttributeGroup is called (directly or via processor model parsing) with an empty List<AttributeInfo>, e.g. when a model class's attributes were all filtered out before grouping but the group was still registered.","commonSituations":"Custom processor extensions or forks that construct AttributeGroup manually; model classes where attribute collection logic yields nothing (e.g. all attributes excluded) but a group name is still provided; internal Epoxy processor bugs after version upgrades.","solutions":["Check the model class that triggered the failure: ensure at least one attribute is actually declarable/visible to the processor (not all filtered out by annotations or visibility)","If you build AttributeGroup in custom code, guard with require(attributes.isNotEmpty()) before constructing","Update or bisect the Epoxy processor version — if a valid model triggers this, it is a processor bug worth reporting with a minimal reproducer","Clear build caches / run a clean build to rule out stale generated model info"],"exampleFix":"// before (custom processor code)\naddAttributeGroup(groupName, attributes)\n// after\nif (attributes.isNotEmpty()) {\n    addAttributeGroup(groupName, attributes)\n}","handlingStrategy":"validation","validationCode":"// caller-side check before registering a group\nrequire(attributes.isNotEmpty()) { \"Attribute group '$groupName' has no attributes\" }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify your model classes expose at least one processor-visible attribute","Skip group creation entirely when the attribute list is empty","Run clean builds after upgrading the processor to avoid stale grouped state"],"tags":["kotlin","annotation-processor","validation","epoxy"],"backgroundTag":"empty-required-field","analyzedSha":"e45bd3a61fe3a1f130e184f5b8dcf172ab99025a","analyzedAt":"2026-09-13T03:24:16.052Z","contentChangedAt":"2026-09-13T03:24:16.052Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}