Skip to content

Commit

Permalink
Minor fix to use calculated TomlWriteFeature's (not a bug since it's …
Browse files Browse the repository at this point in the history
…0, but might become problem)
  • Loading branch information
cowtowncoder committed Apr 11, 2021
1 parent c042f4e commit 621aee9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.fasterxml.jackson.dataformat.toml;

import java.io.ByteArrayInputStream;
import java.io.CharArrayReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.nio.charset.StandardCharsets;

import com.fasterxml.jackson.core.FormatFeature;
import com.fasterxml.jackson.core.FormatSchema;
Expand Down Expand Up @@ -40,16 +37,16 @@ public final class TomlFactory extends JsonFactory {
* Bitfield (set of flags) of all generator features that are enabled
* by default.
*/
final static int DEFAULT_TOML_GENERATOR_FEATURE_FLAGS = 0;
final static int DEFAULT_TOML_GENERATOR_FEATURE_FLAGS = TomlWriteFeature.collectDefaults();

/*
/**********************************************************************
/* Configuration
/**********************************************************************
*/

protected int _tomlParserFeatures = DEFAULT_TOML_PARSER_FEATURE_FLAGS;
protected int _tomlGeneratorFeatures = DEFAULT_TOML_GENERATOR_FEATURE_FLAGS;
protected int _tomlParserFeatures;
protected int _tomlGeneratorFeatures;

/*
/**********************************************************************
Expand All @@ -58,6 +55,8 @@ public final class TomlFactory extends JsonFactory {
*/

public TomlFactory() {
_tomlParserFeatures = DEFAULT_TOML_PARSER_FEATURE_FLAGS;
_tomlGeneratorFeatures = DEFAULT_TOML_GENERATOR_FEATURE_FLAGS;
}

TomlFactory(TomlFactory src, ObjectCodec oc) {
Expand Down Expand Up @@ -154,9 +153,9 @@ public MatchStrength hasFormat(InputAccessor acc) throws IOException {
}

/*
/**********************************************************
/**********************************************************************
/* Configuration, parser settings
/**********************************************************
/**********************************************************************
*/

/**
Expand Down Expand Up @@ -204,9 +203,9 @@ public int getFormatParserFeatures() {
}

/*
/**********************************************************
/**********************************************************************
/* Configuration, generator settings
/**********************************************************
/**********************************************************************
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
*
* @since 3.0
*/
public class TomlFactoryBuilder extends TSFBuilder<TomlFactory, TomlFactoryBuilder> {/*
public class TomlFactoryBuilder extends TSFBuilder<TomlFactory, TomlFactoryBuilder>
{
/*
/**********************************************************
/* Configuration
/**********************************************************
Expand Down

0 comments on commit 621aee9

Please sign in to comment.