diff --git a/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/ModuleTestBase.java b/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/ModuleTestBase.java index e875e9f9..f72498c6 100644 --- a/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/ModuleTestBase.java +++ b/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/ModuleTestBase.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; public abstract class ModuleTestBase extends junit.framework.TestCase @@ -27,9 +28,12 @@ public Validity validateBaseType(MapperConfig config, JavaType baseType) { */ static ObjectMapper mapperWithModule() { - ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new Jdk8Module()); - return mapper; + return mapperBuilderWithModule().build(); + } + + static JsonMapper.Builder mapperBuilderWithModule() { + return JsonMapper.builder() + .addModule(new Jdk8Module()); } @SuppressWarnings("deprecation") diff --git a/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/OptionalNumbersTest.java b/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/OptionalNumbersTest.java index 5ea56082..b5c6849c 100644 --- a/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/OptionalNumbersTest.java +++ b/datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/OptionalNumbersTest.java @@ -42,7 +42,9 @@ static class OptionalDoubleBean { } private ObjectMapper MAPPER = mapperWithModule(); - private ObjectMapper MAPPER_WITHOUT_COERCION = MAPPER.copy().disable(MapperFeature.ALLOW_COERCION_OF_SCALARS); + private ObjectMapper MAPPER_WITHOUT_COERCION = mapperBuilderWithModule() + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .build(); /* /********************************************************** diff --git a/datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/JavaTimeFeature.java b/datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/JavaTimeFeature.java index da079fbc..698976d1 100644 --- a/datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/JavaTimeFeature.java +++ b/datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/JavaTimeFeature.java @@ -27,9 +27,10 @@ public enum JavaTimeFeature implements JacksonFeature * Note that when a pattern is not explicitly defined numeric strings are * interpreted as a numeric timestamp. */ - ALWAYS_ALLOW_STRINGIFIED_TIMESTAMPS(false); + ALWAYS_ALLOW_STRINGIFIED_TIMESTAMPS(false) + ; - /** + /** * Whether feature is enabled or disabled by default. */ private final boolean _defaultState;