Skip to content

Commit b24a337

Browse files
committed
Polishing
1 parent 9138a04 commit b24a337

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ else if (mbd.isPrototype()) {
349349

350350
else {
351351
String scopeName = mbd.getScope();
352+
if (!StringUtils.hasLength(scopeName)) {
353+
throw new IllegalStateException("No scope name defined for bean ´" + beanName + "'");
354+
}
352355
Scope scope = this.scopes.get(scopeName);
353356
if (scope == null) {
354357
throw new IllegalStateException("No Scope registered for scope name '" + scopeName + "'");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,12 @@ private String[] doGetBeanNamesForType(ResolvableType type, boolean includeNonSi
555555
LogMessage.format("Ignoring bean class loading failure for bean '%s'", beanName) :
556556
LogMessage.format("Ignoring unresolvable metadata in bean definition '%s'", beanName));
557557
logger.trace(message, ex);
558+
// Register exception, in case the bean was accidentally unresolvable.
558559
onSuppressedException(ex);
559560
}
560561
}
561562
}
562563

563-
564564
// Check manually registered singletons too.
565565
for (String beanName : this.manualSingletonNames) {
566566
try {

0 commit comments

Comments
 (0)