Skip to content

Commit

Permalink
Demote IOContext handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 1, 2023
1 parent d0d306d commit 96bdde0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ private Feature(boolean defaultState) {
/**********************************************************************
*/

/**
* @since 2.16
*/
protected final IOContext _ioContext;

protected int _formatFeatures;

/**
Expand Down Expand Up @@ -389,7 +384,6 @@ public CsvParser(ObjectReadContext readCtxt, IOContext ioCtxt,
if (reader == null) {
throw new IllegalArgumentException("Can not pass `null` as `java.io.Reader` to read from");
}
_ioContext = ioCtxt;
_formatFeatures = csvFeatures;
DupDetector dups = StreamReadFeature.STRICT_DUPLICATE_DETECTION.enabledIn(stdFeatures)
? DupDetector.rootDetector(this) : null;
Expand Down Expand Up @@ -454,9 +448,8 @@ public void close() {
_reader.close();
} catch (IOException e) {
throw _wrapIOFailure(e);
} finally {
_ioContext.close();
}
super.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ public class JavaPropsParser extends ParserMinimalBase
/**********************************************************************
*/

/**
* @since 2.16
*/
protected final IOContext _ioContext;

/**
* Although most massaging is done later, caller may be interested in the
* ultimate source.
Expand Down Expand Up @@ -91,7 +86,6 @@ public JavaPropsParser(ObjectReadContext readCtxt, IOContext ioCtxt,
Object inputSource, Map<?,?> sourceMap)
{
super(readCtxt, ioCtxt, parserFeatures);
_ioContext = ioCtxt;
_inputSource = inputSource;
_sourceContent = sourceMap;
_schema = schema;
Expand All @@ -102,18 +96,6 @@ public Version version() {
return PackageVersion.VERSION;
}

/*// No need in 3.0
@Override
public void setSchema(FormatSchema schema)
{
if (schema instanceof JavaPropsSchema) {
_schema = (JavaPropsSchema) schema;
} else {
super.setSchema(schema);
}
}
*/

@Override
public JavaPropsSchema getSchema() {
return _schema;
Expand All @@ -139,7 +121,7 @@ public int releaseBuffered(Writer w) {
@Override
public void close() {
if (!_closed) {
_ioContext.close();
super.close();
_closed = true;
_streamReadContext = null;
}
Expand Down

0 comments on commit 96bdde0

Please sign in to comment.