Skip to content

Commit efe3caa

Browse files
committed
Another fix to OSS-Fuzz reported edge case
1 parent bf7bae0 commit efe3caa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

guava/src/main/java/com/fasterxml/jackson/datatype/guava/deser/RangeDeserializer.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
1616
import com.fasterxml.jackson.databind.type.LogicalType;
1717
import com.fasterxml.jackson.databind.type.TypeFactory;
18-
18+
import com.fasterxml.jackson.databind.util.ClassUtil;
1919
import com.fasterxml.jackson.datatype.guava.deser.util.RangeFactory;
2020
import com.fasterxml.jackson.datatype.guava.deser.util.RangeHelper;
2121

@@ -131,7 +131,7 @@ public Range<?> deserialize(JsonParser p, DeserializationContext context)
131131
throws IOException
132132
{
133133
// NOTE: either START_OBJECT _or_ FIELD_NAME fine; latter for polymorphic cases
134-
JsonToken t = p.getCurrentToken();
134+
JsonToken t = p.currentToken();
135135
if (t == JsonToken.START_OBJECT) {
136136
t = p.nextToken();
137137
}
@@ -195,7 +195,7 @@ public Range<?> deserialize(JsonParser p, DeserializationContext context)
195195

196196
private BoundType deserializeBoundType(DeserializationContext context, JsonParser p) throws IOException
197197
{
198-
expect(context, JsonToken.VALUE_STRING, p.getCurrentToken());
198+
expect(context, JsonToken.VALUE_STRING, p.currentToken());
199199
String name = p.getText();
200200
if (name == null) {
201201
name = "";
@@ -227,8 +227,9 @@ private Comparable<?> deserializeEndpoint(DeserializationContext context, JsonPa
227227
// assume definition, but may need to reconsider
228228
context.reportBadDefinition(_rangeType,
229229
String.format(
230-
"Field [%s] deserialized to [%s], which does not implement Comparable.",
231-
p.currentName(), obj.getClass().getName()));
230+
"Field '%s' deserialized to a %s, which does not implement Comparable.",
231+
p.currentName(),
232+
ClassUtil.classNameOf(obj)));
232233
}
233234
return (Comparable<?>) obj;
234235
}

0 commit comments

Comments
 (0)