From e4a993cdfb6ea5f28f6656cb35ed919d02b2310d Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Wed, 27 Dec 2023 08:44:02 +0000 Subject: [PATCH 1/7] Add null checking before accessing integer size Signed-off-by: Arthur Chan --- .../jackson/dataformat/ion/IonParser.java | 3 ++ .../ion/fuzz/Fuzz434_65268_NPETest.java | 37 +++++++++++++++++++ ion/src/test/resources/data/fuzz-65268.ion | 3 ++ 3 files changed, 43 insertions(+) create mode 100644 ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java create mode 100644 ion/src/test/resources/data/fuzz-65268.ion diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java index 55c83817b..e9c6c3894 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java @@ -398,6 +398,9 @@ public NumberType getNumberType() throws IOException return NumberType.BIG_DECIMAL; case INT: IntegerSize size = _reader.getIntegerSize(); + if (size == null) { + _reportError("Current token (%s) not integer", _currToken); + } switch (size) { case INT: return NumberType.INT; diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java new file mode 100644 index 000000000..12606799b --- /dev/null +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java @@ -0,0 +1,37 @@ +package com.fasterxml.jackson.dataformat.ion.fuzz; + +import java.io.InputStream; + +import org.hamcrest.Matchers; +import org.junit.Test; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.exc.StreamReadException; +import com.fasterxml.jackson.dataformat.ion.*; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +// [dataformats-binary#434 +public class Fuzz434_65268_NPETest +{ + private final IonFactory factory = + IonFactory.builderForTextualWriters().build(); + + @Test + public void testFuzz65268() throws Exception { + try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65268.ion")) { + try (JsonParser p = factory.createParser(in)) { + p.nextToken(); + p.getText(); + p.nextTextValue(); + p.getNumberType(); + } + fail("Should not pass (invalid content)"); + } catch (StreamReadException e) { + assertThat(e.getMessage(), Matchers.containsString("not integer")); + } + } +} diff --git a/ion/src/test/resources/data/fuzz-65268.ion b/ion/src/test/resources/data/fuzz-65268.ion new file mode 100644 index 000000000..dd1539cbf --- /dev/null +++ b/ion/src/test/resources/data/fuzz-65268.ion @@ -0,0 +1,3 @@ +n + +null.intÿÿÿÿ~ÿÿÿttttt(þtõ740ôßßôßôßôßnÄÄÄÄ66}tt From 4c47b7503a363566607c0c3d4493e9c3203847ca Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Wed, 27 Dec 2023 13:21:11 +0000 Subject: [PATCH 2/7] Wrap the method call with try catch block Signed-off-by: Arthur Chan --- .../jackson/dataformat/ion/IonParser.java | 7 +- .../ion/fuzz/Fuzz434_65268_65274_NPETest.java | 60 ++++++++++++++++++ .../ion/fuzz/Fuzz434_65268_NPETest.java | 37 ----------- ion/src/test/resources/data/fuzz-65274.ion | Bin 0 -> 5214 bytes 4 files changed, 66 insertions(+), 38 deletions(-) create mode 100644 ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java delete mode 100644 ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java create mode 100644 ion/src/test/resources/data/fuzz-65274.ion diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java index e9c6c3894..e4eb7ab12 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java @@ -397,7 +397,12 @@ public NumberType getNumberType() throws IOException //Ion decimals can be arbitrary precision, need to read as big decimal return NumberType.BIG_DECIMAL; case INT: - IntegerSize size = _reader.getIntegerSize(); + IntegerSize size = null; + try { + size = _reader.getIntegerSize(); + } catch (NullPointerException e) { + // Possible exception + } if (size == null) { _reportError("Current token (%s) not integer", _currToken); } diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java new file mode 100644 index 000000000..950e8084c --- /dev/null +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java @@ -0,0 +1,60 @@ +package com.fasterxml.jackson.dataformat.ion.fuzz; + +import java.io.InputStream; + +import org.hamcrest.Matchers; +import org.junit.Test; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.exc.StreamReadException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.ion.*; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.*; +import java.nio.file.*; + +// [dataformats-binary#434 +public class Fuzz434_65268_65274_NPETest +{ + @Test + public void testFuzz65268() throws Exception { + final IonFactory factory = + IonFactory.builderForTextualWriters().build(); + try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65268.ion")) { + try (JsonParser p = factory.createParser(in)) { + p.nextToken(); + p.getText(); + p.nextTextValue(); + p.getNumberType(); + } + fail("Should not pass (invalid content)"); + } catch (StreamReadException e) { + assertThat(e.getMessage(), Matchers.containsString("not integer")); + } + } + + @Test + public void testFuzz65274() throws Exception { + final ObjectMapper MAPPER = + IonObjectMapper.builder( + IonFactory.builderForBinaryWriters() + .enable(IonParser.Feature.USE_NATIVE_TYPE_ID) + .build()) + .build(); + + try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65274.ion")) { + byte[] invalid = in.readAllBytes(); + try (JsonParser p = MAPPER.getFactory().createParser(new ByteArrayInputStream(invalid))) { + MAPPER.readTree(p); + } + fail("Should not pass (invalid content)"); + } catch (StreamReadException e) { + assertThat(e.getMessage(), Matchers.containsString("not integer")); + } + } +} diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java deleted file mode 100644 index 12606799b..000000000 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_NPETest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fasterxml.jackson.dataformat.ion.fuzz; - -import java.io.InputStream; - -import org.hamcrest.Matchers; -import org.junit.Test; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.exc.StreamReadException; -import com.fasterxml.jackson.dataformat.ion.*; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -// [dataformats-binary#434 -public class Fuzz434_65268_NPETest -{ - private final IonFactory factory = - IonFactory.builderForTextualWriters().build(); - - @Test - public void testFuzz65268() throws Exception { - try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65268.ion")) { - try (JsonParser p = factory.createParser(in)) { - p.nextToken(); - p.getText(); - p.nextTextValue(); - p.getNumberType(); - } - fail("Should not pass (invalid content)"); - } catch (StreamReadException e) { - assertThat(e.getMessage(), Matchers.containsString("not integer")); - } - } -} diff --git a/ion/src/test/resources/data/fuzz-65274.ion b/ion/src/test/resources/data/fuzz-65274.ion new file mode 100644 index 0000000000000000000000000000000000000000..5e6ca06fd7e9593ff4e4b4c9c67c1c54dd911892 GIT binary patch literal 5214 zcmeHK&1(}u6raUN{{aP0LMU#qN)WOQ6^WkoA{KK~h=&C=G))@2G3qH-1=05Ao<#5@ zNCoS~lj6-H!IL*ZuR{NUP_XaK=iAL>9cpT*?So|B%)EW`zINvKet7Ixf671082j8W z6rxfexEuY#0;j7vzZP?P{z5#}|FU8p#Wjn}8ei5zQg~Ip6vt$#z-P%CjPpQRc$7dw zNJ|q%Vv~?BjZ&iDlLCyoWATj38|zOS_h(3qvi% z2_mAGGT-m{K~U=4jX)=3^YaaMld;a`+REnodO~4p-~}hqAZbKTbJRlXi5}Weq+UcO5jP30iGZ+&8+1lZXS`zD?)%Gn9bYBc;F^pY0$PbsHf9ACM!`@< z$kIVIm~yhEhv!25EyvFktNRX|Q1u2ZsR$)XGm&@=1Z-RGydnm+OXF3tW6>awHVG2T za;Vn`?}ZPFi9Uxz8((xk-!$OScew-Rw1LMox?TjKouX^eTL7F^;MO}Vw;Tt=1|5j9 zf2vMv+QDOGh|P1D69xmL^I-+u&^6-DElUT)1pHW}#;4EA5;yex}q3NH>KnTW@T)ufV4aIZ^J;X7}Sf z;9G+d5BV(ggq`j={CtYdaH(Fr*zUIY89 Date: Wed, 27 Dec 2023 13:29:00 +0000 Subject: [PATCH 3/7] Fix for Java 8 Signed-off-by: Arthur Chan --- .../dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java index 950e8084c..8373a3eac 100644 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java @@ -1,6 +1,6 @@ package com.fasterxml.jackson.dataformat.ion.fuzz; -import java.io.InputStream; +import java.io.*; import org.hamcrest.Matchers; import org.junit.Test; @@ -15,9 +15,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import java.io.*; -import java.nio.file.*; - // [dataformats-binary#434 public class Fuzz434_65268_65274_NPETest { @@ -48,7 +45,8 @@ public void testFuzz65274() throws Exception { .build(); try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65274.ion")) { - byte[] invalid = in.readAllBytes(); + byte[] invalid = new byte[in.available()]; + new DataInputStream(in).readFully(invalid); try (JsonParser p = MAPPER.getFactory().createParser(new ByteArrayInputStream(invalid))) { MAPPER.readTree(p); } From e3378bea05943114f2f4a16a42e9231b58b56cbf Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Thu, 28 Dec 2023 02:55:49 +0000 Subject: [PATCH 4/7] Fix comment Signed-off-by: Arthur Chan --- .../java/com/fasterxml/jackson/dataformat/ion/IonParser.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java index e4eb7ab12..2a9716878 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java @@ -398,6 +398,8 @@ public NumberType getNumberType() throws IOException return NumberType.BIG_DECIMAL; case INT: IntegerSize size = null; + // Temporary measure until this bug fixing is merged and published + // https://github.com/amazon-ion/ion-java/issues/685 try { size = _reader.getIntegerSize(); } catch (NullPointerException e) { From 2345a6733a12e76f4c4a9707c91089d84d9f4775 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 30 Dec 2023 12:16:43 -0800 Subject: [PATCH 5/7] Refactor to avoid exception for `JsonParser.getNumberType()` on `JsonToken.VALUE_NULL` --- .../jackson/dataformat/ion/IonParser.java | 62 ++++++++++--------- .../ion/fuzz/Fuzz434_65268_65274_NPETest.java | 53 ++++++++-------- 2 files changed, 61 insertions(+), 54 deletions(-) diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java index 4fd2ff357..0d91dfd67 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java @@ -384,37 +384,43 @@ private void _verifyIsNumberToken() throws IOException @Override public NumberType getNumberType() throws IOException { - IonType type = _reader.getType(); - if (type != null) { - // Hmmh. Looks like Ion gives little bit looser definition here; - // harder to pin down exact type. But let's try some checks still. - switch (type) { - case DECIMAL: - //Ion decimals can be arbitrary precision, need to read as big decimal - return NumberType.BIG_DECIMAL; - case INT: - IntegerSize size = null; - // Temporary measure until this bug fixing is merged and published - // https://github.com/amazon-ion/ion-java/issues/685 - try { - size = _reader.getIntegerSize(); - } catch (NullPointerException e) { - // Possible exception - } - if (size == null) { - _reportError("Current token (%s) not integer", _currToken); - } - switch (size) { + if (_currToken == JsonToken.VALUE_NUMBER_INT + || _currToken == JsonToken.VALUE_NUMBER_FLOAT) { + IonType type = _reader.getType(); + if (type != null) { + // Hmmh. Looks like Ion gives little bit looser definition here; + // harder to pin down exact type. But let's try some checks still. + switch (type) { + case DECIMAL: + //Ion decimals can be arbitrary precision, need to read as big decimal + return NumberType.BIG_DECIMAL; case INT: - return NumberType.INT; - case LONG: - return NumberType.LONG; + final IntegerSize size; + // [dataformats-binary#434]: another problem with corrupt data handling. + // Temporary measure until this bug fixing is merged and published + // https://github.com/amazon-ion/ion-java/issues/685 + try { + size = _reader.getIntegerSize(); + } catch (IonException e) { + return _reportCorruptNumber(e); + } catch (NullPointerException e) { + return _reportCorruptContent(e); + } + if (size == null) { + _reportError("Current token (%s) not integer", _currToken); + } + switch (size) { + case INT: + return NumberType.INT; + case LONG: + return NumberType.LONG; + default: + return NumberType.BIG_INTEGER; + } + case FLOAT: + return NumberType.DOUBLE; default: - return NumberType.BIG_INTEGER; } - case FLOAT: - return NumberType.DOUBLE; - default: } } return null; diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java index 8373a3eac..5b1ff4a93 100644 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java @@ -13,46 +13,47 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; -// [dataformats-binary#434 +// [dataformats-binary#434] public class Fuzz434_65268_65274_NPETest { + private final ObjectMapper ION_MAPPER = new IonObjectMapper(); + + // Test that used to fail on "getNumberType()" for `JsonToken.VALUE_NULL` @Test public void testFuzz65268() throws Exception { - final IonFactory factory = - IonFactory.builderForTextualWriters().build(); try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65268.ion")) { - try (JsonParser p = factory.createParser(in)) { - p.nextToken(); + try (JsonParser p = ION_MAPPER.createParser(in)) { + assertEquals(JsonToken.VALUE_STRING, p.nextToken()); p.getText(); - p.nextTextValue(); - p.getNumberType(); + assertNull(p.nextTextValue()); + assertEquals(JsonToken.VALUE_NULL, p.currentToken()); + assertNull(p.getNumberType()); } - fail("Should not pass (invalid content)"); - } catch (StreamReadException e) { - assertThat(e.getMessage(), Matchers.containsString("not integer")); } } @Test - public void testFuzz65274() throws Exception { - final ObjectMapper MAPPER = - IonObjectMapper.builder( - IonFactory.builderForBinaryWriters() - .enable(IonParser.Feature.USE_NATIVE_TYPE_ID) - .build()) - .build(); + public void testFuzz65274Malformed() throws Exception { + try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65274.ion")) { + byte[] invalid = new byte[in.available()]; + new DataInputStream(in).readFully(invalid); + ION_MAPPER.readTree(new ByteArrayInputStream(invalid)); + fail("Should not pass (invalid content)"); + } catch (StreamReadException e) { + assertThat(e.getMessage(), Matchers.containsString("Corrupt content to decode")); + } + } + @Test + public void testFuzz65274Eof() throws Exception { try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65274.ion")) { - byte[] invalid = new byte[in.available()]; - new DataInputStream(in).readFully(invalid); - try (JsonParser p = MAPPER.getFactory().createParser(new ByteArrayInputStream(invalid))) { - MAPPER.readTree(p); - } - fail("Should not pass (invalid content)"); - } catch (StreamReadException e) { - assertThat(e.getMessage(), Matchers.containsString("not integer")); - } + ION_MAPPER.readTree(in); + fail("Should not pass (invalid content)"); + } catch (StreamReadException e) { + assertThat(e.getMessage(), Matchers.containsString("Corrupt Number value to decode")); + } } } From 4836dfdcb0fdddb9b9fa6e5109d137c137b5405e Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 30 Dec 2023 12:19:19 -0800 Subject: [PATCH 6/7] Update release notes --- release-notes/CREDITS-2.x | 2 ++ release-notes/VERSION-2.x | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index e7246ea0c..8710ceb67 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -295,3 +295,5 @@ Arthur Chan (@arthurscchan) * Contributed #432 (ion) More methods from `IonReader` could throw an unexpected `AssertionError` (2.17.0) + * Contributed #434 (ion) Unexpected `NullPointerException` thrown from `IonParser::getNumberType()` + (2.17.0) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index c9254de34..89fcdc237 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -25,10 +25,12 @@ Active maintainers: #424: (ion) `IonReader` throws `NullPointerException` for unchecked invalid data (fix contributed by Arthur C) #426: (smile) `SmileParser` throws unexpected IOOBE for corrupt content - (fix contributed by Arthur C) + (fix contributed by Arthur C)-( #432: (ion) More methods from `IonReader` could throw an unexpected `AssertionError` (fix contributed by Arthur C) --(ion) Update `com.amazon.ion:ion-java` to 1.11.0 (from 1.10.5) +#434 (ion) Unexpected `NullPointerException` thrown from `IonParser::getNumberType()` + (fix contributed by Arthur C) +- (ion) Update `com.amazon.ion:ion-java` to 1.11.0 (from 1.10.5) 2.16.1 (24-Dec-2023) From d11c407f395935366f7706a84b52c60ad5c283da Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sat, 30 Dec 2023 13:37:53 -0800 Subject: [PATCH 7/7] Add a work-around for edge case wrt getNumberType() --- .../com/fasterxml/jackson/dataformat/ion/IonParser.java | 6 +++++- .../com/fasterxml/jackson/dataformat/ion/IonParserTest.java | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java index 0d91dfd67..98df0749e 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java @@ -385,7 +385,11 @@ private void _verifyIsNumberToken() throws IOException public NumberType getNumberType() throws IOException { if (_currToken == JsonToken.VALUE_NUMBER_INT - || _currToken == JsonToken.VALUE_NUMBER_FLOAT) { + || _currToken == JsonToken.VALUE_NUMBER_FLOAT + // 30-Dec-2023, tatu: This is odd, but some current tests seem to + // expect this case to work when creating `IonParser` from `IonReader`, + // which does not seem to work without work-around like this: + || ((_currToken == null) && !isClosed())) { IonType type = _reader.getType(); if (type != null) { // Hmmh. Looks like Ion gives little bit looser definition here; diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonParserTest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonParserTest.java index a69c20538..6c00afe01 100644 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonParserTest.java +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonParserTest.java @@ -93,6 +93,10 @@ public void testFloatType() throws IOException { reader.stepIn(); // Step next. reader.next(); + // 30-Dec-2023, tatu: This is problematic as created parser is expected + // to point to `JsonToken.VALUE_NUMBER_FLOAT`, but `createParser()` + // does not initialize state. For now, `IonParser.getNumberType()` has + // special handling allowing this case but that should not be needed final IonParser floatParser = new IonFactory().createParser(reader); Assert.assertEquals(JsonParser.NumberType.DOUBLE, floatParser.getNumberType()); }