Skip to content

Commit f0de305

Browse files
committed
Fix #246 (pretty-printing in ion fails)
1 parent ccdeabf commit f0de305

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ protected void _verifyValueWrite(String msg) throws IOException, JsonGenerationE
445445
if (status == JsonWriteContext.STATUS_EXPECT_NAME) {
446446
_reportError("Can not "+msg+", expecting field name");
447447
}
448+
// 18-Feb-2021, tatu: as per [dataformats-binary#246], this does not work
449+
// (Ion impl must do pretty-printing), so
450+
/*
448451
// Only additional work needed if we are pretty-printing
449452
if (_cfgPrettyPrinter != null) {
450453
// If we have a pretty printer, it knows what to do:
@@ -478,6 +481,7 @@ protected void _verifyValueWrite(String msg) throws IOException, JsonGenerationE
478481
throw new IllegalStateException("Should never occur; status "+status);
479482
}
480483
}
484+
*/
481485
}
482486

483487
@Override

ion/src/test/java/com/fasterxml/jackson/dataformat/ion/GenerateSexpTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414

1515
package com.fasterxml.jackson.dataformat.ion;
1616

17-
import com.amazon.ion.IonSexp;
17+
import java.io.ByteArrayOutputStream;
18+
import java.io.IOException;
19+
import java.util.Arrays;
20+
1821
import com.amazon.ion.IonSystem;
1922
import com.amazon.ion.IonWriter;
2023
import com.amazon.ion.system.IonSystemBuilder;
2124
import com.fasterxml.jackson.core.JsonGenerator;
2225
import com.fasterxml.jackson.databind.JsonSerializer;
2326
import com.fasterxml.jackson.databind.SerializerProvider;
2427
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
25-
import java.io.ByteArrayOutputStream;
26-
import java.io.IOException;
27-
import java.util.Arrays;
28-
import java.util.List;
28+
2929
import org.junit.Assert;
3030
import org.junit.Before;
3131
import org.junit.Test;
@@ -104,7 +104,7 @@ private byte[] toBytes(Object object, IonObjectMapper mapper) throws IOException
104104
return bytes;
105105
}
106106

107-
private static class SexpObjectContainer {
107+
static class SexpObjectContainer {
108108
private SexpObject sexpField;
109109

110110
SexpObjectContainer(SexpObject sexpField) {

release-notes/VERSION-2.x

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Project: jackson-datatypes-binaryModules:
2020
(contributed by jhhladky@github)
2121
#244: (ion) Add support for deserializing IonTimestamps and IonBlobs
2222
(contributed by jessbrya-amzn@github)
23+
#246: (ion) Enabling pretty-printing fails Ion serialization
2324

2425
2.12.1 (08-Jan-2021)
2526

0 commit comments

Comments
 (0)