Skip to content

Introduce null-safety of Spring Framework API [SPR-15540] #20099

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-15540 and commented

The proposal brought by this issue is to make nullability of return values and parameters of Spring Framework API explicit via annotations, and leverage this information in Kotlin user Spring projects.

More details can be found in these 2 Square blog posts Rolling out @Nullable and Non-null is the default.

If at some points @ParametersAreNonnullByDefault is supported at package level, it seems it could be possible to add @Nullable annotation only on nullable parameter and return values without bloating our code source with non-nullability annotations.

Notice that the com.google.code.findbugs:jsr305 dependency used is applied with a provided scope which seems to be enough to make it taken in account by Kotlin (without that Kotlin consider Java nullability as unknown). We need to check this would not create some classloader related issues.


Reference URL: https://youtrack.jetbrains.com/issue/KT-10942

Issue Links:

6 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions