From b1aebb2c0cd65d7aeaa153465a7797412b222747 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Sun, 29 Jun 2014 22:09:14 -0400 Subject: [PATCH] Fix failing test --- .../web/socket/config/WebSocketNamespaceUtils.java | 4 +++- .../config/annotation/WebSocketConfigurationSupport.java | 4 +++- .../WebSocketMessageBrokerConfigurationSupport.java | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java index e54be04ec3..7293cb6238 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java @@ -33,6 +33,8 @@ import org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsSe import org.springframework.web.socket.sockjs.transport.handler.DefaultSockJsService; import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler; +import java.util.concurrent.ScheduledThreadPoolExecutor; + /** * Provides utility methods for parsing common WebSocket XML namespace elements. * @@ -44,7 +46,7 @@ class WebSocketNamespaceUtils { // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketConfigurationSupport.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); public static RuntimeBeanReference registerHandshakeHandler(Element element, ParserContext parserContext, Object source) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java index 44bfd503ed..5e558b7691 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationSupport.java @@ -21,6 +21,8 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.util.ClassUtils; import org.springframework.web.servlet.HandlerMapping; +import java.util.concurrent.ScheduledThreadPoolExecutor; + /** * Configuration support for WebSocket request handling. * @@ -31,7 +33,7 @@ public class WebSocketConfigurationSupport { // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketConfigurationSupport.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); @Bean diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java index b1732ba01f..ded2e7d6d0 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java @@ -17,6 +17,7 @@ package org.springframework.web.socket.config.annotation; import java.util.Collections; +import java.util.concurrent.ScheduledThreadPoolExecutor; import org.springframework.beans.factory.config.CustomScopeConfigurer; import org.springframework.context.annotation.Bean; @@ -44,7 +45,7 @@ public abstract class WebSocketMessageBrokerConfigurationSupport extends Abstrac // Check for setRemoveOnCancelPolicy method - available on JDK 7 and higher private static boolean hasRemoveOnCancelPolicyMethod = ClassUtils.hasMethod( - WebSocketConfigurationSupport.class, "setRemoveOnCancelPolicy", boolean.class); + ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class); private WebSocketTransportRegistration transportRegistration;