Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions ion/src/main/java/tools/jackson/dataformat/ion/IonObjectMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
import java.io.IOException;
import java.util.Date;

import tools.jackson.core.JacksonException;
import tools.jackson.core.Version;
import tools.jackson.core.exc.JacksonIOException;
import tools.jackson.core.type.TypeReference;

import tools.jackson.databind.JavaType;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.cfg.MapperBuilder;
import tools.jackson.databind.cfg.MapperBuilderState;
import tools.jackson.databind.deser.DeserializationContextExt;
import tools.jackson.databind.module.SimpleModule;
import tools.jackson.databind.ser.SerializationContextExt;

import tools.jackson.dataformat.ion.ionvalue.IonValueModule;

import com.amazon.ion.IonDatagram;
Expand Down Expand Up @@ -335,7 +335,7 @@ public IonGenerator createGenerator(IonWriter out) {
* Note: method does not close the underlying reader
*/
@SuppressWarnings("unchecked")
public <T> T readValue(IonReader r, Class<T> valueType) throws IOException {
public <T> T readValue(IonReader r, Class<T> valueType) throws JacksonException {
DeserializationContextExt ctxt = _deserializationContext();
return (T)_readMapAndClose(ctxt, tokenStreamFactory().createParser(ctxt, r),
_typeFactory.constructType(valueType));
Expand All @@ -348,7 +348,7 @@ public <T> T readValue(IonReader r, Class<T> valueType) throws IOException {
* Note: method does not close the underlying reader
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> T readValue(IonReader r, TypeReference valueTypeRef) throws IOException {
public <T> T readValue(IonReader r, TypeReference valueTypeRef) throws JacksonException {
DeserializationContextExt ctxt = _deserializationContext();
return (T)_readMapAndClose(ctxt, tokenStreamFactory().createParser(ctxt, r),
_typeFactory.constructType(valueTypeRef));
Expand All @@ -361,7 +361,7 @@ public <T> T readValue(IonReader r, TypeReference valueTypeRef) throws IOExcepti
* Note: method does not close the underlying reader
*/
@SuppressWarnings("unchecked")
public <T> T readValue(IonReader r, JavaType valueType) throws IOException {
public <T> T readValue(IonReader r, JavaType valueType) throws JacksonException {
DeserializationContextExt ctxt = _deserializationContext();
return (T)_readMapAndClose(ctxt, tokenStreamFactory().createParser(ctxt, r), valueType);
}
Expand All @@ -370,7 +370,7 @@ public <T> T readValue(IonReader r, JavaType valueType) throws IOException {
* Convenience method for converting Ion value into given value type.
*/
@SuppressWarnings("unchecked")
public <T> T readValue(IonValue value, Class<T> valueType) throws IOException {
public <T> T readValue(IonValue value, Class<T> valueType) throws JacksonException {
if (value == null) {
return null;
}
Expand All @@ -383,7 +383,7 @@ public <T> T readValue(IonValue value, Class<T> valueType) throws IOException {
* Convenience method for converting Ion value into given value type.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> T readValue(IonValue value, TypeReference valueTypeRef) throws IOException {
public <T> T readValue(IonValue value, TypeReference valueTypeRef) throws JacksonException {
if (value == null) {
return null;
}
Expand All @@ -396,7 +396,7 @@ public <T> T readValue(IonValue value, TypeReference valueTypeRef) throws IOExce
* Convenience method for converting Ion value into given value type.
*/
@SuppressWarnings("unchecked")
public <T> T readValue(IonValue value, JavaType valueType) throws IOException {
public <T> T readValue(IonValue value, JavaType valueType) throws JacksonException {
if (value == null) {
return null;
}
Expand All @@ -410,7 +410,7 @@ public <T> T readValue(IonValue value, JavaType valueType) throws IOException {
*<p>
* Note: method does not close the underlying writer explicitly
*/
public void writeValue(IonWriter w, Object value) throws IOException {
public void writeValue(IonWriter w, Object value) throws JacksonException {
SerializationContextExt prov = _serializationContext();
_configAndWriteValue(prov,
tokenStreamFactory().createGenerator(prov, w), value);
Expand All @@ -419,7 +419,7 @@ public void writeValue(IonWriter w, Object value) throws IOException {
/**
* Method that can be used to map any Java value to an IonValue.
*/
public IonValue writeValueAsIonValue(Object value) throws IOException
public IonValue writeValueAsIonValue(Object value) throws JacksonException
{
// 04-Jan-2017, tatu: Bit of incompatiblity wrt 2.x handling: should this result in
// Java `null`, or Ion null marker? For now, choose latter
Expand All @@ -436,6 +436,8 @@ public IonValue writeValueAsIonValue(Object value) throws IOException
IonValue result = container.get(0);
result.removeFromContainer();
return result;
} catch (IOException e) {
throw JacksonIOException.construct(e);
}
}

Expand Down
5 changes: 5 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Andy Wilkinson (@wilkinsona)
* Requested #619: (avro, cbor, ion, smile) Add `isEnabled()` methods for format-specific features
(like `CBORReadFeature` and `CBORWriteFeature`) to mappers
(3.1.0)

Michael Liedtke (@mcliedtke)

* Contributed #629: (ion) Unnecessary `IOException` in `IonObjectMapper` method signatures
(3.1.0)
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ implementations)
(requested by Andy W)
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
(requested by @Shaurya0108)
#629: (ion) Unnecessary `IOException` in `IonObjectMapper` method signatures
(fix contributed by Michael L)

3.0.1 (21-Oct-2025)

Expand Down