Skip to content

Commit a061742

Browse files
committed
Merge branch '2.12'
2 parents 1113e9b + 4d1f4cf commit a061742

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public CollectionDeserializer createContextual(DeserializationContext ctxt,
182182
valueTypeDeser = valueTypeDeser.forProperty(property);
183183
}
184184
NullValueProvider nuller = findContentNullProvider(ctxt, property, valueDeser);
185-
if ( (unwrapSingle != _unwrapSingle)
185+
if ((unwrapSingle != _unwrapSingle)
186186
|| (nuller != _nullProvider)
187187
|| (delegateDeser != _delegateDeserializer)
188188
|| (valueDeser != _valueDeserializer)
@@ -229,9 +229,15 @@ public Collection<Object> deserialize(JsonParser p, DeserializationContext ctxt)
229229
// there is also possibility of "auto-wrapping" of single-element arrays.
230230
// Hence we only accept empty String here.
231231
if (p.hasToken(JsonToken.VALUE_STRING)) {
232-
String str = p.getText();
233-
if (str.length() == 0) {
234-
return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str);
232+
// 16-May-2020, tatu: As [dataformats-text#199] need to avoid blocking
233+
// check to `isExpectedStartArrayToken()` (needed for CSV in-field array/list logic)
234+
// ... alas, trying to do this here leads to 2 unit test regressions so will
235+
// need to figure out safer mechanism.
236+
// if (_valueInstantiator.canCreateFromString()) {
237+
String str = p.getText();
238+
if (str.length() == 0) {
239+
return (Collection<Object>) _valueInstantiator.createFromString(ctxt, str);
240+
// }
235241
}
236242
}
237243
return deserialize(p, ctxt, createDefaultInstance(ctxt));

src/test/java/com/fasterxml/jackson/databind/deser/jdk/JDKScalarsTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ private void _testEmptyToNullCoercion(Class<?> primType, Object emptyValue) thro
573573
public void testBase64Variants() throws Exception
574574
{
575575
final byte[] INPUT = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890X".getBytes("UTF-8");
576-
576+
577577
// default encoding is "MIME, no linefeeds", so:
578578
Assert.assertArrayEquals(INPUT, MAPPER.readValue(
579579
quote("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwWA=="),
@@ -594,7 +594,7 @@ public void testBase64Variants() throws Exception
594594
Assert.assertArrayEquals(INPUT, (byte[]) reader.with(Base64Variants.PEM).readValue(
595595
quote("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwYWJjZGVmZ2hpamts\\nbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwWA=="
596596
)));
597-
}
597+
}
598598

599599
/*
600600
/**********************************************************

0 commit comments

Comments
 (0)