Skip to content

Commit 4b999cf

Browse files
committed
Clarify AbstractBeanDefinition.getBeanClass() return semantics
Closes gh-22960
1 parent ed3df72 commit 4b999cf

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
@@ -362,10 +362,13 @@ public void setBeanClass(Class<?> beanClass) {
362362
}
363363

364364
/**
365-
* Return the class of the wrapped bean, if already resolved.
366-
* @return the bean class, or {@code null} if none defined
365+
* Return the class of the wrapped bean (assuming it is resolved already).
366+
* @return the bean class (never {@code null})
367367
* @throws IllegalStateException if the bean definition does not define a bean class,
368-
* or a specified bean class name has not been resolved into an actual Class
368+
* or a specified bean class name has not been resolved into an actual Class yet
369+
* @see #hasBeanClass()
370+
* @see #setBeanClass(Class)
371+
* @see #resolveBeanClass(ClassLoader)
369372
*/
370373
public Class<?> getBeanClass() throws IllegalStateException {
371374
Object beanClassObject = this.beanClass;
@@ -381,6 +384,9 @@ public Class<?> getBeanClass() throws IllegalStateException {
381384

382385
/**
383386
* Return whether this definition specifies a bean class.
387+
* @see #getBeanClass()
388+
* @see #setBeanClass(Class)
389+
* @see #resolveBeanClass(ClassLoader)
384390
*/
385391
public boolean hasBeanClass() {
386392
return (this.beanClass instanceof Class);

0 commit comments

Comments
 (0)