-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(#291): InstantDeserializer fails to parse negative numeric timestamp strings for pre-1970 values #362
Conversation
Full Issue Title: InstantDeserializer fails to parse negative numeric timestamp strings for pre-1970 values. - Updated `InstantDeserializer._countPeriods(String)` to check for `-` and `+` at beginning of numeric string. - Additionally, added check if `ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS` is enabled. If disabled, throws same exception as before change from `_countPeriods(...)`. - Moved associated tests out of `failing` directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Would it be better to explicitly throw a |
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
Outdated
Show resolved
Hide resolved
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
Outdated
Show resolved
Hide resolved
I think this is ok. Parsing numbers from Strings is bit icky anyway. |
Changed the function signature of `_countPeriods(JsonParser, String)` to `_countPeriods(String, boolean)` per suggestion from user cowtowncoder
Fix for #291:
InstantDeserializer._countPeriods(String)
to check for-
and+
at beginning of numeric string.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS
is enabled. If disabled, throws same exception as before change from_countPeriods(...)
.failing
directory and then moved todeser
directory.