Skip to content

Commit ddf45b4

Browse files
committed
Add test to verify fixing of #474 (for 2.13)
1 parent 8e722bb commit ddf45b4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

release-notes/VERSION-2.x

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Project: jackson-dataformat-xml
1414
(reported by Fabian M)
1515
#465: ArrayIndexOutOfBoundsException in UTF8Reader (ossfuzz)
1616
(reported by Fabian M)
17+
#474: Empty String ("") parsed as 0 for int even if
18+
DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES enabled (note:
19+
actual fix in `jackson-databind)
1720
- Woodstox dependency 6.2.6 (from 6.2.4)
1821

1922
2.12.4 (not yet released)

src/test/java/com/fasterxml/jackson/dataformat/xml/deser/EmptyWithScalarsTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import java.math.BigDecimal;
44
import java.math.BigInteger;
55

6+
import com.fasterxml.jackson.databind.DeserializationFeature;
7+
import com.fasterxml.jackson.databind.ObjectReader;
8+
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
9+
610
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
711
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
812
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
@@ -72,7 +76,6 @@ public void testPrimitiveFPsWithEmpty() throws Exception
7276
// (will try to fix in 2.13, but not 2.12)
7377
public void testPrimitivesNoNulls() throws Exception
7478
{
75-
/*
7679
ObjectReader r = MAPPER
7780
.readerFor(NumbersPrimitive.class)
7881
.with(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
@@ -88,9 +91,8 @@ private void _testPrimitivesNoNulls(ObjectReader r, String doc) throws Exception
8891
r.readValue(_emptyWrapped("i"));
8992
fail("Should not pass");
9093
} catch (MismatchedInputException e) {
91-
verifyException(e, "Cannot coerce empty String");
94+
verifyException(e, "Cannot coerce `null` to ");
9295
}
93-
*/
9496
}
9597

9698
/*

0 commit comments

Comments
 (0)