Consistent final declaration for static delegate classes

Issue: SPR-16968
This commit is contained in:
Juergen Hoeller 2018-07-02 13:55:18 +02:00
parent 2ade122543
commit e5a6711d29
12 changed files with 65 additions and 17 deletions

View File

@ -39,7 +39,7 @@ import org.springframework.lang.Nullable;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 13.03.2003 * @since 13.03.2003
*/ */
public abstract class AopContext { public final class AopContext {
/** /**
* ThreadLocal holder for AOP proxy associated with this thread. * ThreadLocal holder for AOP proxy associated with this thread.
@ -50,6 +50,10 @@ public abstract class AopContext {
private static final ThreadLocal<Object> currentProxy = new NamedThreadLocal<>("Current AOP proxy"); private static final ThreadLocal<Object> currentProxy = new NamedThreadLocal<>("Current AOP proxy");
private AopContext() {
}
/** /**
* Try to return the current AOP proxy. This method is usable only if the * Try to return the current AOP proxy. This method is usable only if the
* calling method has been invoked via AOP, and the AOP framework has been set * calling method has been invoked via AOP, and the AOP framework has been set

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,7 +24,11 @@ package org.springframework.aop.framework.adapter;
* @author Phillip Webb * @author Phillip Webb
* @see DefaultAdvisorAdapterRegistry * @see DefaultAdvisorAdapterRegistry
*/ */
public abstract class GlobalAdvisorAdapterRegistry { public final class GlobalAdvisorAdapterRegistry {
private GlobalAdvisorAdapterRegistry() {
}
/** /**
* Keep track of a single instance so we can return it to classes that request it. * Keep track of a single instance so we can return it to classes that request it.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,7 +24,11 @@ package org.springframework.beans;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.5.2 * @since 2.5.2
*/ */
public abstract class PropertyAccessorFactory { public final class PropertyAccessorFactory {
private PropertyAccessorFactory() {
}
/** /**
* Obtain a BeanWrapper for the given target object, * Obtain a BeanWrapper for the given target object,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@ import org.springframework.lang.Nullable;
* @see org.springframework.context.support.MessageSourceAccessor * @see org.springframework.context.support.MessageSourceAccessor
* @see org.springframework.web.servlet.DispatcherServlet * @see org.springframework.web.servlet.DispatcherServlet
*/ */
public abstract class LocaleContextHolder { public final class LocaleContextHolder {
private static final ThreadLocal<LocaleContext> localeContextHolder = private static final ThreadLocal<LocaleContext> localeContextHolder =
new NamedThreadLocal<>("LocaleContext"); new NamedThreadLocal<>("LocaleContext");
@ -59,6 +59,10 @@ public abstract class LocaleContextHolder {
private static TimeZone defaultTimeZone; private static TimeZone defaultTimeZone;
private LocaleContextHolder() {
}
/** /**
* Reset the LocaleContext for the current thread. * Reset the LocaleContext for the current thread.
*/ */

View File

@ -45,7 +45,11 @@ import org.springframework.util.ReflectionUtils;
* @author Phillip Webb * @author Phillip Webb
* @since 2.0 * @since 2.0
*/ */
public abstract class BridgeMethodResolver { public final class BridgeMethodResolver {
private BridgeMethodResolver() {
}
/** /**
* Find the original method for the supplied {@link Method bridge Method}. * Find the original method for the supplied {@link Method bridge Method}.

View File

@ -53,7 +53,7 @@ import org.springframework.util.ReflectionUtils;
* @author Sam Brannen * @author Sam Brannen
* @since 1.1.1 * @since 1.1.1
*/ */
public abstract class CollectionFactory { public final class CollectionFactory {
private static final Set<Class<?>> approximableCollectionTypes = new HashSet<>(); private static final Set<Class<?>> approximableCollectionTypes = new HashSet<>();
@ -85,6 +85,10 @@ public abstract class CollectionFactory {
} }
private CollectionFactory() {
}
/** /**
* Determine whether the given collection type is an <em>approximable</em> type, * Determine whether the given collection type is an <em>approximable</em> type,
* i.e. a type that {@link #createApproximateCollection} can approximate. * i.e. a type that {@link #createApproximateCollection} can approximate.

View File

@ -34,7 +34,7 @@ import org.springframework.util.ClassUtils;
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 2.0 * @since 2.0
*/ */
public abstract class Conventions { public final class Conventions {
/** /**
* Suffix added to names when using arrays. * Suffix added to names when using arrays.
@ -42,6 +42,10 @@ public abstract class Conventions {
private static final String PLURAL_SUFFIX = "List"; private static final String PLURAL_SUFFIX = "List";
private Conventions() {
}
/** /**
* Determine the conventional variable name for the supplied {@code Object} * Determine the conventional variable name for the supplied {@code Object}
* based on its concrete type. The convention used is to return the * based on its concrete type. The convention used is to return the

View File

@ -41,13 +41,17 @@ import org.springframework.util.ConcurrentReferenceHashMap;
* @author Phillip Webb * @author Phillip Webb
* @since 2.5.2 * @since 2.5.2
*/ */
public abstract class GenericTypeResolver { public final class GenericTypeResolver {
/** Cache from Class to TypeVariable Map. */ /** Cache from Class to TypeVariable Map. */
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private static final Map<Class<?>, Map<TypeVariable, Type>> typeVariableCache = new ConcurrentReferenceHashMap<>(); private static final Map<Class<?>, Map<TypeVariable, Type>> typeVariableCache = new ConcurrentReferenceHashMap<>();
private GenericTypeResolver() {
}
/** /**
* Determine the target type for the given generic parameter type. * Determine the target type for the given generic parameter type.
* @param methodParameter the method parameter specification * @param methodParameter the method parameter specification
@ -86,7 +90,7 @@ public abstract class GenericTypeResolver {
*/ */
@Nullable @Nullable
public static Class<?> resolveReturnTypeArgument(Method method, Class<?> genericIfc) { public static Class<?> resolveReturnTypeArgument(Method method, Class<?> genericIfc) {
Assert.notNull(method, "method must not be null"); Assert.notNull(method, "Method must not be null");
ResolvableType resolvableType = ResolvableType.forMethodReturnType(method).as(genericIfc); ResolvableType resolvableType = ResolvableType.forMethodReturnType(method).as(genericIfc);
if (!resolvableType.hasGenerics() || resolvableType.getType() instanceof WildcardType) { if (!resolvableType.hasGenerics() || resolvableType.getType() instanceof WildcardType) {
return null; return null;

View File

@ -38,7 +38,11 @@ import org.springframework.util.ReflectionUtils;
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 4.2.3 * @since 4.2.3
*/ */
public abstract class MethodIntrospector { public final class MethodIntrospector {
private MethodIntrospector() {
}
/** /**
* Select methods on the given target type based on the lookup of associated metadata. * Select methods on the given target type based on the lookup of associated metadata.

View File

@ -46,7 +46,7 @@ import org.springframework.lang.Nullable;
* @see org.springframework.jdbc.core.StatementCreatorUtils#IGNORE_GETPARAMETERTYPE_PROPERTY_NAME * @see org.springframework.jdbc.core.StatementCreatorUtils#IGNORE_GETPARAMETERTYPE_PROPERTY_NAME
* @see org.springframework.test.context.cache.ContextCache#MAX_CONTEXT_CACHE_SIZE_PROPERTY_NAME * @see org.springframework.test.context.cache.ContextCache#MAX_CONTEXT_CACHE_SIZE_PROPERTY_NAME
*/ */
public abstract class SpringProperties { public final class SpringProperties {
private static final String PROPERTIES_RESOURCE_LOCATION = "spring.properties"; private static final String PROPERTIES_RESOURCE_LOCATION = "spring.properties";
@ -79,6 +79,10 @@ public abstract class SpringProperties {
} }
private SpringProperties() {
}
/** /**
* Programmatically set a local property, overriding an entry in the * Programmatically set a local property, overriding an entry in the
* {@code spring.properties} file (if any). * {@code spring.properties} file (if any).

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -33,7 +33,11 @@ import org.springframework.lang.Nullable;
* @author Chris Beams * @author Chris Beams
* @since 3.0 * @since 3.0
*/ */
public abstract class ConversionServiceFactory { public final class ConversionServiceFactory {
private ConversionServiceFactory() {
}
/** /**
* Register the given Converter objects with the given target ConverterRegistry. * Register the given Converter objects with the given target ConverterRegistry.

View File

@ -60,7 +60,7 @@ import org.springframework.util.StringUtils;
* @author Sam Brannen * @author Sam Brannen
* @since 3.2 * @since 3.2
*/ */
public abstract class SpringFactoriesLoader { public final class SpringFactoriesLoader {
/** /**
* The location to look for factories. * The location to look for factories.
@ -74,6 +74,10 @@ public abstract class SpringFactoriesLoader {
private static final Map<ClassLoader, MultiValueMap<String, String>> cache = new ConcurrentReferenceHashMap<>(); private static final Map<ClassLoader, MultiValueMap<String, String>> cache = new ConcurrentReferenceHashMap<>();
private SpringFactoriesLoader() {
}
/** /**
* Load and instantiate the factory implementations of the given type from * Load and instantiate the factory implementations of the given type from
* {@value #FACTORIES_RESOURCE_LOCATION}, using the given class loader. * {@value #FACTORIES_RESOURCE_LOCATION}, using the given class loader.