{"record":{"id":"f00d48daee0e813e","repo":"apache/cassandra","slug":"invalid-modifier-specification-spec-substring","errorCode":null,"errorMessage":"Invalid modifier specification: '${spec.substring(next, end)}'; expecting '=' for value assignment","messagePattern":"Invalid modifier specification: '(.+?)'; expecting '=' for value assignment","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/RetryStrategy.java","lineNumber":275,"sourceCode":"    }\n\n    public static RetryStrategy parse(String spec, LatencySourceFactory latencies)\n    {\n        return parse(spec, latencies, null);\n    }\n\n    public static RetryStrategy parse(String spec, LatencySourceFactory latencies, WaitRandomizer randomizer)\n    {\n        String original = spec;\n        int retries = Integer.MAX_VALUE;\n        int end = spec.length();\n        {\n            int next;\n            while ((next = spec.lastIndexOf(',', end - 1)) >= 0)\n            {\n                int mid = spec.indexOf('=', next + 1);\n                if (mid <= next || mid >= end)\n                    throw new IllegalArgumentException(\"Invalid modifier specification: '\" + spec.substring(next, end) + \"'; expecting '=' for value assignment\");\n                String key = spec.substring(next + 1, mid).trim();\n                String value = spec.substring(mid + 1, end).trim();\n                switch (key)\n                {\n                    default: throw new IllegalArgumentException(\"Invalid modifier specification: unrecognised property '\" + key + '\\'');\n                    case \"retries\":\n                        retries = Integer.parseInt(value);\n                        if (retries < 0)\n                            throw new IllegalArgumentException(\"retries must be non-negative (retries=\" + value + \" supplied)\");\n                        break;\n                    case \"attempts\":\n                        retries = Integer.parseInt(value);\n                        if (retries < 0)\n                            throw new IllegalArgumentException(\"Must permit at least one attempt (attempts=\" + value + \" supplied)\");\n                        break;\n                    case \"rnd\":\n                        if (randomizer != null)\n                            throw new IllegalArgumentException(\"Randomizer already specified, cannot re-specify: \" + value);","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/RetryStrategy.java#L257-L293","documentation":"RetryStrategy.parse processes comma-separated `key=value` modifiers in the retry/abort spec string; if a modifier segment contains no '=' (or it is positioned outside the segment), the parser rejects the fragment as an invalid modifier specification.","triggerScenarios":"Passing a spec like `retry(3,mkdir)` or `retry(3,retries)` where a modifier lacks `key=value` form; malformed spacing or a missing value after '='.","commonSituations":"Hand-editing a retry strategy spec string in configuration (e.g. `max_retries=3,millis_between=100` typo'd); copy-paste dropping the '=value' part; using an unrecognized property name which triggers the adjacent 'unrecognised property' error.","solutions":["Ensure every modifier is `key=value` (e.g. `retries=3`), comma-separated, inside the strategy spec","Check spelling of supported keys (retries, ...) per RetryStrategy's parser","Quote the spec in config files so spaces/commas are not mangled"],"exampleFix":"// before\nretry(3,retries)\n// after\nretry(3,retries=5)","handlingStrategy":"validation","validationCode":"// validate each modifier segment has key=value before parsing\nfor (String seg : spec.split(\",\"))\n    if (!seg.contains(\"=\"))\n        throw new IllegalArgumentException(\"modifier missing '=': \" + seg);","typeGuard":null,"tryCatchPattern":"try { RetryStrategy.parse(spec); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"expecting '=' for value assignment\")) RetryStrategy.parse(fixSpec(spec)); else throw e; }","preventionTips":["Follow the documented modifier syntax key=value pairs in strategy specs","Keep spec strings in quoted config values to avoid shell mangling","Test-parse strategy specs at config load time, before runtime use"],"tags":["parsing","configuration","retry","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}