Remove unnecessary final modifier

final is useless for private and static methods

See gh-31916
This commit is contained in:
Yanming Zhou 2023-12-28 11:27:18 +08:00 committed by Stéphane Nicoll
parent c3b5f5bf90
commit 45080e3724
5 changed files with 10 additions and 10 deletions

View File

@ -88,7 +88,7 @@ class ConfigurationClassAndBFPPTests {
@Autowired TestBean autowiredTestBean; @Autowired TestBean autowiredTestBean;
@Bean @Bean
public static final BeanFactoryPostProcessor bfpp() { public static BeanFactoryPostProcessor bfpp() {
return beanFactory -> { return beanFactory -> {
// no-op // no-op
}; };

View File

@ -263,7 +263,7 @@ public abstract class AbstractMethodMetadataTests {
public static class WithPrivateMethod { public static class WithPrivateMethod {
@Tag @Tag
private final String test() { private String test() {
return ""; return "";
} }

View File

@ -34,7 +34,7 @@ public final class SystemProfileValueSource implements ProfileValueSource {
/** /**
* Obtain the canonical instance of this ProfileValueSource. * Obtain the canonical instance of this ProfileValueSource.
*/ */
public static final SystemProfileValueSource getInstance() { public static SystemProfileValueSource getInstance() {
return INSTANCE; return INSTANCE;
} }

View File

@ -32,7 +32,7 @@ public class ContextCacheTestUtils {
/** /**
* Reset the state of the static context cache in {@link DefaultCacheAwareContextLoaderDelegate}. * Reset the state of the static context cache in {@link DefaultCacheAwareContextLoaderDelegate}.
*/ */
public static final void resetContextCache() { public static void resetContextCache() {
DefaultCacheAwareContextLoaderDelegate.defaultContextCache.reset(); DefaultCacheAwareContextLoaderDelegate.defaultContextCache.reset();
} }
@ -43,7 +43,7 @@ public class ContextCacheTestUtils {
* @param expectedHitCount the expected hit count * @param expectedHitCount the expected hit count
* @param expectedMissCount the expected miss count * @param expectedMissCount the expected miss count
*/ */
public static final void assertContextCacheStatistics(int expectedSize, int expectedHitCount, int expectedMissCount) { public static void assertContextCacheStatistics(int expectedSize, int expectedHitCount, int expectedMissCount) {
assertContextCacheStatistics(null, expectedSize, expectedHitCount, expectedMissCount); assertContextCacheStatistics(null, expectedSize, expectedHitCount, expectedMissCount);
} }
@ -55,7 +55,7 @@ public class ContextCacheTestUtils {
* @param expectedHitCount the expected hit count * @param expectedHitCount the expected hit count
* @param expectedMissCount the expected miss count * @param expectedMissCount the expected miss count
*/ */
public static final void assertContextCacheStatistics(String usageScenario, int expectedSize, int expectedHitCount, public static void assertContextCacheStatistics(String usageScenario, int expectedSize, int expectedHitCount,
int expectedMissCount) { int expectedMissCount) {
assertContextCacheStatistics(DefaultCacheAwareContextLoaderDelegate.defaultContextCache, usageScenario, assertContextCacheStatistics(DefaultCacheAwareContextLoaderDelegate.defaultContextCache, usageScenario,
expectedSize, expectedHitCount, expectedMissCount); expectedSize, expectedHitCount, expectedMissCount);
@ -70,7 +70,7 @@ public class ContextCacheTestUtils {
* @param expectedHitCount the expected hit count * @param expectedHitCount the expected hit count
* @param expectedMissCount the expected miss count * @param expectedMissCount the expected miss count
*/ */
public static final void assertContextCacheStatistics(ContextCache contextCache, String usageScenario, public static void assertContextCacheStatistics(ContextCache contextCache, String usageScenario,
int expectedSize, int expectedHitCount, int expectedMissCount) { int expectedSize, int expectedHitCount, int expectedMissCount) {
String context = (StringUtils.hasText(usageScenario) ? " (" + usageScenario + ")" : ""); String context = (StringUtils.hasText(usageScenario) ? " (" + usageScenario + ")" : "");

View File

@ -474,7 +474,7 @@ public class PathPatternParserTests {
} }
@SafeVarargs @SafeVarargs
private final void assertPathElements(PathPattern p, Class<? extends PathElement>... sectionClasses) { private void assertPathElements(PathPattern p, Class<? extends PathElement>... sectionClasses) {
PathElement head = p.getHeadSection(); PathElement head = p.getHeadSection();
for (Class<? extends PathElement> sectionClass : sectionClasses) { for (Class<? extends PathElement> sectionClass : sectionClasses) {
if (head == null) { if (head == null) {