Skip to content

Commit

Permalink
Add accessor for factory feature bitset (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Aug 24, 2023
1 parent eca76dd commit 2a87b6f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/JsonFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ public final boolean isEnabled(JsonFactory.Feature f) {
return (_factoryFeatures & f.getMask()) != 0;
}

@Override
public final int getFactoryFeatures() {
return _factoryFeatures;
}

@Override
public final int getParserFeatures() {
return _parserFeatures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public abstract class TokenStreamFactory
public abstract boolean isEnabled(JsonParser.Feature f);
public abstract boolean isEnabled(JsonGenerator.Feature f);

/**
* @since 2.16
*/
public abstract int getFactoryFeatures();

public abstract int getParserFeatures();
public abstract int getGeneratorFeatures();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public final class CharsToNameCanonicalizer
* defined, and child instance is released (call to <code>release</code>),
* parent's shared tables may be updated from the child instance.
*/
final protected CharsToNameCanonicalizer _parent;
protected final CharsToNameCanonicalizer _parent;

/**
* Member that is only used by the root table instance: root
* passes immutable state info child instances, and children
* may return new state if they add entries to the table.
* Child tables do NOT use the reference.
*/
final protected AtomicReference<TableInfo> _tableInfo;
protected final AtomicReference<TableInfo> _tableInfo;

/**
* Seed value we use as the base to make hash codes non-static between
Expand All @@ -123,9 +123,9 @@ public final class CharsToNameCanonicalizer
*
* @since 2.1
*/
final protected int _seed;
protected final int _seed;

final protected int _flags;
protected final int _flags;

/**
* Whether any canonicalization should be attempted (whether using
Expand Down Expand Up @@ -302,6 +302,7 @@ public static CharsToNameCanonicalizer createRoot() {
protected static CharsToNameCanonicalizer createRoot(int seed) {
return new CharsToNameCanonicalizer(seed);
}

/**
* "Factory" method; will create a new child instance of this symbol
* table. It will be a copy-on-write instance, ie. it will only use
Expand Down

0 comments on commit 2a87b6f

Please sign in to comment.