Order modifiers to align with JLS

This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
This commit is contained in:
Johnny Lim
2023-10-05 21:52:29 +09:00
committed by Stéphane Nicoll
parent f60791a8e2
commit 919faa2ce2
108 changed files with 175 additions and 172 deletions

View File

@@ -428,7 +428,7 @@ public abstract class RequestPredicates {
/**
* Extension of {@code RequestPredicate} that can modify the {@code ServerRequest}.
*/
private static abstract class RequestModifyingPredicate implements RequestPredicate {
private abstract static class RequestModifyingPredicate implements RequestPredicate {
public static RequestModifyingPredicate of(RequestPredicate requestPredicate) {

View File

@@ -78,7 +78,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
implements HandlerMapping, Ordered, BeanNameAware {
final static String SUPPRESS_LOGGING_ATTRIBUTE = AbstractHandlerMapping.class.getName() + ".SUPPRESS_LOGGING";
static final String SUPPRESS_LOGGING_ATTRIBUTE = AbstractHandlerMapping.class.getName() + ".SUPPRESS_LOGGING";
/** Dedicated "hidden" logger for request mappings. */

View File

@@ -50,9 +50,9 @@ import org.springframework.web.util.pattern.PathPatternParser;
*/
public class PatternsRequestCondition extends AbstractRequestCondition<PatternsRequestCondition> {
private final static Set<String> EMPTY_PATH_PATTERN = Collections.singleton("");
private static final Set<String> EMPTY_PATH_PATTERN = Collections.singleton("");
private final static String[] ROOT_PATH_PATTERNS = new String[] {"", "/"};
private static final String[] ROOT_PATH_PATTERNS = new String[] {"", "/"};
private final Set<String> patterns;

View File

@@ -135,7 +135,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
(!AnnotatedElementUtils.hasAnnotation(method, RequestMapping.class) &&
AnnotatedElementUtils.hasAnnotation(method, ModelAttribute.class));
private final static boolean BEAN_VALIDATION_PRESENT =
private static final boolean BEAN_VALIDATION_PRESENT =
ClassUtils.isPresent("jakarta.validation.Validator", HandlerMethod.class.getClassLoader());

View File

@@ -112,7 +112,7 @@ public class ViewResolutionIntegrationTests {
}
@EnableWebMvc
static abstract class AbstractWebConfig implements WebMvcConfigurer {
abstract static class AbstractWebConfig implements WebMvcConfigurer {
@Bean
public SampleController sampleController() {

View File

@@ -187,7 +187,7 @@ class HandlerMethodAnnotationDetectionTests {
@Controller
static abstract class MappingAbstractClass {
abstract static class MappingAbstractClass {
@InitBinder
public abstract void initBinder(WebDataBinder dataBinder, String pattern);
@@ -286,7 +286,7 @@ class HandlerMethodAnnotationDetectionTests {
@Controller
static abstract class MappingGenericAbstractClass<A, B, C> {
abstract static class MappingGenericAbstractClass<A, B, C> {
@InitBinder
public abstract void initBinder(WebDataBinder dataBinder, A thePattern);
@@ -334,7 +334,7 @@ class HandlerMethodAnnotationDetectionTests {
@Controller
static abstract class MappedGenericAbstractClassWithConcreteImplementations<A, B, C> {
abstract static class MappedGenericAbstractClassWithConcreteImplementations<A, B, C> {
@InitBinder
public abstract void initBinder(WebDataBinder dataBinder, A thePattern);
@@ -378,7 +378,7 @@ class HandlerMethodAnnotationDetectionTests {
@Controller
static abstract class GenericAbstractClassDeclaresDefaultMappings<A, B, C> {
abstract static class GenericAbstractClassDeclaresDefaultMappings<A, B, C> {
@InitBinder
public abstract void initBinder(WebDataBinder dataBinder, A thePattern);

View File

@@ -270,7 +270,7 @@ public class HttpEntityMethodProcessorTests {
@SuppressWarnings("unused")
private static abstract class MyParameterizedController<DTO extends Identifiable> {
private abstract static class MyParameterizedController<DTO extends Identifiable> {
public void handleDto(HttpEntity<DTO> dto) {
}

View File

@@ -666,7 +666,7 @@ public class MvcUriComponentsBuilderTests {
}
static abstract class AbstractCrudController<T, ID> {
abstract static class AbstractCrudController<T, ID> {
abstract T get(ID id);
}

View File

@@ -830,7 +830,7 @@ class RequestResponseBodyMethodProcessorTests {
}
private static abstract class MyParameterizedController<DTO extends Identifiable> {
private abstract static class MyParameterizedController<DTO extends Identifiable> {
@SuppressWarnings("unused")
public void handleDto(@RequestBody DTO dto) {}
@@ -850,7 +850,7 @@ class RequestResponseBodyMethodProcessorTests {
@SuppressWarnings("unused")
private static abstract class MyParameterizedControllerWithList<DTO extends Identifiable> {
private abstract static class MyParameterizedControllerWithList<DTO extends Identifiable> {
public void handleDto(@RequestBody List<DTO> dto) {
}

View File

@@ -3620,7 +3620,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
List<E> find(boolean sort, P predicate) throws IOException;
}
static abstract class Entity {
abstract static class Entity {
public UUID id;
@@ -3638,7 +3638,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
public String content;
}
static abstract class EntityPredicate<E extends Entity> {
abstract static class EntityPredicate<E extends Entity> {
public String createdBy;
@@ -3756,7 +3756,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
}
}
static abstract class MyAbstractController {
abstract static class MyAbstractController {
@RequestMapping("/handle")
public abstract void handle(Writer writer) throws IOException;