-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail fast if a @Bean
method has a void return type
#31007
Comments
@Bean
method as a void return type@Bean
method has a void return type
Hi @snicoll - In @Configuration
@ConditionalOnClass(Mono.class)
static class ReactiveConfiguration {
@Bean
void enableAutomaticContextPropagation() {
Hooks.enableAutomaticContextPropagation();
}
} I couldn't see any other way to do this, since |
@jamesmoessis fyi, see this ReactorAutoConfiguration class in Spring Boot. |
Perfect! Thanks @ttddyy |
Thanks @ttddyy. @jamesmoessis I don't see really how that change blocks anything considering it was abusing |
Can you please attach an example.
Can you please suggest how I should refactor this? |
It is currently possible to craft the following faulty configuration:
As a result of processing this configuration class, "Hello" is displayed during the processing phase and a
NullBean
bean is contributed. We should reject this upfront.The text was updated successfully, but these errors were encountered: