Polishing
This commit is contained in:
parent
d7e0eed8d2
commit
14f24f43d7
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -34,9 +34,7 @@ import org.springframework.lang.Nullable;
|
|||
*
|
||||
* <p><b>NOTE:</b> This interface is a special purpose interface, mainly for
|
||||
* internal use within the framework. It is recommended to implement the plain
|
||||
* {@link BeanPostProcessor} interface as far as possible, or to derive from
|
||||
* {@link InstantiationAwareBeanPostProcessorAdapter} in order to be shielded
|
||||
* from extensions to this interface.
|
||||
* {@link BeanPostProcessor} interface as far as possible.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rod Johnson
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -79,7 +79,7 @@ public abstract class AbstractFallbackJCacheOperationSource implements JCacheOpe
|
|||
|
||||
@Nullable
|
||||
private JCacheOperation<?> computeCacheOperation(Method method, @Nullable Class<?> targetClass) {
|
||||
// Don't allow no-public methods as required.
|
||||
// Don't allow non-public methods, as configured.
|
||||
if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -124,7 +124,7 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
|||
|
||||
@Nullable
|
||||
private Collection<CacheOperation> computeCacheOperations(Method method, @Nullable Class<?> targetClass) {
|
||||
// Don't allow no-public methods as required.
|
||||
// Don't allow non-public methods, as configured.
|
||||
if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -26,9 +26,7 @@ import java.util.concurrent.ThreadFactory;
|
|||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
@ -65,7 +63,7 @@ import org.springframework.lang.Nullable;
|
|||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ThreadPoolExecutorFactoryBean extends ExecutorConfigurationSupport
|
||||
implements FactoryBean<ExecutorService>, InitializingBean, DisposableBean {
|
||||
implements FactoryBean<ExecutorService> {
|
||||
|
||||
private int corePoolSize = 1;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -193,7 +193,7 @@ public class ContentRequestMatchers {
|
|||
* <li>{@link Resource} - content from a file
|
||||
* <li>{@code byte[]} - other raw content
|
||||
* </ul>
|
||||
* <p><strong>Note:</strong> This method uses the Apache Commons File Upload
|
||||
* <p><strong>Note:</strong> This method uses the Apache Commons FileUpload
|
||||
* library to parse the multipart data and it must be on the test classpath.
|
||||
* @param expectedMap the expected multipart values
|
||||
* @since 5.3
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -163,7 +163,7 @@ public abstract class AbstractFallbackTransactionAttributeSource
|
|||
*/
|
||||
@Nullable
|
||||
protected TransactionAttribute computeTransactionAttribute(Method method, @Nullable Class<?> targetClass) {
|
||||
// Don't allow no-public methods as required.
|
||||
// Don't allow non-public methods, as configured.
|
||||
if (allowPublicMethodsOnly() && !Modifier.isPublic(method.getModifiers())) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
|
|||
* the next item from the upstream, write Publisher.
|
||||
* <p>The default implementation is a no-op.
|
||||
* @deprecated originally introduced for Undertow to stop write notifications
|
||||
* when no data is available, but deprecated as of as of 5.0.6 since constant
|
||||
* when no data is available, but deprecated as of 5.0.6 since constant
|
||||
* switching on every requested item causes a significant slowdown.
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
|
@ -54,9 +54,9 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
|
|||
* of the {@code Filter.init} and {@code Filter.destroy} lifecycle methods
|
||||
* on the target bean, letting the servlet container manage the filter lifecycle.
|
||||
*
|
||||
* <p>As of Spring 3.1, {@code DelegatingFilterProxy} has been updated to optionally accept
|
||||
* constructor parameters when using Servlet 3.0's instance-based filter registration
|
||||
* methods, usually in conjunction with Spring 3.1's
|
||||
* <p>As of Spring 3.1, {@code DelegatingFilterProxy} has been updated to optionally
|
||||
* accept constructor parameters when using a Servlet container's instance-based filter
|
||||
* registration methods, usually in conjunction with Spring's
|
||||
* {@link org.springframework.web.WebApplicationInitializer} SPI. These constructors allow
|
||||
* for providing the delegate Filter bean directly, or providing the application context
|
||||
* and bean name to fetch, avoiding the need to look up the application context from the
|
||||
|
@ -100,8 +100,7 @@ public class DelegatingFilterProxy extends GenericFilterBean {
|
|||
|
||||
|
||||
/**
|
||||
* Create a new {@code DelegatingFilterProxy}. For traditional (pre-Servlet 3.0) use
|
||||
* in {@code web.xml}.
|
||||
* Create a new {@code DelegatingFilterProxy}. For traditional use in {@code web.xml}.
|
||||
* @see #setTargetBeanName(String)
|
||||
*/
|
||||
public DelegatingFilterProxy() {
|
||||
|
@ -111,8 +110,7 @@ public class DelegatingFilterProxy extends GenericFilterBean {
|
|||
* Create a new {@code DelegatingFilterProxy} with the given {@link Filter} delegate.
|
||||
* Bypasses entirely the need for interacting with a Spring application context,
|
||||
* specifying the {@linkplain #setTargetBeanName target bean name}, etc.
|
||||
* <p>For use in Servlet 3.0+ environments where instance-based registration of
|
||||
* filters is supported.
|
||||
* <p>For use with instance-based registration of filters.
|
||||
* @param delegate the {@code Filter} instance that this proxy will delegate to and
|
||||
* manage the lifecycle for (must not be {@code null}).
|
||||
* @see #doFilter(ServletRequest, ServletResponse, FilterChain)
|
||||
|
@ -130,9 +128,8 @@ public class DelegatingFilterProxy extends GenericFilterBean {
|
|||
* bean from the Spring {@code WebApplicationContext} found in the {@code ServletContext}
|
||||
* (either the 'root' application context or the context named by
|
||||
* {@link #setContextAttribute}).
|
||||
* <p>For use in Servlet 3.0+ environments where instance-based registration of
|
||||
* filters is supported.
|
||||
* <p>The target bean must implement the standard Servlet Filter.
|
||||
* <p>For use with instance-based registration of filters.
|
||||
* <p>The target bean must implement the standard Servlet Filter interface.
|
||||
* @param targetBeanName name of the target filter bean to look up in the Spring
|
||||
* application context (must not be {@code null}).
|
||||
* @see #findWebApplicationContext()
|
||||
|
@ -145,8 +142,7 @@ public class DelegatingFilterProxy extends GenericFilterBean {
|
|||
/**
|
||||
* Create a new {@code DelegatingFilterProxy} that will retrieve the named target
|
||||
* bean from the given Spring {@code WebApplicationContext}.
|
||||
* <p>For use in Servlet 3.0+ environments where instance-based registration of
|
||||
* filters is supported.
|
||||
* <p>For use with instance-based registration of filters.
|
||||
* <p>The target bean must implement the standard Servlet Filter interface.
|
||||
* <p>The given {@code WebApplicationContext} may or may not be refreshed when passed
|
||||
* in. If it has not, and if the context implements {@link ConfigurableApplicationContext},
|
||||
|
|
|
@ -98,12 +98,10 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
|
|||
boolean hasAlreadyFilteredAttribute = request.getAttribute(alreadyFilteredAttributeName) != null;
|
||||
|
||||
if (skipDispatch(httpRequest) || shouldNotFilter(httpRequest)) {
|
||||
|
||||
// Proceed without invoking this filter...
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
else if (hasAlreadyFilteredAttribute) {
|
||||
|
||||
if (DispatcherType.ERROR.equals(request.getDispatcherType())) {
|
||||
doFilterNestedErrorDispatch(httpRequest, httpResponse, filterChain);
|
||||
return;
|
||||
|
@ -197,7 +195,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
|
|||
* setting up thread locals or to perform final processing at the very end.
|
||||
* <p>Note that although a filter can be mapped to handle specific dispatcher
|
||||
* types via {@code web.xml} or in Java through the {@code ServletContext},
|
||||
* servlet containers may enforce different defaults with regards to
|
||||
* servlet containers may enforce different defaults with respect to
|
||||
* dispatcher types. This flag enforces the design intent of the filter.
|
||||
* <p>The default return value is "true", which means the filter will not be
|
||||
* invoked during subsequent async dispatches. If "false", the filter will
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.MediaType;
|
|||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
* @deprecated in favor of {@link UnsupportedMediaTypeStatusException},
|
||||
* with this class never thrown by Spring code and to be removed in 5.3
|
||||
* with this class never thrown by Spring code and to be removed in 6.0
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
|
|
|
@ -48,7 +48,6 @@ import org.springframework.lang.Nullable;
|
|||
* <p>Used e.g. by {@link org.springframework.web.filter.AbstractRequestLoggingFilter}.
|
||||
* Note: As of Spring Framework 5.0, this wrapper is built on the Servlet 3.1 API.
|
||||
*
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Brian Clozel
|
||||
* @since 4.1.3
|
||||
|
|
|
@ -103,14 +103,6 @@ public class HandlerMappingIntrospector
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the configured or detected {@code HandlerMapping}s.
|
||||
*/
|
||||
public List<HandlerMapping> getHandlerMappings() {
|
||||
return (this.handlerMappings != null ? this.handlerMappings : Collections.emptyList());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
|
@ -125,6 +117,13 @@ public class HandlerMappingIntrospector
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the configured or detected {@code HandlerMapping}s.
|
||||
*/
|
||||
public List<HandlerMapping> getHandlerMappings() {
|
||||
return (this.handlerMappings != null ? this.handlerMappings : Collections.emptyList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find the {@link HandlerMapping} that would handle the given request and
|
||||
|
|
Loading…
Reference in New Issue