|
|
|
@ -444,9 +444,9 @@ through Java 8's `java.util.Optional`, as the following example shows: |
|
|
|
} |
|
|
|
} |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
You can also use a `@Nullable` annotation (of any kind in any package -- for example, |
|
|
|
You can also use a parameter-level `@Nullable` annotation (of any kind in any package -- |
|
|
|
`javax.annotation.Nullable` from JSR-305) or just leverage Kotlin built-in null-safety |
|
|
|
for example, `javax.annotation.Nullable` from JSR-305) or just leverage Kotlin built-in |
|
|
|
support: |
|
|
|
null-safety support: |
|
|
|
|
|
|
|
|
|
|
|
[tabs] |
|
|
|
[tabs] |
|
|
|
====== |
|
|
|
====== |
|
|
|
@ -477,6 +477,13 @@ Kotlin:: |
|
|
|
---- |
|
|
|
---- |
|
|
|
====== |
|
|
|
====== |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NOTE] |
|
|
|
|
|
|
|
==== |
|
|
|
|
|
|
|
A type-level `@Nullable` annotation such as from JSpecify is not supported in Spring |
|
|
|
|
|
|
|
Framework 6.2 yet. You need to upgrade to Spring Framework 7.0 where the framework |
|
|
|
|
|
|
|
detects type-level annotations and consistently declares JSpecify in its own codebase. |
|
|
|
|
|
|
|
==== |
|
|
|
|
|
|
|
|
|
|
|
You can also use `@Autowired` for interfaces that are well-known resolvable |
|
|
|
You can also use `@Autowired` for interfaces that are well-known resolvable |
|
|
|
dependencies: `BeanFactory`, `ApplicationContext`, `Environment`, `ResourceLoader`, |
|
|
|
dependencies: `BeanFactory`, `ApplicationContext`, `Environment`, `ResourceLoader`, |
|
|
|
`ApplicationEventPublisher`, and `MessageSource`. These interfaces and their extended |
|
|
|
`ApplicationEventPublisher`, and `MessageSource`. These interfaces and their extended |
|
|
|
|