Skip to content

Add missing @Deprecated(forRemoval = true) for deleted in 7.0 #36591

@seregamorph

Description

@seregamorph

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:
⚠️ these are replaced with updated lists in the comments (as original lists had false positives)

This discussion started within PR addressing some of these #36562 but with @bclozel we agreed to close the PR and create a separate issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions