Skip to content

Commit 1106af1

Browse files
committed
Polishing: Add final at private field
1 parent c6aa371 commit 1106af1

File tree

74 files changed

+224
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+224
-226
lines changed

src/main/java/org/apache/ibatis/builder/MapperBuilderAssistant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
public class MapperBuilderAssistant extends BaseBuilder {
5656

5757
private String currentNamespace;
58-
private String resource;
58+
private final String resource;
5959
private Cache currentCache;
6060
private boolean unresolvedCacheRef; // issue #676
6161

src/main/java/org/apache/ibatis/builder/ResultMapResolver.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2015 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,12 +26,12 @@
2626
*/
2727
public class ResultMapResolver {
2828
private final MapperBuilderAssistant assistant;
29-
private String id;
30-
private Class<?> type;
31-
private String extend;
32-
private Discriminator discriminator;
33-
private List<ResultMapping> resultMappings;
34-
private Boolean autoMapping;
29+
private final String id;
30+
private final Class<?> type;
31+
private final String extend;
32+
private final Discriminator discriminator;
33+
private final List<ResultMapping> resultMappings;
34+
private final Boolean autoMapping;
3535

3636
public ResultMapResolver(MapperBuilderAssistant assistant, String id, Class<?> type, String extend, Discriminator discriminator, List<ResultMapping> resultMappings, Boolean autoMapping) {
3737
this.assistant = assistant;

src/main/java/org/apache/ibatis/builder/StaticSqlSource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2015 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,9 +27,9 @@
2727
*/
2828
public class StaticSqlSource implements SqlSource {
2929

30-
private String sql;
31-
private List<ParameterMapping> parameterMappings;
32-
private Configuration configuration;
30+
private final String sql;
31+
private final List<ParameterMapping> parameterMappings;
32+
private final Configuration configuration;
3333

3434
public StaticSqlSource(Configuration configuration, String sql) {
3535
this(configuration, sql, null);

src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public class MapperAnnotationBuilder {
9797
private final Set<Class<? extends Annotation>> sqlAnnotationTypes = new HashSet<Class<? extends Annotation>>();
9898
private final Set<Class<? extends Annotation>> sqlProviderAnnotationTypes = new HashSet<Class<? extends Annotation>>();
9999

100-
private Configuration configuration;
101-
private MapperBuilderAssistant assistant;
102-
private Class<?> type;
100+
private final Configuration configuration;
101+
private final MapperBuilderAssistant assistant;
102+
private final Class<?> type;
103103

104104
public MapperAnnotationBuilder(Configuration configuration, Class<?> type) {
105105
String resource = type.getName().replace('.', '/') + ".java (best guess)";

src/main/java/org/apache/ibatis/builder/annotation/MethodResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2015 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
*/
2323
public class MethodResolver {
2424
private final MapperAnnotationBuilder annotationBuilder;
25-
private Method method;
25+
private final Method method;
2626

2727
public MethodResolver(MapperAnnotationBuilder annotationBuilder, Method method) {
2828
this.annotationBuilder = annotationBuilder;

src/main/java/org/apache/ibatis/builder/annotation/ProviderSqlSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,8 +32,8 @@
3232
*/
3333
public class ProviderSqlSource implements SqlSource {
3434

35-
private SqlSourceBuilder sqlSourceParser;
36-
private Class<?> providerType;
35+
private final SqlSourceBuilder sqlSourceParser;
36+
private final Class<?> providerType;
3737
private Method providerMethod;
3838
private String[] providerMethodArgumentNames;
3939

src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
public class XMLConfigBuilder extends BaseBuilder {
5555

5656
private boolean parsed;
57-
private XPathParser parser;
57+
private final XPathParser parser;
5858
private String environment;
59-
private ReflectorFactory localReflectorFactory = new DefaultReflectorFactory();
59+
private final ReflectorFactory localReflectorFactory = new DefaultReflectorFactory();
6060

6161
public XMLConfigBuilder(Reader reader) {
6262
this(reader, null, null);

src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
*/
5353
public class XMLMapperBuilder extends BaseBuilder {
5454

55-
private XPathParser parser;
56-
private MapperBuilderAssistant builderAssistant;
57-
private Map<String, XNode> sqlFragments;
58-
private String resource;
55+
private final XPathParser parser;
56+
private final MapperBuilderAssistant builderAssistant;
57+
private final Map<String, XNode> sqlFragments;
58+
private final String resource;
5959

6060
@Deprecated
6161
public XMLMapperBuilder(Reader reader, Configuration configuration, String resource, Map<String, XNode> sqlFragments, String namespace) {

src/main/java/org/apache/ibatis/builder/xml/XMLStatementBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
*/
3939
public class XMLStatementBuilder extends BaseBuilder {
4040

41-
private MapperBuilderAssistant builderAssistant;
42-
private XNode context;
43-
private String requiredDatabaseId;
41+
private final MapperBuilderAssistant builderAssistant;
42+
private final XNode context;
43+
private final String requiredDatabaseId;
4444

4545
public XMLStatementBuilder(Configuration configuration, MapperBuilderAssistant builderAssistant, XNode context) {
4646
this(configuration, builderAssistant, context, null);

src/main/java/org/apache/ibatis/cache/CacheKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CacheKey implements Cloneable, Serializable {
3333
private static final int DEFAULT_MULTIPLYER = 37;
3434
private static final int DEFAULT_HASHCODE = 17;
3535

36-
private int multiplier;
36+
private final int multiplier;
3737
private int hashcode;
3838
private long checksum;
3939
private int count;

0 commit comments

Comments
 (0)