Skip to content

Commit

Permalink
Fix #246 (pretty-printing in ion fails)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 18, 2021
1 parent ccdeabf commit f0de305
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Expand Up @@ -445,6 +445,9 @@ protected void _verifyValueWrite(String msg) throws IOException, JsonGenerationE
if (status == JsonWriteContext.STATUS_EXPECT_NAME) {
_reportError("Can not "+msg+", expecting field name");
}
// 18-Feb-2021, tatu: as per [dataformats-binary#246], this does not work
// (Ion impl must do pretty-printing), so
/*
// Only additional work needed if we are pretty-printing
if (_cfgPrettyPrinter != null) {
// If we have a pretty printer, it knows what to do:
Expand Down Expand Up @@ -478,6 +481,7 @@ protected void _verifyValueWrite(String msg) throws IOException, JsonGenerationE
throw new IllegalStateException("Should never occur; status "+status);
}
}
*/
}

@Override
Expand Down
Expand Up @@ -14,18 +14,18 @@

package com.fasterxml.jackson.dataformat.ion;

import com.amazon.ion.IonSexp;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;

import com.amazon.ion.IonSystem;
import com.amazon.ion.IonWriter;
import com.amazon.ion.system.IonSystemBuilder;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -104,7 +104,7 @@ private byte[] toBytes(Object object, IonObjectMapper mapper) throws IOException
return bytes;
}

private static class SexpObjectContainer {
static class SexpObjectContainer {
private SexpObject sexpField;

SexpObjectContainer(SexpObject sexpField) {
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Expand Up @@ -20,6 +20,7 @@ Project: jackson-datatypes-binaryModules:
(contributed by jhhladky@github)
#244: (ion) Add support for deserializing IonTimestamps and IonBlobs
(contributed by jessbrya-amzn@github)
#246: (ion) Enabling pretty-printing fails Ion serialization

2.12.1 (08-Jan-2021)

Expand Down

0 comments on commit f0de305

Please sign in to comment.