Skip to content

Commit 9109378

Browse files
thachlpodrotbohm
authored andcommitted
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.
1 parent 2bfa58d commit 9109378

11 files changed

+14
-14
lines changed

src/main/java/org/springframework/data/domain/Range.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
public final class Range<T> {
3333

34-
private final static Range<?> UNBOUNDED = Range.of(Bound.unbounded(), Bound.unbounded());
34+
private static final Range<?> UNBOUNDED = Range.of(Bound.unbounded(), Bound.unbounded());
3535

3636
/**
3737
* The lower bound of the range.

src/main/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private Class<PersistentPropertyAccessor<?>> createAccessorClass(PersistentEntit
215215

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

src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*/
5252
class ProxyProjectionFactory implements ProjectionFactory, BeanClassLoaderAware {
5353

54-
final static GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
54+
static final GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
5555

5656
static {
5757
Jsr310Converters.getConvertersToRegister().forEach(CONVERSION_SERVICE::addConverter);

src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
*/
8585
public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, BeanFactoryAware {
8686

87-
final static GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
87+
static final GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
8888
private static final Log logger = LogFactory.getLog(RepositoryFactorySupport.class);
8989

9090
static {

src/main/java/org/springframework/data/repository/query/SpelEvaluator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*/
4040
public class SpelEvaluator {
4141

42-
private final static SpelExpressionParser PARSER = new SpelExpressionParser();
42+
private static final SpelExpressionParser PARSER = new SpelExpressionParser();
4343

4444
private final QueryMethodEvaluationContextProvider evaluationContextProvider;
4545
private final Parameters<?, ?> parameters;

src/main/java/org/springframework/data/repository/query/SpelQueryContext.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
*/
6464
public class SpelQueryContext {
6565

66-
private final static String SPEL_PATTERN_STRING = "([:?])#\\{([^}]+)}";
67-
private final static Pattern SPEL_PATTERN = Pattern.compile(SPEL_PATTERN_STRING);
66+
private static final String SPEL_PATTERN_STRING = "([:?])#\\{([^}]+)}";
67+
private static final Pattern SPEL_PATTERN = Pattern.compile(SPEL_PATTERN_STRING);
6868

6969
/**
7070
* A function from the index of a SpEL expression in a query and the actual SpEL expression to the parameter name to

src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
@Deprecated
7171
public class ChainedTransactionManager implements PlatformTransactionManager {
7272

73-
private final static Log logger = LogFactory.getLog(ChainedTransactionManager.class);
73+
private static final Log logger = LogFactory.getLog(ChainedTransactionManager.class);
7474

7575
private final List<PlatformTransactionManager> transactionManagers;
7676
private final SynchronizationManager synchronizationManager;

src/main/java/org/springframework/data/util/QTypeContributor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
public class QTypeContributor {
3131

32-
private final static Log logger = LogFactory.getLog(QTypeContributor.class);
32+
private static final Log logger = LogFactory.getLog(QTypeContributor.class);
3333

3434
public static void contributeEntityPath(Class<?> type, GenerationContext context, @Nullable ClassLoader classLoader) {
3535

src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryDatatypeTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ public void setStringArray(String[] stringArray) {
509509

510510
// DATACMNS-916
511511
@AccessType(Type.FIELD)
512-
private final static class PrivateFinalFieldAccess {
512+
private static final class PrivateFinalFieldAccess {
513513

514514
int primitiveInteger;
515515
int[] primitiveIntegerArray;
@@ -558,7 +558,7 @@ private final static class PrivateFinalFieldAccess {
558558

559559
// DATACMNS-916
560560
@AccessType(Type.PROPERTY)
561-
private final static class PrivateFinalPropertyAccess {
561+
private static final class PrivateFinalPropertyAccess {
562562

563563
int primitiveInteger;
564564
int[] primitiveIntegerArray;

src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
@SuppressWarnings("WeakerAccess") // public required for class generation due to visibility rules
4242
public class ClassGeneratingPropertyAccessorFactoryTests {
4343

44-
private final static ClassGeneratingPropertyAccessorFactory factory = new ClassGeneratingPropertyAccessorFactory();
45-
private final static SampleMappingContext mappingContext = new SampleMappingContext();
44+
private static final ClassGeneratingPropertyAccessorFactory factory = new ClassGeneratingPropertyAccessorFactory();
45+
private static final SampleMappingContext mappingContext = new SampleMappingContext();
4646

4747

4848
@SuppressWarnings("unchecked")

src/test/java/org/springframework/data/mapping/model/PersistentPropertyAccessorTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*/
4040
public class PersistentPropertyAccessorTests {
4141

42-
private final static SampleMappingContext MAPPING_CONTEXT = new SampleMappingContext();
42+
private static final SampleMappingContext MAPPING_CONTEXT = new SampleMappingContext();
4343

4444
@SuppressWarnings("unchecked")
4545
public static List<Object[]> parameters() {

0 commit comments

Comments
 (0)