{"record":{"id":"92b77830c6630ce2","repo":"apache/cassandra","slug":"invalid-value-for-system-property-expected-floati","errorCode":null,"errorMessage":"Invalid value for system property: expected floating point value but got '%s'","messagePattern":"Invalid value for system property: expected floating point value but got '(.+?)'","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/CassandraRelevantProperties.java","lineNumber":1150,"sourceCode":"        {\n            return FBUtilities.parseHumanReadableBytes(value);\n        }\n        catch (ConfigurationException e)\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for system property: \" +\n                                                           \"expected size in bytes with unit but got '%s'\\n%s\", value, e));\n        }\n    };\n\n    private static final PropertyConverter<Double> DOUBLE_CONVERTER = value ->\n    {\n        try\n        {\n            return Double.parseDouble(value);\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for system property: \" +\n                                                           \"expected floating point value but got '%s'\", value));\n        }\n    };\n\n    /**\n     * @return whether a system property is present or not.\n     */\n    public boolean isPresent()\n    {\n        return System.getProperties().containsKey(key);\n    }\n}\n","sourceCodeStart":1132,"sourceCodeEnd":1163,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java#L1132-L1163","documentation":"The DOUBLE_CONVERTER in CassandraRelevantProperties parses a system property as a Java double. If Double.parseDouble fails because the value is not a valid floating point literal, a ConfigurationException with this message is thrown, echoing the bad value.","triggerScenarios":"Assigning a non-numeric value to a system property whose converter is DOUBLE_CONVERTER, e.g. -Dsome.ratio=high or a value with a comma like 0,5 instead of 0.5.","commonSituations":"Locale mistakes (comma decimal separator), empty values in options files, accidentally passing a property name where a number belongs, YAML/env interpolation producing empty or textual output.","solutions":["Set the property to a plain decimal number using a dot as separator, e.g. 0.5 or 1.0","Check for empty values caused by shell variable expansion in cassandra-env.sh or jvm options","Print the property at startup (System.getProperty) or inspect the ConfigurationException message to see the exact offending value","Remove any units, percent signs, or thousands separators from the value"],"exampleFix":"// before\n-Dcassandra.some_double_ratio=0,75\n// after\n-Dcassandra.some_double_ratio=0.75","handlingStrategy":"validation","validationCode":"String v = System.getProperty(\"my.double.prop\", \"\");\nif (!v.matches(\"[+-]?\\\\d+(\\\\.\\\\d+)?([eE][+-]?\\\\d+)?\"))\n    throw new IllegalArgumentException(\"Property my.double.prop must be a decimal number, got: \" + v);","typeGuard":null,"tryCatchPattern":"try {\n    double d = Double.parseDouble(value);\n} catch (NumberFormatException e) {\n    logger.error(\"Non-numeric double property: \" + value);\n    d = DEFAULT;\n}","preventionTips":["Use dot as the decimal separator, never locale-specific commas","Avoid shell interpolation that can yield empty strings in options files","Strip units/percent signs before setting double-valued properties"],"tags":["configuration","system-properties","parsing"],"backgroundTag":"invalid-config-value","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"}