From 5d946f2788d2be81ea9a3ec69c12db1cb9ce1dcc Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Wed, 27 Jan 2021 21:41:37 -0800 Subject: [PATCH] Minor clean up --- .../fasterxml/jackson/databind/ObjectMapper.java | 9 +-------- .../jackson/databind/SerializerProvider.java | 14 ++++---------- .../jackson/databind/type/TypeFactory.java | 6 ++---- .../jackson/databind/util/TokenBuffer.java | 10 +++------- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java index 40f6cadb25..fd378a15ba 100644 --- a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java +++ b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java @@ -2350,13 +2350,6 @@ public ObjectMapper setConfig(SerializationConfig config) { @Override public JsonFactory getFactory() { return _jsonFactory; } - - /** - * @deprecated Since 2.1: Use {@link #getFactory} instead - */ - @Deprecated - @Override - public JsonFactory getJsonFactory() { return getFactory(); } /** * Method for configuring the default {@link DateFormat} to use when serializing time @@ -2737,7 +2730,7 @@ public ObjectMapper disable(JsonGenerator.Feature... features) { /** * Convenience method, equivalent to: *
-     *  getJsonFactory().isEnabled(f);
+     *  getFactory().isEnabled(f);
      *
*/ public boolean isEnabled(JsonFactory.Feature f) { diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java index cd2cf9756b..a41bf27095 100644 --- a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java +++ b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java @@ -77,13 +77,13 @@ public abstract class SerializerProvider /** * Serialization configuration to use for serialization processing. */ - final protected SerializationConfig _config; + protected final SerializationConfig _config; /** * View used for currently active serialization, if any. * Only set for non-blueprint instances. */ - final protected Class _serializationView; + protected final Class _serializationView; /* /********************************************************** @@ -95,7 +95,7 @@ public abstract class SerializerProvider * Factory used for constructing actual serializer instances. * Only set for non-blueprint instances. */ - final protected SerializerFactory _serializerFactory; + protected final SerializerFactory _serializerFactory; /* /********************************************************** @@ -106,7 +106,7 @@ public abstract class SerializerProvider /** * Cache for doing type-to-value-serializer lookups. */ - final protected SerializerCache _serializerCache; + protected final SerializerCache _serializerCache; /** * Lazily-constructed holder for per-call attributes. @@ -346,12 +346,6 @@ public JavaType constructSpecializedType(JavaType baseType, Class subclass) @Override public final Class getActiveView() { return _serializationView; } - - /** - * @deprecated Since 2.2, use {@link #getActiveView} instead. - */ - @Deprecated - public final Class getSerializationView() { return _serializationView; } @Override public final boolean canOverrideAccessModifiers() { diff --git a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java index 13415f969d..a027a5e063 100644 --- a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java @@ -1135,8 +1135,7 @@ public JavaType constructParametricType(Class rawType, TypeBindings parameter } /** - * @since 2.5 -- but will probably deprecated in 2.7 or 2.8 (not needed with 2.7) - * + * @since 2.5 * @deprecated since 2.9 Use {@link #constructParametricType(Class,JavaType...)} instead */ @Deprecated @@ -1147,8 +1146,7 @@ public JavaType constructParametrizedType(Class parametrized, Class parame } /** - * @since 2.5 -- but will probably deprecated in 2.7 or 2.8 (not needed with 2.7) - * + * @since 2.5 * @deprecated since 2.9 Use {@link #constructParametricType(Class,Class...)} instead */ @Deprecated diff --git a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java index 6b9a0d1663..2aba0f9b3b 100644 --- a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java +++ b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java @@ -19,15 +19,10 @@ * ones; but not significantly less efficient for larger), highly efficient * for linear iteration and appending. Implemented as segmented/chunked * linked list of tokens; only modifications are via appends. - *

- * Note that before version 2.0, this class was located in the "core" - * bundle, not data-binding; but since it was only used by data binding, - * was moved here to reduce size of core package */ public class TokenBuffer -/* Won't use JsonGeneratorBase, to minimize overhead for validity - * checking - */ +// Won't use JsonGeneratorBase, to minimize overhead for validity +// checking extends JsonGenerator { protected final static int DEFAULT_GENERATOR_FEATURES = JsonGenerator.Feature.collectDefaults(); @@ -595,6 +590,7 @@ public int getFeatureMask() { return _generatorFeatures; } + // Note: cannot be removed until deprecated method removed from base class @Override @Deprecated public JsonGenerator setFeatureMask(int mask) {