Fix misordered modifiers 'final static'.

Per the Java Language Specification (Java 17; https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.3.1), 'static' should appear before 'final'.

This is also consistent with source code analysis tools, like Checkstyle, rules: https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.html.

Fixes #2881.
This commit is contained in:
Thach Le
2023-07-18 20:22:47 +07:00
committed by Oliver Drotbohm
parent 2bfa58d329
commit 91093780dc
11 changed files with 14 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ import org.springframework.util.ObjectUtils;
*/
public final class Range<T> {
private final static Range<?> UNBOUNDED = Range.of(Bound.unbounded(), Bound.unbounded());
private static final Range<?> UNBOUNDED = Range.of(Bound.unbounded(), Bound.unbounded());
/**
* The lower bound of the range.

View File

@@ -215,7 +215,7 @@ public class ClassGeneratingPropertyAccessorFactory implements PersistentPropert
/**
* Generates {@link PersistentPropertyAccessor} classes to access properties of a {@link PersistentEntity}. This code
* uses {@code private final static} held method handles which perform about the speed of native method invocations
* uses {@code private static final} held method handles which perform about the speed of native method invocations
* for property access which is restricted due to Java rules (such as private fields/methods) or private inner
* classes. All other scoped members (package default, protected and public) are accessed via field or property access
* to bypass reflection overhead. That's only possible if the type and the member access is possible from another

View File

@@ -51,7 +51,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
*/
class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware {
final static GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
static final GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
static {
Jsr310Converters.getConvertersToRegister().forEach(CONVERSION_SERVICE::addConverter);

View File

@@ -84,7 +84,7 @@ import org.springframework.util.ObjectUtils;
*/
public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, BeanFactoryAware {
final static GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
static final GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
private static final Log logger = LogFactory.getLog(RepositoryFactorySupport.class);
static {

View File

@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
*/
public class SpelEvaluator {
private final static SpelExpressionParser PARSER = new SpelExpressionParser();
private static final SpelExpressionParser PARSER = new SpelExpressionParser();
private final QueryMethodEvaluationContextProvider evaluationContextProvider;
private final Parameters<?, ?> parameters;

View File

@@ -63,8 +63,8 @@ import org.springframework.util.Assert;
*/
public class SpelQueryContext {
private final static String SPEL_PATTERN_STRING = "([:?])#\\{([^}]+)}";
private final static Pattern SPEL_PATTERN = Pattern.compile(SPEL_PATTERN_STRING);
private static final String SPEL_PATTERN_STRING = "([:?])#\\{([^}]+)}";
private static final Pattern SPEL_PATTERN = Pattern.compile(SPEL_PATTERN_STRING);
/**
* A function from the index of a SpEL expression in a query and the actual SpEL expression to the parameter name to

View File

@@ -70,7 +70,7 @@ import org.springframework.util.Assert;
@Deprecated
public class ChainedTransactionManager implements PlatformTransactionManager {
private final static Log logger = LogFactory.getLog(ChainedTransactionManager.class);
private static final Log logger = LogFactory.getLog(ChainedTransactionManager.class);
private final List<PlatformTransactionManager> transactionManagers;
private final SynchronizationManager synchronizationManager;

View File

@@ -29,7 +29,7 @@ import org.springframework.util.ClassUtils;
*/
public class QTypeContributor {
private final static Log logger = LogFactory.getLog(QTypeContributor.class);
private static final Log logger = LogFactory.getLog(QTypeContributor.class);
public static void contributeEntityPath(Class<?> type, GenerationContext context, @Nullable ClassLoader classLoader) {