{"record":{"id":"ce528daa5dec8f40","repo":"apache/cassandra","slug":"invalid-specification-ce528d","errorCode":null,"errorMessage":"Invalid  specification: ","messagePattern":"Invalid  specification: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/OptionMulti.java","lineNumber":87,"sourceCode":"    {\n        this.name = name;\n        pattern = Pattern.compile(name + \"\\\\((.*)\\\\)\", Pattern.CASE_INSENSITIVE);\n        this.description = description;\n        this.collectAsMap = collectExtraOptionsInMap ? new CollectAsMap() : null;\n    }\n\n    @Override\n    public boolean accept(String param)\n    {\n        Matcher m = pattern.matcher(param);\n        if (!m.matches())\n            return false;\n        m = ARGS.matcher(m.group(1));\n        int last = -1;\n        while (m.find())\n        {\n            if (m.start() != last + 1)\n                throw new IllegalArgumentException(\"Invalid \" + name + \" specification: \" + param);\n            last = m.end();\n            if (!delegate.accept(m.group()))\n            {\n\n                throw new IllegalArgumentException(\"Invalid \" + name + \" specification: \" + m.group());\n            }\n        }\n        return true;\n    }\n\n    public String toString()\n    {\n        StringBuilder sb = new StringBuilder();\n        sb.append(name);\n        sb.append(\"(\");\n        for (Option option : delegate.options())\n        {\n            sb.append(option);","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/OptionMulti.java#L69-L105","documentation":"OptionMulti parses a compound spec (like a compound 'key=value,rate' list, e.g. 'read=1,write=2') with a regex and requires the tokens to be contiguous matches. When a token starts at a position other than lastEnd+1, the whole parameter is malformed (stray characters between comma-separated parts), producing 'Invalid <name> specification: <param>'.","triggerScenarios":"A spec string with stray/unrecognized characters between recognized tokens, e.g. 'read=1,,write=2' or 'read=1; write=2', so the matcher finds a gap.","commonSituations":"Double commas from template substitution; using ';' instead of ','; spaces inside the spec that the regex treats as noise; copied specs with invisible characters.","solutions":["Remove stray characters so tokens are contiguous and comma-separated: read=1,write=2","Quote the whole spec for the shell and avoid internal spaces","Test the spec string against the expected '<name>=<value>[,...]' pattern before invoking."],"exampleFix":"// before\n-read=1,,write=2\n// after\n-read=1,write=2","handlingStrategy":"validation","validationCode":"boolean wellFormed(String spec){ return spec.matches(\"([A-Za-z_]+=\\\\d+)(,[A-Za-z_]+=\\\\d+)*\"); } // contiguous, comma-separated key=value","typeGuard":null,"tryCatchPattern":"try { opt.accept(spec); } catch (IllegalArgumentException e) { log.error(\"Malformed compound spec '{}'\", spec); }","preventionTips":["Regex-check the full spec before invoking stress","Avoid spaces and stray separators inside compound specs","Build specs programmatically with join(',', pairs) rather than string concatenation"],"tags":["cli","argument-validation","parsing"],"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-17T15:17:12.973Z"}