Polish: follow name convention - make immutable fields final

This commit is contained in:
igor-suhorukov 2018-02-10 02:07:15 +03:00 committed by Juergen Hoeller
parent 9bb7fcd997
commit 9a6fbf59c5
13 changed files with 29 additions and 29 deletions

View File

@ -45,7 +45,7 @@ import org.springframework.lang.Nullable;
class InstantiationModelAwarePointcutAdvisorImpl
implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation, Serializable {
private static Advice EMPTY_ADVICE = new Advice() {};
private static final Advice EMPTY_ADVICE = new Advice() {};
private final AspectJExpressionPointcut declaredPointcut;

View File

@ -95,7 +95,7 @@ public abstract class Pointcuts {
@SuppressWarnings("serial")
private static class SetterPointcut extends StaticMethodMatcherPointcut implements Serializable {
public static SetterPointcut INSTANCE = new SetterPointcut();
public static final SetterPointcut INSTANCE = new SetterPointcut();
@Override
public boolean matches(Method method, @Nullable Class<?> targetClass) {
@ -116,7 +116,7 @@ public abstract class Pointcuts {
@SuppressWarnings("serial")
private static class GetterPointcut extends StaticMethodMatcherPointcut implements Serializable {
public static GetterPointcut INSTANCE = new GetterPointcut();
public static final GetterPointcut INSTANCE = new GetterPointcut();
@Override
public boolean matches(Method method, @Nullable Class<?> targetClass) {

View File

@ -32,7 +32,7 @@ import org.springframework.util.Assert;
@SuppressWarnings("serial")
public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
public static String VALUE_KEY = "value";
public static final String VALUE_KEY = "value";
private final String typeName;

View File

@ -47,24 +47,24 @@ public abstract class VfsUtils {
private static final String VFS3_PKG = "org.jboss.vfs.";
private static final String VFS_NAME = "VFS";
private static Method VFS_METHOD_GET_ROOT_URL;
private static Method VFS_METHOD_GET_ROOT_URI;
private static final Method VFS_METHOD_GET_ROOT_URL;
private static final Method VFS_METHOD_GET_ROOT_URI;
private static Method VIRTUAL_FILE_METHOD_EXISTS;
private static Method VIRTUAL_FILE_METHOD_GET_INPUT_STREAM;
private static Method VIRTUAL_FILE_METHOD_GET_SIZE;
private static Method VIRTUAL_FILE_METHOD_GET_LAST_MODIFIED;
private static Method VIRTUAL_FILE_METHOD_TO_URL;
private static Method VIRTUAL_FILE_METHOD_TO_URI;
private static Method VIRTUAL_FILE_METHOD_GET_NAME;
private static Method VIRTUAL_FILE_METHOD_GET_PATH_NAME;
private static Method VIRTUAL_FILE_METHOD_GET_CHILD;
private static final Method VIRTUAL_FILE_METHOD_EXISTS;
private static final Method VIRTUAL_FILE_METHOD_GET_INPUT_STREAM;
private static final Method VIRTUAL_FILE_METHOD_GET_SIZE;
private static final Method VIRTUAL_FILE_METHOD_GET_LAST_MODIFIED;
private static final Method VIRTUAL_FILE_METHOD_TO_URL;
private static final Method VIRTUAL_FILE_METHOD_TO_URI;
private static final Method VIRTUAL_FILE_METHOD_GET_NAME;
private static final Method VIRTUAL_FILE_METHOD_GET_PATH_NAME;
private static final Method VIRTUAL_FILE_METHOD_GET_CHILD;
protected static Class<?> VIRTUAL_FILE_VISITOR_INTERFACE;
protected static Method VIRTUAL_FILE_METHOD_VISIT;
protected static final Class<?> VIRTUAL_FILE_VISITOR_INTERFACE;
protected static final Method VIRTUAL_FILE_METHOD_VISIT;
private static Field VISITOR_ATTRIBUTES_FIELD_RECURSE;
private static Method GET_PHYSICAL_FILE;
private static final Field VISITOR_ATTRIBUTES_FIELD_RECURSE;
private static final Method GET_PHYSICAL_FILE;
static {
ClassLoader loader = VfsUtils.class.getClassLoader();

View File

@ -238,9 +238,9 @@ public abstract class Operator extends SpelNodeImpl {
*/
protected static class DescriptorComparison {
static DescriptorComparison NOT_NUMBERS = new DescriptorComparison(false, false, ' ');
static final DescriptorComparison NOT_NUMBERS = new DescriptorComparison(false, false, ' ');
static DescriptorComparison INCOMPATIBLE_NUMBERS = new DescriptorComparison(true, false, ' ');
static final DescriptorComparison INCOMPATIBLE_NUMBERS = new DescriptorComparison(true, false, ' ');
final boolean areNumbers; // Were the two compared descriptor both for numbers?

View File

@ -44,7 +44,7 @@ import org.springframework.util.ObjectUtils;
*/
public abstract class SpelNodeImpl implements SpelNode, Opcodes {
private static SpelNodeImpl[] NO_CHILDREN = new SpelNodeImpl[0];
private static final SpelNodeImpl[] NO_CHILDREN = new SpelNodeImpl[0];
protected int pos; // start = top 16bits, end = bottom 16bits

View File

@ -48,7 +48,7 @@ public class BatchSqlUpdate extends SqlUpdate {
/**
* Default number of inserts to accumulate before commiting a batch (5000).
*/
public static int DEFAULT_BATCH_SIZE = 5000;
public static final int DEFAULT_BATCH_SIZE = 5000;
private int batchSize = DEFAULT_BATCH_SIZE;

View File

@ -55,7 +55,7 @@ import org.springframework.util.StringUtils;
*/
public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> implements JmsHeaderMapper {
private static Set<Class<?>> SUPPORTED_PROPERTY_TYPES = new HashSet<>(Arrays.asList(new Class<?>[] {
private static final Set<Class<?>> SUPPORTED_PROPERTY_TYPES = new HashSet<>(Arrays.asList(new Class<?>[] {
Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class}));

View File

@ -37,7 +37,7 @@ import org.springframework.util.MultiValueMap;
*/
public abstract class AbstractSubscriptionRegistry implements SubscriptionRegistry {
private static MultiValueMap<String, String> EMPTY_MAP =
private static final MultiValueMap<String, String> EMPTY_MAP =
CollectionUtils.unmodifiableMultiValueMap(new LinkedMultiValueMap<>(0));
protected final Log logger = LogFactory.getLog(getClass());

View File

@ -65,7 +65,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
*/
public final class MockMvc {
static String MVC_RESULT_ATTRIBUTE = MockMvc.class.getName().concat(".MVC_RESULT_ATTRIBUTE");
static final String MVC_RESULT_ATTRIBUTE = MockMvc.class.getName().concat(".MVC_RESULT_ATTRIBUTE");
private final TestDispatcherServlet servlet;

View File

@ -35,7 +35,7 @@ import org.springframework.util.Assert;
*/
public class ServletServerHttpAsyncRequestControl implements ServerHttpAsyncRequestControl, AsyncListener {
private static long NO_TIMEOUT_VALUE = Long.MIN_VALUE;
private static final long NO_TIMEOUT_VALUE = Long.MIN_VALUE;
private final ServletServerHttpRequest request;

View File

@ -78,7 +78,7 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
"EEE MMM dd HH:mm:ss yyyy"
};
private static TimeZone GMT = TimeZone.getTimeZone("GMT");
private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
private boolean notModified = false;

View File

@ -32,7 +32,7 @@ import org.springframework.util.Assert;
*/
public class StompSubProtocolErrorHandler implements SubProtocolErrorHandler<byte[]> {
private static byte[] EMPTY_PAYLOAD = new byte[0];
private static final byte[] EMPTY_PAYLOAD = new byte[0];
@Override