From 8ce5e88c66a220a549aa74489cd21a495a77d9a9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 17 Dec 2015 17:14:50 +0100 Subject: [PATCH] Require Jackson 2.6+, FreeMarker 2.3.21+, XStream 1.4.5+ Issue: SPR-13062 --- .../FreeMarkerConfigurationFactory.java | 8 +--- .../MappingJackson2MessageConverter.java | 4 +- .../MappingJackson2MessageConverter.java | 16 +++----- .../oxm/xstream/XStreamMarshaller.java | 12 +++--- .../AbstractJackson2HttpMessageConverter.java | 22 +++-------- .../json/Jackson2ObjectMapperBuilder.java | 19 ++-------- .../json/Jackson2ObjectMapperFactoryBean.java | 2 +- .../MappingJackson2HttpMessageConverter.java | 4 +- ...appingJackson2XmlHttpMessageConverter.java | 5 ++- .../view/freemarker/FreeMarkerView.java | 5 ++- .../view/json/AbstractJackson2View.java | 37 +++++++++---------- .../view/json/MappingJackson2JsonView.java | 2 +- .../view/xml/MappingJackson2XmlView.java | 4 +- .../frame/Jackson2SockJsMessageCodec.java | 4 +- 14 files changed, 55 insertions(+), 89 deletions(-) diff --git a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java index a5c8a1b1f4..f85fb5006d 100644 --- a/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java +++ b/spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -316,12 +316,8 @@ public class FreeMarkerConfigurationFactory { * @throws TemplateException on FreeMarker initialization failure * @see #createConfiguration() */ - @SuppressWarnings("deprecation") protected Configuration newConfiguration() throws IOException, TemplateException { - // The default Configuration constructor is deprecated as of FreeMarker 2.3.21, - // in favor of specifying a compatibility version - which is a 2.3.21 feature. - // We won't be able to call that for a long while, but custom subclasses can. - return new Configuration(); + return new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS); } /** diff --git a/spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java b/spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java index b64abf2fce..c9805aedf4 100644 --- a/spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java +++ b/spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ import org.springframework.util.ClassUtils; *
  • {@link DeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES} is disabled
  • * * - *

    Tested against Jackson 2.2; compatible with Jackson 2.0 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Mark Pollack * @author Dave Syer diff --git a/spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java index 4283889bea..30a1612cff 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java @@ -50,7 +50,7 @@ import org.springframework.util.MimeType; *

  • {@link DeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES} is disabled
  • * * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Rossen Stoyanchev * @author Juergen Hoeller @@ -59,11 +59,6 @@ import org.springframework.util.MimeType; */ public class MappingJackson2MessageConverter extends AbstractMessageConverter { - // Check for Jackson 2.3's overloaded canDeserialize/canSerialize variants with cause reference - private static final boolean jackson23Available = - ClassUtils.hasMethod(ObjectMapper.class, "canDeserialize", JavaType.class, AtomicReference.class); - - private ObjectMapper objectMapper; private Boolean prettyPrint; @@ -146,7 +141,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { return false; } JavaType javaType = this.objectMapper.constructType(targetClass); - if (!jackson23Available || !logger.isWarnEnabled()) { + if (!logger.isWarnEnabled()) { return (this.objectMapper.canDeserialize(javaType) && supportsMimeType(message.getHeaders())); } AtomicReference causeRef = new AtomicReference(); @@ -168,7 +163,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { @Override protected boolean canConvertTo(Object payload, MessageHeaders headers) { - if (!jackson23Available || !logger.isWarnEnabled()) { + if (!logger.isWarnEnabled()) { return (this.objectMapper.canSerialize(payload.getClass()) && supportsMimeType(headers)); } AtomicReference causeRef = new AtomicReference(); @@ -195,7 +190,6 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { } @Override - @SuppressWarnings("deprecation") protected Object convertFromInternal(Message message, Class targetClass, Object conversionHint) { JavaType javaType = this.objectMapper.constructType(targetClass); Object payload = message.getPayload(); @@ -204,7 +198,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { try { if (payload instanceof byte[]) { if (view != null) { - return this.objectMapper.readerWithView(view).withType(javaType).readValue((byte[]) payload); + return this.objectMapper.readerWithView(view).forType(javaType).readValue((byte[]) payload); } else { return this.objectMapper.readValue((byte[]) payload, javaType); @@ -212,7 +206,7 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { } else { if (view != null) { - return this.objectMapper.readerWithView(view).withType(javaType).readValue(payload.toString()); + return this.objectMapper.readerWithView(view).forType(javaType).readValue(payload.toString()); } else { return this.objectMapper.readValue(payload.toString(), javaType); diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java index 504f6c580c..7ce47f58c4 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ import com.thoughtworks.xstream.converters.ConverterRegistry; import com.thoughtworks.xstream.converters.DataHolder; import com.thoughtworks.xstream.converters.SingleValueConverter; import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; +import com.thoughtworks.xstream.core.ClassLoaderReference; import com.thoughtworks.xstream.core.DefaultConverterLookup; import com.thoughtworks.xstream.core.util.CompositeClassLoader; import com.thoughtworks.xstream.io.HierarchicalStreamDriver; @@ -104,7 +105,7 @@ import org.springframework.util.xml.StaxUtils; * Therefore, it has limited namespace support. As such, it is rather unsuitable for * usage within Web Services. * - *

    This marshaller requires XStream 1.4 or higher, as of Spring 4.0. + *

    This marshaller requires XStream 1.4.5 or higher, as of Spring 4.3. * Note that {@link XStream} construction has been reworked in 4.0, with the * stream driver and the class loader getting passed into XStream itself now. * @@ -405,12 +406,9 @@ public class XStreamMarshaller extends AbstractMarshaller implements Initializin * standard constructors or creating a custom subclass. * @return the {@code XStream} instance */ - @SuppressWarnings("deprecation") protected XStream constructXStream() { - // The referenced XStream constructor has been deprecated as of 1.4.5. - // We're preserving this call for broader XStream 1.4.x compatibility. - return new XStream(this.reflectionProvider, getDefaultDriver(), - this.beanClassLoader, this.mapper, this.converterLookup, this.converterRegistry) { + return new XStream(this.reflectionProvider, getDefaultDriver(), new ClassLoaderReference(this.beanClassLoader), + this.mapper, this.converterLookup, this.converterRegistry) { @Override protected MapperWrapper wrapMapper(MapperWrapper next) { MapperWrapper mapperToWrap = next; diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java index d648d0d070..c85dda4af0 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java @@ -48,7 +48,7 @@ import org.springframework.util.TypeUtils; * Abstract base class for Jackson based and content type independent * {@link HttpMessageConverter} implementations. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Arjen Poutsma * @author Keith Donald @@ -62,14 +62,6 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); - // Check for Jackson 2.3's overloaded canDeserialize/canSerialize variants with cause reference - private static final boolean jackson23Available = ClassUtils.hasMethod(ObjectMapper.class, - "canDeserialize", JavaType.class, AtomicReference.class); - - // Check for Jackson 2.6+ for support of generic type aware serialization of polymorphic collections - private static final boolean jackson26Available = ClassUtils.hasMethod(ObjectMapper.class, - "setDefaultPrettyPrinter", PrettyPrinter.class); - protected ObjectMapper objectMapper; @@ -144,7 +136,7 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener @Override public boolean canRead(Type type, Class contextClass, MediaType mediaType) { JavaType javaType = getJavaType(type, contextClass); - if (!jackson23Available || !logger.isWarnEnabled()) { + if (!logger.isWarnEnabled()) { return (this.objectMapper.canDeserialize(javaType) && canRead(mediaType)); } AtomicReference causeRef = new AtomicReference(); @@ -166,7 +158,7 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener @Override public boolean canWrite(Class clazz, MediaType mediaType) { - if (!jackson23Available || !logger.isWarnEnabled()) { + if (!logger.isWarnEnabled()) { return (this.objectMapper.canSerialize(clazz) && canWrite(mediaType)); } AtomicReference causeRef = new AtomicReference(); @@ -208,13 +200,12 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener return readJavaType(javaType, inputMessage); } - @SuppressWarnings("deprecation") private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) { try { if (inputMessage instanceof MappingJacksonInputMessage) { Class deserializationView = ((MappingJacksonInputMessage) inputMessage).getDeserializationView(); if (deserializationView != null) { - return this.objectMapper.readerWithView(deserializationView).withType(javaType). + return this.objectMapper.readerWithView(deserializationView).forType(javaType). readValue(inputMessage.getBody()); } } @@ -226,7 +217,6 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener } @Override - @SuppressWarnings("deprecation") protected void writeInternal(Object object, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { @@ -245,7 +235,7 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener serializationView = container.getSerializationView(); filters = container.getFilters(); } - if (jackson26Available && type != null && value != null && TypeUtils.isAssignable(type, value.getClass())) { + if (type != null && value != null && TypeUtils.isAssignable(type, value.getClass())) { javaType = getJavaType(type, null); } ObjectWriter objectWriter; @@ -259,7 +249,7 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener objectWriter = this.objectMapper.writer(); } if (javaType != null && javaType.isContainerType()) { - objectWriter = objectWriter.withType(javaType); + objectWriter = objectWriter.forType(javaType); } objectWriter.writeValue(generator, value); diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java index b2ee1e5b7f..33f68d7fb9 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java @@ -75,7 +75,7 @@ import org.springframework.util.StringUtils; *

  • jackson-datatype-joda: support for Joda-Time types
  • * * - *

    Tested against Jackson 2.4, 2.5, 2.6; compatible with Jackson 2.0 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Sebastien Deleuze * @author Juergen Hoeller @@ -561,7 +561,6 @@ public class Jackson2ObjectMapperBuilder { * settings. This can be applied to any number of {@code ObjectMappers}. * @param objectMapper the ObjectMapper to configure */ - @SuppressWarnings("deprecation") public void configure(ObjectMapper objectMapper) { Assert.notNull(objectMapper, "ObjectMapper must not be null"); @@ -609,13 +608,11 @@ public class Jackson2ObjectMapperBuilder { } if (this.filters != null) { - // Deprecated as of Jackson 2.6, but just in favor of a fluent variant. - objectMapper.setFilters(this.filters); + objectMapper.setFilterProvider(this.filters); } for (Class target : this.mixIns.keySet()) { - // Deprecated as of Jackson 2.5, but just in favor of a fluent variant. - objectMapper.addMixInAnnotations(target, this.mixIns.get(target)); + objectMapper.addMixIn(target, this.mixIns.get(target)); } if (!this.serializers.isEmpty() || !this.deserializers.isEmpty()) { @@ -720,15 +717,7 @@ public class Jackson2ObjectMapperBuilder { objectMapper.registerModule(BeanUtils.instantiate(javaTimeModule)); } catch (ClassNotFoundException ex) { - // jackson-datatype-jsr310 not available or older than 2.6 - try { - Class jsr310Module = (Class) - ClassUtils.forName("com.fasterxml.jackson.datatype.jsr310.JSR310Module", this.moduleClassLoader); - objectMapper.registerModule(BeanUtils.instantiate(jsr310Module)); - } - catch (ClassNotFoundException ex2) { - // OK, jackson-datatype-jsr310 not available at all... - } + // jackson-datatype-jsr310 not available } } diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java index f17016e9cf..fa35579364 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java @@ -127,7 +127,7 @@ import org.springframework.context.ApplicationContextAware; * </bean * * - *

    Tested against Jackson 2.4, 2.5, 2.6; compatible with Jackson 2.0 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Dmitry Katsubo * @author Rossen Stoyanchev diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java index 80f9b430a3..3cb3966600 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.http.MediaType; * *

    The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Arjen Poutsma * @author Keith Donald diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter.java index f6099585cc..f30fe118c1 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.springframework.util.Assert; * *

    The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Sebastien Deleuze * @since 4.1 @@ -72,4 +72,5 @@ public class MappingJackson2XmlHttpMessageConverter extends AbstractJackson2Http Assert.isAssignable(XmlMapper.class, objectMapper.getClass()); super.setObjectMapper(objectMapper); } + } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java index f5e260eb26..991cea244f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java @@ -42,6 +42,7 @@ import freemarker.ext.servlet.HttpRequestParametersHashModel; import freemarker.ext.servlet.HttpSessionHashModel; import freemarker.ext.servlet.ServletContextHashModel; import freemarker.template.Configuration; +import freemarker.template.DefaultObjectWrapperBuilder; import freemarker.template.ObjectWrapper; import freemarker.template.SimpleHash; import freemarker.template.Template; @@ -186,10 +187,10 @@ public class FreeMarkerView extends AbstractTemplateView { * {@link ObjectWrapper#DEFAULT_WRAPPER default wrapper} if none specified. * @see freemarker.template.Configuration#getObjectWrapper() */ - @SuppressWarnings("deprecation") protected ObjectWrapper getObjectWrapper() { ObjectWrapper ow = getConfiguration().getObjectWrapper(); - return (ow != null ? ow : ObjectWrapper.DEFAULT_WRAPPER); + return (ow != null ? ow : + new DefaultObjectWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS).build()); } /** diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/AbstractJackson2View.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/AbstractJackson2View.java index 2069bbcd60..cf67ecc589 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/AbstractJackson2View.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/AbstractJackson2View.java @@ -38,7 +38,7 @@ import org.springframework.web.servlet.view.AbstractView; * Abstract base class for Jackson based and content type independent * {@link AbstractView} implementations. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Jeremy Grelle * @author Arjen Poutsma @@ -122,12 +122,6 @@ public abstract class AbstractJackson2View extends AbstractView { } } - /** - * Set the attribute in the model that should be rendered by this view. - * When set, all other model attributes will be ignored. - */ - public abstract void setModelKey(String modelKey); - /** * Disables caching of the generated JSON. *

    Default is {@code true}, which will prevent the client from caching the generated JSON. @@ -187,23 +181,13 @@ public abstract class AbstractJackson2View extends AbstractView { return value; } - /** - * Filter out undesired attributes from the given model. - * The return value can be either another {@link Map} or a single value object. - * @param model the model, as passed on to {@link #renderMergedOutputModel} - * @return the value to be rendered - */ - protected abstract Object filterModel(Map model); - /** * Write the actual JSON content to the stream. * @param stream the output stream to use * @param object the value to be rendered, as returned from {@link #filterModel} * @throws IOException if writing failed */ - protected void writeContent(OutputStream stream, Object object) - throws IOException { - + protected void writeContent(OutputStream stream, Object object) throws IOException { JsonGenerator generator = this.objectMapper.getFactory().createGenerator(stream, this.encoding); writePrefix(generator, object); @@ -230,13 +214,27 @@ public abstract class AbstractJackson2View extends AbstractView { generator.flush(); } + + /** + * Set the attribute in the model that should be rendered by this view. + * When set, all other model attributes will be ignored. + */ + public abstract void setModelKey(String modelKey); + + /** + * Filter out undesired attributes from the given model. + * The return value can be either another {@link Map} or a single value object. + * @param model the model, as passed on to {@link #renderMergedOutputModel} + * @return the value to be rendered + */ + protected abstract Object filterModel(Map model); + /** * Write a prefix before the main content. * @param generator the generator to use for writing content. * @param object the object to write to the output message. */ protected void writePrefix(JsonGenerator generator, Object object) throws IOException { - } /** @@ -245,7 +243,6 @@ public abstract class AbstractJackson2View extends AbstractView { * @param object the object to write to the output message. */ protected void writeSuffix(JsonGenerator generator, Object object) throws IOException { - } } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java index 2039e8c0ea..12a5baa0c2 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java @@ -49,7 +49,7 @@ import org.springframework.web.servlet.View; * *

    The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Jeremy Grelle * @author Arjen Poutsma diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MappingJackson2XmlView.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MappingJackson2XmlView.java index dfcf59e523..ef40ba896d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MappingJackson2XmlView.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/xml/MappingJackson2XmlView.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import org.springframework.web.servlet.view.json.AbstractJackson2View; * *

    The default constructor uses the default configuration provided by {@link Jackson2ObjectMapperBuilder}. * - *

    Compatible with Jackson 2.1 and higher. + *

    Compatible with Jackson 2.6 and higher, as of Spring 4.3. * * @author Sebastien Deleuze * @since 4.1 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java index e879b26f8e..8ed46882c5 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.util.Assert; /** - * A Jackson 2.x codec for encoding and decoding SockJS messages. + * A Jackson 2.6+ codec for encoding and decoding SockJS messages. * *

    It customizes Jackson's default properties with the following ones: *