In ScheduledAnnotationBeanPostProcessor,I found this code. ` @Override public void afterSingletonsInstantiated() { // Remove resolved singleton classes from cache this.nonAnnotatedClasses.clear();

    if (this.applicationContext == null) {
        // Not running in an ApplicationContext -> register tasks early...
        finishRegistration();
    }
}`

I want to know how to understand this comment. Not running in an ApplicationContext -> register tasks early... In what scenario will this method be called?finishRegistration() Thanks!

Comment From: snicoll

@funnyx6 please review the guidelines for contributing that states we don't use the issue tracker for questions. You can see the change in https://github.com/spring-projects/spring-framework/issues/17242. It's about running with a raw BeanFactory or a regular ApplicationContext. The former gives you additional lifecycles that will make sure things are going to be registered by the event. If not, we register tasks directly.