Skip to content

Commit f683f78

Browse files
committed
Revert deprecation of BDRU#registerWithGeneratedName
The overloading necessary to preserve the new signature as well as the old causes ambiguities leading to deprecation warnings in some caller scenarios.
1 parent 84a63b6 commit f683f78

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

org.springframework.beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,11 @@ public static void registerBeanDefinition(
166166
* for the given bean definition or the definition cannot be registered
167167
*/
168168
public static String registerWithGeneratedName(
169-
BeanDefinition definition, BeanDefinitionRegistry registry)
169+
AbstractBeanDefinition definition, BeanDefinitionRegistry registry)
170170
throws BeanDefinitionStoreException {
171171
String generatedName = generateBeanName(definition, registry, false);
172172
registry.registerBeanDefinition(generatedName, definition);
173173
return generatedName;
174174
}
175175

176-
/**
177-
* @deprecated since Spring 3.1 in favor of
178-
* {@link #registerWithGeneratedName(BeanDefinition, BeanDefinitionRegistry)}
179-
* and its more general signature.
180-
*/
181-
@Deprecated
182-
public static String registerWithGeneratedName(
183-
AbstractBeanDefinition definition, BeanDefinitionRegistry registry)
184-
throws BeanDefinitionStoreException {
185-
return registerWithGeneratedName((BeanDefinition)definition, registry);
186-
187-
}
188-
189176
}

org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private void doLoadBeanDefinitionForConfigurationClassIfNecessary(ConfigurationC
180180
String className = configClass.getMetadata().getClassName();
181181
configBeanDef.setBeanClassName(className);
182182
if (checkConfigurationClassCandidate(configBeanDef, this.metadataReaderFactory)) {
183-
String configBeanName = BeanDefinitionReaderUtils.registerWithGeneratedName(configBeanDef, this.registry);
183+
String configBeanName = BeanDefinitionReaderUtils.registerWithGeneratedName((AbstractBeanDefinition)configBeanDef, this.registry);
184184
configClass.setBeanName(configBeanName);
185185
if (logger.isDebugEnabled()) {
186186
logger.debug(String.format("Registered bean definition for imported @Configuration class %s", configBeanName));

0 commit comments

Comments
 (0)