Skip to content

Commit da06796

Browse files
committed
Clarify AbstractBeanDefinition.getBeanClass() return semantics
Closes gh-22960
1 parent 85188b8 commit da06796

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,13 @@ public void setBeanClass(@Nullable Class<?> beanClass) {
397397
}
398398

399399
/**
400-
* Return the class of the wrapped bean, if already resolved.
401-
* @return the bean class, or {@code null} if none defined
400+
* Return the class of the wrapped bean (assuming it is resolved already).
401+
* @return the bean class (never {@code null})
402402
* @throws IllegalStateException if the bean definition does not define a bean class,
403-
* or a specified bean class name has not been resolved into an actual Class
403+
* or a specified bean class name has not been resolved into an actual Class yet
404+
* @see #hasBeanClass()
405+
* @see #setBeanClass(Class)
406+
* @see #resolveBeanClass(ClassLoader)
404407
*/
405408
public Class<?> getBeanClass() throws IllegalStateException {
406409
Object beanClassObject = this.beanClass;
@@ -416,6 +419,9 @@ public Class<?> getBeanClass() throws IllegalStateException {
416419

417420
/**
418421
* Return whether this definition specifies a bean class.
422+
* @see #getBeanClass()
423+
* @see #setBeanClass(Class)
424+
* @see #resolveBeanClass(ClassLoader)
419425
*/
420426
public boolean hasBeanClass() {
421427
return (this.beanClass instanceof Class);

0 commit comments

Comments
 (0)