Polish instance check

- Remove possible call to expensive
  BeanFactory#toString.
- Backport #569
- Relates #573
This commit is contained in:
Janne Valkealahti
2018-07-11 09:01:28 +01:00
parent fd8db33c37
commit 4568f80730
2 changed files with 2 additions and 4 deletions

View File

@@ -128,8 +128,7 @@ public abstract class AbstractImportingAnnotationConfiguration<B extends Annotat
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
Assert.isInstanceOf(ListableBeanFactory.class, beanFactory,
"beanFactory be of type ListableBeanFactory but was " + beanFactory);
Assert.isInstanceOf(ListableBeanFactory.class, beanFactory);
this.beanFactory = beanFactory;
}

View File

@@ -109,8 +109,7 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
// in a same way further things will be skipped in afterPropertiesSet()
return;
}
Assert.state(beanFactory instanceof ListableBeanFactory,
"Bean factory must be instance of ListableBeanFactory, was " + beanFactory);
Assert.isInstanceOf(ListableBeanFactory.class, beanFactory);
this.beanFactory = (ListableBeanFactory)beanFactory;
}