Skip to content

Commit

Permalink
Add test to verify fixing of #474 (for 2.13)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 4, 2021
1 parent 8e722bb commit ddf45b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Project: jackson-dataformat-xml
(reported by Fabian M)
#465: ArrayIndexOutOfBoundsException in UTF8Reader (ossfuzz)
(reported by Fabian M)
#474: Empty String ("") parsed as 0 for int even if
DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES enabled (note:
actual fix in `jackson-databind)
- Woodstox dependency 6.2.6 (from 6.2.4)

2.12.4 (not yet released)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.math.BigDecimal;
import java.math.BigInteger;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.exc.MismatchedInputException;

import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
Expand Down Expand Up @@ -72,7 +76,6 @@ public void testPrimitiveFPsWithEmpty() throws Exception
// (will try to fix in 2.13, but not 2.12)
public void testPrimitivesNoNulls() throws Exception
{
/*
ObjectReader r = MAPPER
.readerFor(NumbersPrimitive.class)
.with(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
Expand All @@ -88,9 +91,8 @@ private void _testPrimitivesNoNulls(ObjectReader r, String doc) throws Exception
r.readValue(_emptyWrapped("i"));
fail("Should not pass");
} catch (MismatchedInputException e) {
verifyException(e, "Cannot coerce empty String");
verifyException(e, "Cannot coerce `null` to ");
}
*/
}

/*
Expand Down

0 comments on commit ddf45b4

Please sign in to comment.