Skip to content

Commit b1b7202

Browse files
committed
Allow @⁠Configuration classes to be abstract again
This commit addresses a regression introduced in 6.2.4 in conjunction with spring-projects#34486. See spring-projectsgh-34486 Closes spring-projectsgh-34663
1 parent 551f6c0 commit b1b7202

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ else if (bd instanceof AbstractBeanDefinition abstractBeanDef && abstractBeanDef
180180
}
181181

182182
// Downgrade to lite (no enhancement) in case of no instance-level @Bean methods.
183-
if (!configClass.hasNonStaticBeanMethods() && ConfigurationClassUtils.CONFIGURATION_CLASS_FULL.equals(
184-
bd.getAttribute(ConfigurationClassUtils.CONFIGURATION_CLASS_ATTRIBUTE))) {
183+
if (!configClass.getMetadata().isAbstract() && !configClass.hasNonStaticBeanMethods() &&
184+
ConfigurationClassUtils.CONFIGURATION_CLASS_FULL.equals(
185+
bd.getAttribute(ConfigurationClassUtils.CONFIGURATION_CLASS_ATTRIBUTE))) {
185186
bd.setAttribute(ConfigurationClassUtils.CONFIGURATION_CLASS_ATTRIBUTE,
186187
ConfigurationClassUtils.CONFIGURATION_CLASS_LITE);
187188
}

0 commit comments

Comments
 (0)