diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryAuthorizationException.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryAuthorizationException.java index 099df54178..010e576711 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryAuthorizationException.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryAuthorizationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class CloudFoundryAuthorizationException extends RuntimeException { public CloudFoundryAuthorizationException(Reason reason, String message, Throwable cause) { - super(message); + super(message, cause); this.reason = reason; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointAutoConfiguration.java index 622ce38fd2..6c14809f29 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointAutoConfiguration.java @@ -77,8 +77,7 @@ public class MappingsEndpointAutoConfiguration { static class SpringMvcConfiguration { @Bean - DispatcherServletsMappingDescriptionProvider dispatcherServletMappingDescriptionProvider( - ApplicationContext applicationContext) { + DispatcherServletsMappingDescriptionProvider dispatcherServletMappingDescriptionProvider() { return new DispatcherServletsMappingDescriptionProvider(); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index afc6b8356a..6ef084007f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -115,7 +115,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext for (Map.Entry entry : beans.entrySet()) { String beanName = entry.getKey(); Object bean = entry.getValue(); - String prefix = extractPrefix(context, beanFactoryMetaData, beanName, bean); + String prefix = extractPrefix(context, beanFactoryMetaData, beanName); beanDescriptors.put(beanName, new ConfigurationPropertiesBeanDescriptor( prefix, sanitize(prefix, safeSerialize(mapper, bean, prefix)))); } @@ -201,12 +201,10 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext * @param context the application context * @param beanFactoryMetaData the bean factory meta-data * @param beanName the bean name - * @param bean the bean * @return the prefix */ private String extractPrefix(ApplicationContext context, - ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName, - Object bean) { + ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName) { ConfigurationProperties annotation = context.findAnnotationOnBean(beanName, ConfigurationProperties.class); if (beanFactoryMetaData != null) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java index f962552043..8ce5291b81 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java @@ -53,7 +53,7 @@ class RequestPredicateFactory { public WebOperationRequestPredicate getRequestPredicate(String endpointId, String rootPath, DiscoveredOperationMethod operationMethod) { Method method = operationMethod.getMethod(); - String path = getPath(endpointId, rootPath, method); + String path = getPath(rootPath, method); WebEndpointHttpMethod httpMethod = determineHttpMethod( operationMethod.getOperationType()); Collection consumes = getConsumes(httpMethod, method); @@ -61,7 +61,7 @@ class RequestPredicateFactory { return new WebOperationRequestPredicate(path, httpMethod, consumes, produces); } - private String getPath(String endpointId, String rootPath, Method method) { + private String getPath(String rootPath, Method method) { return rootPath + Stream.of(method.getParameters()).filter(this::hasSelector) .map(this::slashName).collect(Collectors.joining()); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java index c85ad8d481..528bfe288f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java @@ -136,7 +136,7 @@ public class SpringIntegrationMetrics implements MeterBinder, SmartInitializingS private void registerGauge(MeterRegistry registry, T object, Iterable tags, String name, String description, ToDoubleFunction value) { Gauge.Builder builder = Gauge.builder(name, object, value); - builder.tags(this.tags).description(description).register(registry); + builder.tags(tags).description(description).register(registry); } private void registerTimedGauge(MeterRegistry registry, T object, diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java index f958006b52..7d71193e86 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -62,7 +62,7 @@ public class DataSourcePoolMetrics implements MeterBinder { Assert.notNull(dataSource, "DataSource must not be null"); Assert.notNull(metadataProvider, "MetadataProvider must not be null"); this.dataSource = dataSource; - this.metadataProvider = new CachingDataSourcePoolMetadataProvider(dataSource, + this.metadataProvider = new CachingDataSourcePoolMetadataProvider( metadataProvider); this.name = name; this.tags = tags; @@ -97,7 +97,7 @@ public class DataSourcePoolMetrics implements MeterBinder { private final DataSourcePoolMetadataProvider metadataProvider; - CachingDataSourcePoolMetadataProvider(DataSource dataSource, + CachingDataSourcePoolMetadataProvider( DataSourcePoolMetadataProvider metadataProvider) { this.metadataProvider = metadataProvider; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java index f29ad405e7..a794c2e400 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java @@ -167,7 +167,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { String factoryName = BeanFactory.FACTORY_BEAN_PREFIX + name; if (this.beanFactory.isFactoryBean(factoryName)) { Class factoryBeanGeneric = getFactoryBeanGeneric(this.beanFactory, - beanDefinition, name); + beanDefinition); this.beanTypes.put(name, factoryBeanGeneric); this.beanTypes.put(factoryName, this.beanFactory.getType(factoryName)); @@ -216,13 +216,12 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { * generics in its method signature. * @param beanFactory the source bean factory * @param definition the bean definition - * @param name the name of the bean * @return the generic type of the {@link FactoryBean} or {@code null} */ private Class getFactoryBeanGeneric(ConfigurableListableBeanFactory beanFactory, - BeanDefinition definition, String name) { + BeanDefinition definition) { try { - return doGetFactoryBeanGeneric(beanFactory, definition, name); + return doGetFactoryBeanGeneric(beanFactory, definition); } catch (Exception ex) { return null; @@ -230,21 +229,21 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { } private Class doGetFactoryBeanGeneric(ConfigurableListableBeanFactory beanFactory, - BeanDefinition definition, String name) + BeanDefinition definition) throws Exception, ClassNotFoundException, LinkageError { if (StringUtils.hasLength(definition.getFactoryBeanName()) && StringUtils.hasLength(definition.getFactoryMethodName())) { - return getConfigurationClassFactoryBeanGeneric(beanFactory, definition, name); + return getConfigurationClassFactoryBeanGeneric(beanFactory, definition); } if (StringUtils.hasLength(definition.getBeanClassName())) { - return getDirectFactoryBeanGeneric(beanFactory, definition, name); + return getDirectFactoryBeanGeneric(beanFactory, definition); } return null; } private Class getConfigurationClassFactoryBeanGeneric( - ConfigurableListableBeanFactory beanFactory, BeanDefinition definition, - String name) throws Exception { + ConfigurableListableBeanFactory beanFactory, BeanDefinition definition) + throws Exception { Method method = getFactoryMethod(beanFactory, definition); Class generic = ResolvableType.forMethodReturnType(method) .as(FactoryBean.class).resolveGeneric(); @@ -305,8 +304,8 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { } private Class getDirectFactoryBeanGeneric( - ConfigurableListableBeanFactory beanFactory, BeanDefinition definition, - String name) throws ClassNotFoundException, LinkageError { + ConfigurableListableBeanFactory beanFactory, BeanDefinition definition) + throws ClassNotFoundException, LinkageError { Class factoryBeanClass = ClassUtils.forName(definition.getBeanClassName(), beanFactory.getBeanClassLoader()); Class generic = ResolvableType.forClass(factoryBeanClass).as(FactoryBean.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/AbstractSessionCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/AbstractSessionCondition.java index e8ba662cb2..a23c1c7508 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/AbstractSessionCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/AbstractSessionCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java index 6d473e14d9..4c7a5e2335 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java @@ -106,8 +106,7 @@ public class SessionAutoConfiguration { */ abstract static class SessionConfigurationImportSelector implements ImportSelector { - protected final String[] selectImports(AnnotationMetadata importingClassMetadata, - WebApplicationType webApplicationType) { + protected final String[] selectImports(WebApplicationType webApplicationType) { List imports = new ArrayList<>(); StoreType[] types = StoreType.values(); for (int i = 0; i < types.length; i++) { @@ -128,8 +127,7 @@ public class SessionAutoConfiguration { @Override public String[] selectImports(AnnotationMetadata importingClassMetadata) { - return super.selectImports(importingClassMetadata, - WebApplicationType.REACTIVE); + return super.selectImports(WebApplicationType.REACTIVE); } } @@ -143,8 +141,7 @@ public class SessionAutoConfiguration { @Override public String[] selectImports(AnnotationMetadata importingClassMetadata) { - return super.selectImports(importingClassMetadata, - WebApplicationType.SERVLET); + return super.selectImports(WebApplicationType.SERVLET); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionStoreMappings.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionStoreMappings.java index a6c93be19e..d9565b564c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionStoreMappings.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionStoreMappings.java @@ -86,7 +86,8 @@ final class SessionStoreMappings { .entrySet()) { for (Map.Entry> entry : storeEntry.getValue() .entrySet()) { - if (entry.getValue().getName().equals(configurationClassName)) { + if (entry.getKey() == webApplicationType + && entry.getValue().getName().equals(configurationClassName)) { return storeEntry.getKey(); } } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java index 782edec4d3..4f2c4accc8 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java @@ -183,7 +183,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader { Set urls = new HashSet<>(); findGroovyJarsDirectly(parent, urls); if (urls.isEmpty()) { - findGroovyJarsFromClassPath(parent, urls); + findGroovyJarsFromClassPath(urls); } Assert.state(!urls.isEmpty(), "Unable to find groovy JAR"); return new ArrayList<>(urls).toArray(new URL[urls.size()]); @@ -202,7 +202,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader { } } - private void findGroovyJarsFromClassPath(ClassLoader parent, Set urls) { + private void findGroovyJarsFromClassPath(Set urls) { String classpath = System.getProperty("java.class.path"); String[] entries = classpath.split(System.getProperty("path.separator")); for (String entry : entries) { diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java index a2aa200b8b..3b1092ce14 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java @@ -280,8 +280,7 @@ public class GroovyCompiler { public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { - ImportCustomizer importCustomizer = new SmartImportCustomizer(source, context, - classNode); + ImportCustomizer importCustomizer = new SmartImportCustomizer(source); ClassNode mainClassNode = MainClass.get(source.getAST().getClasses()); // Additional auto configuration diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/SmartImportCustomizer.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/SmartImportCustomizer.java index 0261670149..a429594990 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/SmartImportCustomizer.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/SmartImportCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -17,8 +17,6 @@ package org.springframework.boot.cli.compiler; import org.codehaus.groovy.ast.ClassHelper; -import org.codehaus.groovy.ast.ClassNode; -import org.codehaus.groovy.classgen.GeneratorContext; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.control.customizers.ImportCustomizer; @@ -33,8 +31,7 @@ class SmartImportCustomizer extends ImportCustomizer { private SourceUnit source; - SmartImportCustomizer(SourceUnit source, GeneratorContext context, - ClassNode classNode) { + SmartImportCustomizer(SourceUnit source) { this.source = source; } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java index cc83da8637..be0bb5163e 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -80,11 +80,10 @@ public class SpringBootCompilerAutoConfiguration extends CompilerAutoConfigurati public void applyToMainClass(GroovyClassLoader loader, GroovyCompilerConfiguration configuration, GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) throws CompilationFailedException { - addEnableAutoConfigurationAnnotation(source, classNode); + addEnableAutoConfigurationAnnotation(classNode); } - private void addEnableAutoConfigurationAnnotation(SourceUnit source, - ClassNode classNode) { + private void addEnableAutoConfigurationAnnotation(ClassNode classNode) { if (!hasEnableAutoConfigureAnnotation(classNode)) { AnnotationNode annotationNode = new AnnotationNode( ClassHelper.make("EnableAutoConfiguration")); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java index 4b0c257a72..0188426f8d 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java @@ -80,7 +80,7 @@ class Connection { public void run() throws Exception { if (this.header.contains("Upgrade: websocket") && this.header.contains("Sec-WebSocket-Version: 13")) { - runWebSocket(this.header); + runWebSocket(); } if (this.header.contains("GET /livereload.js")) { this.outputStream.writeHttp(getClass().getResourceAsStream("livereload.js"), @@ -88,7 +88,7 @@ class Connection { } } - private void runWebSocket(String header) throws Exception { + private void runWebSocket() throws Exception { String accept = getWebsocketAcceptResponse(); this.outputStream.writeHeaders("HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade", diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java index eff020d331..d5e2ce5842 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -178,15 +178,20 @@ public class JsonTestersAutoConfiguration { } private void processField(Object bean, Field field) { - if (AbstractJsonMarshalTester.class.isAssignableFrom(field.getType()) - || BasicJsonTester.class.isAssignableFrom(field.getType())) { - ResolvableType type = ResolvableType.forField(field).getGeneric(); - ReflectionUtils.makeAccessible(field); - Object tester = ReflectionUtils.getField(field, bean); - if (tester != null) { - ReflectionTestUtils.invokeMethod(tester, "initialize", - bean.getClass(), type); - } + if (AbstractJsonMarshalTester.class.isAssignableFrom(field.getType())) { + initializeTester(bean, field, bean.getClass(), + ResolvableType.forField(field).getGeneric()); + } + else if (BasicJsonTester.class.isAssignableFrom(field.getType())) { + initializeTester(bean, field, bean.getClass()); + } + } + + private void initializeTester(Object bean, Field field, Object... args) { + ReflectionUtils.makeAccessible(field); + Object tester = ReflectionUtils.getField(field, bean); + if (tester != null) { + ReflectionTestUtils.invokeMethod(tester, "initialize", args); } } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java index 4909f174ad..187d834a07 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -20,7 +20,6 @@ import java.io.File; import java.io.InputStream; import java.nio.charset.Charset; -import org.springframework.core.ResolvableType; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -80,10 +79,9 @@ public class BasicJsonTester { * UTF-8. * @param resourceLoadClass the source class used when loading relative classpath * resources - * @param type the type under test */ - protected final void initialize(Class resourceLoadClass, ResolvableType type) { - this.initialize(resourceLoadClass, null, type); + protected final void initialize(Class resourceLoadClass) { + this.initialize(resourceLoadClass, null); } /** @@ -91,11 +89,9 @@ public class BasicJsonTester { * @param resourceLoadClass the source class used when loading relative classpath * resources * @param charset the charset used when loading relative classpath resources - * @param type the type under test * @since 1.4.1 */ - protected final void initialize(Class resourceLoadClass, Charset charset, - ResolvableType type) { + protected final void initialize(Class resourceLoadClass, Charset charset) { if (this.loader == null) { this.loader = new JsonLoader(resourceLoadClass, charset); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java index a84186e7a6..73d7744978 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -97,7 +97,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda private Map beanNameRegistry = new HashMap<>(); - private Map fieldRegistry = new HashMap<>(); + private Map fieldRegistry = new HashMap<>(); private Map spies = new HashMap<>(); @@ -194,7 +194,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda this.mockitoBeans.add(mock); this.beanNameRegistry.put(definition, beanName); if (field != null) { - this.fieldRegistry.put(field, new RegisteredField(definition, beanName)); + this.fieldRegistry.put(field, beanName); } } @@ -347,7 +347,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda this.spies.put(beanName, definition); this.beanNameRegistry.put(definition, beanName); if (field != null) { - this.fieldRegistry.put(field, new RegisteredField(definition, beanName)); + this.fieldRegistry.put(field, beanName); } } @@ -370,9 +370,9 @@ 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()); + String beanName = this.fieldRegistry.get(field); + if (StringUtils.hasText(beanName)) { + inject(field, bean, beanName); } } @@ -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, @@ -512,28 +511,4 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda } - /** - * A registered field item. - */ - private static class RegisteredField { - - private final Definition definition; - - private final String beanName; - - RegisteredField(Definition definition, String beanName) { - this.definition = definition; - this.beanName = beanName; - } - - public Definition getDefinition() { - return this.definition; - } - - public String getBeanName() { - return this.beanName; - } - - } - } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplateTestContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplateTestContextCustomizer.java index 205029345a..7ba5742537 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplateTestContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplateTestContextCustomizer.java @@ -62,12 +62,11 @@ class TestRestTemplateTestContextCustomizer implements ContextCustomizer { private void registerTestRestTemplate(ConfigurableApplicationContext context) { ConfigurableListableBeanFactory beanFactory = context.getBeanFactory(); if (beanFactory instanceof BeanDefinitionRegistry) { - registerTestRestTemplate(context, (BeanDefinitionRegistry) context); + registerTestRestTemplate((BeanDefinitionRegistry) context); } } - private void registerTestRestTemplate(ConfigurableApplicationContext context, - BeanDefinitionRegistry registry) { + private void registerTestRestTemplate(BeanDefinitionRegistry registry) { RootBeanDefinition definition = new RootBeanDefinition( TestRestTemplateRegistrar.class); definition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java index a7550cec26..0ebfeb5b20 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java @@ -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); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java index f583172a47..f402dff0c3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -99,12 +99,11 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable { public void visitFileHeader(CentralDirectoryFileHeader fileHeader, int dataOffset) { AsciiBytes name = applyFilter(fileHeader.getName()); if (name != null) { - add(name, fileHeader, dataOffset); + add(name, dataOffset); } } - private void add(AsciiBytes name, CentralDirectoryFileHeader fileHeader, - int dataOffset) { + private void add(AsciiBytes name, int dataOffset) { this.hashCodes[this.size] = name.hashCode(); this.centralDirectoryOffsets[this.size] = dataOffset; this.positions[this.size] = this.size; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index f09298c129..61b8d5dffb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -451,7 +451,7 @@ public class ConfigFileApplicationListener String loadProfile) { try { Resource resource = this.resourceLoader.getResource(location); - String description = getDescription(profile, location, resource); + String description = getDescription(location, resource); if (profile != null) { description = description + " for profile " + profile; } @@ -482,8 +482,7 @@ public class ConfigFileApplicationListener } } - private String getDescription(Profile profile, String location, - Resource resource) { + private String getDescription(String location, Resource resource) { try { if (resource != null) { String uri = resource.getURI().toASCIIString(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ArrayBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ArrayBinder.java index eeecc65a73..70dac91032 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ArrayBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ArrayBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -41,8 +41,7 @@ class ArrayBinder extends IndexedElementsBinder { IndexedCollectionSupplier collection = new IndexedCollectionSupplier( ArrayList::new); ResolvableType elementType = target.getType().getComponentType(); - bindIndexed(name, target, elementBinder, collection, target.getType(), - elementType); + bindIndexed(name, elementBinder, collection, target.getType(), elementType); if (collection.wasSupplied()) { List list = (List) collection.get(); Object array = Array.newInstance(elementType.resolve(), list.size()); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index fe9e2c50d8..625cfbdbc4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -246,7 +246,7 @@ public class Binder { } if (property != null) { try { - return bindProperty(name, target, handler, context, property); + return bindProperty(target, context, property); } catch (ConverterNotFoundException ex) { // We might still be able to bind it as a bean @@ -295,8 +295,8 @@ public class Binder { .filter(Objects::nonNull).findFirst().orElse(null); } - private Object bindProperty(ConfigurationPropertyName name, Bindable target, - BindHandler handler, Context context, ConfigurationProperty property) { + private Object bindProperty(Bindable target, Context context, + ConfigurationProperty property) { context.setConfigurationProperty(property); Object result = property.getValue(); result = this.placeholdersResolver.resolvePlaceholders(result); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java index 9e45f5c789..dd52f16201 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -45,7 +45,7 @@ class CollectionBinder extends IndexedElementsBinder> { ResolvableType elementType = target.getType().asCollection().getGeneric(); ResolvableType aggregateType = ResolvableType.forClassWithGenerics(List.class, target.getType().asCollection().getGenerics()); - bindIndexed(name, target, elementBinder, collection, aggregateType, elementType); + bindIndexed(name, elementBinder, collection, aggregateType, elementType); if (collection.wasSupplied()) { return collection.get(); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/IndexedElementsBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/IndexedElementsBinder.java index 2710493c03..8b56826658 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/IndexedElementsBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/IndexedElementsBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -53,7 +53,7 @@ abstract class IndexedElementsBinder extends AggregateBinder { return source == null || source instanceof IterableConfigurationPropertySource; } - protected final void bindIndexed(ConfigurationPropertyName name, Bindable target, + protected final void bindIndexed(ConfigurationPropertyName name, AggregateElementBinder elementBinder, IndexedCollectionSupplier collection, ResolvableType aggregateType, ResolvableType elementType) { for (ConfigurationPropertySource source : getContext().getSources()) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java index 2faaf570bf..efdd118608 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -49,11 +49,10 @@ class SpringIterableConfigurationPropertySource extends SpringConfigurationPrope SpringIterableConfigurationPropertySource(EnumerablePropertySource propertySource, PropertyMapper mapper) { super(propertySource, mapper, null); - assertEnumerablePropertySource(propertySource); + assertEnumerablePropertySource(); } - private void assertEnumerablePropertySource( - EnumerablePropertySource propertySource) { + private void assertEnumerablePropertySource() { if (getPropertySource() instanceof MapPropertySource) { try { ((MapPropertySource) getPropertySource()).getSource().size(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatErrorPage.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatErrorPage.java index 93d25fb2a0..3f74389dc4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatErrorPage.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatErrorPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -48,10 +48,10 @@ class TomcatErrorPage { this.location = errorPage.getPath(); this.exceptionType = errorPage.getExceptionName(); this.errorCode = errorPage.getStatusCode(); - this.nativePage = createNativePage(errorPage); + this.nativePage = createNativePage(); } - private Object createNativePage(ErrorPage errorPage) { + private Object createNativePage() { try { if (ClassUtils.isPresent(ERROR_PAGE_CLASS, null)) { return BeanUtils diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java index 93106b8f7e..dc272d6a5e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java @@ -190,7 +190,7 @@ public class TomcatWebServer implements WebServer { addPreviouslyRemovedConnectors(); Connector connector = this.tomcat.getConnector(); if (connector != null && this.autoStart) { - startConnector(connector); + startConnector(); } checkThatConnectorsHaveStarted(); this.started = true; @@ -264,7 +264,7 @@ public class TomcatWebServer implements WebServer { } } - private void startConnector(Connector connector) { + private void startConnector() { try { for (Container child : this.tomcat.getHost().findChildren()) { if (child instanceof TomcatEmbeddedContext) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/SslBuilderCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/SslBuilderCustomizer.java index 218b97c026..3aaa311f45 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/SslBuilderCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/SslBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -72,8 +72,7 @@ class SslBuilderCustomizer implements UndertowBuilderCustomizer { SSLContext sslContext = SSLContext.getInstance(this.ssl.getProtocol()); sslContext.init(getKeyManagers(this.ssl, this.sslStoreProvider), getTrustManagers(this.ssl, this.sslStoreProvider), null); - builder.addHttpsListener(this.port, getListenAddress(this.address), - sslContext); + builder.addHttpsListener(this.port, getListenAddress(), sslContext); builder.setSocketOption(Options.SSL_CLIENT_AUTH_MODE, getSslClientAuthMode(this.ssl)); if (this.ssl.getEnabledProtocols() != null) { @@ -93,7 +92,7 @@ class SslBuilderCustomizer implements UndertowBuilderCustomizer { } } - private String getListenAddress(InetAddress address) { + private String getListenAddress() { if (this.address == null) { return "0.0.0.0"; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java index fac24430c1..4eb37be3e0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -48,8 +48,7 @@ abstract class ServletComponentHandler { return this.typeFilter; } - protected String[] extractUrlPatterns(String attribute, - Map attributes) { + protected String[] extractUrlPatterns(Map attributes) { String[] value = (String[]) attributes.get("value"); String[] urlPatterns = (String[]) attributes.get("urlPatterns"); if (urlPatterns.length > 0) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java index e8ed855ce7..ccdfac65bc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -53,8 +53,7 @@ class WebFilterHandler extends ServletComponentHandler { String name = determineName(attributes, beanDefinition); builder.addPropertyValue("name", name); builder.addPropertyValue("servletNames", attributes.get("servletNames")); - builder.addPropertyValue("urlPatterns", - extractUrlPatterns("urlPatterns", attributes)); + builder.addPropertyValue("urlPatterns", extractUrlPatterns(attributes)); registry.registerBeanDefinition(name, builder.getBeanDefinition()); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java index edad3ffb7f..f50f0b8e20 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-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. @@ -51,8 +51,7 @@ class WebServletHandler extends ServletComponentHandler { String name = determineName(attributes, beanDefinition); builder.addPropertyValue("name", name); builder.addPropertyValue("servlet", beanDefinition); - builder.addPropertyValue("urlMappings", - extractUrlPatterns("urlPatterns", attributes)); + builder.addPropertyValue("urlMappings", extractUrlPatterns(attributes)); builder.addPropertyValue("multipartConfig", determineMultipartConfig(beanDefinition)); registry.registerBeanDefinition(name, builder.getBeanDefinition());