Was making some hardcore tests on my EveryConfig and got a problem on the TOML parser.
The problem
When a value is a non-finite double (NaN, positive infinity, or negative infinity), TomlMapper writes it using the Java text form NaN, Infinity, or -Infinity. That is not valid TOML. The TOML spec uses nan, inf, and -inf instead. Because of this, the output produced by the writer cannot be parsed again by the same TomlMapper: reading it back fails with Unknown token.
This is a writer-only problem. The reader already understands the correct TOML tokens nan, inf, +inf, and -inf, and reads them back as proper floating-point values. So writing nan / inf / -inf instead of the Java form would make these values round-trip, and it would need no change to the reader.
How to reproduce
import com.fasterxml.jackson.dataformat.toml.TomlMapper;
import java.util.Collections;
TomlMapper mapper = new TomlMapper();
// The writer produces a line that is not valid TOML.
String toml = mapper.writeValueAsString(Collections.singletonMap("x", Double.NaN));
System.out.println(toml); // x = NaN
// Reading the writer's own output fails.
mapper.readTree(toml); // throws TomlStreamReadException: Unknown token
// The reader does accept the spec form, which shows the fix is safe.
mapper.readTree("x = nan"); // ok: "x" is a number whose value is NaN
Reproduced with jackson-dataformat-toml 2.22.0 (latest at the time of writing). The behavior is the same on older 2.x releases.

Was making some hardcore tests on my EveryConfig and got a problem on the TOML parser.
The problem
When a value is a non-finite
double(NaN, positive infinity, or negative infinity),TomlMapperwrites it using the Java text formNaN,Infinity, or-Infinity. That is not valid TOML. The TOML spec usesnan,inf, and-infinstead. Because of this, the output produced by the writer cannot be parsed again by the sameTomlMapper: reading it back fails withUnknown token.This is a writer-only problem. The reader already understands the correct TOML tokens
nan,inf,+inf, and-inf, and reads them back as proper floating-point values. So writingnan/inf/-infinstead of the Java form would make these values round-trip, and it would need no change to the reader.How to reproduce
Reproduced with
jackson-dataformat-toml2.22.0 (latest at the time of writing). The behavior is the same on older 2.x releases.