Skip to content

Commit

Permalink
Minor tweak to #65 wrt key handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 5, 2018
1 parent 8aafca1 commit ff76427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.IOException;
import java.time.DateTimeException;
import java.time.format.DateTimeParseException;

import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
Expand Down Expand Up @@ -30,7 +29,7 @@ protected <T> T _handleDateTimeException(DeserializationContext ctxt,
Class<?> type, DateTimeException e0, String value) throws IOException
{
try {
return (T) ctxt.handleWeirdStringValue(type, value,
return (T) ctxt.handleWeirdKey(type, value,
"Failed to deserialize %s: (%s) %s",
type.getName(), e0.getClass().getName(), e0.getMessage());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testDateTimeExceptionIsHandled() throws Throwable
LocalDateTime now = LocalDateTime.now();
DeserializationProblemHandler handler = new DeserializationProblemHandler() {
@Override
public Object handleWeirdStringValue(DeserializationContext ctxt, Class<?> targetType,
public Object handleWeirdKey(DeserializationContext ctxt, Class<?> targetType,
String valueToConvert, String failureMsg) throws IOException {
if (LocalDateTime.class == targetType) {
if ("now".equals(valueToConvert)) {
Expand Down

0 comments on commit ff76427

Please sign in to comment.