-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Add missing @Deprecated(forRemoval = true) for deleted in 7.0 #36591
Description
There are a lot of classes/methods/constructors removed in 7.0 release. Many of these are missing @Deprecated(forRemoval=true) annotations (even just @Deprecated is missing) in the latest 6.2.17.
This may be critical as during migration you need to distinguish which deprecations are critical and which are not.
For a trivial microservice based on pure spring-boot this can be quite ok as it will simply lead to compilation failures highlighting all cases.
But for the huge codebases with hundreds of libraries this is quite challenging. For org.springframework.* libraries there is confidence (as we mostly take their versions from spring-boot-dependencies, others can be found on https://spring.io/projects/generations#mappings), but for own libraries based on spring as well as any third-party this can become an issue caught in the runtime.
E.g. within our organization we implemented arch-unit tests scanning project modules and all JAR dependencies on usages of classes/methods/constructors/fields marked as @Deprecated(forRemoval = true) to make the migration more safe.
The list of classes, methods, constructors and fields missing the proper annotation:
- missing-deprecated-forRemoval-classes.txt
- missing-deprecated-forRemoval-public-constructors.txt
- missing-deprecated-forRemoval-protected-constructors.txt
- missing-deprecated-forRemoval-methods-public.txt
- missing-deprecated-forRemoval-methods-protected.txt
- missing-deprecated-forRemoval-fields-public.txt
This discussion started within PR addressing some of these #36562 but with @bclozel we agreed to close the PR and create a separate issue.