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
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ private Feature(boolean defaultState) {
EMPTY_SCHEMA = CsvSchema.emptySchema();
}

protected final IOContext _ioContext;

/**
* @since 2.16
*/
Expand Down Expand Up @@ -246,8 +244,7 @@ private Feature(boolean defaultState) {
public CsvGenerator(IOContext ctxt, int jsonFeatures, int csvFeatures,
ObjectCodec codec, Writer out, CsvSchema schema)
{
super(jsonFeatures, codec);
_ioContext = ctxt;
super(jsonFeatures, codec, ctxt);
_streamWriteConstraints = ctxt.streamWriteConstraints();
_formatFeatures = csvFeatures;
_schema = schema;
Expand All @@ -261,8 +258,7 @@ public CsvGenerator(IOContext ctxt, int jsonFeatures, int csvFeatures,
public CsvGenerator(IOContext ctxt, int jsonFeatures, int csvFeatures,
ObjectCodec codec, CsvEncoder csvWriter)
{
super(jsonFeatures, codec);
_ioContext = ctxt;
super(jsonFeatures, codec, ctxt);
_streamWriteConstraints = ctxt.streamWriteConstraints();
_formatFeatures = csvFeatures;
_writer = csvWriter;
Expand Down Expand Up @@ -505,8 +501,6 @@ public final void flush() throws IOException {
public void close() throws IOException
{
if (!isClosed()) {
super.close();

// Let's mark row as closed, if we had any...
finishRow();

Expand All @@ -516,7 +510,7 @@ public void close() throws IOException
}
_writer.close(_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET),
isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM));
_ioContext.close();
super.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public abstract class JavaPropsGenerator extends GeneratorBase
/**********************************************************
*/

protected final IOContext _ioContext;

/**
* @since 2.16
*/
Expand Down Expand Up @@ -80,8 +78,7 @@ public abstract class JavaPropsGenerator extends GeneratorBase

public JavaPropsGenerator(IOContext ctxt, int stdFeatures, ObjectCodec codec)
{
super(stdFeatures, codec, BOGUS_WRITE_CONTEXT);
_ioContext = ctxt;
super(stdFeatures, codec, ctxt, BOGUS_WRITE_CONTEXT);
_streamWriteConstraints = ctxt.streamWriteConstraints();
_jpropContext = JPropWriteContext.createRootContext();
}
Expand Down Expand Up @@ -222,14 +219,6 @@ public JsonGenerator overrideFormatFeatures(int values, int mask) { }
/**********************************************************
*/

@Override
public void close() throws IOException {
if (!isClosed()) {
super.close();
_ioContext.close();
}
}

// public void flush() throws IOException

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ final class TomlGenerator extends GeneratorBase
/**********************************************************************
*/

protected final IOContext _ioContext;

/**
* @since 2.16
*/
Expand Down Expand Up @@ -86,8 +84,7 @@ final class TomlGenerator extends GeneratorBase
*/

public TomlGenerator(IOContext ioCtxt, int stdFeatures, int tomlFeatures, ObjectCodec codec, Writer out) {
super(stdFeatures, codec);
_ioContext = ioCtxt;
super(stdFeatures, codec, ioCtxt);
_streamWriteConstraints = ioCtxt.streamWriteConstraints();
_tomlFeatures = tomlFeatures;
_streamWriteContext = TomlWriteContext.createRootContext();
Expand Down Expand Up @@ -121,7 +118,6 @@ public Version version() {
@Override
public void close() throws IOException {
if (!isClosed()) {
super.close();
_flushBuffer();
_outputTail = 0; // just to ensure we don't think there's anything buffered

Expand All @@ -135,7 +131,7 @@ public void close() throws IOException {
}
// Internal buffer(s) generator has can now be released as well
_releaseBuffers();
_ioContext.close();
super.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ private Feature(boolean defaultState) {
/**********************************************************************
*/

protected final IOContext _ioContext;

/**
* @since 2.16
*/
Expand Down Expand Up @@ -298,8 +296,7 @@ public YAMLGenerator(IOContext ctxt, int jsonFeatures, int yamlFeatures,
org.yaml.snakeyaml.DumperOptions.Version version)
throws IOException
{
super(jsonFeatures, codec);
_ioContext = ctxt;
super(jsonFeatures, codec, ctxt);
_streamWriteConstraints = ctxt.streamWriteConstraints();
_formatFeatures = yamlFeatures;
_quotingChecker = (quotingChecker == null)
Expand All @@ -324,8 +321,7 @@ public YAMLGenerator(IOContext ctxt, int jsonFeatures, int yamlFeatures,
org.yaml.snakeyaml.DumperOptions dumperOptions)
throws IOException
{
super(jsonFeatures, codec);
_ioContext = ctxt;
super(jsonFeatures, codec, ctxt);
_streamWriteConstraints = ctxt.streamWriteConstraints();
_formatFeatures = yamlFeatures;
_quotingChecker = (quotingChecker == null)
Expand Down Expand Up @@ -567,7 +563,6 @@ public void close() throws IOException

_emitEndDocument();
_emit(new StreamEndEvent(null, null));
super.close();

/* 25-Nov-2008, tatus: As per [JACKSON-16] we are not to call close()
* on the underlying Reader, unless we "own" it, or auto-closing
Expand All @@ -583,7 +578,7 @@ public void close() throws IOException
_writer.flush();
}
}
_ioContext.close();
super.close();
}
}

Expand Down