Skip to content

remove workaround for nasty double #750

@pjfanning

Description

@pjfanning

According to https://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ - the issue with this number was fixed in 2011. Instead of taking the hit to check for this string when parsing doubles, the code could be removed - eg for jackson v2.14.

https://www.exploringbinary.com/fpupdater-fixes-the-java-2-2250738585072012e-308-bug/

https://github.com/FasterXML/jackson-core/blob/2.14/src/main/java/com/fasterxml/jackson/core/io/NumberInput.java#L302

        // [JACKSON-486]: avoid some nasty float representations... but should it be MIN_NORMAL or MIN_VALUE?
        /* as per [JACKSON-827], let's use MIN_VALUE as it is available on all JDKs; normalized
         * only in JDK 1.6. In practice, should not really matter.
         */
        if (NASTY_SMALL_DOUBLE.equals(s)) {
            return Double.MIN_VALUE;
        }

If we proceed with #746, then maybe this change is safer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions