{"record":{"id":"e204f2871e2531bd","repo":"apache/cassandra","slug":"missing-separator","errorCode":null,"errorMessage":"Missing separator ","messagePattern":"Missing separator ","errorType":"validation","errorClass":"NumberFormatException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/utils/FBUtilities.java","lineNumber":1143,"sourceCode":"        double v = Double.parseDouble(m.group(0));\n\n        int pos = m.end();\n        if (m.group(2) == null) // possible binary exponent, parse\n        {\n            m = BINARY_EXPONENT.matcher(datum);\n            m.region(pos, end);\n            if (m.lookingAt())\n            {\n                int power = Integer.parseInt(m.group(1));\n                v = Math.scalb(v, power);\n                pos = m.end();\n            }\n        }\n\n        if (separator != null)\n        {\n            if (!datum.startsWith(separator, pos))\n                throw new NumberFormatException(\"Missing separator \" + separator + \" in \" + datum);\n            pos += separator.length();\n        }\n        else\n        {\n            while (pos < end && Character.isWhitespace(datum.charAt(pos)))\n                ++pos;\n        }\n\n        if (pos < end)\n        {\n            char prefixChar = datum.charAt(pos);\n            int prefixIndex = UNIT_PREFIXES.indexOf(prefixChar);\n            if (prefixIndex >= 0)\n            {\n                prefixIndex -= UNIT_PREFIXES_BASE;\n                ++pos;\n                if (pos < end && datum.charAt(pos) == 'i')\n                {","sourceCodeStart":1125,"sourceCodeEnd":1161,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/utils/FBUtilities.java#L1125-L1161","documentation":"parseHumanReadable supports values combining a number and a second component separated by a literal separator (e.g. '4x2GB' or '2 x 5GB'). This NumberFormatException is thrown when the expected separator string is not found at the position right after the parsed number.","triggerScenarios":"Calling parseHumanReadable(datum, separator, unit) where datum contains a number+unit but lacks the required separator, e.g. parseHumanReadable(\"4x2GB\", \"x\", \"GB\") given \"4*2GB\" or \"4 2GB\".","commonSituations":"Config values using a different separator character than the caller expects (asterisk vs 'x'), missing separator entirely, or extra whitespace preventing an exact match.","solutions":["Use the exact separator the caller expects (e.g. write 4x2GB when 'x' is the separator)","Remove extra whitespace if the separator match is exact (e.g. use '4x2GB' not '4 x 2GB' when separator is 'x')","Check the calling code to see which separator string it passes and match it in your config","Make the separator optional in the caller if both forms should be accepted"],"exampleFix":"// before: parseHumanReadable(\"4*2GB\", \"x\", \"GB\")\n// after:  parseHumanReadable(\"4x2GB\", \"x\", \"GB\")","handlingStrategy":"validation","validationCode":"if (separator != null && !value.contains(separator)) throw new IllegalArgumentException(\"expected separator '\" + separator + \"' in \" + value);","typeGuard":null,"tryCatchPattern":"try { return FBUtilities.parseHumanReadable(s, \"x\", \"GB\"); } catch (NumberFormatException e) { throw new ConfigurationException(\"Value '\" + s + \"' must look like '4x2GB'\", e); }","preventionTips":["Match the exact separator character the calling code expects","Document the accepted value format next to the config option","Normalize whitespace before parsing"],"tags":["parsing","number-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-17T15:17:12.973Z"}