Closed brenuart closed 4 years ago
Thank you for reporting this. I'll transfer it to Joda module.
I was wondering if the issue belongs to the joda module or not.
The problem is caused by the JsonFormat.Value
containing a null
pattern value when created by one of the with*()
methods but having an empty string when used as an annotation. If this is normal and expected - then indeed the issue belongs to Joda...
@brenuart Ah. Ok, in that case I think I better have a look myself. It is possible change is needed in multiple places. Thank you for additional information!
(Jackson version:
2.10.1
)Consider the following example:
This code raises the following exception:
This is caused by
JsonFormat.Value#getPattern()
returningnull
at line https://github.com/FasterXML/jackson-datatype-joda/blob/master/src/main/java/com/fasterxml/jackson/datatype/joda/cfg/JacksonJodaDateFormat.java#L123.Note that
getPattern
returns an empty string whenJsonFormat
comes from an annotation, butnull
when created because ofObjectMapper.setDefaultLenciency()
.