Browse Source

Use consistent class design

Update all classes so that inner classes are always last. Also
ensure that utility classes are always final and have a private
constructor and make exceptions final whenever possible.

Issue: SPR-16968
pull/1868/head
Phillip Webb 8 years ago committed by Juergen Hoeller
parent
commit
eeebd51f57
  1. 4
      spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java
  2. 4
      spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java
  3. 4
      spring-aop/src/main/java/org/springframework/aop/TruePointcut.java
  4. 27
      spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
  5. 6
      spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java
  6. 4
      spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java
  7. 6
      spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java
  8. 2
      spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java
  9. 2
      spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java
  10. 8
      spring-aspects/src/main/java/org/springframework/cache/aspectj/AnyThrow.java
  11. 12
      spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java
  12. 2
      spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
  13. 6
      spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java
  14. 7
      spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java
  15. 5
      spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java
  16. 2
      spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
  17. 9
      spring-beans/src/main/java/org/springframework/beans/PropertyDescriptorUtils.java
  18. 2
      spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
  19. 10
      spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java
  20. 12
      spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java
  21. 6
      spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java
  22. 8
      spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java
  23. 10
      spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java
  24. 10
      spring-beans/src/main/java/org/springframework/beans/factory/NoUniqueBeanDefinitionException.java
  25. 5
      spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java
  26. 4
      spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
  27. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
  28. 8
      spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
  29. 3
      spring-context-support/src/main/java/org/springframework/mail/MailSendException.java
  30. 6
      spring-context/src/main/java/org/springframework/cache/config/CacheManagementConfigUtils.java
  31. 6
      spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java
  32. 9
      spring-context/src/main/java/org/springframework/context/annotation/BeanAnnotationHelper.java
  33. 9
      spring-context/src/main/java/org/springframework/context/annotation/ScopedProxyCreator.java
  34. 8
      spring-context/src/main/java/org/springframework/context/index/CandidateComponentsIndexLoader.java
  35. 7
      spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java
  36. 6
      spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java
  37. 7
      spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeConverters.java
  38. 6
      spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeContextHolder.java
  39. 7
      spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeConverters.java
  40. 9
      spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java
  41. 9
      spring-context/src/main/java/org/springframework/scheduling/config/TaskManagementConfigUtils.java
  42. 6
      spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java
  43. 4
      spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java
  44. 2
      spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java
  45. 9
      spring-core/src/main/java/org/springframework/core/SpringVersion.java
  46. 2
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java
  47. 2
      spring-core/src/main/java/org/springframework/core/codec/CharSequenceEncoder.java
  48. 2
      spring-core/src/main/java/org/springframework/core/codec/StringDecoder.java
  49. 5
      spring-core/src/main/java/org/springframework/core/env/ProfilesParser.java
  50. 42
      spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
  51. 8
      spring-expression/src/main/java/org/springframework/expression/ExpressionException.java
  52. 29
      spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java
  53. 28
      spring-expression/src/main/java/org/springframework/expression/spel/ast/Operator.java
  54. 4
      spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java
  55. 2
      spring-expression/src/main/java/org/springframework/expression/spel/support/BooleanTypedValue.java
  56. 2
      spring-expression/src/main/java/org/springframework/expression/spel/support/DataBindingMethodResolver.java
  57. 2
      spring-expression/src/main/java/org/springframework/expression/spel/support/DataBindingPropertyAccessor.java
  58. 2
      spring-expression/src/main/java/org/springframework/expression/spel/support/SimpleEvaluationContext.java
  59. 8
      spring-instrument/src/main/java/org/springframework/instrument/InstrumentationSavingAgent.java
  60. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/BadSqlGrammarException.java
  61. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java
  62. 5
      spring-jdbc/src/main/java/org/springframework/jdbc/InvalidResultSetAccessException.java
  63. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java
  64. 7
      spring-jdbc/src/main/java/org/springframework/jdbc/config/DatabasePopulatorConfigUtils.java
  65. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java
  66. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java
  67. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java
  68. 5
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java
  69. 9
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/OutputStreamFactory.java
  70. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java
  71. 6
      spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java
  72. 2
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/DestinationVariableMethodArgumentResolver.java
  73. 4
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java
  74. 5
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java
  75. 2
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java
  76. 8
      spring-orm/src/main/java/org/springframework/orm/ObjectOptimisticLockingFailureException.java
  77. 8
      spring-orm/src/main/java/org/springframework/orm/ObjectRetrievalFailureException.java
  78. 2
      spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java
  79. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/ExtendedEntityManagerCreator.java
  80. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java
  81. 7
      spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
  82. 4
      spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java
  83. 2
      spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
  84. 4
      spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java
  85. 2
      spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java
  86. 2
      spring-test/src/main/java/org/springframework/mock/web/reactive/function/server/MockServerRequest.java
  87. 4
      spring-test/src/main/java/org/springframework/test/annotation/SystemProfileValueSource.java
  88. 9
      spring-test/src/main/java/org/springframework/test/annotation/TestAnnotationUtils.java
  89. 7
      spring-test/src/main/java/org/springframework/test/context/transaction/TestTransaction.java
  90. 6
      spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContextHolder.java
  91. 8
      spring-test/src/main/java/org/springframework/test/jdbc/JdbcTestUtils.java
  92. 4
      spring-test/src/main/java/org/springframework/test/web/client/ExpectedCount.java
  93. 2
      spring-test/src/main/java/org/springframework/test/web/client/MockRestServiceServer.java
  94. 7
      spring-test/src/main/java/org/springframework/test/web/servlet/setup/MockMvcBuilders.java
  95. 6
      spring-tx/src/main/java/org/springframework/dao/IncorrectResultSizeDataAccessException.java
  96. 2
      spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java
  97. 2
      spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java
  98. 4
      spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java
  99. 2
      spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java
  100. 2
      spring-web/src/main/java/org/springframework/http/ContentDisposition.java
  101. Some files were not shown because too many files have changed in this diff Show More

4
spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ import java.io.Serializable; @@ -24,7 +24,7 @@ import java.io.Serializable;
* @author Rod Johnson
*/
@SuppressWarnings("serial")
class TrueClassFilter implements ClassFilter, Serializable {
final class TrueClassFilter implements ClassFilter, Serializable {
public static final TrueClassFilter INSTANCE = new TrueClassFilter();

4
spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -27,7 +27,7 @@ import org.springframework.lang.Nullable; @@ -27,7 +27,7 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
*/
@SuppressWarnings("serial")
class TrueMethodMatcher implements MethodMatcher, Serializable {
final class TrueMethodMatcher implements MethodMatcher, Serializable {
public static final TrueMethodMatcher INSTANCE = new TrueMethodMatcher();

4
spring-aop/src/main/java/org/springframework/aop/TruePointcut.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ import java.io.Serializable; @@ -24,7 +24,7 @@ import java.io.Serializable;
* @author Rod Johnson
*/
@SuppressWarnings("serial")
class TruePointcut implements Pointcut, Serializable {
final class TruePointcut implements Pointcut, Serializable {
public static final TruePointcut INSTANCE = new TruePointcut();

27
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java

@ -561,6 +561,19 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut @@ -561,6 +561,19 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
return sb.toString();
}
//---------------------------------------------------------------------
// Serialization support
//---------------------------------------------------------------------
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
// Rely on default serialization, just initialize state after deserialization.
ois.defaultReadObject();
// Initialize transient fields.
// pointcutExpression will be initialized lazily by checkReadyToMatch()
this.shadowMatchCache = new ConcurrentHashMap<>(32);
}
/**
* Handler for the Spring-specific {@code bean()} pointcut designator
@ -657,20 +670,6 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut @@ -657,20 +670,6 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
}
//---------------------------------------------------------------------
// Serialization support
//---------------------------------------------------------------------
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
// Rely on default serialization, just initialize state after deserialization.
ois.defaultReadObject();
// Initialize transient fields.
// pointcutExpression will be initialized lazily by checkReadyToMatch()
this.shadowMatchCache = new ConcurrentHashMap<>(32);
}
private static class DefensiveShadowMatch implements ShadowMatch {
private final ShadowMatch primary;

6
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@ import org.springframework.lang.Nullable; @@ -42,7 +42,7 @@ import org.springframework.lang.Nullable;
* @since 2.0
*/
@SuppressWarnings("serial")
class InstantiationModelAwarePointcutAdvisorImpl
final class InstantiationModelAwarePointcutAdvisorImpl
implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation, Serializable {
private static final Advice EMPTY_ADVICE = new Advice() {};
@ -264,7 +264,7 @@ class InstantiationModelAwarePointcutAdvisorImpl @@ -264,7 +264,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
* Note that this is a <i>dynamic</i> pointcut. Otherwise it might
* be optimized out if it does not at first match statically.
*/
private class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut {
private final class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut {
private final AspectJExpressionPointcut declaredPointcut;

4
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -29,7 +29,7 @@ import org.springframework.aop.framework.AopConfigException; @@ -29,7 +29,7 @@ import org.springframework.aop.framework.AopConfigException;
@SuppressWarnings("serial")
public class NotAnAtAspectException extends AopConfigException {
private Class<?> nonAspectClass;
private final Class<?> nonAspectClass;
/**

6
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java

@ -27,13 +27,17 @@ import org.springframework.lang.Nullable; @@ -27,13 +27,17 @@ import org.springframework.lang.Nullable;
* @author Ramnivas Laddad
* @since 2.5
*/
public class ProxyCreationContext {
public final class ProxyCreationContext {
/** ThreadLocal holding the current proxied bean name during Advisor matching. */
private static final ThreadLocal<String> currentProxiedBeanName =
new NamedThreadLocal<>("Name of currently proxied bean");
private ProxyCreationContext() {
}
/**
* Return the name of the currently proxied bean instance.
* @return the name of the bean, or {@code null} if none available

2
spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java

@ -41,7 +41,7 @@ import org.springframework.core.PriorityOrdered; @@ -41,7 +41,7 @@ import org.springframework.core.PriorityOrdered;
* @author Juergen Hoeller
*/
@SuppressWarnings("serial")
public class ExposeInvocationInterceptor implements MethodInterceptor, PriorityOrdered, Serializable {
public final class ExposeInvocationInterceptor implements MethodInterceptor, PriorityOrdered, Serializable {
/** Singleton instance of this class. */
public static final ExposeInvocationInterceptor INSTANCE = new ExposeInvocationInterceptor();

2
spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java

@ -30,7 +30,7 @@ import org.springframework.util.ObjectUtils; @@ -30,7 +30,7 @@ import org.springframework.util.ObjectUtils;
* @author Rod Johnson
* @author Juergen Hoeller
*/
public class EmptyTargetSource implements TargetSource, Serializable {
public final class EmptyTargetSource implements TargetSource, Serializable {
/** use serialVersionUID from Spring 1.2 for interoperability. */
private static final long serialVersionUID = 3680494563553489691L;

8
spring-aspects/src/main/java/org/springframework/cache/aspectj/AnyThrow.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,7 +22,11 @@ package org.springframework.cache.aspectj; @@ -22,7 +22,11 @@ package org.springframework.cache.aspectj;
*
* @author Stephane Nicoll
*/
class AnyThrow {
final class AnyThrow {
private AnyThrow() {
}
static void throwUnchecked(Throwable e) {
AnyThrow.<RuntimeException>throwAny(e);

12
spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -31,13 +31,13 @@ import org.springframework.lang.Nullable; @@ -31,13 +31,13 @@ import org.springframework.lang.Nullable;
@SuppressWarnings("serial")
public class BeanInstantiationException extends FatalBeanException {
private Class<?> beanClass;
private final Class<?> beanClass;
@Nullable
private Constructor<?> constructor;
private final Constructor<?> constructor;
@Nullable
private Method constructingMethod;
private final Method constructingMethod;
/**
@ -58,6 +58,8 @@ public class BeanInstantiationException extends FatalBeanException { @@ -58,6 +58,8 @@ public class BeanInstantiationException extends FatalBeanException {
public BeanInstantiationException(Class<?> beanClass, String msg, @Nullable Throwable cause) {
super("Failed to instantiate [" + beanClass.getName() + "]: " + msg, cause);
this.beanClass = beanClass;
this.constructor = null;
this.constructingMethod = null;
}
/**
@ -71,6 +73,7 @@ public class BeanInstantiationException extends FatalBeanException { @@ -71,6 +73,7 @@ public class BeanInstantiationException extends FatalBeanException {
super("Failed to instantiate [" + constructor.getDeclaringClass().getName() + "]: " + msg, cause);
this.beanClass = constructor.getDeclaringClass();
this.constructor = constructor;
this.constructingMethod = null;
}
/**
@ -84,6 +87,7 @@ public class BeanInstantiationException extends FatalBeanException { @@ -84,6 +87,7 @@ public class BeanInstantiationException extends FatalBeanException {
public BeanInstantiationException(Method constructingMethod, String msg, @Nullable Throwable cause) {
super("Failed to instantiate [" + constructingMethod.getReturnType().getName() + "]: " + msg, cause);
this.beanClass = constructingMethod.getReturnType();
this.constructor = null;
this.constructingMethod = constructingMethod;
}

2
spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

@ -71,7 +71,7 @@ import org.springframework.util.StringUtils; @@ -71,7 +71,7 @@ import org.springframework.util.StringUtils;
* @see #clearClassLoader(ClassLoader)
* @see #forClass(Class)
*/
public class CachedIntrospectionResults {
public final class CachedIntrospectionResults {
/**
* System property that instructs Spring to use the {@link Introspector#IGNORE_ALL_BEANINFO}

6
spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -28,9 +28,9 @@ import org.springframework.lang.Nullable; @@ -28,9 +28,9 @@ import org.springframework.lang.Nullable;
@SuppressWarnings("serial")
public class InvalidPropertyException extends FatalBeanException {
private Class<?> beanClass;
private final Class<?> beanClass;
private String propertyName;
private final String propertyName;
/**

7
spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -30,7 +30,7 @@ import org.springframework.lang.Nullable; @@ -30,7 +30,7 @@ import org.springframework.lang.Nullable;
public class NotWritablePropertyException extends InvalidPropertyException {
@Nullable
private String[] possibleMatches;
private final String[] possibleMatches;
/**
@ -42,6 +42,7 @@ public class NotWritablePropertyException extends InvalidPropertyException { @@ -42,6 +42,7 @@ public class NotWritablePropertyException extends InvalidPropertyException {
super(beanClass, propertyName,
"Bean property '" + propertyName + "' is not writable or has an invalid setter method: " +
"Does the return type of the getter match the parameter type of the setter?");
this.possibleMatches = null;
}
/**
@ -52,6 +53,7 @@ public class NotWritablePropertyException extends InvalidPropertyException { @@ -52,6 +53,7 @@ public class NotWritablePropertyException extends InvalidPropertyException {
*/
public NotWritablePropertyException(Class<?> beanClass, String propertyName, String msg) {
super(beanClass, propertyName, msg);
this.possibleMatches = null;
}
/**
@ -63,6 +65,7 @@ public class NotWritablePropertyException extends InvalidPropertyException { @@ -63,6 +65,7 @@ public class NotWritablePropertyException extends InvalidPropertyException {
*/
public NotWritablePropertyException(Class<?> beanClass, String propertyName, String msg, Throwable cause) {
super(beanClass, propertyName, msg, cause);
this.possibleMatches = null;
}
/**

5
spring-beans/src/main/java/org/springframework/beans/PropertyAccessException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -31,7 +31,7 @@ import org.springframework.lang.Nullable; @@ -31,7 +31,7 @@ import org.springframework.lang.Nullable;
public abstract class PropertyAccessException extends BeansException {
@Nullable
private transient PropertyChangeEvent propertyChangeEvent;
private final PropertyChangeEvent propertyChangeEvent;
/**
@ -52,6 +52,7 @@ public abstract class PropertyAccessException extends BeansException { @@ -52,6 +52,7 @@ public abstract class PropertyAccessException extends BeansException {
*/
public PropertyAccessException(String msg, @Nullable Throwable cause) {
super(msg, cause);
this.propertyChangeEvent = null;
}

2
spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java

@ -40,7 +40,7 @@ import org.springframework.util.ObjectUtils; @@ -40,7 +40,7 @@ import org.springframework.util.ObjectUtils;
public class PropertyBatchUpdateException extends BeansException {
/** List of PropertyAccessException objects. */
private PropertyAccessException[] propertyAccessExceptions;
private final PropertyAccessException[] propertyAccessExceptions;
/**

9
spring-beans/src/main/java/org/springframework/beans/PropertyDescriptorUtils.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -30,7 +30,12 @@ import org.springframework.util.ObjectUtils; @@ -30,7 +30,12 @@ import org.springframework.util.ObjectUtils;
* @author Chris Beams
* @author Juergen Hoeller
*/
class PropertyDescriptorUtils {
final class PropertyDescriptorUtils {
private PropertyDescriptorUtils() {
}
/**
* See {@link java.beans.FeatureDescriptor}.

2
spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java

@ -517,7 +517,7 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry { @@ -517,7 +517,7 @@ public class PropertyEditorRegistrySupport implements PropertyEditorRegistry {
* Holder for a registered custom editor with property name.
* Keeps the PropertyEditor itself plus the type it was registered for.
*/
private static class CustomEditorHolder {
private static final class CustomEditorHolder {
private final PropertyEditor propertyEditor;

10
spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java

@ -35,10 +35,10 @@ import org.springframework.lang.Nullable; @@ -35,10 +35,10 @@ import org.springframework.lang.Nullable;
public class BeanCreationException extends FatalBeanException {
@Nullable
private String beanName;
private final String beanName;
@Nullable
private String resourceDescription;
private final String resourceDescription;
@Nullable
private List<Throwable> relatedCauses;
@ -50,6 +50,8 @@ public class BeanCreationException extends FatalBeanException { @@ -50,6 +50,8 @@ public class BeanCreationException extends FatalBeanException {
*/
public BeanCreationException(String msg) {
super(msg);
this.beanName = null;
this.resourceDescription = null;
}
/**
@ -59,6 +61,8 @@ public class BeanCreationException extends FatalBeanException { @@ -59,6 +61,8 @@ public class BeanCreationException extends FatalBeanException {
*/
public BeanCreationException(String msg, Throwable cause) {
super(msg, cause);
this.beanName = null;
this.resourceDescription = null;
}
/**
@ -69,6 +73,7 @@ public class BeanCreationException extends FatalBeanException { @@ -69,6 +73,7 @@ public class BeanCreationException extends FatalBeanException {
public BeanCreationException(String beanName, String msg) {
super("Error creating bean with name '" + beanName + "': " + msg);
this.beanName = beanName;
this.resourceDescription = null;
}
/**
@ -94,6 +99,7 @@ public class BeanCreationException extends FatalBeanException { @@ -94,6 +99,7 @@ public class BeanCreationException extends FatalBeanException {
(resourceDescription != null ? " defined in " + resourceDescription : "") + ": " + msg);
this.resourceDescription = resourceDescription;
this.beanName = beanName;
this.relatedCauses = null;
}
/**

12
spring-beans/src/main/java/org/springframework/beans/factory/BeanDefinitionStoreException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -31,10 +31,10 @@ import org.springframework.lang.Nullable; @@ -31,10 +31,10 @@ import org.springframework.lang.Nullable;
public class BeanDefinitionStoreException extends FatalBeanException {
@Nullable
private String resourceDescription;
private final String resourceDescription;
@Nullable
private String beanName;
private final String beanName;
/**
@ -43,6 +43,8 @@ public class BeanDefinitionStoreException extends FatalBeanException { @@ -43,6 +43,8 @@ public class BeanDefinitionStoreException extends FatalBeanException {
*/
public BeanDefinitionStoreException(String msg) {
super(msg);
this.resourceDescription = null;
this.beanName = null;
}
/**
@ -52,6 +54,8 @@ public class BeanDefinitionStoreException extends FatalBeanException { @@ -52,6 +54,8 @@ public class BeanDefinitionStoreException extends FatalBeanException {
*/
public BeanDefinitionStoreException(String msg, @Nullable Throwable cause) {
super(msg, cause);
this.resourceDescription = null;
this.beanName = null;
}
/**
@ -62,6 +66,7 @@ public class BeanDefinitionStoreException extends FatalBeanException { @@ -62,6 +66,7 @@ public class BeanDefinitionStoreException extends FatalBeanException {
public BeanDefinitionStoreException(@Nullable String resourceDescription, String msg) {
super(msg);
this.resourceDescription = resourceDescription;
this.beanName = null;
}
/**
@ -73,6 +78,7 @@ public class BeanDefinitionStoreException extends FatalBeanException { @@ -73,6 +78,7 @@ public class BeanDefinitionStoreException extends FatalBeanException {
public BeanDefinitionStoreException(@Nullable String resourceDescription, String msg, @Nullable Throwable cause) {
super(msg, cause);
this.resourceDescription = resourceDescription;
this.beanName = null;
}
/**

6
spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java

@ -29,13 +29,13 @@ import org.springframework.util.ClassUtils; @@ -29,13 +29,13 @@ import org.springframework.util.ClassUtils;
public class BeanNotOfRequiredTypeException extends BeansException {
/** The name of the instance that was of the wrong type. */
private String beanName;
private final String beanName;
/** The required type. */
private Class<?> requiredType;
private final Class<?> requiredType;
/** The offending type. */
private Class<?> actualType;
private final Class<?> actualType;
/**

8
spring-beans/src/main/java/org/springframework/beans/factory/CannotLoadBeanClassException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -30,13 +30,13 @@ import org.springframework.lang.Nullable; @@ -30,13 +30,13 @@ import org.springframework.lang.Nullable;
public class CannotLoadBeanClassException extends FatalBeanException {
@Nullable
private String resourceDescription;
private final String resourceDescription;
@Nullable
private String beanName;
private final String beanName;
@Nullable
private String beanClassName;
private final String beanClassName;
/**

10
spring-beans/src/main/java/org/springframework/beans/factory/NoSuchBeanDefinitionException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -36,10 +36,10 @@ import org.springframework.lang.Nullable; @@ -36,10 +36,10 @@ import org.springframework.lang.Nullable;
public class NoSuchBeanDefinitionException extends BeansException {
@Nullable
private String beanName;
private final String beanName;
@Nullable
private ResolvableType resolvableType;
private final ResolvableType resolvableType;
/**
@ -49,6 +49,7 @@ public class NoSuchBeanDefinitionException extends BeansException { @@ -49,6 +49,7 @@ public class NoSuchBeanDefinitionException extends BeansException {
public NoSuchBeanDefinitionException(String name) {
super("No bean named '" + name + "' available");
this.beanName = name;
this.resolvableType = null;
}
/**
@ -59,6 +60,7 @@ public class NoSuchBeanDefinitionException extends BeansException { @@ -59,6 +60,7 @@ public class NoSuchBeanDefinitionException extends BeansException {
public NoSuchBeanDefinitionException(String name, String message) {
super("No bean named '" + name + "' available: " + message);
this.beanName = name;
this.resolvableType = null;
}
/**
@ -85,6 +87,7 @@ public class NoSuchBeanDefinitionException extends BeansException { @@ -85,6 +87,7 @@ public class NoSuchBeanDefinitionException extends BeansException {
*/
public NoSuchBeanDefinitionException(ResolvableType type) {
super("No qualifying bean of type '" + type + "' available");
this.beanName = null;
this.resolvableType = type;
}
@ -96,6 +99,7 @@ public class NoSuchBeanDefinitionException extends BeansException { @@ -96,6 +99,7 @@ public class NoSuchBeanDefinitionException extends BeansException {
*/
public NoSuchBeanDefinitionException(ResolvableType type, String message) {
super("No qualifying bean of type '" + type + "' available: " + message);
this.beanName = null;
this.resolvableType = type;
}

10
spring-beans/src/main/java/org/springframework/beans/factory/NoUniqueBeanDefinitionException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -33,10 +33,10 @@ import org.springframework.util.StringUtils; @@ -33,10 +33,10 @@ import org.springframework.util.StringUtils;
@SuppressWarnings("serial")
public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionException {
private int numberOfBeansFound;
private final int numberOfBeansFound;
@Nullable
private Collection<String> beanNamesFound;
private final Collection<String> beanNamesFound;
/**
@ -48,6 +48,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti @@ -48,6 +48,7 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
public NoUniqueBeanDefinitionException(Class<?> type, int numberOfBeansFound, String message) {
super(type, message);
this.numberOfBeansFound = numberOfBeansFound;
this.beanNamesFound = null;
}
/**
@ -56,8 +57,9 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti @@ -56,8 +57,9 @@ public class NoUniqueBeanDefinitionException extends NoSuchBeanDefinitionExcepti
* @param beanNamesFound the names of all matching beans (as a Collection)
*/
public NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound) {
this(type, beanNamesFound.size(), "expected single matching bean but found " + beanNamesFound.size() + ": " +
super(type, "expected single matching bean but found " + beanNamesFound.size() + ": " +
StringUtils.collectionToCommaDelimitedString(beanNamesFound));
this.numberOfBeansFound = beanNamesFound.size();
this.beanNamesFound = beanNamesFound;
}

5
spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -33,7 +33,7 @@ import org.springframework.util.StringUtils; @@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
public class UnsatisfiedDependencyException extends BeanCreationException {
@Nullable
private InjectionPoint injectionPoint;
private final InjectionPoint injectionPoint;
/**
@ -49,6 +49,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException { @@ -49,6 +49,7 @@ public class UnsatisfiedDependencyException extends BeanCreationException {
super(resourceDescription, beanName,
"Unsatisfied dependency expressed through bean property '" + propertyName + "'" +
(StringUtils.hasLength(msg) ? ": " + msg : ""));
this.injectionPoint = null;
}
/**

4
spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -250,7 +250,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport @@ -250,7 +250,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
}
private class PropertyPlaceholderConfigurerResolver implements PlaceholderResolver {
private final class PropertyPlaceholderConfigurerResolver implements PlaceholderResolver {
private final Properties props;

4
spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.util.ObjectUtils; @@ -34,7 +34,7 @@ import org.springframework.util.ObjectUtils;
* @author Juergen Hoeller
* @since 2.0
*/
public class BeanDefinitionBuilder {
public final class BeanDefinitionBuilder {
/**
* Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}.

8
spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,7 +35,7 @@ import org.springframework.util.StringUtils; @@ -35,7 +35,7 @@ import org.springframework.util.StringUtils;
* @see PropertiesBeanDefinitionReader
* @see org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
*/
public class BeanDefinitionReaderUtils {
public final class BeanDefinitionReaderUtils {
/**
* Separator for generated bean names. If a class name or parent name is not
@ -44,6 +44,10 @@ public class BeanDefinitionReaderUtils { @@ -44,6 +44,10 @@ public class BeanDefinitionReaderUtils {
public static final String GENERATED_BEAN_NAME_SEPARATOR = BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR;
private BeanDefinitionReaderUtils() {
}
/**
* Create a new GenericBeanDefinition for the given parent name and class name,
* eagerly loading the bean class if a ClassLoader has been specified.

3
spring-context-support/src/main/java/org/springframework/mail/MailSendException.java

@ -37,7 +37,7 @@ public class MailSendException extends MailException { @@ -37,7 +37,7 @@ public class MailSendException extends MailException {
private final transient Map<Object, Exception> failedMessages;
@Nullable
private Exception[] messageExceptions;
private final Exception[] messageExceptions;
/**
@ -56,6 +56,7 @@ public class MailSendException extends MailException { @@ -56,6 +56,7 @@ public class MailSendException extends MailException {
public MailSendException(String msg, @Nullable Throwable cause) {
super(msg, cause);
this.failedMessages = new LinkedHashMap<>();
this.messageExceptions = null;
}
/**

6
spring-context/src/main/java/org/springframework/cache/config/CacheManagementConfigUtils.java vendored

@ -22,7 +22,7 @@ package org.springframework.cache.config; @@ -22,7 +22,7 @@ package org.springframework.cache.config;
* @author Juergen Hoeller
* @since 4.1
*/
public class CacheManagementConfigUtils {
public final class CacheManagementConfigUtils {
/**
* The name of the cache advisor bean.
@ -48,4 +48,8 @@ public class CacheManagementConfigUtils { @@ -48,4 +48,8 @@ public class CacheManagementConfigUtils {
public static final String JCACHE_ASPECT_BEAN_NAME =
"org.springframework.cache.config.internalJCacheAspect";
private CacheManagementConfigUtils() {
}
}

6
spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java

@ -60,7 +60,7 @@ import org.springframework.util.ClassUtils; @@ -60,7 +60,7 @@ import org.springframework.util.ClassUtils;
* @see org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
* @see org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
*/
public class AnnotationConfigUtils {
public final class AnnotationConfigUtils {
/**
* The bean name of the internally managed Configuration annotation processor.
@ -127,6 +127,10 @@ public class AnnotationConfigUtils { @@ -127,6 +127,10 @@ public class AnnotationConfigUtils {
ClassUtils.isPresent(PERSISTENCE_ANNOTATION_PROCESSOR_CLASS_NAME, AnnotationConfigUtils.class.getClassLoader());
private AnnotationConfigUtils() {
}
/**
* Register all relevant annotation post processors in the given registry.
* @param registry the registry to operate on

9
spring-context/src/main/java/org/springframework/context/annotation/BeanAnnotationHelper.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -27,7 +27,12 @@ import org.springframework.core.annotation.AnnotatedElementUtils; @@ -27,7 +27,12 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
* @author Juergen Hoeller
* @since 3.1
*/
class BeanAnnotationHelper {
final class BeanAnnotationHelper {
private BeanAnnotationHelper() {
}
public static boolean isBeanAnnotated(Method method) {
return AnnotatedElementUtils.hasAnnotation(method, Bean.class);

9
spring-context/src/main/java/org/springframework/context/annotation/ScopedProxyCreator.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,7 +28,12 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; @@ -28,7 +28,12 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
* @since 3.0
* @see org.springframework.aop.scope.ScopedProxyUtils#createScopedProxy
*/
class ScopedProxyCreator {
final class ScopedProxyCreator {
private ScopedProxyCreator() {
}
public static BeanDefinitionHolder createScopedProxy(
BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry, boolean proxyTargetClass) {

8
spring-context/src/main/java/org/springframework/context/index/CandidateComponentsIndexLoader.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -39,7 +39,7 @@ import org.springframework.util.ConcurrentReferenceHashMap; @@ -39,7 +39,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
* @author Stephane Nicoll
* @since 5.0
*/
public class CandidateComponentsIndexLoader {
public final class CandidateComponentsIndexLoader {
/**
* The location to look for components.
@ -67,6 +67,10 @@ public class CandidateComponentsIndexLoader { @@ -67,6 +67,10 @@ public class CandidateComponentsIndexLoader {
new ConcurrentReferenceHashMap<>();
private CandidateComponentsIndexLoader() {
}
/**
* Load and instantiate the {@link CandidateComponentsIndex} from
* {@value #COMPONENTS_RESOURCE_LOCATION}, using the given class loader. If no

7
spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java

@ -48,7 +48,12 @@ import org.springframework.lang.Nullable; @@ -48,7 +48,12 @@ import org.springframework.lang.Nullable;
* @author Juergen Hoeller
* @since 4.0
*/
class PostProcessorRegistrationDelegate {
final class PostProcessorRegistrationDelegate {
private PostProcessorRegistrationDelegate() {
}
public static void invokeBeanFactoryPostProcessors(
ConfigurableListableBeanFactory beanFactory, List<BeanFactoryPostProcessor> beanFactoryPostProcessors) {

6
spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -38,6 +38,10 @@ public final class JodaTimeContextHolder { @@ -38,6 +38,10 @@ public final class JodaTimeContextHolder {
new NamedThreadLocal<>("JodaTimeContext");
private JodaTimeContextHolder() {
}
/**
* Reset the JodaTimeContext for the current thread.
*/

7
spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeConverters.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -46,6 +46,11 @@ import org.springframework.format.datetime.DateFormatterRegistrar; @@ -46,6 +46,11 @@ import org.springframework.format.datetime.DateFormatterRegistrar;
*/
final class JodaTimeConverters {
private JodaTimeConverters() {
}
/**
* Install the converters into the converter registry.
* @param registry the converter registry

6
spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeContextHolder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,6 +35,10 @@ public final class DateTimeContextHolder { @@ -35,6 +35,10 @@ public final class DateTimeContextHolder {
new NamedThreadLocal<>("DateTimeContext");
private DateTimeContextHolder() {
}
/**
* Reset the DateTimeContext for the current thread.
*/

7
spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeConverters.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,6 +43,11 @@ import org.springframework.format.datetime.DateFormatterRegistrar; @@ -43,6 +43,11 @@ import org.springframework.format.datetime.DateFormatterRegistrar;
*/
final class DateTimeConverters {
private DateTimeConverters() {
}
/**
* Install the converters into the converter registry.
* @param registry the converter registry

9
spring-context/src/main/java/org/springframework/jmx/support/ObjectNameManager.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -28,7 +28,12 @@ import javax.management.ObjectName; @@ -28,7 +28,12 @@ import javax.management.ObjectName;
* @since 1.2
* @see javax.management.ObjectName#getInstance(String)
*/
public class ObjectNameManager {
public final class ObjectNameManager {
private ObjectNameManager() {
}
/**
* Retrieve the {@code ObjectName} instance corresponding to the supplied name.

9
spring-context/src/main/java/org/springframework/scheduling/config/TaskManagementConfigUtils.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ package org.springframework.scheduling.config; @@ -22,7 +22,7 @@ package org.springframework.scheduling.config;
* @author Juergen Hoeller
* @since 4.1
*/
public class TaskManagementConfigUtils {
public final class TaskManagementConfigUtils {
/**
* The bean name of the internally managed Scheduled annotation processor.
@ -42,4 +42,9 @@ public class TaskManagementConfigUtils { @@ -42,4 +42,9 @@ public class TaskManagementConfigUtils {
public static final String ASYNC_EXECUTION_ASPECT_BEAN_NAME =
"org.springframework.scheduling.config.internalAsyncExecutionAspect";
private TaskManagementConfigUtils() {
}
}

6
spring-context/src/main/java/org/springframework/scripting/ScriptCompilationException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -29,7 +29,7 @@ import org.springframework.lang.Nullable; @@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
public class ScriptCompilationException extends NestedRuntimeException {
@Nullable
private ScriptSource scriptSource;
private final ScriptSource scriptSource;
/**
@ -38,6 +38,7 @@ public class ScriptCompilationException extends NestedRuntimeException { @@ -38,6 +38,7 @@ public class ScriptCompilationException extends NestedRuntimeException {
*/
public ScriptCompilationException(String msg) {
super(msg);
this.scriptSource = null;
}
/**
@ -47,6 +48,7 @@ public class ScriptCompilationException extends NestedRuntimeException { @@ -47,6 +48,7 @@ public class ScriptCompilationException extends NestedRuntimeException {
*/
public ScriptCompilationException(String msg, Throwable cause) {
super(msg, cause);
this.scriptSource = null;
}
/**

4
spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -225,7 +225,7 @@ public abstract class BshScriptUtils { @@ -225,7 +225,7 @@ public abstract class BshScriptUtils {
* Exception to be thrown on script execution failure.
*/
@SuppressWarnings("serial")
public static class BshExecutionException extends NestedRuntimeException {
public static final class BshExecutionException extends NestedRuntimeException {
private BshExecutionException(EvalError ex) {
super("BeanShell script execution failed", ex);

2
spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java

@ -28,7 +28,7 @@ import org.springframework.util.Assert; @@ -28,7 +28,7 @@ import org.springframework.util.Assert;
* @author Rossen Stoyanchev
* @since 5.0
*/
public class ReactiveTypeDescriptor {
public final class ReactiveTypeDescriptor {
private final Class<?> reactiveType;

9
spring-core/src/main/java/org/springframework/core/SpringVersion.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -31,7 +31,12 @@ import org.springframework.lang.Nullable; @@ -31,7 +31,12 @@ import org.springframework.lang.Nullable;
* @author Juergen Hoeller
* @since 1.1
*/
public class SpringVersion {
public final class SpringVersion {
private SpringVersion() {
}
/**
* Return the full version string of the present Spring codebase,

2
spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

@ -2047,7 +2047,7 @@ public abstract class AnnotationUtils { @@ -2047,7 +2047,7 @@ public abstract class AnnotationUtils {
* @see #getAttributeAliasNames
* @see #getAttributeOverrideName
*/
private static class AliasDescriptor {
private static final class AliasDescriptor {
private final Method sourceAttribute;

2
spring-core/src/main/java/org/springframework/core/codec/CharSequenceEncoder.java

@ -42,7 +42,7 @@ import org.springframework.util.MimeTypeUtils; @@ -42,7 +42,7 @@ import org.springframework.util.MimeTypeUtils;
* @since 5.0
* @see StringDecoder
*/
public class CharSequenceEncoder extends AbstractEncoder<CharSequence> {
public final class CharSequenceEncoder extends AbstractEncoder<CharSequence> {
/**
* The default charset used by the encoder.

2
spring-core/src/main/java/org/springframework/core/codec/StringDecoder.java

@ -53,7 +53,7 @@ import org.springframework.util.MimeTypeUtils; @@ -53,7 +53,7 @@ import org.springframework.util.MimeTypeUtils;
* @since 5.0
* @see CharSequenceEncoder
*/
public class StringDecoder extends AbstractDataBufferDecoder<String> {
public final class StringDecoder extends AbstractDataBufferDecoder<String> {
private static final DataBuffer END_FRAME = new DefaultDataBufferFactory().wrap(new byte[0]);

5
spring-core/src/main/java/org/springframework/core/env/ProfilesParser.java vendored

@ -31,7 +31,10 @@ import org.springframework.util.StringUtils; @@ -31,7 +31,10 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @since 5.1
*/
class ProfilesParser {
final class ProfilesParser {
private ProfilesParser() {
}
static Profiles parse(String... expressions) {
Assert.notEmpty(expressions, "Must specify at least one profile");

42
spring-core/src/main/java/org/springframework/util/ReflectionUtils.java

@ -57,6 +57,27 @@ public abstract class ReflectionUtils { @@ -57,6 +57,27 @@ public abstract class ReflectionUtils {
private static final Field[] NO_FIELDS = {};
/**
* Pre-built FieldFilter that matches all non-static, non-final fields.
*/
public static final FieldFilter COPYABLE_FIELDS =
field -> !(Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()));
/**
* Pre-built MethodFilter that matches all non-bridge methods.
*/
public static final MethodFilter NON_BRIDGED_METHODS =
(method -> !method.isBridge());
/**
* Pre-built MethodFilter that matches all non-bridge non-synthetic methods
* which are not declared on {@code java.lang.Object}.
*/
public static final MethodFilter USER_DECLARED_METHODS =
(method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class));
/**
* Cache for {@link Class#getDeclaredMethods()} plus equivalent default methods
@ -847,25 +868,4 @@ public abstract class ReflectionUtils { @@ -847,25 +868,4 @@ public abstract class ReflectionUtils {
}
/**
* Pre-built FieldFilter that matches all non-static, non-final fields.
*/
public static final FieldFilter COPYABLE_FIELDS =
field -> !(Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()));
/**
* Pre-built MethodFilter that matches all non-bridge methods.
*/
public static final MethodFilter NON_BRIDGED_METHODS =
(method -> !method.isBridge());
/**
* Pre-built MethodFilter that matches all non-bridge non-synthetic methods
* which are not declared on {@code java.lang.Object}.
*/
public static final MethodFilter USER_DECLARED_METHODS =
(method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class));
}

8
spring-expression/src/main/java/org/springframework/expression/ExpressionException.java

@ -29,7 +29,7 @@ import org.springframework.lang.Nullable; @@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
public class ExpressionException extends RuntimeException {
@Nullable
protected String expressionString;
protected final String expressionString;
protected int position; // -1 if not known; should be known in all reasonable cases
@ -40,6 +40,8 @@ public class ExpressionException extends RuntimeException { @@ -40,6 +40,8 @@ public class ExpressionException extends RuntimeException {
*/
public ExpressionException(String message) {
super(message);
this.expressionString = null;
this.position = 0;
}
/**
@ -49,6 +51,8 @@ public class ExpressionException extends RuntimeException { @@ -49,6 +51,8 @@ public class ExpressionException extends RuntimeException {
*/
public ExpressionException(String message, Throwable cause) {
super(message, cause);
this.expressionString = null;
this.position = 0;
}
/**
@ -81,6 +85,7 @@ public class ExpressionException extends RuntimeException { @@ -81,6 +85,7 @@ public class ExpressionException extends RuntimeException {
*/
public ExpressionException(int position, String message) {
super(message);
this.expressionString = null;
this.position = position;
}
@ -92,6 +97,7 @@ public class ExpressionException extends RuntimeException { @@ -92,6 +97,7 @@ public class ExpressionException extends RuntimeException {
*/
public ExpressionException(int position, String message, Throwable cause) {
super(message, cause);
this.expressionString = null;
this.position = position;
}

29
spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java

@ -1009,6 +1009,21 @@ public class CodeFlow implements Opcodes { @@ -1009,6 +1009,21 @@ public class CodeFlow implements Opcodes {
}
}
public static final String toBoxedDescriptor(String primitiveDescriptor) {
switch (primitiveDescriptor.charAt(0)) {
case 'I': return "Ljava/lang/Integer";
case 'J': return "Ljava/lang/Long";
case 'F': return "Ljava/lang/Float";
case 'D': return "Ljava/lang/Double";
case 'B': return "Ljava/lang/Byte";
case 'C': return "Ljava/lang/Character";
case 'S': return "Ljava/lang/Short";
case 'Z': return "Ljava/lang/Boolean";
default:
throw new IllegalArgumentException("Unexpected non primitive descriptor "+primitiveDescriptor);
}
}
/**
* Interface used to generate fields.
@ -1029,19 +1044,5 @@ public class CodeFlow implements Opcodes { @@ -1029,19 +1044,5 @@ public class CodeFlow implements Opcodes {
void generateCode(MethodVisitor mv, CodeFlow codeflow);
}
public static String toBoxedDescriptor(String primitiveDescriptor) {
switch (primitiveDescriptor.charAt(0)) {
case 'I': return "Ljava/lang/Integer";
case 'J': return "Ljava/lang/Long";
case 'F': return "Ljava/lang/Float";
case 'D': return "Ljava/lang/Double";
case 'B': return "Ljava/lang/Byte";
case 'C': return "Ljava/lang/Character";
case 'S': return "Ljava/lang/Short";
case 'Z': return "Ljava/lang/Boolean";
default:
throw new IllegalArgumentException("Unexpected non primitive descriptor "+primitiveDescriptor);
}
}
}

28
spring-expression/src/main/java/org/springframework/expression/spel/ast/Operator.java

@ -41,7 +41,7 @@ import org.springframework.util.ObjectUtils; @@ -41,7 +41,7 @@ import org.springframework.util.ObjectUtils;
public abstract class Operator extends SpelNodeImpl {
private final String operatorName;
// The descriptors of the runtime operand values are used if the discovered declared
// descriptors are not providing enough information (for example a generic type
// whose accessors seem to only be returning 'Object' - the actual descriptors may
@ -104,8 +104,8 @@ public abstract class Operator extends SpelNodeImpl { @@ -104,8 +104,8 @@ public abstract class Operator extends SpelNodeImpl {
return (dc.areNumbers && dc.areCompatible);
}
/**
* Numeric comparison operators share very similar generated code, only differing in
/**
* Numeric comparison operators share very similar generated code, only differing in
* two comparison instructions.
*/
protected void generateComparisonCode(MethodVisitor mv, CodeFlow cf, int compInstruction1, int compInstruction2) {
@ -113,20 +113,20 @@ public abstract class Operator extends SpelNodeImpl { @@ -113,20 +113,20 @@ public abstract class Operator extends SpelNodeImpl {
SpelNodeImpl right = getRightOperand();
String leftDesc = left.exitTypeDescriptor;
String rightDesc = right.exitTypeDescriptor;
boolean unboxLeft = !CodeFlow.isPrimitive(leftDesc);
boolean unboxRight = !CodeFlow.isPrimitive(rightDesc);
DescriptorComparison dc = DescriptorComparison.checkNumericCompatibility(
leftDesc, rightDesc, this.leftActualDescriptor, this.rightActualDescriptor);
char targetType = dc.compatibleType; // CodeFlow.toPrimitiveTargetDesc(leftDesc);
cf.enterCompilationScope();
left.generateCode(mv, cf);
cf.exitCompilationScope();
if (unboxLeft) {
CodeFlow.insertUnboxInsns(mv, targetType, leftDesc);
}
cf.enterCompilationScope();
right.generateCode(mv, cf);
cf.exitCompilationScope();
@ -142,11 +142,11 @@ public abstract class Operator extends SpelNodeImpl { @@ -142,11 +142,11 @@ public abstract class Operator extends SpelNodeImpl {
mv.visitJumpInsn(compInstruction1, elseTarget);
}
else if (targetType == 'F') {
mv.visitInsn(FCMPG);
mv.visitInsn(FCMPG);
mv.visitJumpInsn(compInstruction1, elseTarget);
}
else if (targetType == 'J') {
mv.visitInsn(LCMP);
mv.visitInsn(LCMP);
mv.visitJumpInsn(compInstruction1, elseTarget);
}
else if (targetType == 'I') {
@ -231,13 +231,13 @@ public abstract class Operator extends SpelNodeImpl { @@ -231,13 +231,13 @@ public abstract class Operator extends SpelNodeImpl {
return false;
}
/**
* A descriptor comparison encapsulates the result of comparing descriptor
* for two operands and describes at what level they are compatible.
*/
protected static class DescriptorComparison {
protected static final class DescriptorComparison {
static final DescriptorComparison NOT_NUMBERS = new DescriptorComparison(false, false, ' ');
@ -254,7 +254,7 @@ public abstract class Operator extends SpelNodeImpl { @@ -254,7 +254,7 @@ public abstract class Operator extends SpelNodeImpl {
this.areCompatible = areCompatible;
this.compatibleType = compatibleType;
}
/**
* Return an object that indicates whether the input descriptors are compatible.
* <p>A declared descriptor is what could statically be determined (e.g. from looking
@ -278,7 +278,7 @@ public abstract class Operator extends SpelNodeImpl { @@ -278,7 +278,7 @@ public abstract class Operator extends SpelNodeImpl {
boolean leftNumeric = CodeFlow.isPrimitiveOrUnboxableSupportedNumberOrBoolean(ld);
boolean rightNumeric = CodeFlow.isPrimitiveOrUnboxableSupportedNumberOrBoolean(rd);
// If the declared descriptors aren't providing the information, try the actual descriptors
if (!leftNumeric && !ObjectUtils.nullSafeEquals(ld, leftActualDescriptor)) {
ld = leftActualDescriptor;
@ -288,7 +288,7 @@ public abstract class Operator extends SpelNodeImpl { @@ -288,7 +288,7 @@ public abstract class Operator extends SpelNodeImpl {
rd = rightActualDescriptor;
rightNumeric = CodeFlow.isPrimitiveOrUnboxableSupportedNumberOrBoolean(rd);
}
if (leftNumeric && rightNumeric) {
if (CodeFlow.areBoxingCompatible(ld, rd)) {
return new DescriptorComparison(true, true, CodeFlow.toPrimitiveTargetDesc(ld));
@ -299,7 +299,7 @@ public abstract class Operator extends SpelNodeImpl { @@ -299,7 +299,7 @@ public abstract class Operator extends SpelNodeImpl {
}
else {
return DescriptorComparison.NOT_NUMBERS;
}
}
}
}

4
spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -64,7 +64,7 @@ import org.springframework.util.ReflectionUtils; @@ -64,7 +64,7 @@ import org.springframework.util.ReflectionUtils;
* @author Andy Clement
* @since 4.1
*/
public class SpelCompiler implements Opcodes {
public final class SpelCompiler implements Opcodes {
private static final Log logger = LogFactory.getLog(SpelCompiler.class);

2
spring-expression/src/main/java/org/springframework/expression/spel/support/BooleanTypedValue.java

@ -24,7 +24,7 @@ import org.springframework.expression.TypedValue; @@ -24,7 +24,7 @@ import org.springframework.expression.TypedValue;
* @author Andy Clement
* @since 3.0
*/
public class BooleanTypedValue extends TypedValue {
public final class BooleanTypedValue extends TypedValue {
/**
* True.

2
spring-expression/src/main/java/org/springframework/expression/spel/support/DataBindingMethodResolver.java

@ -39,7 +39,7 @@ import org.springframework.lang.Nullable; @@ -39,7 +39,7 @@ import org.springframework.lang.Nullable;
* @see #forInstanceMethodInvocation()
* @see DataBindingPropertyAccessor
*/
public class DataBindingMethodResolver extends ReflectiveMethodResolver {
public final class DataBindingMethodResolver extends ReflectiveMethodResolver {
private DataBindingMethodResolver() {
super();

2
spring-expression/src/main/java/org/springframework/expression/spel/support/DataBindingPropertyAccessor.java

@ -37,7 +37,7 @@ import java.lang.reflect.Method; @@ -37,7 +37,7 @@ import java.lang.reflect.Method;
* @see StandardEvaluationContext
* @see ReflectivePropertyAccessor
*/
public class DataBindingPropertyAccessor extends ReflectivePropertyAccessor {
public final class DataBindingPropertyAccessor extends ReflectivePropertyAccessor {
/**
* Create a new property accessor for reading and possibly also writing.

2
spring-expression/src/main/java/org/springframework/expression/spel/support/SimpleEvaluationContext.java

@ -86,7 +86,7 @@ import org.springframework.lang.Nullable; @@ -86,7 +86,7 @@ import org.springframework.lang.Nullable;
* @see StandardTypeConverter
* @see DataBindingPropertyAccessor
*/
public class SimpleEvaluationContext implements EvaluationContext {
public final class SimpleEvaluationContext implements EvaluationContext {
private static final TypeLocator typeNotFoundTypeLocator = typeName -> {
throw new SpelEvaluationException(SpelMessage.TYPE_NOT_FOUND, typeName);

8
spring-instrument/src/main/java/org/springframework/instrument/InstrumentationSavingAgent.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -27,11 +27,15 @@ import java.lang.instrument.Instrumentation; @@ -27,11 +27,15 @@ import java.lang.instrument.Instrumentation;
* @since 2.0
* @see org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
*/
public class InstrumentationSavingAgent {
public final class InstrumentationSavingAgent {
private static volatile Instrumentation instrumentation;
private InstrumentationSavingAgent() {
}
/**
* Save the {@link Instrumentation} interface exposed by the JVM.
*/

4
spring-jdbc/src/main/java/org/springframework/jdbc/BadSqlGrammarException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException; @@ -34,7 +34,7 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException;
@SuppressWarnings("serial")
public class BadSqlGrammarException extends InvalidDataAccessResourceUsageException {
private String sql;
private final String sql;
/**

6
spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -29,9 +29,9 @@ import org.springframework.dao.DataRetrievalFailureException; @@ -29,9 +29,9 @@ import org.springframework.dao.DataRetrievalFailureException;
@SuppressWarnings("serial")
public class IncorrectResultSetColumnCountException extends DataRetrievalFailureException {
private int expectedCount;
private final int expectedCount;
private int actualCount;
private final int actualCount;
/**

5
spring-jdbc/src/main/java/org/springframework/jdbc/InvalidResultSetAccessException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -37,7 +37,7 @@ import org.springframework.lang.Nullable; @@ -37,7 +37,7 @@ import org.springframework.lang.Nullable;
public class InvalidResultSetAccessException extends InvalidDataAccessResourceUsageException {
@Nullable
private String sql;
private final String sql;
/**
@ -57,6 +57,7 @@ public class InvalidResultSetAccessException extends InvalidDataAccessResourceUs @@ -57,6 +57,7 @@ public class InvalidResultSetAccessException extends InvalidDataAccessResourceUs
*/
public InvalidResultSetAccessException(SQLException ex) {
super(ex.getMessage(), ex);
this.sql = null;
}

4
spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java

@ -30,10 +30,10 @@ import org.springframework.dao.IncorrectUpdateSemanticsDataAccessException; @@ -30,10 +30,10 @@ import org.springframework.dao.IncorrectUpdateSemanticsDataAccessException;
public class JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectUpdateSemanticsDataAccessException {
/** Number of rows that should have been affected. */
private int expected;
private final int expected;
/** Number of rows that actually were affected. */
private int actual;
private final int actual;
/**

7
spring-jdbc/src/main/java/org/springframework/jdbc/config/DatabasePopulatorConfigUtils.java

@ -38,7 +38,12 @@ import org.springframework.util.xml.DomUtils; @@ -38,7 +38,12 @@ import org.springframework.util.xml.DomUtils;
* @author Stephane Nicoll
* @since 3.1
*/
class DatabasePopulatorConfigUtils {
final class DatabasePopulatorConfigUtils {
private DatabasePopulatorConfigUtils() {
}
public static void setDatabasePopulator(Element element, BeanDefinitionBuilder builder) {
List<Element> scripts = DomUtils.getChildElementsByTagName(element, "script");

6
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java

@ -35,7 +35,7 @@ import org.springframework.jdbc.support.MetaDataAccessException; @@ -35,7 +35,7 @@ import org.springframework.jdbc.support.MetaDataAccessException;
* @author Juergen Hoeller
* @since 2.5
*/
public class CallMetaDataProviderFactory {
public final class CallMetaDataProviderFactory {
/** List of supported database products for procedure calls. */
public static final List<String> supportedDatabaseProductsForProcedures = Arrays.asList(
@ -59,6 +59,10 @@ public class CallMetaDataProviderFactory { @@ -59,6 +59,10 @@ public class CallMetaDataProviderFactory {
private static final Log logger = LogFactory.getLog(CallMetaDataProviderFactory.class);
private CallMetaDataProviderFactory() {
}
/**
* Create a {@link CallMetaDataProvider} based on the database meta-data.
* @param dataSource the JDBC DataSource to use for retrieving meta-data

6
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java

@ -32,11 +32,15 @@ import org.springframework.jdbc.support.MetaDataAccessException; @@ -32,11 +32,15 @@ import org.springframework.jdbc.support.MetaDataAccessException;
* @author Thomas Risberg
* @since 2.5
*/
public class TableMetaDataProviderFactory {
public final class TableMetaDataProviderFactory {
private static final Log logger = LogFactory.getLog(TableMetaDataProviderFactory.class);
private TableMetaDataProviderFactory() {
}
/**
* Create a {@link TableMetaDataProvider} based on the database meta-data.
* @param dataSource used to retrieve meta-data

4
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -202,7 +202,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource { @@ -202,7 +202,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
/**
* Inner class used as ThreadLocal value.
*/
private static class JdbcUserCredentials {
private static final class JdbcUserCredentials {
public final String username;

5
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java

@ -29,6 +29,11 @@ import org.springframework.util.Assert; @@ -29,6 +29,11 @@ import org.springframework.util.Assert;
*/
final class EmbeddedDatabaseConfigurerFactory {
private EmbeddedDatabaseConfigurerFactory() {
}
/**
* Return a configurer instance for the given embedded database type.
* @param type the embedded database type (HSQL, H2 or Derby)

9
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/OutputStreamFactory.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -26,7 +26,12 @@ import java.io.OutputStream; @@ -26,7 +26,12 @@ import java.io.OutputStream;
* @author Juergen Hoeller
* @since 3.0
*/
public class OutputStreamFactory {
public final class OutputStreamFactory {
private OutputStreamFactory() {
}
/**
* Returns an {@link java.io.OutputStream} that ignores all data given to it.

4
spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,7 @@ import org.springframework.lang.Nullable; @@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
* @since 3.1.1
* @see SQLErrorCodesFactory
*/
public class CustomSQLExceptionTranslatorRegistry {
public final class CustomSQLExceptionTranslatorRegistry {
private static final Log logger = LogFactory.getLog(CustomSQLExceptionTranslatorRegistry.class);

6
spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -320,17 +320,19 @@ public class UserCredentialsConnectionFactoryAdapter @@ -320,17 +320,19 @@ public class UserCredentialsConnectionFactoryAdapter
/**
* Inner class used as ThreadLocal value.
*/
private static class JmsUserCredentials {
private static final class JmsUserCredentials {
public final String username;
public final String password;
private JmsUserCredentials(String username, String password) {
this.username = username;
this.password = password;
}
@Override
public String toString() {
return "JmsUserCredentials[username='" + this.username + "',password='" + this.password + "']";

2
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/DestinationVariableMethodArgumentResolver.java

@ -78,7 +78,7 @@ public class DestinationVariableMethodArgumentResolver extends AbstractNamedValu @@ -78,7 +78,7 @@ public class DestinationVariableMethodArgumentResolver extends AbstractNamedValu
}
private static class DestinationVariableNamedValueInfo extends NamedValueInfo {
private static final class DestinationVariableNamedValueInfo extends NamedValueInfo {
private DestinationVariableNamedValueInfo(DestinationVariable annotation) {
super(annotation.value(), true, ValueConstants.DEFAULT_NONE);

4
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -106,7 +106,7 @@ public class HeaderMethodArgumentResolver extends AbstractNamedValueMethodArgume @@ -106,7 +106,7 @@ public class HeaderMethodArgumentResolver extends AbstractNamedValueMethodArgume
}
private static class HeaderNamedValueInfo extends NamedValueInfo {
private static final class HeaderNamedValueInfo extends NamedValueInfo {
private HeaderNamedValueInfo(Header annotation) {
super(annotation.name(), annotation.required(), annotation.defaultValue());

5
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.validation.ObjectError; @@ -34,7 +34,7 @@ import org.springframework.validation.ObjectError;
@SuppressWarnings("serial")
public class MethodArgumentNotValidException extends MethodArgumentResolutionException {
private BindingResult bindingResult;
private final BindingResult bindingResult;
/**
@ -42,6 +42,7 @@ public class MethodArgumentNotValidException extends MethodArgumentResolutionExc @@ -42,6 +42,7 @@ public class MethodArgumentNotValidException extends MethodArgumentResolutionExc
*/
public MethodArgumentNotValidException(Message<?> message, MethodParameter parameter) {
super(message, parameter);
this.bindingResult = null;
}
/**

2
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java

@ -577,7 +577,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler @@ -577,7 +577,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
private volatile boolean isStompConnected;
private StompConnectionHandler(String sessionId, StompHeaderAccessor connectHeaders) {
protected StompConnectionHandler(String sessionId, StompHeaderAccessor connectHeaders) {
this(sessionId, connectHeaders, true);
}

8
spring-orm/src/main/java/org/springframework/orm/ObjectOptimisticLockingFailureException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -30,10 +30,10 @@ import org.springframework.lang.Nullable; @@ -30,10 +30,10 @@ import org.springframework.lang.Nullable;
public class ObjectOptimisticLockingFailureException extends OptimisticLockingFailureException {
@Nullable
private Object persistentClass;
private final Object persistentClass;
@Nullable
private Object identifier;
private final Object identifier;
/**
@ -44,6 +44,8 @@ public class ObjectOptimisticLockingFailureException extends OptimisticLockingFa @@ -44,6 +44,8 @@ public class ObjectOptimisticLockingFailureException extends OptimisticLockingFa
*/
public ObjectOptimisticLockingFailureException(String msg, Throwable cause) {
super(msg, cause);
this.persistentClass = null;
this.identifier = null;
}
/**

8
spring-orm/src/main/java/org/springframework/orm/ObjectRetrievalFailureException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -30,10 +30,10 @@ import org.springframework.lang.Nullable; @@ -30,10 +30,10 @@ import org.springframework.lang.Nullable;
public class ObjectRetrievalFailureException extends DataRetrievalFailureException {
@Nullable
private Object persistentClass;
private final Object persistentClass;
@Nullable
private Object identifier;
private final Object identifier;
/**
@ -44,6 +44,8 @@ public class ObjectRetrievalFailureException extends DataRetrievalFailureExcepti @@ -44,6 +44,8 @@ public class ObjectRetrievalFailureException extends DataRetrievalFailureExcepti
*/
public ObjectRetrievalFailureException(String msg, Throwable cause) {
super(msg, cause);
this.persistentClass = null;
this.identifier = null;
}
/**

2
spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java

@ -890,7 +890,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana @@ -890,7 +890,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
* Holder for suspended resources.
* Used internally by {@code doSuspend} and {@code doResume}.
*/
private static class SuspendedResourcesHolder {
private static final class SuspendedResourcesHolder {
private final SessionHolder sessionHolder;

2
spring-orm/src/main/java/org/springframework/orm/jpa/ExtendedEntityManagerCreator.java

@ -242,7 +242,7 @@ public abstract class ExtendedEntityManagerCreator { @@ -242,7 +242,7 @@ public abstract class ExtendedEntityManagerCreator {
* InvocationHandler for extended EntityManagers as defined in the JPA spec.
*/
@SuppressWarnings("serial")
private static class ExtendedEntityManagerInvocationHandler implements InvocationHandler, Serializable {
private static final class ExtendedEntityManagerInvocationHandler implements InvocationHandler, Serializable {
private static final Log logger = LogFactory.getLog(ExtendedEntityManagerInvocationHandler.class);

2
spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java

@ -745,7 +745,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager @@ -745,7 +745,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
* Holder for suspended resources.
* Used internally by {@code doSuspend} and {@code doResume}.
*/
private static class SuspendedResourcesHolder {
private static final class SuspendedResourcesHolder {
private final EntityManagerHolder entityManagerHolder;

7
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java

@ -127,6 +127,9 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi @@ -127,6 +127,9 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
private static final String CID = "cid:";
private static final EntityResolver NO_OP_ENTITY_RESOLVER =
(publicId, systemId) -> new InputSource(new StringReader(""));
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
@ -1079,8 +1082,4 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi @@ -1079,8 +1082,4 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
}
private static final EntityResolver NO_OP_ENTITY_RESOLVER =
(publicId, systemId) -> new InputSource(new StringReader(""));
}

4
spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -102,7 +102,7 @@ public class MarshallingSource extends SAXSource { @@ -102,7 +102,7 @@ public class MarshallingSource extends SAXSource {
}
private static class MarshallingXMLReader implements XMLReader {
private static final class MarshallingXMLReader implements XMLReader {
private final Marshaller marshaller;

2
spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java

@ -52,7 +52,7 @@ import org.springframework.web.util.UriComponentsBuilder; @@ -52,7 +52,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* @author Rossen Stoyanchev
* @since 5.0
*/
public class MockServerHttpRequest extends AbstractServerHttpRequest {
public final class MockServerHttpRequest extends AbstractServerHttpRequest {
private final HttpMethod httpMethod;

4
spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContext.java

@ -357,7 +357,7 @@ public class SimpleNamingContext implements Context { @@ -357,7 +357,7 @@ public class SimpleNamingContext implements Context {
}
private static class NameClassPairEnumeration extends AbstractNamingEnumeration<NameClassPair> {
private static final class NameClassPairEnumeration extends AbstractNamingEnumeration<NameClassPair> {
private NameClassPairEnumeration(SimpleNamingContext context, String root) throws NamingException {
super(context, root);
@ -370,7 +370,7 @@ public class SimpleNamingContext implements Context { @@ -370,7 +370,7 @@ public class SimpleNamingContext implements Context {
}
private static class BindingEnumeration extends AbstractNamingEnumeration<Binding> {
private static final class BindingEnumeration extends AbstractNamingEnumeration<Binding> {
private BindingEnumeration(SimpleNamingContext context, String root) throws NamingException {
super(context, root);

2
spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java

@ -150,7 +150,7 @@ public class MockFilterChain implements FilterChain { @@ -150,7 +150,7 @@ public class MockFilterChain implements FilterChain {
/**
* A filter that simply delegates to a Servlet.
*/
private static class ServletFilterProxy implements Filter {
private static final class ServletFilterProxy implements Filter {
private final Servlet delegateServlet;

2
spring-test/src/main/java/org/springframework/mock/web/reactive/function/server/MockServerRequest.java

@ -63,7 +63,7 @@ import org.springframework.web.util.UriComponentsBuilder; @@ -63,7 +63,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* @author Arjen Poutsma
* @since 5.0
*/
public class MockServerRequest implements ServerRequest {
public final class MockServerRequest implements ServerRequest {
private final HttpMethod method;

4
spring-test/src/main/java/org/springframework/test/annotation/SystemProfileValueSource.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ import org.springframework.util.Assert; @@ -26,7 +26,7 @@ import org.springframework.util.Assert;
* @author Sam Brannen
* @since 2.0
*/
public class SystemProfileValueSource implements ProfileValueSource {
public final class SystemProfileValueSource implements ProfileValueSource {
private static final SystemProfileValueSource INSTANCE = new SystemProfileValueSource();

9
spring-test/src/main/java/org/springframework/test/annotation/TestAnnotationUtils.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,7 +26,12 @@ import org.springframework.core.annotation.AnnotatedElementUtils; @@ -26,7 +26,12 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
* @author Sam Brannen
* @since 4.2
*/
public class TestAnnotationUtils {
public final class TestAnnotationUtils {
private TestAnnotationUtils() {
}
/**
* Get the {@code timeout} configured via the {@link Timed @Timed}

7
spring-test/src/main/java/org/springframework/test/context/transaction/TestTransaction.java

@ -38,7 +38,12 @@ import org.springframework.util.Assert; @@ -38,7 +38,12 @@ import org.springframework.util.Assert;
* @since 4.1
* @see TransactionalTestExecutionListener
*/
public class TestTransaction {
public final class TestTransaction {
private TestTransaction() {
}
/**
* Determine whether a test-managed transaction is currently <em>active</em>.

6
spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContextHolder.java

@ -25,12 +25,16 @@ import org.springframework.lang.Nullable; @@ -25,12 +25,16 @@ import org.springframework.lang.Nullable;
* @author Sam Brannen
* @since 4.1
*/
class TransactionContextHolder {
final class TransactionContextHolder {
private static final ThreadLocal<TransactionContext> currentTransactionContext =
new NamedInheritableThreadLocal<>("Test Transaction Context");
private TransactionContextHolder() {
}
static void setCurrentTransactionContext(TransactionContext transactionContext) {
currentTransactionContext.set(transactionContext);
}

8
spring-test/src/main/java/org/springframework/test/jdbc/JdbcTestUtils.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -38,11 +38,15 @@ import org.springframework.util.StringUtils; @@ -38,11 +38,15 @@ import org.springframework.util.StringUtils;
* @see org.springframework.jdbc.datasource.init.ResourceDatabasePopulator
* @see org.springframework.jdbc.datasource.init.DatabasePopulatorUtils
*/
public class JdbcTestUtils {
public final class JdbcTestUtils {
private static final Log logger = LogFactory.getLog(JdbcTestUtils.class);
private JdbcTestUtils() {
}
/**
* Count the rows in the given table.
* @param jdbcTemplate the JdbcTemplate with which to perform JDBC operations

4
spring-test/src/main/java/org/springframework/test/web/client/ExpectedCount.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -38,7 +38,7 @@ import org.springframework.util.Assert; @@ -38,7 +38,7 @@ import org.springframework.util.Assert;
* @author Rossen Stoyanchev
* @since 4.3
*/
public class ExpectedCount {
public final class ExpectedCount {
private final int minCount;

2
spring-test/src/main/java/org/springframework/test/web/client/MockRestServiceServer.java

@ -64,7 +64,7 @@ import org.springframework.web.client.support.RestGatewaySupport; @@ -64,7 +64,7 @@ import org.springframework.web.client.support.RestGatewaySupport;
* @since 3.2
*/
@SuppressWarnings("deprecation")
public class MockRestServiceServer {
public final class MockRestServiceServer {
private final RequestExpectationManager expectationManager;

7
spring-test/src/main/java/org/springframework/test/web/servlet/setup/MockMvcBuilders.java

@ -33,7 +33,12 @@ import org.springframework.web.context.WebApplicationContext; @@ -33,7 +33,12 @@ import org.springframework.web.context.WebApplicationContext;
* @see #webAppContextSetup(WebApplicationContext)
* @see #standaloneSetup(Object...)
*/
public class MockMvcBuilders {
public final class MockMvcBuilders {
private MockMvcBuilders() {
}
/**
* Build a {@link MockMvc} instance using the given, fully initialized

6
spring-tx/src/main/java/org/springframework/dao/IncorrectResultSizeDataAccessException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -28,9 +28,9 @@ package org.springframework.dao; @@ -28,9 +28,9 @@ package org.springframework.dao;
@SuppressWarnings("serial")
public class IncorrectResultSizeDataAccessException extends DataRetrievalFailureException {
private int expectedSize;
private final int expectedSize;
private int actualSize;
private final int actualSize;
/**

2
spring-tx/src/main/java/org/springframework/jca/cci/connection/SingleConnectionFactory.java

@ -225,7 +225,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme @@ -225,7 +225,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
/**
* Invocation handler that suppresses close calls on CCI Connections.
*/
private static class CloseSuppressingInvocationHandler implements InvocationHandler {
private static final class CloseSuppressingInvocationHandler implements InvocationHandler {
private final Connection target;

2
spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java

@ -65,7 +65,7 @@ public class HeuristicCompletionException extends TransactionException { @@ -65,7 +65,7 @@ public class HeuristicCompletionException extends TransactionException {
/**
* The outcome state of the transaction: have some or all resources been committed?
*/
private int outcomeState = STATE_UNKNOWN;
private final int outcomeState;
/**

4
spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java

@ -1,5 +1,5 @@ @@ -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");
* you may not use this file except in compliance with the License.
@ -27,7 +27,7 @@ package org.springframework.transaction; @@ -27,7 +27,7 @@ package org.springframework.transaction;
@SuppressWarnings("serial")
public class InvalidTimeoutException extends TransactionUsageException {
private int timeout;
private final int timeout;
/**

2
spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

@ -1273,7 +1273,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran @@ -1273,7 +1273,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
* Holder for suspended resources.
* Used internally by {@code suspend} and {@code resume}.
*/
protected static class SuspendedResourcesHolder {
protected static final class SuspendedResourcesHolder {
@Nullable
private final Object suspendedResources;

2
spring-web/src/main/java/org/springframework/http/ContentDisposition.java

@ -39,7 +39,7 @@ import static java.time.format.DateTimeFormatter.*; @@ -39,7 +39,7 @@ import static java.time.format.DateTimeFormatter.*;
* @since 5.0
* @see <a href="https://tools.ietf.org/html/rfc2183">RFC 2183</a>
*/
public class ContentDisposition {
public final class ContentDisposition {
@Nullable
private final String type;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save