Skip to content

Commit 799a03e

Browse files
committed
Polishing
1 parent c0b6d32 commit 799a03e

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* <p>Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
6767
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
6868
*
69-
* <p>Tested against Jackson 2.2, 2.3 and 2.4; compatible with Jackson 2.0 and higher.
69+
* <p>Tested against Jackson 2.2, 2.3, 2.4 and 2.5; compatible with Jackson 2.0 and higher.
7070
*
7171
* @author Sebastien Deleuze
7272
* @author Juergen Hoeller
@@ -451,6 +451,7 @@ public Jackson2ObjectMapperBuilder modulesToInstall(Module... modules) {
451451
* @see #modulesToInstall(Module...)
452452
* @see com.fasterxml.jackson.databind.Module
453453
*/
454+
@SuppressWarnings("unchecked")
454455
public Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module>... modules) {
455456
this.moduleClasses = modules;
456457
this.findWellKnownModules = true;
@@ -500,6 +501,7 @@ public Jackson2ObjectMapperBuilder applicationContext(ApplicationContext applica
500501
return this;
501502
}
502503

504+
503505
/**
504506
* Build a new {@link ObjectMapper} instance.
505507
* <p>Each build operation produces an independent {@link ObjectMapper} instance.
@@ -682,7 +684,6 @@ public static Jackson2ObjectMapperBuilder json() {
682684
* Obtain a {@link Jackson2ObjectMapperBuilder} instance in order to
683685
* build an {@link XmlMapper} instance.
684686
*/
685-
@SuppressWarnings("unchecked")
686687
public static Jackson2ObjectMapperBuilder xml() {
687688
return new Jackson2ObjectMapperBuilder().createXmlMapper(true);
688689
}

spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -118,7 +118,7 @@
118118
* Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
119119
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
120120
*
121-
* <p>Tested against Jackson 2.2, 2.3 and 2.4; compatible with Jackson 2.0 and higher.
121+
* <p>Tested against Jackson 2.2, 2.3, 2.4 and 2.5; compatible with Jackson 2.0 and higher.
122122
*
123123
* @author <a href="mailto:[email protected]">Dmitry Katsubo</a>
124124
* @author Rossen Stoyanchev
@@ -346,6 +346,7 @@ public void setModules(List<Module> modules) {
346346
* @since 4.0.1
347347
* @see com.fasterxml.jackson.databind.Module
348348
*/
349+
@SuppressWarnings("unchecked")
349350
public void setModulesToInstall(Class<? extends Module>... modules) {
350351
this.builder.modulesToInstall(modules);
351352
}
@@ -363,6 +364,11 @@ public void setFindModulesViaServiceLoader(boolean findModules) {
363364
this.builder.findModulesViaServiceLoader(findModules);
364365
}
365366

367+
@Override
368+
public void setBeanClassLoader(ClassLoader beanClassLoader) {
369+
this.builder.moduleClassLoader(beanClassLoader);
370+
}
371+
366372
/**
367373
* Customize the construction of Jackson handlers ({@link JsonSerializer}, {@link JsonDeserializer},
368374
* {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
@@ -373,14 +379,20 @@ public void setHandlerInstantiator(HandlerInstantiator handlerInstantiator) {
373379
this.builder.handlerInstantiator(handlerInstantiator);
374380
}
375381

382+
/**
383+
* Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
384+
* {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
385+
* @since 4.1.3
386+
* @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
387+
* @see SpringHandlerInstantiator
388+
*/
376389
@Override
377-
public void setBeanClassLoader(ClassLoader beanClassLoader) {
378-
this.builder.moduleClassLoader(beanClassLoader);
390+
public void setApplicationContext(ApplicationContext applicationContext) {
391+
this.builder.applicationContext(applicationContext);
379392
}
380393

381394

382395
@Override
383-
@SuppressWarnings("unchecked")
384396
public void afterPropertiesSet() {
385397
if (this.objectMapper != null) {
386398
this.builder.configure(this.objectMapper);
@@ -390,18 +402,6 @@ public void afterPropertiesSet() {
390402
}
391403
}
392404

393-
/**
394-
* Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
395-
* {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
396-
* @since 4.1.3
397-
* @see Jackson2ObjectMapperBuilder#applicationContext(ApplicationContext)
398-
* @see SpringHandlerInstantiator
399-
*/
400-
@Override
401-
public void setApplicationContext(ApplicationContext applicationContext) {
402-
this.builder.applicationContext(applicationContext);
403-
}
404-
405405
/**
406406
* Return the singleton ObjectMapper.
407407
*/

spring-websocket/src/main/java/org/springframework/web/socket/server/jetty/JettyRequestUpgradeStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import org.springframework.web.socket.server.RequestUpgradeStrategy;
5151

5252
/**
53-
* A {@link RequestUpgradeStrategy} for use with Jetty 9.x. Based on Jetty's
53+
* A {@link RequestUpgradeStrategy} for use with Jetty 9.0-9.2. Based on Jetty's
5454
* internal {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
5555
*
5656
* @author Phillip Webb

spring-websocket/src/main/java/org/springframework/web/socket/server/support/DefaultHandshakeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
5555
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
5656
* the response as necessary and initialize the WebSocket. Currently supported servers are
57-
* Jetty 9.x, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
57+
* Jetty 9.0-9.2, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
5858
*
5959
* @author Rossen Stoyanchev
6060
* @author Juergen Hoeller

0 commit comments

Comments
 (0)