{"record":{"id":"19591fe53953be23","repo":"apache/cassandra","slug":"invalid-parameter-list-for-fixed-distribution","errorCode":null,"errorMessage":"Invalid parameter list for fixed distribution: ","messagePattern":"Invalid parameter list for fixed distribution: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java","lineNumber":358,"sourceCode":"                final long max = parseLong(bounds[1]);\n                if (min == max)\n                    return new FixedFactory(min);\n                return new UniformFactory(min, max);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for uniform distribution: \" + params);\n            }\n        }\n    }\n\n    private static final class FixedImpl implements Impl\n    {\n\n        @Override\n        public DistributionFactory getFactory(List<String> params)\n        {\n            if (params.size() != 1)\n                throw new IllegalArgumentException(\"Invalid parameter list for fixed distribution: \" + params);\n            try\n            {\n                final long key = parseLong(params.get(0));\n                return new FixedFactory(key);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for fixed distribution: \" + params);\n            }\n        }\n    }\n\n    private static final class SequenceImpl implements Impl\n    {\n\n        @Override\n        public DistributionFactory getFactory(List<String> params)\n        {\n            if (params.size() != 1)","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java#L340-L376","documentation":"cassandra-stress throws this when the 'fixed' distribution spec (e.g. FIX(1)) is given a parameter list whose size is not exactly 1. The Fixed distribution impl requires exactly one long value to return a constant. Any other arity, or a value that fails to parse as a long, is rejected as an IllegalArgumentException.","triggerScenarios":"Invoking cassandra-stress with a distribution spec like 'fixed' followed by zero, two or more parameters (e.g. 'FIX(1,2)' or 'FIX()'), or the params list missing entirely.","commonSituations":"Typing a comma-separated pair into a distribution that only takes one value; copying a Gaussian/Uniform spec style into FIX; extra whitespace causing the tokenizer to split args unexpectedly; passing a non-numeric token so parseLong fails.","solutions":["Pass exactly one numeric argument: -pop seq=FIX(10000)","Remove extra comma-separated values; to get a range use seq distribution instead: SEQ(1..10000)","Verify the value parses as a whole number (no suffixes, decimals, or quotes)."],"exampleFix":"// before\n-fixed=FIX(1,2)\n// after\n-fixed=FIX(1)","handlingStrategy":"validation","validationCode":"boolean isValidFixSpec(String s){ java.util.List<String> p = splitParams(s); if (p.size()!=1) return false; try { Long.parseLong(p.get(0)); return true; } catch (NumberFormatException e){ return false; } }","typeGuard":null,"tryCatchPattern":"try { DistributionFactory f = OptionDistribution.get(\"FIX(\" + v + \")\"); } catch (IllegalArgumentException e) { log.error(\"Bad FIX spec: {}\", e.getMessage()); }","preventionTips":["Always wrap single values in FIX(...)","Use whole numbers only","Prefer the OptionDistribution.get(...) helpers which validate early"],"tags":["cli","argument-validation","distribution"],"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"}