Browse Source

Always use 'this.' when accessing fields

Ensure that `this.` is used consistently when accessing class
fields.

Issue: SPR-16968
pull/1868/head
Phillip Webb 8 years ago committed by Juergen Hoeller
parent
commit
0b53c1096a
  1. 2
      spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java
  2. 2
      spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java
  3. 4
      spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java
  4. 2
      spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java
  5. 2
      spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java
  6. 4
      spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java
  7. 6
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
  8. 4
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java
  9. 2
      spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java
  10. 3
      spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
  11. 2
      spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java
  12. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
  13. 6
      spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
  14. 10
      spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
  15. 6
      spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  16. 12
      spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java
  17. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
  18. 2
      spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
  19. 4
      spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java
  20. 2
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResolverAdapter.java
  21. 4
      spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheKeyInvocationContext.java
  22. 2
      spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java
  23. 6
      spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
  24. 4
      spring-context/src/main/java/org/springframework/context/event/DefaultEventListenerFactory.java
  25. 6
      spring-context/src/main/java/org/springframework/context/event/EventExpressionRootObject.java
  26. 6
      spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java
  27. 4
      spring-context/src/main/java/org/springframework/format/support/FormattingConversionService.java
  28. 4
      spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.java
  29. 8
      spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java
  30. 4
      spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java
  31. 4
      spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java
  32. 4
      spring-context/src/main/java/org/springframework/ui/context/support/DelegatingThemeSource.java
  33. 4
      spring-core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java
  34. 2
      spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java
  35. 4
      spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java
  36. 2
      spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java
  37. 4
      spring-core/src/main/java/org/springframework/core/io/ClassPathResource.java
  38. 4
      spring-core/src/main/java/org/springframework/util/AntPathMatcher.java
  39. 2
      spring-core/src/main/java/org/springframework/util/CollectionUtils.java
  40. 2
      spring-core/src/main/java/org/springframework/util/StreamUtils.java
  41. 10
      spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java
  42. 6
      spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java
  43. 4
      spring-core/src/main/java/org/springframework/util/concurrent/CompletableToListenableFutureAdapter.java
  44. 22
      spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java
  45. 6
      spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.java
  46. 8
      spring-expression/src/main/java/org/springframework/expression/spel/ast/InlineList.java
  47. 2
      spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
  48. 2
      spring-expression/src/main/java/org/springframework/expression/spel/ast/VariableReference.java
  49. 4
      spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java
  50. 4
      spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelExpression.java
  51. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java
  52. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/object/SqlCall.java
  53. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java
  54. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodes.java
  55. 4
      spring-jms/src/main/java/org/springframework/jms/config/JmsListenerEndpointRegistrar.java
  56. 4
      spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java
  57. 4
      spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java
  58. 2
      spring-jms/src/main/java/org/springframework/jms/listener/endpoint/JmsMessageEndpointFactory.java
  59. 2
      spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java
  60. 2
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java
  61. 10
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaders.java
  62. 6
      spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/AbstractMonoToListenableFutureAdapter.java
  63. 10
      spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java
  64. 2
      spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java
  65. 4
      spring-orm/src/main/java/org/springframework/orm/jpa/support/AsyncRequestInterceptor.java
  66. 2
      spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMarshaller.java
  67. 12
      spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java
  68. 2
      spring-oxm/src/main/java/org/springframework/oxm/support/MarshallingSource.java
  69. 6
      spring-test/src/main/java/org/springframework/mock/env/MockEnvironment.java
  70. 2
      spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpResponse.java
  71. 2
      spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
  72. 2
      spring-test/src/main/java/org/springframework/mock/web/MockAsyncContext.java
  73. 6
      spring-test/src/main/java/org/springframework/mock/web/MockFilterConfig.java
  74. 2
      spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
  75. 4
      spring-test/src/main/java/org/springframework/test/context/junit4/AbstractTransactionalJUnit4SpringContextTests.java
  76. 6
      spring-test/src/main/java/org/springframework/test/context/junit4/rules/SpringClassRule.java
  77. 4
      spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunPrepareTestInstanceCallbacks.java
  78. 6
      spring-test/src/main/java/org/springframework/test/context/support/DefaultBootstrapContext.java
  79. 2
      spring-test/src/main/java/org/springframework/test/context/support/DefaultTestContext.java
  80. 12
      spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceAttributes.java
  81. 4
      spring-test/src/main/java/org/springframework/test/context/testng/AbstractTransactionalTestNGSpringContextTests.java
  82. 2
      spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContext.java
  83. 4
      spring-test/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java
  84. 4
      spring-test/src/main/java/org/springframework/test/web/client/MockMvcClientHttpRequestFactory.java
  85. 2
      spring-test/src/main/java/org/springframework/test/web/client/match/ContentRequestMatchers.java
  86. 4
      spring-test/src/main/java/org/springframework/test/web/reactive/server/WiretapConnector.java
  87. 2
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java
  88. 2
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java
  89. 8
      spring-test/src/main/java/org/springframework/test/web/servlet/result/ContentResultMatchers.java
  90. 28
      spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java
  91. 20
      spring-test/src/main/java/org/springframework/test/web/servlet/result/XpathResultMatchers.java
  92. 4
      spring-tx/src/main/java/org/springframework/jca/work/SimpleTaskWorkManager.java
  93. 2
      spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java
  94. 2
      spring-tx/src/main/java/org/springframework/transaction/InvalidTimeoutException.java
  95. 4
      spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.java
  96. 6
      spring-web/src/main/java/org/springframework/http/ContentDisposition.java
  97. 4
      spring-web/src/main/java/org/springframework/http/client/InterceptingAsyncClientHttpRequest.java
  98. 2
      spring-web/src/main/java/org/springframework/http/client/Netty4ClientHttpRequest.java
  99. 4
      spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.java
  100. 4
      spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java
  101. Some files were not shown because too many files have changed in this diff Show More

2
spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java

@ -76,7 +76,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor { @@ -76,7 +76,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
// Excludes methods implemented.
ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern);
ClassFilter exclusion = (clazz -> !introducedInterface.isAssignableFrom(clazz));
ClassFilter exclusion = (clazz -> !this.introducedInterface.isAssignableFrom(clazz));
this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion);
}

2
spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java

@ -651,7 +651,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport @@ -651,7 +651,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
}
public String getBeanName() {
return beanName;
return this.beanName;
}
@Override

4
spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.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.
@ -128,7 +128,7 @@ public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor @@ -128,7 +128,7 @@ public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor
this.pointcut.setPatterns(this.patterns);
}
}
return pointcut;
return this.pointcut;
}
}

2
spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java

@ -38,7 +38,7 @@ public class RootClassFilter implements ClassFilter, Serializable { @@ -38,7 +38,7 @@ public class RootClassFilter implements ClassFilter, Serializable {
@Override
public boolean matches(Class<?> candidate) {
return clazz.isAssignableFrom(candidate);
return this.clazz.isAssignableFrom(candidate);
}
}

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

@ -283,7 +283,7 @@ public class BeanWrapperImpl extends AbstractNestablePropertyAccessor implements @@ -283,7 +283,7 @@ public class BeanWrapperImpl extends AbstractNestablePropertyAccessor implements
@Override
@Nullable
public TypeDescriptor nested(int level) {
return TypeDescriptor.nested(property(pd), level);
return TypeDescriptor.nested(property(this.pd), level);
}
@Override

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

@ -60,14 +60,14 @@ public class InvalidPropertyException extends FatalBeanException { @@ -60,14 +60,14 @@ public class InvalidPropertyException extends FatalBeanException {
* Return the offending bean class.
*/
public Class<?> getBeanClass() {
return beanClass;
return this.beanClass;
}
/**
* Return the name of the offending property.
*/
public String getPropertyName() {
return propertyName;
return this.propertyName;
}
}

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

@ -245,10 +245,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean @@ -245,10 +245,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
ReflectionUtils.doWithMethods(beanClass, method -> {
Lookup lookup = method.getAnnotation(Lookup.class);
if (lookup != null) {
Assert.state(beanFactory != null, "No BeanFactory available");
Assert.state(this.beanFactory != null, "No BeanFactory available");
LookupOverride override = new LookupOverride(method, lookup.value());
try {
RootBeanDefinition mbd = (RootBeanDefinition) beanFactory.getMergedBeanDefinition(beanName);
RootBeanDefinition mbd = (RootBeanDefinition) this.beanFactory.getMergedBeanDefinition(beanName);
mbd.getMethodOverrides().addOverride(override);
}
catch (NoSuchBeanDefinitionException ex) {
@ -541,7 +541,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean @@ -541,7 +541,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
private Object resolvedCachedArgument(@Nullable String beanName, @Nullable Object cachedArgument) {
if (cachedArgument instanceof DependencyDescriptor) {
DependencyDescriptor descriptor = (DependencyDescriptor) cachedArgument;
Assert.state(beanFactory != null, "No BeanFactory available");
Assert.state(this.beanFactory != null, "No BeanFactory available");
return this.beanFactory.resolveDependency(descriptor, beanName, null, null);
}
else {

4
spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java

@ -205,14 +205,14 @@ public class InitDestroyAnnotationBeanPostProcessor @@ -205,14 +205,14 @@ public class InitDestroyAnnotationBeanPostProcessor
final LinkedList<LifecycleElement> currDestroyMethods = new LinkedList<>();
ReflectionUtils.doWithLocalMethods(targetClass, method -> {
if (initAnnotationType != null && method.isAnnotationPresent(initAnnotationType)) {
if (this.initAnnotationType != null && method.isAnnotationPresent(this.initAnnotationType)) {
LifecycleElement element = new LifecycleElement(method);
currInitMethods.add(element);
if (debug) {
logger.debug("Found init method on class [" + clazz.getName() + "]: " + method);
}
}
if (destroyAnnotationType != null && method.isAnnotationPresent(destroyAnnotationType)) {
if (this.destroyAnnotationType != null && method.isAnnotationPresent(this.destroyAnnotationType)) {
currDestroyMethods.add(new LifecycleElement(method));
if (debug) {
logger.debug("Found destroy method on class [" + clazz.getName() + "]: " + method);

2
spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java

@ -97,7 +97,7 @@ public class FieldRetrievingFactoryBean @@ -97,7 +97,7 @@ public class FieldRetrievingFactoryBean
*/
@Nullable
public Class<?> getTargetClass() {
return targetClass;
return this.targetClass;
}
/**

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

@ -261,7 +261,8 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport @@ -261,7 +261,8 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
@Override
@Nullable
public String resolvePlaceholder(String placeholderName) {
return PropertyPlaceholderConfigurer.this.resolvePlaceholder(placeholderName, props, systemPropertiesMode);
return PropertyPlaceholderConfigurer.this.resolvePlaceholder(placeholderName,
this.props, systemPropertiesMode);
}
}

2
spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java

@ -512,7 +512,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp @@ -512,7 +512,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
}
else {
List constructorArgs = resolveConstructorArguments(args, 0, hasClosureArgument ? args.length - 1 : args.length);
currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, null, constructorArgs);
this.currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, null, constructorArgs);
}
if (hasClosureArgument) {

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

@ -470,7 +470,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess @@ -470,7 +470,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
*/
@Override
public boolean isSingleton() {
return SCOPE_SINGLETON.equals(scope) || SCOPE_DEFAULT.equals(scope);
return SCOPE_SINGLETON.equals(this.scope) || SCOPE_DEFAULT.equals(this.scope);
}
/**
@ -480,7 +480,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess @@ -480,7 +480,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
*/
@Override
public boolean isPrototype() {
return SCOPE_PROTOTYPE.equals(scope);
return SCOPE_PROTOTYPE.equals(this.scope);
}
/**

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

@ -275,7 +275,7 @@ public final class BeanDefinitionBuilder { @@ -275,7 +275,7 @@ public final class BeanDefinitionBuilder {
* Set the autowire mode for this definition.
*/
public BeanDefinitionBuilder setAutowireMode(int autowireMode) {
beanDefinition.setAutowireMode(autowireMode);
this.beanDefinition.setAutowireMode(autowireMode);
return this;
}
@ -283,7 +283,7 @@ public final class BeanDefinitionBuilder { @@ -283,7 +283,7 @@ public final class BeanDefinitionBuilder {
* Set the depency check mode for this definition.
*/
public BeanDefinitionBuilder setDependencyCheck(int dependencyCheck) {
beanDefinition.setDependencyCheck(dependencyCheck);
this.beanDefinition.setDependencyCheck(dependencyCheck);
return this;
}
@ -316,7 +316,7 @@ public final class BeanDefinitionBuilder { @@ -316,7 +316,7 @@ public final class BeanDefinitionBuilder {
*/
public BeanDefinitionBuilder applyCustomizers(BeanDefinitionCustomizer... customizers) {
for (BeanDefinitionCustomizer customizer : customizers) {
customizer.customize(beanDefinition);
customizer.customize(this.beanDefinition);
}
return this;
}

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

@ -261,15 +261,15 @@ class ConstructorResolver { @@ -261,15 +261,15 @@ class ConstructorResolver {
}
try {
final InstantiationStrategy strategy = beanFactory.getInstantiationStrategy();
final InstantiationStrategy strategy = this.beanFactory.getInstantiationStrategy();
Object beanInstance;
if (System.getSecurityManager() != null) {
final Constructor<?> ctorToUse = constructorToUse;
final Object[] argumentsToUse = argsToUse;
beanInstance = AccessController.doPrivileged((PrivilegedAction<Object>) () ->
strategy.instantiate(mbd, beanName, beanFactory, ctorToUse, argumentsToUse),
beanFactory.getAccessControlContext());
strategy.instantiate(mbd, beanName, this.beanFactory, ctorToUse, argumentsToUse),
this.beanFactory.getAccessControlContext());
}
else {
beanInstance = strategy.instantiate(mbd, beanName, this.beanFactory, constructorToUse, argsToUse);
@ -575,8 +575,8 @@ class ConstructorResolver { @@ -575,8 +575,8 @@ class ConstructorResolver {
final Method factoryMethod = factoryMethodToUse;
final Object[] args = argsToUse;
beanInstance = AccessController.doPrivileged((PrivilegedAction<Object>) () ->
beanFactory.getInstantiationStrategy().instantiate(mbd, beanName, beanFactory, fb, factoryMethod, args),
beanFactory.getAccessControlContext());
this.beanFactory.getInstantiationStrategy().instantiate(mbd, beanName, this.beanFactory, fb, factoryMethod, args),
this.beanFactory.getAccessControlContext());
}
else {
beanInstance = this.beanFactory.getInstantiationStrategy().instantiate(

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

@ -1656,7 +1656,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -1656,7 +1656,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
return createOptionalDependency(this.descriptor, this.beanName, args);
}
else {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(descriptor) {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(this.descriptor) {
@Override
public Object resolveCandidate(String beanName, Class<?> requiredType, BeanFactory beanFactory) {
return beanFactory.getBean(beanName, args);
@ -1677,7 +1677,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -1677,7 +1677,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
return createOptionalDependency(this.descriptor, this.beanName);
}
else {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(descriptor) {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(this.descriptor) {
@Override
public boolean isRequired() {
return false;
@ -1690,7 +1690,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -1690,7 +1690,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
@Override
@Nullable
public Object getIfUnique() throws BeansException {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(descriptor) {
DependencyDescriptor descriptorToUse = new DependencyDescriptor(this.descriptor) {
@Override
public boolean isRequired() {
return false;

12
spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.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.
@ -248,12 +248,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { @@ -248,12 +248,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
try {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged((PrivilegedExceptionAction<Object>) () -> {
((DisposableBean) bean).destroy();
((DisposableBean) this.bean).destroy();
return null;
}, acc);
}, this.acc);
}
else {
((DisposableBean) bean).destroy();
((DisposableBean) this.bean).destroy();
}
}
catch (Throwable ex) {
@ -326,7 +326,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { @@ -326,7 +326,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
});
try {
AccessController.doPrivileged((PrivilegedExceptionAction<Object>) () ->
destroyMethod.invoke(bean, args), acc);
destroyMethod.invoke(this.bean, args), this.acc);
}
catch (PrivilegedActionException pax) {
throw (InvocationTargetException) pax.getException();
@ -334,7 +334,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { @@ -334,7 +334,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
}
else {
ReflectionUtils.makeAccessible(destroyMethod);
destroyMethod.invoke(bean, args);
destroyMethod.invoke(this.bean, args);
}
}
catch (InvocationTargetException ex) {

4
spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.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.
@ -56,7 +56,7 @@ public class SimpleSecurityContextProvider implements SecurityContextProvider { @@ -56,7 +56,7 @@ public class SimpleSecurityContextProvider implements SecurityContextProvider {
@Override
public AccessControlContext getAccessControlContext() {
return (this.acc != null ? acc : AccessController.getContext());
return (this.acc != null ? this.acc : AccessController.getContext());
}
}

2
spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java

@ -128,7 +128,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport { @@ -128,7 +128,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
String[] array = StringUtils.delimitedListToStringArray(text, this.separator, this.charsToDelete);
if (trimValues) {
if (this.trimValues) {
array = StringUtils.trimArrayElements(array);
}
if (this.emptyArrayAsNull && array.length == 0) {

4
spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java vendored

@ -159,10 +159,10 @@ public class CaffeineCache extends AbstractValueAdaptingCache { @@ -159,10 +159,10 @@ public class CaffeineCache extends AbstractValueAdaptingCache {
@Override
public Object apply(Object o) {
try {
return toStoreValue(valueLoader.call());
return toStoreValue(this.valueLoader.call());
}
catch (Exception ex) {
throw new ValueRetrievalException(o, valueLoader, ex);
throw new ValueRetrievalException(o, this.valueLoader, ex);
}
}
}

2
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResolverAdapter.java vendored

@ -53,7 +53,7 @@ class CacheResolverAdapter implements CacheResolver { @@ -53,7 +53,7 @@ class CacheResolverAdapter implements CacheResolver {
* that this instance is using.
*/
protected javax.cache.annotation.CacheResolver getTarget() {
return target;
return this.target;
}
@Override

4
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheKeyInvocationContext.java vendored

@ -48,12 +48,12 @@ class DefaultCacheKeyInvocationContext<A extends Annotation> @@ -48,12 +48,12 @@ class DefaultCacheKeyInvocationContext<A extends Annotation>
@Override
public CacheInvocationParameter[] getKeyParameters() {
return keyParameters.clone();
return this.keyParameters.clone();
}
@Override
public CacheInvocationParameter getValueParameter() {
return valueParameter;
return this.valueParameter;
}
}

2
spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java

@ -113,7 +113,7 @@ public class FreeMarkerConfigurationFactory { @@ -113,7 +113,7 @@ public class FreeMarkerConfigurationFactory {
* @see #setTemplateLoaderPath
*/
public void setConfigLocation(Resource resource) {
configLocation = resource;
this.configLocation = resource;
}
/**

6
spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.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.
@ -369,7 +369,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean @@ -369,7 +369,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
if (Modifier.isStatic(field.getModifiers())) {
throw new IllegalStateException("@Resource annotation is not supported on static fields");
}
if (!ignoredResourceTypes.contains(field.getType().getName())) {
if (!this.ignoredResourceTypes.contains(field.getType().getName())) {
currElements.add(new ResourceElement(field, field, null));
}
}
@ -409,7 +409,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean @@ -409,7 +409,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
if (paramTypes.length != 1) {
throw new IllegalStateException("@Resource annotation requires a single-arg method: " + method);
}
if (!ignoredResourceTypes.contains(paramTypes[0].getName())) {
if (!this.ignoredResourceTypes.contains(paramTypes[0].getName())) {
PropertyDescriptor pd = BeanUtils.findPropertyForMethod(bridgedMethod, clazz);
currElements.add(new ResourceElement(method, bridgedMethod, pd));
}

4
spring-context/src/main/java/org/springframework/context/event/DefaultEventListenerFactory.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.
@ -35,7 +35,7 @@ public class DefaultEventListenerFactory implements EventListenerFactory, Ordere @@ -35,7 +35,7 @@ public class DefaultEventListenerFactory implements EventListenerFactory, Ordere
@Override
public int getOrder() {
return order;
return this.order;
}
public void setOrder(int order) {

6
spring-context/src/main/java/org/springframework/context/event/EventExpressionRootObject.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.
@ -36,11 +36,11 @@ class EventExpressionRootObject { @@ -36,11 +36,11 @@ class EventExpressionRootObject {
}
public ApplicationEvent getEvent() {
return event;
return this.event;
}
public Object[] getArgs() {
return args;
return this.args;
}
}

6
spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

@ -170,13 +170,13 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS @@ -170,13 +170,13 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS
propertyResolver.setValueSeparator(this.valueSeparator);
StringValueResolver valueResolver = strVal -> {
String resolved = (ignoreUnresolvablePlaceholders ?
String resolved = (this.ignoreUnresolvablePlaceholders ?
propertyResolver.resolvePlaceholders(strVal) :
propertyResolver.resolveRequiredPlaceholders(strVal));
if (trimValues) {
if (this.trimValues) {
resolved = resolved.trim();
}
return (resolved.equals(nullValue) ? null : resolved);
return (resolved.equals(this.nullValue) ? null : resolved);
};
doProcessProperties(beanFactoryToProcess, valueResolver);

4
spring-context/src/main/java/org/springframework/format/support/FormattingConversionService.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.
@ -293,7 +293,7 @@ public class FormattingConversionService extends GenericConversionService @@ -293,7 +293,7 @@ public class FormattingConversionService extends GenericConversionService
@Override
public Set<ConvertiblePair> getConvertibleTypes() {
return Collections.singleton(new ConvertiblePair(String.class, fieldType));
return Collections.singleton(new ConvertiblePair(String.class, this.fieldType));
}
@Override

4
spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassPreDefinePlugin.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.
@ -83,7 +83,7 @@ class WebSphereClassPreDefinePlugin implements InvocationHandler { @@ -83,7 +83,7 @@ class WebSphereClassPreDefinePlugin implements InvocationHandler {
throws Exception {
// NB: WebSphere passes className as "." without class while the transformer expects a VM "/" format
byte[] result = transformer.transform(classLoader, className.replace('.', '/'), null, null, classfileBuffer);
byte[] result = this.transformer.transform(classLoader, className.replace('.', '/'), null, null, classfileBuffer);
return (result != null ? result : classfileBuffer);
}

8
spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java

@ -250,12 +250,12 @@ public class ScheduledAnnotationBeanPostProcessor @@ -250,12 +250,12 @@ public class ScheduledAnnotationBeanPostProcessor
Assert.state(this.beanFactory != null, "BeanFactory must be set to find scheduler by type");
try {
// Search for TaskScheduler bean...
this.registrar.setTaskScheduler(resolveSchedulerBean(beanFactory, TaskScheduler.class, false));
this.registrar.setTaskScheduler(resolveSchedulerBean(this.beanFactory, TaskScheduler.class, false));
}
catch (NoUniqueBeanDefinitionException ex) {
logger.debug("Could not find unique TaskScheduler bean", ex);
try {
this.registrar.setTaskScheduler(resolveSchedulerBean(beanFactory, TaskScheduler.class, true));
this.registrar.setTaskScheduler(resolveSchedulerBean(this.beanFactory, TaskScheduler.class, true));
}
catch (NoSuchBeanDefinitionException ex2) {
if (logger.isInfoEnabled()) {
@ -271,12 +271,12 @@ public class ScheduledAnnotationBeanPostProcessor @@ -271,12 +271,12 @@ public class ScheduledAnnotationBeanPostProcessor
logger.debug("Could not find default TaskScheduler bean", ex);
// Search for ScheduledExecutorService bean next...
try {
this.registrar.setScheduler(resolveSchedulerBean(beanFactory, ScheduledExecutorService.class, false));
this.registrar.setScheduler(resolveSchedulerBean(this.beanFactory, ScheduledExecutorService.class, false));
}
catch (NoUniqueBeanDefinitionException ex2) {
logger.debug("Could not find unique ScheduledExecutorService bean", ex2);
try {
this.registrar.setScheduler(resolveSchedulerBean(beanFactory, ScheduledExecutorService.class, true));
this.registrar.setScheduler(resolveSchedulerBean(this.beanFactory, ScheduledExecutorService.class, true));
}
catch (NoSuchBeanDefinitionException ex3) {
if (logger.isInfoEnabled()) {

4
spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java

@ -284,8 +284,8 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport @@ -284,8 +284,8 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
private void executeAndTrack(ExecutorService executor, ListenableFutureTask<?> listenableFuture) {
Future<?> scheduledFuture = executor.submit(errorHandlingTask(listenableFuture, false));
this.listenableFutureMap.put(scheduledFuture, listenableFuture);
listenableFuture.addCallback(result -> listenableFutureMap.remove(scheduledFuture),
ex -> listenableFutureMap.remove(scheduledFuture));
listenableFuture.addCallback(result -> this.listenableFutureMap.remove(scheduledFuture),
ex -> this.listenableFutureMap.remove(scheduledFuture));
}
@Override

4
spring-context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.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.
@ -186,7 +186,7 @@ public class CronSequenceGenerator { @@ -186,7 +186,7 @@ public class CronSequenceGenerator {
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
int updateDayOfMonth = findNextDay(calendar, this.daysOfMonth, dayOfMonth, daysOfWeek, dayOfWeek, resets);
int updateDayOfMonth = findNextDay(calendar, this.daysOfMonth, dayOfMonth, this.daysOfWeek, dayOfWeek, resets);
if (dayOfMonth == updateDayOfMonth) {
resets.add(Calendar.DAY_OF_MONTH);
}

4
spring-context/src/main/java/org/springframework/ui/context/support/DelegatingThemeSource.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.
@ -46,7 +46,7 @@ public class DelegatingThemeSource implements HierarchicalThemeSource { @@ -46,7 +46,7 @@ public class DelegatingThemeSource implements HierarchicalThemeSource {
@Override
@Nullable
public ThemeSource getParentThemeSource() {
return parentThemeSource;
return this.parentThemeSource;
}

4
spring-core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.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.
@ -164,7 +164,7 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD @@ -164,7 +164,7 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
// exclude synthetic + bridged && static class initialization
if (!isSyntheticOrBridged(access) && !STATIC_CLASS_INIT.equals(name)) {
return new LocalVariableTableVisitor(clazz, memberMap, name, desc, isStatic(access));
return new LocalVariableTableVisitor(this.clazz, this.memberMap, name, desc, isStatic(access));
}
return null;
}

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

@ -118,7 +118,7 @@ public class ReactiveAdapterRegistry { @@ -118,7 +118,7 @@ public class ReactiveAdapterRegistry {
public void registerReactiveType(ReactiveTypeDescriptor descriptor,
Function<Object, Publisher<?>> toAdapter, Function<Publisher<?>, Object> fromAdapter) {
if (reactorPresent) {
if (this.reactorPresent) {
this.adapters.add(new ReactorAdapter(descriptor, toAdapter, fromAdapter));
}
else {

4
spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.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.
@ -642,7 +642,7 @@ public class GenericConversionService implements ConfigurableConversionService { @@ -642,7 +642,7 @@ public class GenericConversionService implements ConfigurableConversionService {
private List<String> getConverterStrings() {
List<String> converterStrings = new ArrayList<>();
for (ConvertersForPair convertersForPair : converters.values()) {
for (ConvertersForPair convertersForPair : this.converters.values()) {
converterStrings.add(convertersForPair.toString());
}
Collections.sort(converterStrings);

2
spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java vendored

@ -106,7 +106,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -106,7 +106,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
private final Set<String> defaultProfiles = new LinkedHashSet<>(getReservedDefaultProfiles());
private final MutablePropertySources propertySources = new MutablePropertySources(this.logger);
private final MutablePropertySources propertySources = new MutablePropertySources(logger);
private final ConfigurablePropertyResolver propertyResolver =
new PropertySourcesPropertyResolver(this.propertySources);

4
spring-core/src/main/java/org/springframework/core/io/ClassPathResource.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.
@ -226,7 +226,7 @@ public class ClassPathResource extends AbstractFileResolvingResource { @@ -226,7 +226,7 @@ public class ClassPathResource extends AbstractFileResolvingResource {
@Override
public String getDescription() {
StringBuilder builder = new StringBuilder("class path resource [");
String pathToUse = path;
String pathToUse = this.path;
if (this.clazz != null && !pathToUse.startsWith("/")) {
builder.append(ClassUtils.classPackageAsResourcePath(this.clazz));
builder.append('/');

4
spring-core/src/main/java/org/springframework/util/AntPathMatcher.java

@ -750,8 +750,8 @@ public class AntPathMatcher implements PathMatcher { @@ -750,8 +750,8 @@ public class AntPathMatcher implements PathMatcher {
return -1;
}
boolean pattern1EqualsPath = pattern1.equals(path);
boolean pattern2EqualsPath = pattern2.equals(path);
boolean pattern1EqualsPath = pattern1.equals(this.path);
boolean pattern2EqualsPath = pattern2.equals(this.path);
if (pattern1EqualsPath && pattern2EqualsPath) {
return 0;
}

2
spring-core/src/main/java/org/springframework/util/CollectionUtils.java

@ -557,7 +557,7 @@ public abstract class CollectionUtils { @@ -557,7 +557,7 @@ public abstract class CollectionUtils {
if (this == other) {
return true;
}
return map.equals(other);
return this.map.equals(other);
}
@Override

2
spring-core/src/main/java/org/springframework/util/StreamUtils.java

@ -260,7 +260,7 @@ public abstract class StreamUtils { @@ -260,7 +260,7 @@ public abstract class StreamUtils {
@Override
public void write(byte[] b, int off, int let) throws IOException {
// It is critical that we override this method for performance
out.write(b, off, let);
this.out.write(b, off, let);
}
@Override

10
spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.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.
@ -117,7 +117,7 @@ public class ExponentialBackOff implements BackOff { @@ -117,7 +117,7 @@ public class ExponentialBackOff implements BackOff {
* Return the initial interval in milliseconds.
*/
public long getInitialInterval() {
return initialInterval;
return this.initialInterval;
}
/**
@ -132,7 +132,7 @@ public class ExponentialBackOff implements BackOff { @@ -132,7 +132,7 @@ public class ExponentialBackOff implements BackOff {
* Return the value to multiply the current interval by for each retry attempt.
*/
public double getMultiplier() {
return multiplier;
return this.multiplier;
}
/**
@ -146,7 +146,7 @@ public class ExponentialBackOff implements BackOff { @@ -146,7 +146,7 @@ public class ExponentialBackOff implements BackOff {
* Return the maximum back off time.
*/
public long getMaxInterval() {
return maxInterval;
return this.maxInterval;
}
/**
@ -162,7 +162,7 @@ public class ExponentialBackOff implements BackOff { @@ -162,7 +162,7 @@ public class ExponentialBackOff implements BackOff {
* {@link BackOffExecution#nextBackOff()} returns {@link BackOffExecution#STOP}.
*/
public long getMaxElapsedTime() {
return maxElapsedTime;
return this.maxElapsedTime;
}
@Override

6
spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.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.
@ -69,7 +69,7 @@ public class FixedBackOff implements BackOff { @@ -69,7 +69,7 @@ public class FixedBackOff implements BackOff {
* Return the interval between two attempts in milliseconds.
*/
public long getInterval() {
return interval;
return this.interval;
}
/**
@ -83,7 +83,7 @@ public class FixedBackOff implements BackOff { @@ -83,7 +83,7 @@ public class FixedBackOff implements BackOff {
* Return the maximum number of attempts in milliseconds.
*/
public long getMaxAttempts() {
return maxAttempts;
return this.maxAttempts;
}
@Override

4
spring-core/src/main/java/org/springframework/util/concurrent/CompletableToListenableFutureAdapter.java

@ -53,10 +53,10 @@ public class CompletableToListenableFutureAdapter<T> implements ListenableFuture @@ -53,10 +53,10 @@ public class CompletableToListenableFutureAdapter<T> implements ListenableFuture
this.completableFuture = completableFuture;
this.completableFuture.whenComplete((result, ex) -> {
if (ex != null) {
callbacks.failure(ex);
this.callbacks.failure(ex);
}
else {
callbacks.success(result);
this.callbacks.success(result);
}
});
}

22
spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java

@ -55,27 +55,27 @@ class DomContentHandler implements ContentHandler { @@ -55,27 +55,27 @@ class DomContentHandler implements ContentHandler {
Assert.notNull(node, "node must not be null");
this.node = node;
if (node instanceof Document) {
document = (Document) node;
this.document = (Document) node;
}
else {
document = node.getOwnerDocument();
this.document = node.getOwnerDocument();
}
Assert.notNull(document, "document must not be null");
Assert.notNull(this.document, "document must not be null");
}
private Node getParent() {
if (!elements.isEmpty()) {
return elements.get(elements.size() - 1);
if (!this.elements.isEmpty()) {
return this.elements.get(this.elements.size() - 1);
}
else {
return node;
return this.node;
}
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
Node parent = getParent();
Element element = document.createElementNS(uri, qName);
Element element = this.document.createElementNS(uri, qName);
for (int i = 0; i < attributes.getLength(); i++) {
String attrUri = attributes.getURI(i);
String attrQname = attributes.getQName(i);
@ -85,12 +85,12 @@ class DomContentHandler implements ContentHandler { @@ -85,12 +85,12 @@ class DomContentHandler implements ContentHandler {
}
}
element = (Element) parent.appendChild(element);
elements.add(element);
this.elements.add(element);
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
elements.remove(elements.size() - 1);
this.elements.remove(this.elements.size() - 1);
}
@Override
@ -102,7 +102,7 @@ class DomContentHandler implements ContentHandler { @@ -102,7 +102,7 @@ class DomContentHandler implements ContentHandler {
((Text) lastChild).appendData(data);
}
else {
Text text = document.createTextNode(data);
Text text = this.document.createTextNode(data);
parent.appendChild(text);
}
}
@ -110,7 +110,7 @@ class DomContentHandler implements ContentHandler { @@ -110,7 +110,7 @@ class DomContentHandler implements ContentHandler {
@Override
public void processingInstruction(String target, String data) throws SAXException {
Node parent = getParent();
ProcessingInstruction pi = document.createProcessingInstruction(target, data);
ProcessingInstruction pi = this.document.createProcessingInstruction(target, data);
parent.appendChild(pi);
}

6
spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.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.
@ -95,7 +95,7 @@ class XMLEventStreamReader extends AbstractXMLStreamReader { @@ -95,7 +95,7 @@ class XMLEventStreamReader extends AbstractXMLStreamReader {
@Override
public boolean isStandalone() {
if (this.event.isStartDocument()) {
return ((StartDocument) event).isStandalone();
return ((StartDocument) this.event).isStandalone();
}
else {
throw new IllegalStateException();
@ -152,7 +152,7 @@ class XMLEventStreamReader extends AbstractXMLStreamReader { @@ -152,7 +152,7 @@ class XMLEventStreamReader extends AbstractXMLStreamReader {
@Override
public String getText() {
if (this.event.isCharacters()) {
return event.asCharacters().getData();
return this.event.asCharacters().getData();
}
else if (this.event.getEventType() == XMLEvent.COMMENT) {
return ((Comment) this.event).getText();

8
spring-expression/src/main/java/org/springframework/expression/spel/ast/InlineList.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.
@ -167,11 +167,11 @@ public class InlineList extends SpelNodeImpl { @@ -167,11 +167,11 @@ public class InlineList extends SpelNodeImpl {
// The children might be further lists if they are not constants. In this
// situation do not call back into generateCode() because it will register another clinit adder.
// Instead, directly build the list here:
if (children[c] instanceof InlineList) {
((InlineList)children[c]).generateClinitCode(clazzname, constantFieldName, mv, codeflow, true);
if (this.children[c] instanceof InlineList) {
((InlineList)this.children[c]).generateClinitCode(clazzname, constantFieldName, mv, codeflow, true);
}
else {
children[c].generateCode(mv, codeflow);
this.children[c].generateCode(mv, codeflow);
String lastDesc = codeflow.lastDescriptor();
if (CodeFlow.isPrimitive(lastDesc)) {
CodeFlow.insertBoxIfNecessary(mv, lastDesc.charAt(0));

2
spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java

@ -249,7 +249,7 @@ public class MethodReference extends SpelNodeImpl { @@ -249,7 +249,7 @@ public class MethodReference extends SpelNodeImpl {
Method method = ((ReflectiveMethodExecutor) executorToCheck.get()).getMethod();
String descriptor = CodeFlow.toDescriptor(method.getReturnType());
if (this.nullSafe && CodeFlow.isPrimitive(descriptor)) {
originalPrimitiveExitTypeDescriptor = descriptor;
this.originalPrimitiveExitTypeDescriptor = descriptor;
this.exitTypeDescriptor = CodeFlow.toBoxedDescriptor(descriptor);
}
else {

2
spring-expression/src/main/java/org/springframework/expression/spel/ast/VariableReference.java

@ -116,7 +116,7 @@ public class VariableReference extends SpelNodeImpl { @@ -116,7 +116,7 @@ public class VariableReference extends SpelNodeImpl {
}
else {
mv.visitVarInsn(ALOAD, 2);
mv.visitLdcInsn(name);
mv.visitLdcInsn(this.name);
mv.visitMethodInsn(INVOKEINTERFACE, "org/springframework/expression/EvaluationContext", "lookupVariable", "(Ljava/lang/String;)Ljava/lang/Object;",true);
}
CodeFlow.insertCheckCast(mv, this.exitTypeDescriptor);

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

@ -256,12 +256,12 @@ public final class SpelCompiler implements Opcodes { @@ -256,12 +256,12 @@ public final class SpelCompiler implements Opcodes {
}
int getClassesDefinedCount() {
return classesDefinedCount;
return this.classesDefinedCount;
}
public Class<?> defineClass(String name, byte[] bytes) {
Class<?> clazz = super.defineClass(name, bytes, 0, bytes.length);
classesDefinedCount++;
this.classesDefinedCount++;
return clazz;
}
}

4
spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelExpression.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.
@ -185,7 +185,7 @@ public class SpelExpression implements Expression { @@ -185,7 +185,7 @@ public class SpelExpression implements Expression {
public Object getValue(Object rootObject) throws EvaluationException {
if (this.compiledAst != null) {
try {
return this.compiledAst.getValue(rootObject, evaluationContext);
return this.compiledAst.getValue(rootObject, this.evaluationContext);
}
catch (Throwable ex) {
// If running in mixed mode, revert to interpreted

2
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java

@ -103,7 +103,7 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider { @@ -103,7 +103,7 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider {
@Nullable
protected String getDefaultSchema() {
if (this.defaultSchema != null) {
return defaultSchema;
return this.defaultSchema;
}
return super.getDefaultSchema();
}

4
spring-jdbc/src/main/java/org/springframework/jdbc/object/SqlCall.java

@ -103,7 +103,7 @@ public abstract class SqlCall extends RdbmsOperation { @@ -103,7 +103,7 @@ public abstract class SqlCall extends RdbmsOperation {
* Return whether this call is for a function.
*/
public boolean isFunction() {
return function;
return this.function;
}
/**
@ -117,7 +117,7 @@ public abstract class SqlCall extends RdbmsOperation { @@ -117,7 +117,7 @@ public abstract class SqlCall extends RdbmsOperation {
* Return whether the SQL can be used as is.
*/
public boolean isSqlReadyForUse() {
return sqlReadyForUse;
return this.sqlReadyForUse;
}

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

@ -72,7 +72,7 @@ public final class CustomSQLExceptionTranslatorRegistry { @@ -72,7 +72,7 @@ public final class CustomSQLExceptionTranslatorRegistry {
* @param translator the custom translator
*/
public void registerTranslator(String dbName, SQLExceptionTranslator translator) {
SQLExceptionTranslator replaced = translatorMap.put(dbName, translator);
SQLExceptionTranslator replaced = this.translatorMap.put(dbName, translator);
if (replaced != null) {
logger.warn("Replacing custom translator [" + replaced + "] for database '" + dbName +
"' with [" + translator + "]");

4
spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodes.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.
@ -123,7 +123,7 @@ public class SQLErrorCodes { @@ -123,7 +123,7 @@ public class SQLErrorCodes {
}
public String[] getDuplicateKeyCodes() {
return duplicateKeyCodes;
return this.duplicateKeyCodes;
}
public void setDuplicateKeyCodes(String... duplicateKeyCodes) {

4
spring-jms/src/main/java/org/springframework/jms/config/JmsListenerEndpointRegistrar.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.
@ -57,7 +57,7 @@ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, Initializ @@ -57,7 +57,7 @@ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, Initializ
private boolean startImmediately;
private Object mutex = endpointDescriptors;
private Object mutex = this.endpointDescriptors;
/**

4
spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.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.
@ -486,7 +486,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen @@ -486,7 +486,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
@Override
public boolean isReplyPubSubDomain() {
if (this.replyPubSubDomain != null) {
return replyPubSubDomain;
return this.replyPubSubDomain;
}
else {
return isPubSubDomain();

4
spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.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.
@ -293,7 +293,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta @@ -293,7 +293,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
MessageConsumer consumer = createConsumer(session, destination);
if (this.taskExecutor != null) {
consumer.setMessageListener(message -> taskExecutor.execute(() -> processMessage(message, session)));
consumer.setMessageListener(message -> this.taskExecutor.execute(() -> processMessage(message, session)));
}
else {
consumer.setMessageListener(message -> processMessage(message, session));

2
spring-jms/src/main/java/org/springframework/jms/listener/endpoint/JmsMessageEndpointFactory.java

@ -64,7 +64,7 @@ public class JmsMessageEndpointFactory extends AbstractMessageEndpointFactory { @@ -64,7 +64,7 @@ public class JmsMessageEndpointFactory extends AbstractMessageEndpointFactory {
* Return the JMS MessageListener for this endpoint.
*/
protected MessageListener getMessageListener() {
Assert.state(messageListener != null, "No MessageListener set");
Assert.state(this.messageListener != null, "No MessageListener set");
return this.messageListener;
}

2
spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandler.java

@ -253,7 +253,7 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH @@ -253,7 +253,7 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH
@Override
public String toString() {
return "SendToMethodReturnValueHandler [annotationRequired=" + annotationRequired + "]";
return "SendToMethodReturnValueHandler [annotationRequired=" + this.annotationRequired + "]";
}

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

@ -538,7 +538,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler @@ -538,7 +538,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
}
return;
}
stats.incrementDisconnectCount();
this.stats.incrementDisconnectCount();
handler.forward(message, stompAccessor);
}
else {

10
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaders.java

@ -431,7 +431,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable @@ -431,7 +431,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
@Override
@Nullable
public String getFirst(String headerName) {
List<String> headerValues = headers.get(headerName);
List<String> headerValues = this.headers.get(headerName);
return headerValues != null ? headerValues.get(0) : null;
}
@ -445,13 +445,13 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable @@ -445,13 +445,13 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
*/
@Override
public void add(String headerName, @Nullable String headerValue) {
List<String> headerValues = headers.computeIfAbsent(headerName, k -> new LinkedList<>());
List<String> headerValues = this.headers.computeIfAbsent(headerName, k -> new LinkedList<>());
headerValues.add(headerValue);
}
@Override
public void addAll(String headerName, List<? extends String> headerValues) {
List<String> currentValues = headers.computeIfAbsent(headerName, k -> new LinkedList<>());
List<String> currentValues = this.headers.computeIfAbsent(headerName, k -> new LinkedList<>());
currentValues.addAll(headerValues);
}
@ -472,7 +472,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable @@ -472,7 +472,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
public void set(String headerName, @Nullable String headerValue) {
List<String> headerValues = new LinkedList<>();
headerValues.add(headerValue);
headers.put(headerName, headerValues);
this.headers.put(headerName, headerValues);
}
@Override
@ -483,7 +483,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable @@ -483,7 +483,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
@Override
public Map<String, String> toSingleValueMap() {
LinkedHashMap<String, String> singleValueMap = new LinkedHashMap<>(this.headers.size());
headers.forEach((key, value) -> singleValueMap.put(key, value.get(0)));
this.headers.forEach((key, value) -> singleValueMap.put(key, value.get(0)));
return singleValueMap;
}

6
spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/AbstractMonoToListenableFutureAdapter.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.
@ -57,10 +57,10 @@ abstract class AbstractMonoToListenableFutureAdapter<S, T> implements Listenable @@ -57,10 +57,10 @@ abstract class AbstractMonoToListenableFutureAdapter<S, T> implements Listenable
adapted = adapt(result);
}
catch (Throwable ex) {
registry.failure(ex);
this.registry.failure(ex);
return;
}
registry.success(adapted);
this.registry.success(adapted);
})
.doOnError(this.registry::failure)
.toProcessor();

10
spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java

@ -277,7 +277,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> { @@ -277,7 +277,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> {
});
DirectProcessor<Void> completion = DirectProcessor.create();
TcpConnection<P> connection = new ReactorNettyTcpConnection<>(inbound, outbound, codec, completion);
scheduler.schedule(() -> connectionHandler.afterConnected(connection));
scheduler.schedule(() -> this.connectionHandler.afterConnected(connection));
inbound.withConnection(conn -> conn.addHandler(new StompMessageDecoder<>(codec)));
@ -285,9 +285,9 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> { @@ -285,9 +285,9 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> {
.cast(Message.class)
.publishOn(scheduler, PUBLISH_ON_BUFFER_SIZE)
.subscribe(
connectionHandler::handleMessage,
connectionHandler::handleFailure,
connectionHandler::afterConnectionClosed);
this.connectionHandler::handleMessage,
this.connectionHandler::handleFailure,
this.connectionHandler::afterConnectionClosed);
return completion;
}
@ -304,7 +304,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> { @@ -304,7 +304,7 @@ public class ReactorNettyTcpClient<P> implements TcpOperations<P> {
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
Collection<Message<P>> messages = codec.decode(in);
Collection<Message<P>> messages = this.codec.decode(in);
out.addAll(messages);
}
}

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

@ -336,7 +336,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana @@ -336,7 +336,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
@Nullable
public Interceptor getEntityInterceptor() throws IllegalStateException, BeansException {
if (this.entityInterceptor instanceof Interceptor) {
return (Interceptor) entityInterceptor;
return (Interceptor) this.entityInterceptor;
}
else if (this.entityInterceptor instanceof String) {
if (this.beanFactory == null) {

4
spring-orm/src/main/java/org/springframework/orm/jpa/support/AsyncRequestInterceptor.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.
@ -96,7 +96,7 @@ class AsyncRequestInterceptor implements CallableProcessingInterceptor, Deferred @@ -96,7 +96,7 @@ class AsyncRequestInterceptor implements CallableProcessingInterceptor, Deferred
private void closeEntityManager() {
if (this.timeoutInProgress || this.errorInProgress) {
logger.debug("Closing JPA EntityManager after async request timeout/error");
EntityManagerFactoryUtils.closeEntityManager(emHolder.getEntityManager());
EntityManagerFactoryUtils.closeEntityManager(this.emHolder.getEntityManager());
}
}

2
spring-oxm/src/main/java/org/springframework/oxm/castor/CastorMarshaller.java

@ -550,7 +550,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing @@ -550,7 +550,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
@Override
protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException {
marshalWriter(graph, new OutputStreamWriter(outputStream, encoding));
marshalWriter(graph, new OutputStreamWriter(outputStream, this.encoding));
}
@Override

12
spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.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.
@ -230,8 +230,8 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe @@ -230,8 +230,8 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
}
}
else if (this.targetPackage != null) {
if (!StringUtils.hasLength(bindingName)) {
bindingName = DEFAULT_BINDING_NAME;
if (!StringUtils.hasLength(this.bindingName)) {
this.bindingName = DEFAULT_BINDING_NAME;
}
if (logger.isInfoEnabled()) {
logger.info("Configured for target package [" + this.targetPackage + "] using binding [" + this.bindingName + "]");
@ -290,9 +290,9 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe @@ -290,9 +290,9 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
}
private void marshalDocument(IMarshallingContext marshallingContext, Object graph) throws IOException, JiBXException {
if (StringUtils.hasLength(docTypeRootElementName)) {
if (StringUtils.hasLength(this.docTypeRootElementName)) {
IXMLWriter xmlWriter = marshallingContext.getXmlWriter();
xmlWriter.writeDocType(docTypeRootElementName, docTypeSystemId, docTypePublicId, docTypeInternalSubset);
xmlWriter.writeDocType(this.docTypeRootElementName, this.docTypeSystemId, this.docTypePublicId, this.docTypeInternalSubset);
}
marshallingContext.marshalDocument(graph);
}
@ -391,7 +391,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe @@ -391,7 +391,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
try {
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
return unmarshallingContext.unmarshalDocument(inputStream, encoding);
return unmarshallingContext.unmarshalDocument(inputStream, this.encoding);
}
catch (JiBXException ex) {
throw convertJibxException(ex, false);

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

@ -193,7 +193,7 @@ public class MarshallingSource extends SAXSource { @@ -193,7 +193,7 @@ public class MarshallingSource extends SAXSource {
@Nullable
public Object getProperty(String name) throws SAXNotRecognizedException {
if ("http://xml.org/sax/properties/lexical-handler".equals(name)) {
return lexicalHandler;
return this.lexicalHandler;
}
else {
throw new SAXNotRecognizedException(name);

6
spring-test/src/main/java/org/springframework/mock/env/MockEnvironment.java vendored

@ -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.
@ -37,14 +37,14 @@ public class MockEnvironment extends AbstractEnvironment { @@ -37,14 +37,14 @@ public class MockEnvironment extends AbstractEnvironment {
* Create a new {@code MockEnvironment} with a single {@link MockPropertySource}.
*/
public MockEnvironment() {
getPropertySources().addLast(propertySource);
getPropertySources().addLast(this.propertySource);
}
/**
* Set a property on the underlying {@link MockPropertySource} for this environment.
*/
public void setProperty(String key, String value) {
propertySource.setProperty(key, value);
this.propertySource.setProperty(key, value);
}
/**

2
spring-test/src/main/java/org/springframework/mock/http/client/reactive/MockClientHttpResponse.java

@ -120,7 +120,7 @@ public class MockClientHttpResponse implements ClientHttpResponse { @@ -120,7 +120,7 @@ public class MockClientHttpResponse implements ClientHttpResponse {
public Mono<String> getBodyAsString() {
Charset charset = getCharset();
return Flux.from(getBody())
.reduce(bufferFactory.allocateBuffer(), (previous, current) -> {
.reduce(this.bufferFactory.allocateBuffer(), (previous, current) -> {
previous.write(current);
DataBufferUtils.release(current);
return previous;

2
spring-test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java

@ -226,7 +226,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder @@ -226,7 +226,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder
}
// Default case...
return environment1 -> new SimpleNamingContext("", boundObjects, (Hashtable<String, Object>) environment1);
return environment1 -> new SimpleNamingContext("", this.boundObjects, (Hashtable<String, Object>) environment1);
}
}

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

@ -116,7 +116,7 @@ public class MockAsyncContext implements AsyncContext { @@ -116,7 +116,7 @@ public class MockAsyncContext implements AsyncContext {
@Override
public void complete() {
MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(request, MockHttpServletRequest.class);
MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(this.request, MockHttpServletRequest.class);
if (mockRequest != null) {
mockRequest.setAsyncStarted(false);
}

6
spring-test/src/main/java/org/springframework/mock/web/MockFilterConfig.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.
@ -82,12 +82,12 @@ public class MockFilterConfig implements FilterConfig { @@ -82,12 +82,12 @@ public class MockFilterConfig implements FilterConfig {
@Override
public String getFilterName() {
return filterName;
return this.filterName;
}
@Override
public ServletContext getServletContext() {
return servletContext;
return this.servletContext;
}
public void addInitParameter(String name, String value) {

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

@ -1285,7 +1285,7 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -1285,7 +1285,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
public String changeSessionId() {
Assert.isTrue(this.session != null, "The request does not have a session");
if (this.session instanceof MockHttpSession) {
return ((MockHttpSession) session).changeSessionId();
return ((MockHttpSession) this.session).changeSessionId();
}
return this.session.getId();
}

4
spring-test/src/main/java/org/springframework/test/context/junit4/AbstractTransactionalJUnit4SpringContextTests.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.
@ -177,7 +177,7 @@ public abstract class AbstractTransactionalJUnit4SpringContextTests extends Abst @@ -177,7 +177,7 @@ public abstract class AbstractTransactionalJUnit4SpringContextTests extends Abst
* @see JdbcTestUtils#deleteFromTableWhere
*/
protected int deleteFromTableWhere(String tableName, String whereClause, Object... args) {
return JdbcTestUtils.deleteFromTableWhere(jdbcTemplate, tableName, whereClause, args);
return JdbcTestUtils.deleteFromTableWhere(this.jdbcTemplate, tableName, whereClause, args);
}
/**

6
spring-test/src/main/java/org/springframework/test/context/junit4/rules/SpringClassRule.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.
@ -227,10 +227,10 @@ public class SpringClassRule implements TestRule { @@ -227,10 +227,10 @@ public class SpringClassRule implements TestRule {
@Override
public void evaluate() throws Throwable {
try {
next.evaluate();
this.next.evaluate();
}
finally {
testContextManagerCache.remove(testClass);
testContextManagerCache.remove(this.testClass);
}
}
}

4
spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunPrepareTestInstanceCallbacks.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.
@ -60,7 +60,7 @@ public class RunPrepareTestInstanceCallbacks extends Statement { @@ -60,7 +60,7 @@ public class RunPrepareTestInstanceCallbacks extends Statement {
*/
@Override
public void evaluate() throws Throwable {
this.testContextManager.prepareTestInstance(testInstance);
this.testContextManager.prepareTestInstance(this.testInstance);
this.next.evaluate();
}

6
spring-test/src/main/java/org/springframework/test/context/support/DefaultBootstrapContext.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.
@ -68,8 +68,8 @@ public class DefaultBootstrapContext implements BootstrapContext { @@ -68,8 +68,8 @@ public class DefaultBootstrapContext implements BootstrapContext {
@Override
public String toString() {
return new ToStringCreator(this)//
.append("testClass", testClass.getName())//
.append("cacheAwareContextLoaderDelegate", cacheAwareContextLoaderDelegate.getClass().getName())//
.append("testClass", this.testClass.getName())//
.append("cacheAwareContextLoaderDelegate", this.cacheAwareContextLoaderDelegate.getClass().getName())//
.toString();
}

2
spring-test/src/main/java/org/springframework/test/context/support/DefaultTestContext.java

@ -110,7 +110,7 @@ public class DefaultTestContext implements TestContext { @@ -110,7 +110,7 @@ public class DefaultTestContext implements TestContext {
@SuppressWarnings("resource")
ConfigurableApplicationContext cac = (ConfigurableApplicationContext) context;
Assert.state(cac.isActive(), () ->
"The ApplicationContext loaded for [" + mergedContextConfiguration +
"The ApplicationContext loaded for [" + this.mergedContextConfiguration +
"] is not active. This may be due to one of the following reasons: " +
"1) the context was closed programmatically by user code; " +
"2) the context was closed during parallel test execution either " +

12
spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceAttributes.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.
@ -141,11 +141,11 @@ class TestPropertySourceAttributes { @@ -141,11 +141,11 @@ class TestPropertySourceAttributes {
@Override
public String toString() {
return new ToStringCreator(this)//
.append("declaringClass", declaringClass.getName())//
.append("locations", ObjectUtils.nullSafeToString(locations))//
.append("inheritLocations", inheritLocations)//
.append("properties", ObjectUtils.nullSafeToString(properties))//
.append("inheritProperties", inheritProperties)//
.append("declaringClass", this.declaringClass.getName())//
.append("locations", ObjectUtils.nullSafeToString(this.locations))//
.append("inheritLocations", this.inheritLocations)//
.append("properties", ObjectUtils.nullSafeToString(this.properties))//
.append("inheritProperties", this.inheritProperties)//
.toString();
}

4
spring-test/src/main/java/org/springframework/test/context/testng/AbstractTransactionalTestNGSpringContextTests.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.
@ -161,7 +161,7 @@ public abstract class AbstractTransactionalTestNGSpringContextTests extends Abst @@ -161,7 +161,7 @@ public abstract class AbstractTransactionalTestNGSpringContextTests extends Abst
* @see JdbcTestUtils#deleteFromTableWhere
*/
protected int deleteFromTableWhere(String tableName, String whereClause, Object... args) {
return JdbcTestUtils.deleteFromTableWhere(jdbcTemplate, tableName, whereClause, args);
return JdbcTestUtils.deleteFromTableWhere(this.jdbcTemplate, tableName, whereClause, args);
}
/**

2
spring-test/src/main/java/org/springframework/test/context/transaction/TransactionContext.java

@ -106,7 +106,7 @@ class TransactionContext { @@ -106,7 +106,7 @@ class TransactionContext {
if (logger.isInfoEnabled()) {
logger.info(String.format(
"Began transaction (%s) for test context %s; transaction manager [%s]; rollback [%s]",
transactionsStarted, this.testContext, this.transactionManager, flaggedForRollback));
transactionsStarted, this.testContext, this.transactionManager, this.flaggedForRollback));
}
}

4
spring-test/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java

@ -104,12 +104,12 @@ public class XmlExpectationsHelper { @@ -104,12 +104,12 @@ public class XmlExpectationsHelper {
public boolean hasDifferences() {
return diff.hasDifferences();
return this.diff.hasDifferences();
}
@Override
public String toString() {
return diff.toString();
return this.diff.toString();
}
}

4
spring-test/src/main/java/org/springframework/test/web/client/MockMvcClientHttpRequestFactory.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.
@ -85,7 +85,7 @@ public class MockMvcClientHttpRequestFactory @@ -85,7 +85,7 @@ public class MockMvcClientHttpRequestFactory
HttpMethod httpMethod, URI uri, HttpHeaders requestHeaders, byte[] requestBody) {
try {
MockHttpServletResponse servletResponse = mockMvc
MockHttpServletResponse servletResponse = this.mockMvc
.perform(request(httpMethod, uri).content(requestBody).headers(requestHeaders))
.andReturn()
.getResponse();

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

@ -231,7 +231,7 @@ public class ContentRequestMatchers { @@ -231,7 +231,7 @@ public class ContentRequestMatchers {
return request -> {
try {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
jsonHelper.assertJsonEqual(expectedJsonContent, mockRequest.getBodyAsString(), strict);
this.jsonHelper.assertJsonEqual(expectedJsonContent, mockRequest.getBodyAsString(), strict);
}
catch (Exception ex) {
throw new AssertionError("Failed to parse expected or actual JSON request content", ex);

4
spring-test/src/main/java/org/springframework/test/web/reactive/server/WiretapConnector.java

@ -218,8 +218,8 @@ class WiretapConnector implements ClientHttpConnector { @@ -218,8 +218,8 @@ class WiretapConnector implements ClientHttpConnector {
@Override
public Flux<DataBuffer> getBody() {
return super.getBody()
.doOnNext(buffer::write)
.doOnError(body::onError)
.doOnNext(this.buffer::write)
.doOnError(this.body::onError)
.doOnCancel(this::handleOnComplete)
.doOnComplete(this::handleOnComplete);
}

2
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java

@ -490,7 +490,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable { @@ -490,7 +490,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable {
synchronized (HtmlUnitRequestBuilder.this.sessions) {
HtmlUnitRequestBuilder.this.sessions.remove(getId());
}
removeSessionCookie(request, getId());
removeSessionCookie(this.request, getId());
}
}

2
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilder.java

@ -63,7 +63,7 @@ final class MockWebResponseBuilder { @@ -63,7 +63,7 @@ final class MockWebResponseBuilder {
public WebResponse build() throws IOException {
WebResponseData webResponseData = webResponseData();
long endTime = System.currentTimeMillis();
return new WebResponse(webResponseData, webRequest, endTime - startTime);
return new WebResponse(webResponseData, this.webRequest, endTime - this.startTime);
}
private WebResponseData webResponseData() throws IOException {

8
spring-test/src/main/java/org/springframework/test/web/servlet/result/ContentResultMatchers.java

@ -156,7 +156,7 @@ public class ContentResultMatchers { @@ -156,7 +156,7 @@ public class ContentResultMatchers {
public ResultMatcher xml(final String xmlContent) {
return result -> {
String content = result.getResponse().getContentAsString();
xmlHelper.assertXmlEqual(xmlContent, content);
this.xmlHelper.assertXmlEqual(xmlContent, content);
};
}
@ -167,7 +167,7 @@ public class ContentResultMatchers { @@ -167,7 +167,7 @@ public class ContentResultMatchers {
public ResultMatcher node(final Matcher<? super Node> matcher) {
return result -> {
String content = result.getResponse().getContentAsString();
xmlHelper.assertNode(content, matcher);
this.xmlHelper.assertNode(content, matcher);
};
}
@ -179,7 +179,7 @@ public class ContentResultMatchers { @@ -179,7 +179,7 @@ public class ContentResultMatchers {
public ResultMatcher source(final Matcher<? super Source> matcher) {
return result -> {
String content = result.getResponse().getContentAsString();
xmlHelper.assertSource(content, matcher);
this.xmlHelper.assertSource(content, matcher);
};
}
@ -212,7 +212,7 @@ public class ContentResultMatchers { @@ -212,7 +212,7 @@ public class ContentResultMatchers {
public ResultMatcher json(final String jsonContent, final boolean strict) {
return result -> {
String content = result.getResponse().getContentAsString();
jsonHelper.assertJsonEqual(jsonContent, content, strict);
this.jsonHelper.assertJsonEqual(jsonContent, content, strict);
};
}

28
spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java

@ -84,7 +84,7 @@ public class JsonPathResultMatchers { @@ -84,7 +84,7 @@ public class JsonPathResultMatchers {
* @see #value(Object)
*/
public <T> ResultMatcher value(Matcher<T> matcher) {
return result -> jsonPathHelper.assertValue(getContent(result), matcher);
return result -> this.jsonPathHelper.assertValue(getContent(result), matcher);
}
/**
@ -98,7 +98,7 @@ public class JsonPathResultMatchers { @@ -98,7 +98,7 @@ public class JsonPathResultMatchers {
* @see #value(Object)
*/
public <T> ResultMatcher value(Matcher<T> matcher, Class<T> targetType) {
return result -> jsonPathHelper.assertValue(getContent(result), matcher, targetType);
return result -> this.jsonPathHelper.assertValue(getContent(result), matcher, targetType);
}
/**
@ -108,7 +108,7 @@ public class JsonPathResultMatchers { @@ -108,7 +108,7 @@ public class JsonPathResultMatchers {
* @see #value(Matcher, Class)
*/
public ResultMatcher value(Object expectedValue) {
return result -> jsonPathHelper.assertValue(getContent(result), expectedValue);
return result -> this.jsonPathHelper.assertValue(getContent(result), expectedValue);
}
/**
@ -120,7 +120,7 @@ public class JsonPathResultMatchers { @@ -120,7 +120,7 @@ public class JsonPathResultMatchers {
* <em>empty</em>.
*/
public ResultMatcher exists() {
return result -> jsonPathHelper.exists(getContent(result));
return result -> this.jsonPathHelper.exists(getContent(result));
}
/**
@ -131,7 +131,7 @@ public class JsonPathResultMatchers { @@ -131,7 +131,7 @@ public class JsonPathResultMatchers {
* <em>empty</em>.
*/
public ResultMatcher doesNotExist() {
return result -> jsonPathHelper.doesNotExist(getContent(result));
return result -> this.jsonPathHelper.doesNotExist(getContent(result));
}
/**
@ -145,7 +145,7 @@ public class JsonPathResultMatchers { @@ -145,7 +145,7 @@ public class JsonPathResultMatchers {
* @see #doesNotExist()
*/
public ResultMatcher isEmpty() {
return result -> jsonPathHelper.assertValueIsEmpty(getContent(result));
return result -> this.jsonPathHelper.assertValueIsEmpty(getContent(result));
}
/**
@ -159,7 +159,7 @@ public class JsonPathResultMatchers { @@ -159,7 +159,7 @@ public class JsonPathResultMatchers {
* @see #doesNotExist()
*/
public ResultMatcher isNotEmpty() {
return result -> jsonPathHelper.assertValueIsNotEmpty(getContent(result));
return result -> this.jsonPathHelper.assertValueIsNotEmpty(getContent(result));
}
/**
@ -173,7 +173,7 @@ public class JsonPathResultMatchers { @@ -173,7 +173,7 @@ public class JsonPathResultMatchers {
* @see #isNotEmpty()
*/
public ResultMatcher hasJsonPath() {
return result -> jsonPathHelper.hasJsonPath(getContent(result));
return result -> this.jsonPathHelper.hasJsonPath(getContent(result));
}
/**
@ -188,7 +188,7 @@ public class JsonPathResultMatchers { @@ -188,7 +188,7 @@ public class JsonPathResultMatchers {
* @see #isEmpty()
*/
public ResultMatcher doesNotHaveJsonPath() {
return result -> jsonPathHelper.doesNotHaveJsonPath(getContent(result));
return result -> this.jsonPathHelper.doesNotHaveJsonPath(getContent(result));
}
/**
@ -197,7 +197,7 @@ public class JsonPathResultMatchers { @@ -197,7 +197,7 @@ public class JsonPathResultMatchers {
* @since 4.2.1
*/
public ResultMatcher isString() {
return result -> jsonPathHelper.assertValueIsString(getContent(result));
return result -> this.jsonPathHelper.assertValueIsString(getContent(result));
}
/**
@ -206,7 +206,7 @@ public class JsonPathResultMatchers { @@ -206,7 +206,7 @@ public class JsonPathResultMatchers {
* @since 4.2.1
*/
public ResultMatcher isBoolean() {
return result -> jsonPathHelper.assertValueIsBoolean(getContent(result));
return result -> this.jsonPathHelper.assertValueIsBoolean(getContent(result));
}
/**
@ -215,7 +215,7 @@ public class JsonPathResultMatchers { @@ -215,7 +215,7 @@ public class JsonPathResultMatchers {
* @since 4.2.1
*/
public ResultMatcher isNumber() {
return result -> jsonPathHelper.assertValueIsNumber(getContent(result));
return result -> this.jsonPathHelper.assertValueIsNumber(getContent(result));
}
/**
@ -223,7 +223,7 @@ public class JsonPathResultMatchers { @@ -223,7 +223,7 @@ public class JsonPathResultMatchers {
* assert that the result is an array.
*/
public ResultMatcher isArray() {
return result -> jsonPathHelper.assertValueIsArray(getContent(result));
return result -> this.jsonPathHelper.assertValueIsArray(getContent(result));
}
/**
@ -232,7 +232,7 @@ public class JsonPathResultMatchers { @@ -232,7 +232,7 @@ public class JsonPathResultMatchers {
* @since 4.2.1
*/
public ResultMatcher isMap() {
return result -> jsonPathHelper.assertValueIsMap(getContent(result));
return result -> this.jsonPathHelper.assertValueIsMap(getContent(result));
}
private String getContent(MvcResult result) throws UnsupportedEncodingException {

20
spring-test/src/main/java/org/springframework/test/web/servlet/result/XpathResultMatchers.java

@ -64,7 +64,7 @@ public class XpathResultMatchers { @@ -64,7 +64,7 @@ public class XpathResultMatchers {
public ResultMatcher node(final Matcher<? super Node> matcher) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertNode(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
this.xpathHelper.assertNode(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
};
}
@ -82,7 +82,7 @@ public class XpathResultMatchers { @@ -82,7 +82,7 @@ public class XpathResultMatchers {
public ResultMatcher exists() {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.exists(response.getContentAsByteArray(), getDefinedEncoding(response));
this.xpathHelper.exists(response.getContentAsByteArray(), getDefinedEncoding(response));
};
}
@ -92,7 +92,7 @@ public class XpathResultMatchers { @@ -92,7 +92,7 @@ public class XpathResultMatchers {
public ResultMatcher doesNotExist() {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.doesNotExist(response.getContentAsByteArray(), getDefinedEncoding(response));
this.xpathHelper.doesNotExist(response.getContentAsByteArray(), getDefinedEncoding(response));
};
}
@ -103,7 +103,7 @@ public class XpathResultMatchers { @@ -103,7 +103,7 @@ public class XpathResultMatchers {
public ResultMatcher nodeCount(final Matcher<Integer> matcher) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
};
}
@ -113,7 +113,7 @@ public class XpathResultMatchers { @@ -113,7 +113,7 @@ public class XpathResultMatchers {
public ResultMatcher nodeCount(final int expectedCount) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), expectedCount);
this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), expectedCount);
};
}
@ -124,7 +124,7 @@ public class XpathResultMatchers { @@ -124,7 +124,7 @@ public class XpathResultMatchers {
public ResultMatcher string(final Matcher<? super String> matcher) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
};
}
@ -134,7 +134,7 @@ public class XpathResultMatchers { @@ -134,7 +134,7 @@ public class XpathResultMatchers {
public ResultMatcher string(final String expectedValue) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
};
}
@ -145,7 +145,7 @@ public class XpathResultMatchers { @@ -145,7 +145,7 @@ public class XpathResultMatchers {
public ResultMatcher number(final Matcher<? super Double> matcher) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
};
}
@ -155,7 +155,7 @@ public class XpathResultMatchers { @@ -155,7 +155,7 @@ public class XpathResultMatchers {
public ResultMatcher number(final Double expectedValue) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
};
}
@ -165,7 +165,7 @@ public class XpathResultMatchers { @@ -165,7 +165,7 @@ public class XpathResultMatchers {
public ResultMatcher booleanValue(final Boolean value) {
return result -> {
MockHttpServletResponse response = result.getResponse();
xpathHelper.assertBoolean(response.getContentAsByteArray(), getDefinedEncoding(response), value);
this.xpathHelper.assertBoolean(response.getContentAsByteArray(), getDefinedEncoding(response), value);
};
}

4
spring-tx/src/main/java/org/springframework/jca/work/SimpleTaskWorkManager.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.
@ -230,7 +230,7 @@ public class SimpleTaskWorkManager implements WorkManager { @@ -230,7 +230,7 @@ public class SimpleTaskWorkManager implements WorkManager {
@Override
public void run() {
if (this.acceptOnExecution) {
this.workListener.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null));
this.workListener.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, this.work, null));
}
synchronized (this.monitor) {
this.started = true;

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

@ -87,7 +87,7 @@ public class HeuristicCompletionException extends TransactionException { @@ -87,7 +87,7 @@ public class HeuristicCompletionException extends TransactionException {
* @see #STATE_MIXED
*/
public int getOutcomeState() {
return outcomeState;
return this.outcomeState;
}
}

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

@ -44,7 +44,7 @@ public class InvalidTimeoutException extends TransactionUsageException { @@ -44,7 +44,7 @@ public class InvalidTimeoutException extends TransactionUsageException {
* Return the invalid timeout value.
*/
public int getTimeout() {
return timeout;
return this.timeout;
}
}

4
spring-tx/src/main/java/org/springframework/transaction/interceptor/RollbackRuleAttribute.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.
@ -96,7 +96,7 @@ public class RollbackRuleAttribute implements Serializable{ @@ -96,7 +96,7 @@ public class RollbackRuleAttribute implements Serializable{
* Return the pattern for the exception name.
*/
public String getExceptionName() {
return exceptionName;
return this.exceptionName;
}
/**

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

@ -177,9 +177,9 @@ public final class ContentDisposition { @@ -177,9 +177,9 @@ public final class ContentDisposition {
result = 31 * result + ObjectUtils.nullSafeHashCode(this.filename);
result = 31 * result + ObjectUtils.nullSafeHashCode(this.charset);
result = 31 * result + ObjectUtils.nullSafeHashCode(this.size);
result = 31 * result + (creationDate != null ? creationDate.hashCode() : 0);
result = 31 * result + (modificationDate != null ? modificationDate.hashCode() : 0);
result = 31 * result + (readDate != null ? readDate.hashCode() : 0);
result = 31 * result + (this.creationDate != null ? this.creationDate.hashCode() : 0);
result = 31 * result + (this.modificationDate != null ? this.modificationDate.hashCode() : 0);
result = 31 * result + (this.readDate != null ? this.readDate.hashCode() : 0);
return result;
}

4
spring-web/src/main/java/org/springframework/http/client/InterceptingAsyncClientHttpRequest.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.
@ -85,7 +85,7 @@ class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHtt @@ -85,7 +85,7 @@ class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHtt
@Override
public URI getURI() {
return uri;
return this.uri;
}

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

@ -138,7 +138,7 @@ class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements @@ -138,7 +138,7 @@ class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements
FullHttpRequest nettyRequest = new DefaultFullHttpRequest(
HttpVersion.HTTP_1_1, nettyMethod, path, this.body.buffer());
nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost() + ":" + getPort(uri));
nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost() + ":" + getPort(this.uri));
nettyRequest.headers().set(HttpHeaders.CONNECTION, "close");
headers.forEach((headerName, headerValues) -> nettyRequest.headers().add(headerName, headerValues));
if (!nettyRequest.headers().contains(HttpHeaders.CONTENT_LENGTH) && this.body.buffer().readableBytes() > 0) {

4
spring-web/src/main/java/org/springframework/http/client/support/AsyncHttpAccessor.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.
@ -66,7 +66,7 @@ public class AsyncHttpAccessor { @@ -66,7 +66,7 @@ public class AsyncHttpAccessor {
* org.springframework.http.client.ClientHttpRequest HttpRequests}.
*/
public org.springframework.http.client.AsyncClientHttpRequestFactory getAsyncRequestFactory() {
Assert.state(asyncRequestFactory != null, "No AsyncClientHttpRequestFactory set");
Assert.state(this.asyncRequestFactory != null, "No AsyncClientHttpRequestFactory set");
return this.asyncRequestFactory;
}

4
spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriter.java

@ -150,7 +150,7 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport @@ -150,7 +150,7 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport
* @since 5.0.7
*/
public List<HttpMessageWriter<?>> getPartWriters() {
return Collections.unmodifiableList(partWriters);
return Collections.unmodifiableList(this.partWriters);
}
/**
@ -398,7 +398,7 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport @@ -398,7 +398,7 @@ public class MultipartHttpMessageWriter extends LoggingCodecSupport
private DataBuffer generateHeaders() {
DataBuffer buffer = this.bufferFactory.allocateBuffer();
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
for (Map.Entry<String, List<String>> entry : this.headers.entrySet()) {
byte[] headerName = entry.getKey().getBytes(this.charset);
for (String headerValueString : entry.getValue()) {
byte[] headerValue = headerValueString.getBytes(this.charset);

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

Loading…
Cancel
Save