Skip to content

Commit

Permalink
EPMRPP-88602 || refactor deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Apr 1, 2024
1 parent c0f07a9 commit ab7722b
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,10 @@ public class MultiFormatDateDeserializer extends JsonDeserializer<Instant> {

@Override
public Instant deserialize(JsonParser parser, DeserializationContext context) throws IOException {

long longDate = parser.getLongValue();
if (longDate > 0) {
return Instant.ofEpochMilli(longDate);
}
try {
long millis = Long.parseLong(parser.getText());
return Instant.ofEpochMilli(millis);
} catch (NumberFormatException e) {
} catch (Exception e) {
// ignore
}

Expand Down

0 comments on commit ab7722b

Please sign in to comment.