Avoid defensive checks against Java 8 API (java.util.Optional etc)
This commit also fixes broken javadoc links and code references. Issue: SPR-13188
This commit is contained in:
@@ -40,7 +40,7 @@ import org.springframework.util.MimeType;
|
||||
* {@link Marshaller} and {@link Unmarshaller} abstractions.
|
||||
*
|
||||
* <p>This converter requires a {@code Marshaller} and {@code Unmarshaller} before it can
|
||||
* be used. These can be injected by the {@linkplain MarshallingMessageConverter(Marshaller)
|
||||
* be used. These can be injected by the {@linkplain #MarshallingMessageConverter(Marshaller)
|
||||
* constructor} or {@linkplain #setMarshaller(Marshaller) bean properties}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.messaging.handler;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.core.MethodIntrospector;
|
||||
import org.springframework.util.ReflectionUtils.MethodFilter;
|
||||
|
||||
/**
|
||||
* Defines the algorithm for searching handler methods exhaustively including interfaces and parent
|
||||
* classes while also dealing with parameterized methods as well as interface and class-based proxies.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
* @deprecated as of Spring 4.2.3, in favor of the generalized and refined {@link MethodIntrospector}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class HandlerMethodSelector {
|
||||
|
||||
/**
|
||||
* Select handler methods for the given handler type.
|
||||
* <p>Callers define handler methods of interest through the {@link MethodFilter} parameter.
|
||||
* @param handlerType the handler type to search handler methods on
|
||||
* @param handlerMethodFilter a {@link MethodFilter} to help recognize handler methods of interest
|
||||
* @return the selected methods, or an empty set
|
||||
* @see MethodIntrospector#selectMethods(Class, MethodFilter)
|
||||
*/
|
||||
public static Set<Method> selectMethods(Class<?> handlerType, MethodFilter handlerMethodFilter) {
|
||||
return MethodIntrospector.selectMethods(handlerType, handlerMethodFilter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -19,7 +19,6 @@ package org.springframework.messaging.handler.invocation;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.lang.UsesJava8;
|
||||
import org.springframework.util.concurrent.CompletableToListenableFutureAdapter;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
|
||||
@@ -29,7 +28,6 @@ import org.springframework.util.concurrent.ListenableFuture;
|
||||
* @author Sebastien Deleuze
|
||||
* @since 4.2
|
||||
*/
|
||||
@UsesJava8
|
||||
public class CompletableFutureReturnValueHandler extends AbstractAsyncReturnValueHandler {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,7 +67,6 @@ import org.springframework.messaging.support.MessageHeaderInitializer;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.PathMatcher;
|
||||
import org.springframework.util.StringValueResolver;
|
||||
@@ -87,10 +86,6 @@ import org.springframework.validation.Validator;
|
||||
public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHandler<SimpMessageMappingInfo>
|
||||
implements EmbeddedValueResolverAware, SmartLifecycle {
|
||||
|
||||
private static final boolean completableFuturePresent = ClassUtils.isPresent(
|
||||
"java.util.concurrent.CompletableFuture", SimpAnnotationMethodMessageHandler.class.getClassLoader());
|
||||
|
||||
|
||||
private final SubscribableChannel clientInboundChannel;
|
||||
|
||||
private final SimpMessageSendingOperations clientMessagingTemplate;
|
||||
@@ -331,9 +326,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
|
||||
|
||||
// Single-purpose return value types
|
||||
handlers.add(new ListenableFutureReturnValueHandler());
|
||||
if (completableFuturePresent) {
|
||||
handlers.add(new CompletableFutureReturnValueHandler());
|
||||
}
|
||||
handlers.add(new CompletableFutureReturnValueHandler());
|
||||
|
||||
// Annotation-based return value types
|
||||
SendToMethodReturnValueHandler sendToHandler =
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
|
||||
|
||||
private static final String MVC_VALIDATOR_NAME = "mvcValidator";
|
||||
|
||||
private static final boolean jackson2Present= ClassUtils.isPresent(
|
||||
private static final boolean jackson2Present = ClassUtils.isPresent(
|
||||
"com.fasterxml.jackson.databind.ObjectMapper", AbstractMessageBrokerConfiguration.class.getClassLoader());
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user