From 28b476cc476d6b0f73d8fb0aab7b1f7b4c2130a0 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Thu, 28 Jan 2021 17:41:17 -0800 Subject: [PATCH] Remove `DeserializationContext.getFactory()` accessor --- .../databind/DeserializationContext.java | 7 ------- .../jackson/databind/SerializerProvider.java | 18 +++++++++--------- .../deser/DeserializerFactoryTest.java | 3 +-- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java index a8d897efc0..4151eb3d6a 100644 --- a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java +++ b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java @@ -391,13 +391,6 @@ public T readValue(JsonParser p, JavaType type) throws JacksonException { /********************************************************************** */ - /** - * Method for getting current {@link DeserializerFactory}. - */ - public DeserializerFactory getFactory() { - return _factory; - } - /** * Convenience method for checking whether specified on/off * feature is enabled diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java index 784e519b2b..fe8a8b1020 100644 --- a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java +++ b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java @@ -66,20 +66,20 @@ public abstract class SerializerProvider /** * Serialization configuration to use for serialization processing. */ - final protected SerializationConfig _config; + protected final SerializationConfig _config; /** * Configuration to be used by streaming generator when it is constructed. * * @since 3.0 */ - final protected GeneratorSettings _generatorConfig; + protected final GeneratorSettings _generatorConfig; /** * Low-level {@link TokenStreamFactory} that may be used for constructing * embedded generators. */ - final protected TokenStreamFactory _streamFactory; + protected final TokenStreamFactory _streamFactory; /** * Token stream generator actively used; only set for per-call instances @@ -91,7 +91,7 @@ public abstract class SerializerProvider /** * View used for currently active serialization, if any. */ - final protected Class _activeView; + protected final Class _activeView; /* /********************************************************************** @@ -103,18 +103,18 @@ 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; /** * Serializer used to output a null value. Default implementation * writes nulls using {@link JsonGenerator#writeNull}. */ - final protected JsonSerializer _nullValueSerializer; + protected final JsonSerializer _nullValueSerializer; /** * Flag set to indicate that we are using vanilla null value serialization */ - final protected boolean _stdNullValueSerializer; + protected final boolean _stdNullValueSerializer; /* /********************************************************************** @@ -125,13 +125,13 @@ public abstract class SerializerProvider /** * Cache for doing type-to-value-serializer lookups. */ - final protected SerializerCache _serializerCache; + protected final SerializerCache _serializerCache; /** * For fast lookups, we will have a local non-shared read-only * map that contains serializers previously fetched. */ - final protected ReadOnlyClassToSerializerMap _knownSerializers; + protected final ReadOnlyClassToSerializerMap _knownSerializers; /** * Lazily acquired and instantiated formatter object: initialized diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/DeserializerFactoryTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/DeserializerFactoryTest.java index 8402b49c84..699b665f11 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/DeserializerFactoryTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/DeserializerFactoryTest.java @@ -94,8 +94,7 @@ private void _verifyNotFound(Class rawType) { private boolean _verifyDeserExistence(Class rawType) { DeserializationContext ctxt = MAPPER.deserializationContext(); - DeserializerFactory factory = ctxt.getFactory(); - return factory.hasExplicitDeserializerFor(ctxt, rawType); + return ctxt.hasExplicitDeserializerFor(rawType); } }