From e90143e03b2972864c382114470dc88d7d70b124 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 1 Jul 2014 12:52:09 +0200 Subject: [PATCH] Polishing --- .../core/annotation/AnnotationUtils.java | 2 +- .../client/SimpleStreamingAsyncClientHttpRequest.java | 2 +- .../client/standard/StandardWebSocketClient.java | 8 +++----- .../socket/sockjs/support/AbstractSockJsService.java | 11 +++-------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java index 3784c9815c..3ae7bba39a 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java @@ -593,7 +593,7 @@ public abstract class AnnotationUtils { } if (nestedAnnotationsAsMap && value instanceof Annotation) { attrs.put(method.getName(), - getAnnotationAttributes((Annotation) value, classValuesAsString, true)); + getAnnotationAttributes((Annotation) value, classValuesAsString, true)); } else if (nestedAnnotationsAsMap && value instanceof Annotation[]) { Annotation[] realAnnotations = (Annotation[]) value; diff --git a/spring-web/src/main/java/org/springframework/http/client/SimpleStreamingAsyncClientHttpRequest.java b/spring-web/src/main/java/org/springframework/http/client/SimpleStreamingAsyncClientHttpRequest.java index 14c95e584d..34ba8911f2 100644 --- a/spring-web/src/main/java/org/springframework/http/client/SimpleStreamingAsyncClientHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/SimpleStreamingAsyncClientHttpRequest.java @@ -109,7 +109,7 @@ final class SimpleStreamingAsyncClientHttpRequest extends AbstractAsyncClientHtt @Override protected ListenableFuture executeInternal(final HttpHeaders headers) throws IOException { - return taskExecutor.submitListenable(new Callable() { + return this.taskExecutor.submitListenable(new Callable() { @Override public ClientHttpResponse call() throws Exception { try { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java index 9251025a97..fdea416dde 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java @@ -74,9 +74,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { /** * Constructor accepting an existing {@link WebSocketContainer} instance. - * - *

For XML configuration see {@link WebSocketContainerFactoryBean}. For Java - * configuration use {@code ContainerProvider.getWebSocketContainer()} to obtain + *

For XML configuration, see {@link WebSocketContainerFactoryBean}. For Java + * configuration, use {@code ContainerProvider.getWebSocketContainer()} to obtain * the {@code WebSocketContainer} instance. */ public StandardWebSocketClient(WebSocketContainer webSocketContainer) { @@ -89,8 +88,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { * Set an {@link AsyncListenableTaskExecutor} to use when opening connections. * If this property is set to {@code null}, calls to any of the * {@code doHandshake} methods will block until the connection is established. - * - *

By default an instance of {@code SimpleAsyncTaskExecutor} is used. + *

By default, an instance of {@code SimpleAsyncTaskExecutor} is used. */ public void setTaskExecutor(AsyncListenableTaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java index 0d5fbe63ac..7ccf651757 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java @@ -106,11 +106,9 @@ public abstract class AbstractSockJsService implements SockJsService { * iframe so that code in the iframe can run from a domain local to the SockJS * server. Since the iframe needs to load the SockJS javascript client library, * this property allows specifying where to load it from. - * *

By default this is set to point to - * "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". However it can - * also be set to point to a URL served by the application. - * + * "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". + * However, it can also be set to point to a URL served by the application. *

Note that it's possible to specify a relative URL in which case the URL * must be relative to the iframe URL. For example assuming a SockJS endpoint * mapped to "/sockjs", and resulting iframe URL "/sockjs/iframe.html", then the @@ -153,16 +151,13 @@ public abstract class AbstractSockJsService implements SockJsService { * clients with a "cookie_needed" boolean property that indicates whether the use of a * JSESSIONID cookie is required for the application to function correctly, e.g. for * load balancing or in Java Servlet containers for the use of an HTTP session. - * *

This is especially important for IE 8,9 that support XDomainRequest -- a modified * AJAX/XHR -- that can do requests across domains but does not send any cookies. In * those cases, the SockJS client prefers the "iframe-htmlfile" transport over * "xdr-streaming" in order to be able to send cookies. - * *

The SockJS protocol also expects a SockJS service to echo back the JSESSIONID * cookie when this property is set to true. However, when running in a Servlet * container this is not necessary since the container takes care of it. - * *

The default value is "true" to maximize the chance for applications to work * correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in * particular). However, an application can choose to set this to "false" if @@ -363,7 +358,6 @@ public abstract class AbstractSockJsService implements SockJsService { protected void addCorsHeaders(ServerHttpRequest request, ServerHttpResponse response, HttpMethod... httpMethods) { - HttpHeaders requestHeaders = request.getHeaders(); HttpHeaders responseHeaders = response.getHeaders(); @@ -444,6 +438,7 @@ public abstract class AbstractSockJsService implements SockJsService { } }; + private final SockJsRequestHandler iframeHandler = new SockJsRequestHandler() { private static final String IFRAME_CONTENT = -- GitLab