Remove or use unused method parameters

This commit is contained in:
igor-suhorukov
2018-01-27 15:13:04 +03:00
committed by Andy Wilkinson
parent c1c0385dbc
commit 717bd2c580
21 changed files with 37 additions and 52 deletions

View File

@@ -372,7 +372,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
private void postProcessField(Object bean, Field field) {
RegisteredField registered = this.fieldRegistry.get(field);
if (registered != null && StringUtils.hasLength(registered.getBeanName())) {
inject(field, bean, registered.getBeanName(), registered.getDefinition());
inject(field, bean, registered.getBeanName());
}
}
@@ -380,11 +380,10 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
String beanName = this.beanNameRegistry.get(definition);
Assert.state(StringUtils.hasLength(beanName),
() -> "No bean found for definition " + definition);
inject(field, target, beanName, definition);
inject(field, target, beanName);
}
private void inject(Field field, Object target, String beanName,
Definition definition) {
private void inject(Field field, Object target, String beanName) {
try {
field.setAccessible(true);
Assert.state(ReflectionUtils.getField(field, target) == null,

View File

@@ -65,12 +65,11 @@ class WebTestClientContextCustomizer implements ContextCustomizer {
private void registerWebTestClient(ConfigurableApplicationContext context) {
ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
if (beanFactory instanceof BeanDefinitionRegistry) {
registerWebTestClient(context, (BeanDefinitionRegistry) context);
registerWebTestClient((BeanDefinitionRegistry) context);
}
}
private void registerWebTestClient(ConfigurableApplicationContext context,
BeanDefinitionRegistry registry) {
private void registerWebTestClient(BeanDefinitionRegistry registry) {
RootBeanDefinition definition = new RootBeanDefinition(
WebTestClientRegistrar.class);
definition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);