Skip to content

Commit ff76427

Browse files
committed
Minor tweak to #65 wrt key handling
1 parent 8aafca1 commit ff76427

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/key/Jsr310KeyDeserializer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.io.IOException;
44
import java.time.DateTimeException;
5-
import java.time.format.DateTimeParseException;
65

76
import com.fasterxml.jackson.databind.DeserializationContext;
87
import com.fasterxml.jackson.databind.JsonMappingException;
@@ -30,7 +29,7 @@ protected <T> T _handleDateTimeException(DeserializationContext ctxt,
3029
Class<?> type, DateTimeException e0, String value) throws IOException
3130
{
3231
try {
33-
return (T) ctxt.handleWeirdStringValue(type, value,
32+
return (T) ctxt.handleWeirdKey(type, value,
3433
"Failed to deserialize %s: (%s) %s",
3534
type.getName(), e0.getClass().getName(), e0.getMessage());
3635

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestLocalDateTimeKeySerialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void testDateTimeExceptionIsHandled() throws Throwable
8585
LocalDateTime now = LocalDateTime.now();
8686
DeserializationProblemHandler handler = new DeserializationProblemHandler() {
8787
@Override
88-
public Object handleWeirdStringValue(DeserializationContext ctxt, Class<?> targetType,
88+
public Object handleWeirdKey(DeserializationContext ctxt, Class<?> targetType,
8989
String valueToConvert, String failureMsg) throws IOException {
9090
if (LocalDateTime.class == targetType) {
9191
if ("now".equals(valueToConvert)) {

0 commit comments

Comments
 (0)