Skip to content

Commit 4974cfd

Browse files
authored
Upgrade ion-java to 1.11.2 and remove handling of exceptions that are no longer leaked (#482)
1 parent 10dea97 commit 4974cfd

File tree

7 files changed

+17
-25
lines changed

7 files changed

+17
-25
lines changed

ion/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tree model)
3939
<dependency>
4040
<groupId>com.amazon.ion</groupId>
4141
<artifactId>ion-java</artifactId>
42-
<version>1.11.1</version>
42+
<version>1.11.2</version>
4343
</dependency>
4444

4545
<!-- Extends Jackson core, databind -->

ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java

+1-16
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,7 @@ public String getText() throws IOException
273273
case VALUE_STRING:
274274
try {
275275
return _reader.stringValue();
276-
} catch (IonException
277-
// stringValue() will throw an UnknownSymbolException if we're
278-
// trying to get the text for a symbol id that cannot be resolved.
279-
// stringValue() has an assert statement which could throw an
280-
| AssertionError e
281-
// AssertionError if we're trying to get the text with a symbol
282-
// id less than or equals to 0. This is a bug in ion-java that
283-
// will be fixed by https://github.com/amazon-ion/ion-java/issues/702
284-
// at which point this AssertionError clause should be removed.
285-
) {
276+
} catch (IonException e) {
286277
return _reportCorruptContent(e);
287278
}
288279
case VALUE_NUMBER_INT:
@@ -658,12 +649,6 @@ public JsonToken nextToken() throws IOException
658649
} catch (IonException e) {
659650
return _reportCorruptContent(e);
660651

661-
} catch (AssertionError e) {
662-
// [dataformats-binary#432]: AssertionError if we're trying to get the text
663-
// with a symbol id less than or equals to 0. This is a bug in ion-java that
664-
// will be fixed by https://github.com/amazon-ion/ion-java/issues/702
665-
// at which point this AssertionError clause should be removed.
666-
return _reportCorruptContent(e);
667652
}
668653
if (type == null) {
669654
if (_parsingContext.inRoot()) { // EOF?
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.dataformat.ion.failing;
1+
package com.fasterxml.jackson.dataformat.ion.fuzz;
22

33
import org.hamcrest.Matchers;
44
import org.junit.Test;
@@ -24,7 +24,6 @@ public void testFuzz66149_NegativeArraySize() throws Exception {
2424
ION_MAPPER.readTree(doc);
2525
fail("Should not pass (invalid content)");
2626
} catch (StreamReadException e) {
27-
// May or may not be the exception message to get, change as appropriate
2827
assertThat(e.getMessage(), Matchers.containsString("Corrupt content to decode"));
2928
}
3029
}
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.dataformat.ion.failing;
1+
package com.fasterxml.jackson.dataformat.ion.fuzz;
22

33
import org.hamcrest.Matchers;
44
import org.junit.Test;
@@ -24,8 +24,7 @@ public void testFuzz66141_AssertionError() throws Exception {
2424
ION_MAPPER.readValue(doc, java.util.Date.class);
2525
fail("Should not pass (invalid content)");
2626
} catch (StreamReadException e) {
27-
// May or may not be the exception message to get, change as appropriate
28-
assertThat(e.getMessage(), Matchers.containsString("Corrupt content to decode"));
27+
assertThat(e.getMessage(), Matchers.containsString("Corrupt Number value to decode"));
2928
}
3029
}
3130
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.dataformat.ion.failing;
1+
package com.fasterxml.jackson.dataformat.ion.fuzz;
22

33
import org.hamcrest.Matchers;
44
import org.junit.Test;

release-notes/CREDITS-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ Tyler Gregg (tgregg@github)
240240
(2.14.0)
241241
#468: (ion) Upgrade `ion-java` to 1.11.1 and remove catch clauses for exceptions
242242
(2.17.0)
243+
* ... and countless others, no longer listed here but only in main Release Notes
244+
(since he is the official maintainer of the Ion backend)
243245

244246
David Turner (DaveCTurner@github)
245247
#312: (cbor, smile) Short NUL-only keys incorrectly detected as duplicates

release-notes/VERSION-2.x

+9-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ Active maintainers:
4949
#464: (cbor) Unexpected `ArrayIndexOutOfBoundsException` in `CBORParser`
5050
for corrupt String value
5151
(fix contributed by Arthur C)
52-
#468: (ion) Upgrade `ion-java` to 1.11.1 and remove catch clauses for exceptions
53-
that are no longer leaked
52+
#469 (ion) IonReader.newBytes() throwing `NegativeArraySizeException`
53+
(contributed by @tgregg)
54+
#471 (ion) `IonReader` throws `AssertionError` for Timestamp value
55+
(contributed by @tgregg)
56+
#473 (ion) `IonReader.next()` throws `ArrayIndexOutOfBoundsException` for some
57+
corrupt content
58+
(contributed by @tgregg)
59+
#482 (ion): Upgrade `ion-java` to 1.11.2 and remove handling of exceptions that
60+
are no longer leaked
5461
(contributed by @tgregg)
5562

5663
2.16.1 (24-Dec-2023)

0 commit comments

Comments
 (0)