Skip to content
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

Support null-safety at generics, varargs and array elements level [SPR-15942] #20496

Closed
spring-projects-issues opened this issue Sep 8, 2017 · 5 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 8, 2017

Sébastien Deleuze opened SPR-15942 and commented

As raised and discuss on KT-19592 Kotlin issue, null-safety of Spring API does not apply to generic type arguments. To do so, after KT-19592 being fixed we would have to use ElementType.TYPE_USE but its scope is too wide to make it usable for us at @TypeQualifierDefault level of @Nullable and @NonNullApi.

Another solution would be to add ElementType.TYPE_USE at @Target and annotate every generic type argument of Spring API, maybe that could be done via introducing a @NonNull annotation that would also be useful for #20311.


Issue Links:

Referenced from: commits 0e1be82, 1bc93e3

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

I have to postpone this improvement to a future release since there are flaws in current support that need to be fixed, see this detailed description for more info.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

See related discussion about Kotlin artifact with meta-annotations for Java types.

Juergen Hoeller I have added my feedback on their PR. My main concern is that current plan is to have a Kotlin centric meta-annotations library instead of a JVM one that could be use for more wide use cases, including pure Java projects.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Latest update on that topic: I have asked to JetBrains to not make the upcoming meta-annotation library Kotlin specific since the scope is wider (cf. our usage on Spring which is also useful for Java developers via IDE and static code analysis tools) and also asked if it could avoid to use enums for annotation attribute value in order to avoid compilation warnings like we have currently with When.MAYBE when using Spring null-safety annotations without JSR 305 in the classpath.

@liuHongJie1217

This comment has been minimized.

@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Jul 26, 2021
@sdeleuze
Copy link
Contributor

Will be covered as part of #28797.

@sdeleuze sdeleuze closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
@sdeleuze sdeleuze removed this from the 6.x Backlog milestone Jun 12, 2023
@sdeleuze sdeleuze added the status: duplicate A duplicate of another issue label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants