From 47b0da6b257dbe47f95e7ee3e7a55ef57e5641de Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 6 Oct 2021 11:48:30 +0200 Subject: [PATCH 1/2] Polishing --- .../src/test/java/org/springframework/util/ClassUtilsTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java index b8ddd8c4ca75..f14412ba4b18 100644 --- a/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java @@ -154,7 +154,7 @@ public Class loadClass(String name) throws ClassNotFoundException { assertThat(ClassUtils.isCacheSafe(composite, childLoader3)).isTrue(); } - @ParameterizedTest + @ParameterizedTest(name = "''{0}'' -> {1}") @CsvSource({ "boolean, boolean", "byte, byte", From 41ae9632d1ede2ceafbcb727166b6d6b6d4ab490 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 6 Oct 2021 12:02:26 +0200 Subject: [PATCH 2/2] Upgrade to Checkstyle 9.0 and spring-javaformat 0.0.29 This commit upgrades the Gradle build to use Checkstyle 9.0 and spring-javaformat 0.0.29 (which internally uses Checkstyle 8.45.1). Closes gh-27520 --- build.gradle | 5 ++--- .../java/org/springframework/beans/BeanUtils.java | 2 +- .../PropertySourcesPlaceholderConfigurer.java | 4 ++-- .../org/springframework/jndi/JndiCallback.java | 4 ++-- .../springframework/core/AttributeAccessor.java | 4 ++-- .../springframework/core/CollectionFactory.java | 14 +++++++------- .../core/annotation/AnnotationFilter.java | 4 ++-- .../core/annotation/AnnotationsProcessor.java | 6 +++--- .../core/annotation/ValueExtractor.java | 4 ++-- .../core/env/AbstractEnvironment.java | 3 +++ .../messaging/rsocket/RSocketRequester.java | 4 ++-- .../org/springframework/mock/web/MockCookie.java | 2 +- .../context/ContextConfigurationAttributes.java | 4 ++-- .../test/context/MergedContextConfiguration.java | 6 +++--- .../test/context/jdbc/MergedSqlConfig.java | 4 ++-- .../junit4/statements/ProfileValueChecker.java | 6 +++--- .../support/AbstractGenericContextLoader.java | 6 +++--- .../support/GenericGroovyXmlContextLoader.java | 4 ++-- .../web/AbstractGenericWebContextLoader.java | 4 ++-- .../web/GenericGroovyXmlWebContextLoader.java | 4 ++-- .../web/servlet/result/StatusResultMatchers.java | 6 +++--- .../transaction/reactive/TransactionCallback.java | 4 ++-- .../transaction/support/TransactionCallback.java | 4 ++-- .../java/org/springframework/http/MediaType.java | 6 +++--- .../org/springframework/http/ResponseCookie.java | 4 ++-- .../web/client/AsyncRequestCallback.java | 4 ++-- .../web/client/RequestCallback.java | 4 ++-- .../web/filter/reactive/ForwardedHeaderFilter.java | 6 +++--- .../web/reactive/function/client/WebClient.java | 2 +- .../web/servlet/HandlerAdapter.java | 2 +- .../web/servlet/mvc/LastModified.java | 10 +++++----- .../web/servlet/mvc/method/RequestMappingInfo.java | 2 +- .../view/DefaultRequestToViewNameTranslator.java | 6 +++--- src/checkstyle/checkstyle.xml | 2 +- 34 files changed, 79 insertions(+), 77 deletions(-) diff --git a/build.gradle b/build.gradle index ec48137948d3..78f42328360c 100644 --- a/build.gradle +++ b/build.gradle @@ -340,7 +340,7 @@ configure([rootProject] + javaProjects) { project -> } checkstyle { - toolVersion = "8.41" + toolVersion = "9.0" configDirectory.set(rootProject.file("src/checkstyle")) } @@ -362,8 +362,7 @@ configure([rootProject] + javaProjects) { project -> // JSR-305 only used for non-required meta-annotations compileOnly("com.google.code.findbugs:jsr305") testCompileOnly("com.google.code.findbugs:jsr305") - checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.28") - checkstyle("com.puppycrawl.tools:checkstyle:8.41") + checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.29") } ext.javadocLinks = [ diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java b/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java index 3a2b3f0b03ae..77aff7ffe08e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java @@ -100,9 +100,9 @@ public abstract class BeanUtils { * @param clazz class to instantiate * @return the new instance * @throws BeanInstantiationException if the bean cannot be instantiated + * @see Class#newInstance() * @deprecated as of Spring 5.0, following the deprecation of * {@link Class#newInstance()} in JDK 9 - * @see Class#newInstance() */ @Deprecated public static T instantiate(Class clazz) throws BeanInstantiationException { diff --git a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java index abbfec08ab2e..a0907a1f3a15 100644 --- a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java +++ b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java @@ -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. @@ -185,9 +185,9 @@ protected void processProperties(ConfigurableListableBeanFactory beanFactoryToPr /** * Implemented for compatibility with * {@link org.springframework.beans.factory.config.PlaceholderConfigurerSupport}. + * @throws UnsupportedOperationException in this implementation * @deprecated in favor of * {@link #processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver)} - * @throws UnsupportedOperationException in this implementation */ @Override @Deprecated diff --git a/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java b/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java index c463cdb10013..cf53e20a47b1 100644 --- a/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java +++ b/spring-context/src/main/java/org/springframework/jndi/JndiCallback.java @@ -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. @@ -44,8 +44,8 @@ public interface JndiCallback { *

Implementations don't need to worry about error handling * or cleanup, as the JndiTemplate class will handle this. * @param ctx the current JNDI context - * @throws NamingException if thrown by JNDI methods * @return a result object, or {@code null} + * @throws NamingException if thrown by JNDI methods */ @Nullable T doInContext(Context ctx) throws NamingException; diff --git a/spring-core/src/main/java/org/springframework/core/AttributeAccessor.java b/spring-core/src/main/java/org/springframework/core/AttributeAccessor.java index ea6d3a0c43f2..f8644f2cbab7 100644 --- a/spring-core/src/main/java/org/springframework/core/AttributeAccessor.java +++ b/spring-core/src/main/java/org/springframework/core/AttributeAccessor.java @@ -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. @@ -65,9 +65,9 @@ public interface AttributeAccessor { * @param computeFunction a function that computes a new value for the attribute * name; the function must not return a {@code null} value * @return the existing value or newly computed value for the named attribute + * @since 5.3.3 * @see #getAttribute(String) * @see #setAttribute(String, Object) - * @since 5.3.3 */ @SuppressWarnings("unchecked") default T computeAttribute(String name, Function computeFunction) { diff --git a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java index 30225a708f35..4f90a3bff18e 100644 --- a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java +++ b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java @@ -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. @@ -169,14 +169,14 @@ public static Collection createCollection(Class collectionType, int ca * (note: only relevant for {@link EnumSet} creation) * @param capacity the initial capacity * @return a new collection instance + * @throws IllegalArgumentException if the supplied {@code collectionType} is + * {@code null}; or if the desired {@code collectionType} is {@link EnumSet} and + * the supplied {@code elementType} is not a subtype of {@link Enum} * @since 4.1.3 * @see java.util.LinkedHashSet * @see java.util.ArrayList * @see java.util.TreeSet * @see java.util.EnumSet - * @throws IllegalArgumentException if the supplied {@code collectionType} is - * {@code null}; or if the desired {@code collectionType} is {@link EnumSet} and - * the supplied {@code elementType} is not a subtype of {@link Enum} */ @SuppressWarnings({"unchecked", "cast"}) public static Collection createCollection(Class collectionType, @Nullable Class elementType, int capacity) { @@ -285,14 +285,14 @@ public static Map createMap(Class mapType, int capacity) { * (note: only relevant for {@link EnumMap} creation) * @param capacity the initial capacity * @return a new map instance + * @throws IllegalArgumentException if the supplied {@code mapType} is + * {@code null}; or if the desired {@code mapType} is {@link EnumMap} and + * the supplied {@code keyType} is not a subtype of {@link Enum} * @since 4.1.3 * @see java.util.LinkedHashMap * @see java.util.TreeMap * @see org.springframework.util.LinkedMultiValueMap * @see java.util.EnumMap - * @throws IllegalArgumentException if the supplied {@code mapType} is - * {@code null}; or if the desired {@code mapType} is {@link EnumMap} and - * the supplied {@code keyType} is not a subtype of {@link Enum} */ @SuppressWarnings({"rawtypes", "unchecked"}) public static Map createMap(Class mapType, @Nullable Class keyType, int capacity) { diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationFilter.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationFilter.java index 07963dc3e8d3..9b5e4ecd2f94 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationFilter.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationFilter.java @@ -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. @@ -74,10 +74,10 @@ public String toString() { /** * {@link AnnotationFilter} that never matches and can be used when no * filtering is needed (allowing for any annotation types to be present). + * @see #PLAIN * @deprecated as of 5.2.6 since the {@link MergedAnnotations} model * always ignores lang annotations according to the {@link #PLAIN} filter * (for efficiency reasons) - * @see #PLAIN */ @Deprecated AnnotationFilter NONE = new AnnotationFilter() { diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationsProcessor.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationsProcessor.java index 75552f3b24ef..f7a3d16f2df3 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationsProcessor.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationsProcessor.java @@ -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. @@ -23,10 +23,10 @@ /** * Callback interface used to process annotations. * - * @param the context type - * @param the result type * @author Phillip Webb * @since 5.2 + * @param the context type + * @param the result type * @see AnnotationsScanner * @see TypeMappedAnnotations */ diff --git a/spring-core/src/main/java/org/springframework/core/annotation/ValueExtractor.java b/spring-core/src/main/java/org/springframework/core/annotation/ValueExtractor.java index 62438f629bf7..5f1b2146393c 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/ValueExtractor.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/ValueExtractor.java @@ -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. @@ -27,8 +27,8 @@ * source object which is typically an {@link Annotation}, {@link Map}, or * {@link TypeMappedAnnotation}. * - * @since 5.2.4 * @author Sam Brannen + * @since 5.2.4 */ @FunctionalInterface interface ValueExtractor { diff --git a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java index 85968d699a89..8ce86529c7e7 100644 --- a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java @@ -209,10 +209,13 @@ protected final ConfigurablePropertyResolver getPropertyResolver() { * * *

The search order is now C, D, A, B as desired. + * *

Beyond these recommendations, subclasses may use any of the {@code add*}, * {@code remove}, or {@code replace} methods exposed by {@link MutablePropertySources} * in order to create the exact arrangement of property sources desired. + * *

The base implementation registers no property sources. + * *

Note that clients of any {@link ConfigurableEnvironment} may further customize * property sources via the {@link #getPropertySources()} accessor, typically within * an {@link org.springframework.context.ApplicationContextInitializer diff --git a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java index 63c726037734..365d894cb953 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java @@ -305,8 +305,8 @@ RSocketRequester transports( * @param host the server host * @param port the server port * @return an {@code RSocketRequester} for the connection - * @deprecated as of 5.3 in favor of {@link #tcp(String, int)} * @see TcpClientTransport + * @deprecated as of 5.3 in favor of {@link #tcp(String, int)} */ @Deprecated Mono connectTcp(String host, int port); @@ -315,8 +315,8 @@ RSocketRequester transports( * Connect to the server over WebSocket. * @param uri the RSocket server endpoint URI * @return an {@code RSocketRequester} for the connection - * @deprecated as of 5.3 in favor of {@link #websocket(URI)} * @see WebsocketClientTransport + * @deprecated as of 5.3 in favor of {@link #websocket(URI)} */ @Deprecated Mono connectWebSocket(URI uri); diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockCookie.java b/spring-test/src/main/java/org/springframework/mock/web/MockCookie.java index 372898cd5a36..759eae8f9f0f 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockCookie.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockCookie.java @@ -68,8 +68,8 @@ public void setExpires(@Nullable ZonedDateTime expires) { /** * Get the "Expires" attribute for this cookie. - * @since 5.1.11 * @return the "Expires" attribute for this cookie, or {@code null} if not set + * @since 5.1.11 */ @Nullable public ZonedDateTime getExpires() { diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextConfigurationAttributes.java b/spring-test/src/main/java/org/springframework/test/context/ContextConfigurationAttributes.java index 2f29ba978c2b..e910c4c9d5e4 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextConfigurationAttributes.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextConfigurationAttributes.java @@ -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. @@ -300,8 +300,8 @@ public boolean isInheritInitializers() { * Get the name of the context hierarchy level that was declared via * {@link ContextConfiguration @ContextConfiguration}. * @return the name of the context hierarchy level or {@code null} if not applicable - * @see ContextConfiguration#name() * @since 3.2.2 + * @see ContextConfiguration#name() */ @Nullable public String getName() { diff --git a/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java index f434b14022a2..2ae169bd2959 100644 --- a/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java @@ -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. @@ -372,8 +372,8 @@ public ContextLoader getContextLoader() { * Get the {@link MergedContextConfiguration} for the parent application context * in a context hierarchy. * @return the parent configuration or {@code null} if there is no parent - * @see #getParentApplicationContext() * @since 3.2.2 + * @see #getParentApplicationContext() */ @Nullable public MergedContextConfiguration getParent() { @@ -386,8 +386,8 @@ public MergedContextConfiguration getParent() { *

If the parent context has not yet been loaded, it will be loaded, stored * in the cache, and then returned. * @return the parent {@code ApplicationContext} or {@code null} if there is no parent - * @see #getParent() * @since 3.2.2 + * @see #getParent() */ @Nullable public ApplicationContext getParentApplicationContext() { diff --git a/spring-test/src/main/java/org/springframework/test/context/jdbc/MergedSqlConfig.java b/spring-test/src/main/java/org/springframework/test/context/jdbc/MergedSqlConfig.java index 1ca7bda328d4..8130ddd3b8bb 100644 --- a/spring-test/src/main/java/org/springframework/test/context/jdbc/MergedSqlConfig.java +++ b/spring-test/src/main/java/org/springframework/test/context/jdbc/MergedSqlConfig.java @@ -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. @@ -174,8 +174,8 @@ String getSeparator() { /** * Get the prefixes that identify single-line comments within the SQL scripts. - * @see SqlConfig#commentPrefixes() * @since 5.2 + * @see SqlConfig#commentPrefixes() */ String[] getCommentPrefixes() { return this.commentPrefixes; diff --git a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/ProfileValueChecker.java b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/ProfileValueChecker.java index accd806e5fed..d9162ae0d4d6 100644 --- a/spring-test/src/main/java/org/springframework/test/context/junit4/statements/ProfileValueChecker.java +++ b/spring-test/src/main/java/org/springframework/test/context/junit4/statements/ProfileValueChecker.java @@ -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. @@ -77,10 +77,10 @@ public ProfileValueChecker(Statement next, Class testClass, @Nullable Method *

If a test is not enabled, this method will abort further evaluation * of the execution chain with a failed assumption; otherwise, this method * will simply evaluate the next {@link Statement} in the execution chain. - * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Class) - * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Method, Class) * @throws AssumptionViolatedException if the test is disabled * @throws Throwable if evaluation of the next statement fails + * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Class) + * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Method, Class) */ @Override public void evaluate() throws Throwable { diff --git a/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java index 8794ec49f49a..45ae716f6f02 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java @@ -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. @@ -97,9 +97,9 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader * context and registers a JVM shutdown hook for it. * * @return a new application context + * @since 3.1 * @see org.springframework.test.context.SmartContextLoader#loadContext(MergedContextConfiguration) * @see GenericApplicationContext - * @since 3.1 */ @Override public final ConfigurableApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { @@ -170,10 +170,10 @@ protected void validateMergedContextConfiguration(MergedContextConfiguration mer * and {@link AbstractContextLoader#prepareContext(ConfigurableApplicationContext, MergedContextConfiguration)} * for an alternative. * @return a new application context + * @since 2.5 * @see org.springframework.test.context.ContextLoader#loadContext * @see GenericApplicationContext * @see #loadContext(MergedContextConfiguration) - * @since 2.5 */ @Override public final ConfigurableApplicationContext loadContext(String... locations) throws Exception { diff --git a/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java index 86dc00da9489..4c4a02990253 100644 --- a/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/support/GenericGroovyXmlContextLoader.java @@ -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. @@ -61,8 +61,8 @@ protected String[] getResourceSuffixes() { * {@code GenericGroovyXmlContextLoader} supports both Groovy and XML * resource types for detection of defaults. Consequently, this method * is not supported. - * @see #getResourceSuffixes() * @throws UnsupportedOperationException in this implementation + * @see #getResourceSuffixes() */ @Override protected String getResourceSuffix() { diff --git a/spring-test/src/main/java/org/springframework/test/context/web/AbstractGenericWebContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/web/AbstractGenericWebContextLoader.java index c363dd2d671c..e48cfecc8ac8 100644 --- a/spring-test/src/main/java/org/springframework/test/context/web/AbstractGenericWebContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/web/AbstractGenericWebContextLoader.java @@ -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. @@ -260,8 +260,8 @@ protected void customizeContext( * {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}, * not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}. * Consequently, this method is not supported. - * @see org.springframework.test.context.ContextLoader#loadContext(java.lang.String[]) * @throws UnsupportedOperationException in this implementation + * @see org.springframework.test.context.ContextLoader#loadContext(java.lang.String[]) */ @Override public final ApplicationContext loadContext(String... locations) throws Exception { diff --git a/spring-test/src/main/java/org/springframework/test/context/web/GenericGroovyXmlWebContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/web/GenericGroovyXmlWebContextLoader.java index d0f32b423971..c84f033e5a98 100644 --- a/spring-test/src/main/java/org/springframework/test/context/web/GenericGroovyXmlWebContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/web/GenericGroovyXmlWebContextLoader.java @@ -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. @@ -61,8 +61,8 @@ protected String[] getResourceSuffixes() { * {@code GenericGroovyXmlWebContextLoader} supports both Groovy and XML * resource types for detection of defaults. Consequently, this method * is not supported. - * @see #getResourceSuffixes() * @throws UnsupportedOperationException in this implementation + * @see #getResourceSuffixes() */ @Override protected String getResourceSuffix() { diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java b/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java index a33eba0fa13b..6983b6866097 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java @@ -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. @@ -390,8 +390,8 @@ public ResultMatcher isPayloadTooLarge() { /** * Assert the response status code is {@code HttpStatus.REQUEST_ENTITY_TOO_LARGE} (413). - * @deprecated matching the deprecation of {@code HttpStatus.REQUEST_ENTITY_TOO_LARGE} * @see #isPayloadTooLarge() + * @deprecated matching the deprecation of {@code HttpStatus.REQUEST_ENTITY_TOO_LARGE} */ @Deprecated public ResultMatcher isRequestEntityTooLarge() { @@ -408,8 +408,8 @@ public ResultMatcher isUriTooLong() { /** * Assert the response status code is {@code HttpStatus.REQUEST_URI_TOO_LONG} (414). - * @deprecated matching the deprecation of {@code HttpStatus.REQUEST_URI_TOO_LONG} * @see #isUriTooLong() + * @deprecated matching the deprecation of {@code HttpStatus.REQUEST_URI_TOO_LONG} */ @Deprecated public ResultMatcher isRequestUriTooLong() { diff --git a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionCallback.java b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionCallback.java index 9ba759f0d55d..63546c24c435 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionCallback.java +++ b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionCallback.java @@ -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. @@ -32,8 +32,8 @@ * @author Mark Paluch * @author Juergen Hoeller * @since 5.2 - * @see TransactionalOperator * @param the result type + * @see TransactionalOperator */ @FunctionalInterface public interface TransactionCallback { diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java index 08bacac4ec43..926cdaf9289c 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionCallback.java @@ -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. @@ -30,9 +30,9 @@ * * @author Juergen Hoeller * @since 17.03.2003 + * @param the result type * @see TransactionTemplate * @see CallbackPreferringPlatformTransactionManager - * @param the result type */ @FunctionalInterface public interface TransactionCallback { diff --git a/spring-web/src/main/java/org/springframework/http/MediaType.java b/spring-web/src/main/java/org/springframework/http/MediaType.java index 6b51e1783df8..ec57d77a5ac2 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaType.java +++ b/spring-web/src/main/java/org/springframework/http/MediaType.java @@ -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. @@ -230,20 +230,20 @@ public class MediaType extends MimeType implements Serializable { /** * Public constant media type for {@code application/stream+json}. - * @deprecated as of 5.3, see notice on {@link #APPLICATION_STREAM_JSON_VALUE}. * @since 5.0 + * @deprecated as of 5.3, see notice on {@link #APPLICATION_STREAM_JSON_VALUE}. */ @Deprecated public static final MediaType APPLICATION_STREAM_JSON; /** * A String equivalent of {@link MediaType#APPLICATION_STREAM_JSON}. + * @since 5.0 * @deprecated as of 5.3 since it originates from the W3C Activity Streams * specification which has a more specific purpose and has been since * replaced with a different mime type. Use {@link #APPLICATION_NDJSON} as * a replacement or any other line-delimited JSON format (e.g. JSON Lines, * JSON Text Sequences). - * @since 5.0 */ @Deprecated public static final String APPLICATION_STREAM_JSON_VALUE = "application/stream+json"; diff --git a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java index 01048cab83c4..bada6e559885 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseCookie.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseCookie.java @@ -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. @@ -120,8 +120,8 @@ public boolean isHttpOnly() { * Return the cookie "SameSite" attribute, or {@code null} if not set. *

This limits the scope of the cookie such that it will only be attached to * same site requests if {@code "Strict"} or cross-site requests if {@code "Lax"}. - * @see RFC6265 bis * @since 5.1 + * @see RFC6265 bis */ @Nullable public String getSameSite() { diff --git a/spring-web/src/main/java/org/springframework/web/client/AsyncRequestCallback.java b/spring-web/src/main/java/org/springframework/web/client/AsyncRequestCallback.java index 4efc74eef602..00e2fdd4ab94 100644 --- a/spring-web/src/main/java/org/springframework/web/client/AsyncRequestCallback.java +++ b/spring-web/src/main/java/org/springframework/web/client/AsyncRequestCallback.java @@ -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. @@ -27,8 +27,8 @@ * application code. * * @author Arjen Poutsma - * @see org.springframework.web.client.AsyncRestTemplate#execute * @since 4.0 + * @see org.springframework.web.client.AsyncRestTemplate#execute * @deprecated as of Spring 5.0, in favor of * {@link org.springframework.web.reactive.function.client.ExchangeFilterFunction} */ diff --git a/spring-web/src/main/java/org/springframework/web/client/RequestCallback.java b/spring-web/src/main/java/org/springframework/web/client/RequestCallback.java index e3d32f526f14..82ef0d694e86 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RequestCallback.java +++ b/spring-web/src/main/java/org/springframework/web/client/RequestCallback.java @@ -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. @@ -34,8 +34,8 @@ * * * @author Arjen Poutsma - * @see RestTemplate#execute * @since 3.0 + * @see RestTemplate#execute */ @FunctionalInterface public interface RequestCallback { diff --git a/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java b/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java index cf8b17b54552..85e7215b4e24 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java @@ -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,13 +34,13 @@ * * @author Arjen Poutsma * @author Rossen Stoyanchev + * @since 5.0 + * @see https://tools.ietf.org/html/rfc7239 * @deprecated as of 5.1 this filter is deprecated in favor of using * {@link ForwardedHeaderTransformer} which can be declared as a bean with the * name "forwardedHeaderTransformer" or registered explicitly in * {@link org.springframework.web.server.adapter.WebHttpHandlerBuilder * WebHttpHandlerBuilder}. - * @since 5.0 - * @see https://tools.ietf.org/html/rfc7239 */ @Deprecated public class ForwardedHeaderFilter extends ForwardedHeaderTransformer implements WebFilter { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java index 4d929888bde8..7e8219c1678a 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java @@ -469,10 +469,10 @@ interface RequestHeadersSpec> { /** * Provide a function to populate the Reactor {@code Context}. * @param contextModifier the function to modify the context with + * @since 5.3.1 * @deprecated in 5.3.2 to be removed soon after; this method cannot * provide context to downstream (nested or subsequent) requests and is * of limited value. - * @since 5.3.1 */ @Deprecated S context(Function contextModifier); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java index cd43bdce5b15..2af977fea803 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerAdapter.java @@ -70,9 +70,9 @@ public interface HandlerAdapter { * @param handler the handler to use. This object must have previously been passed * to the {@code supports} method of this interface, which must have * returned {@code true}. - * @throws Exception in case of errors * @return a ModelAndView object with the name of the view and the required * model data, or {@code null} if the request has been handled directly + * @throws Exception in case of errors */ @Nullable ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception; diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java index a6cfdcf86a69..d8bb3660f52c 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/LastModified.java @@ -34,16 +34,16 @@ * * @author Rod Johnson * @author Juergen Hoeller - * @deprecated as of 5.3.9 in favor of using the {@code checkNotModified} methods - * in {@link org.springframework.web.context.request.WebRequest}, or from an - * annotated controller method, returning a - * {@link org.springframework.http.ResponseEntity} with an "ETag" and/or - * "Last-Modified" headers set. * @see javax.servlet.http.HttpServlet#getLastModified * @see Controller * @see SimpleControllerHandlerAdapter * @see org.springframework.web.HttpRequestHandler * @see HttpRequestHandlerAdapter + * @deprecated as of 5.3.9 in favor of using the {@code checkNotModified} methods + * in {@link org.springframework.web.context.request.WebRequest}, or from an + * annotated controller method, returning a + * {@link org.springframework.http.ResponseEntity} with an "ETag" and/or + * "Last-Modified" headers set. */ @Deprecated public interface LastModified { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java index 79622c386169..c410a7c7f29d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/RequestMappingInfo.java @@ -912,9 +912,9 @@ public PathPatternParser getPatternParser() { /** * Set a custom UrlPathHelper to use for the PatternsRequestCondition. *

By default this is not set. + * @since 4.2.8 * @deprecated as of 5.3, the path is resolved externally and obtained with * {@link ServletRequestPathUtils#getCachedPathValue(ServletRequest)} - * @since 4.2.8 */ @Deprecated public void setUrlPathHelper(@Nullable UrlPathHelper urlPathHelper) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java index 9d9bc6811ccb..1180aa734a4a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.java @@ -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. @@ -168,10 +168,10 @@ public void setUrlPathHelper(UrlPathHelper urlPathHelper) { /** * Translates the request URI of the incoming {@link HttpServletRequest} * into the view name based on the configured parameters. - * @see ServletRequestPathUtils#getCachedPath(ServletRequest) - * @see #transformPath * @throws IllegalArgumentException if neither a parsed RequestPath, nor a * String lookupPath have been resolved and cached as a request attribute. + * @see ServletRequestPathUtils#getCachedPath(ServletRequest) + * @see #transformPath */ @Override public String getViewName(HttpServletRequest request) { diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 2d8a043623c0..555364592425 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -160,7 +160,7 @@ - +