-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
ConditionalOnClass not working for Bean methods on Java 8 #27846
Comments
The javadoc for |
Thanks for the link to the other issue @mbhave. I didn't find that one. I've read the Javadoc and I thought that it is more linked towards the return type being available when the class is loaded. However, in this case the return type is available. The class can be safely loaded. The problem is then the Spring Core The full cause is
Most likely there is not much you can do, perhaps the only thing would be to update the Javadoc to mention that |
Thanks for the suggestion. I think we should update the javadoc. |
The JavaDoc states
Should we reword it to
? |
Thanks for looking at this, @mhalbritter. I think we should probably go a bit further than that. The previous paragraph reads:
I think we should replace the "Note" with something that builds on that and states that |
Great, I will do this. We only need to do this for 2.6.x and 2.7.x, as 3.x has Java 17 as a baseline where this limitation no longer applies. |
When I have the following auto configuration
My application cannot start on Java 8 due to
On Java 11 this problem is not there. The return type is not the same as the one in
ConditionalOnClass
.This is clearly some kind of difference in the way annotations are loaded in Java 8 vs Java 11.
I am creating this here in case there is something that could be done in Spring Boot or Spring Core that would fix this behaviour between Java 8 and Java 11.
I have also created a minimal project that can be used to see this problem. The project is located here
The text was updated successfully, but these errors were encountered: