{"record":{"id":"24e0d3f735a8b81c","repo":"apache/cassandra","slug":"unsupported-verb-kind-v-kind-for-verb-v","errorCode":null,"errorMessage":"Unsupported Verb Kind: + v.kind + for verb + v","messagePattern":"Unsupported Verb Kind: \\+ v\\.kind \\+ for verb \\+ v","errorType":"panic","errorClass":"AssertionError","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/net/Verb.java","lineNumber":611,"sourceCode":"    private static final int minCustomId;\n\n    static\n    {\n        Verb[] verbs = values();\n        int max = -1;\n        int minCustom = Integer.MAX_VALUE;\n        for (Verb v : verbs)\n        {\n            switch (v.kind)\n            {\n                case NORMAL:\n                    max = Math.max(v.id, max);\n                    break;\n                case CUSTOM:\n                    minCustom = Math.min(v.id, minCustom);\n                    break;\n                default:\n                    throw new AssertionError(\"Unsupported Verb Kind: \" + v.kind + \" for verb \" + v);\n            }\n        }\n        minCustomId = minCustom;\n\n        if (minCustom <= max)\n            throw new IllegalStateException(\"Overlapping verb ids are not allowed\");\n\n        Verb[] idMap = new Verb[max + 1];\n        int customCount = minCustom < Integer.MAX_VALUE ? CUSTOM_VERB_START - minCustom : 0;\n        Verb[] customIdMap = new Verb[customCount + 1];\n        for (Verb v : verbs)\n        {\n            switch (v.kind)\n            {\n                case NORMAL:\n                    if (idMap[v.id] != null)\n                        throw new IllegalArgumentException(\"cannot have two verbs that map to the same id: \" + v + \" and \" + idMap[v.id]);\n                    idMap[v.id] = v;","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/net/Verb.java#L593-L629","documentation":"During the static Verb registry sweep, an unknown Kind falls outside the switch over built-in kinds (with a CUSTOM case) and triggers AssertionError. The sweep computes min/max ids to detect overlapping id allocations between built-in and custom verbs.","triggerScenarios":"Adding a new Kind to the Verb enum without extending the static-id-computation switch; a verb whose kind field is null or corrupted so it matches no case.","commonSituations":"Extending Verb.Kind for new message classes and forgetting to update every switch over Kind; typically caught immediately at class initialization.","solutions":["Add a case for the new Kind in the id-range computation block in Verb's static initializer","Verify every verb's kind is one of the enumerated Kind values","Run startup tests after introducing new Kind values to catch unhandled switches"],"exampleFix":"// before\ncase CUSTOM: minCustom = Math.min(v.id, minCustom); break;\ndefault: throw new AssertionError(...);\n// after\ncase CUSTOM: minCustom = Math.min(v.id, minCustom); break;\ncase NEW_KIND: /* handle id range */ break;\ndefault: throw new AssertionError(...);","handlingStrategy":"validation","validationCode":"for (Verb v : Verb.values()) { switch (v.kind) { case ... /* mirror the static switch */ default: throw new IllegalStateException(\"unhandled kind \" + v.kind); } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never add a Kind without updating every switch over Verb.Kind","Enable exhaustive-switch warnings/lint for Kind","Exercise class init in tests after any Kind change"],"tags":["network","enum","verb-kind","static-init"],"backgroundTag":"internal-invariant-violation","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}