-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Suppress deprecation warning for AOT-generated code that refers to a deprecated member #29597
Comments
What is the benefit of suppressing the deprecation automatically? I don't think we should be doing that for generated code. |
Well, the code is generated by the library, so there's no way for me to suppress it. That means we'd see the warning during compilation. I guess this would be an issue wherever the source code is used (e.g. code analysis tools maybe? if they look at the generated code as well) |
Yes, I understand that. I don't think your code analysis tool should be looking at generated code. In the absence of an actual problem, I am going to close this. I understand that the warning can be annoying but blindly (automatically) suppressing it is worse IMO. |
We discussed this today and we think that there would be some value in the generated code not producing any compilation warnings. The warnings aren't helpful as the user can't do anything to the generated code to fix them. We could configure Boot to compile the code with |
This is quite noticeable in Spring Boot 3.2 as almost every app with see at least these deprecation warnings when compiling the AOT-generated code:
|
WebMvcAutoConfiguration__BeanDefinitions
ClassThis commit is a prerequisite to help suppressing deprecating warnings by allowing tests to validate that the compiler does not encounter them. See spring-projectsgh-29597
This commit is a prerequisite to help suppressing deprecating warnings by allowing tests to validate that the compiler does not encounter them. See gh-29597
This commit is a best effort attempt at identifying the members that code generation invokes and might be deprecated. It introduces a CodeWarnings helper class that records warnings, with special handling for `@Deprecated`. See gh-29597
And probably other generated
BeanDefinitions
by AoT?Example:
The text was updated successfully, but these errors were encountered: