Juergen Hoeller
f813712f5b
Consistent use of @Nullable across the codebase (even for internals)
...
Beyond just formally declaring the current behavior, this revision actually enforces non-null behavior in selected signatures now, not tolerating null values anymore when not explicitly documented. It also changes some utility methods with historic null-in/null-out tolerance towards enforced non-null return values, making them a proper citizen in non-null assignments.
Some issues are left as to-do: in particular a thorough revision of spring-test, and a few tests with unclear failures (ignored as "TODO: NULLABLE") to be sorted out in a follow-up commit.
Issue: SPR-15540
8 years ago
Sebastien Deleuze
1f28825f9d
Add more @Nullable parameters based on null usage
...
Issue: SPR-15540
8 years ago
Sebastien Deleuze
c3e6afb879
Improve null-safety to fix some Spring Boot warnings
...
Issue: SPR-15540
8 years ago
Sebastien Deleuze
b47d713e14
Add missing @Nullable annotations on parameters
...
Issue: SPR-15540
8 years ago
Sebastien Deleuze
87598f48e4
Introduce null-safety of Spring Framework API
...
This commit introduces 2 new @Nullable and @NonNullApi
annotations that leverage JSR 305 (dormant but available via
Findbugs jsr305 dependency and already used by libraries
like OkHttp) meta-annotations to specify explicitly
null-safety of Spring Framework parameters and return values.
In order to avoid adding too much annotations, the
default is set at package level with @NonNullApi and
@Nullable annotations are added when needed at parameter or
return value level. These annotations are intended to be used
on Spring Framework itself but also by other Spring projects.
@Nullable annotations have been introduced based on Javadoc
and search of patterns like "return null;". It is expected that
nullability of Spring Framework API will be polished with
complementary commits.
In practice, this will make the whole Spring Framework API
null-safe for Kotlin projects (when KT-10942 will be fixed)
since Kotlin will be able to leverage these annotations to
know if a parameter or a return value is nullable or not. But
this is also useful for Java developers as well since IntelliJ
IDEA, for example, also understands these annotations to
generate warnings when unsafe nullable usages are detected.
Issue: SPR-15540
8 years ago
Juergen Hoeller
f985f71daf
Polishing
8 years ago
Juergen Hoeller
652266bcc2
Polishing
8 years ago
Juergen Hoeller
27057889f8
Polishing
8 years ago
Juergen Hoeller
d74542ed21
Honor @Autowired(required=false) at parameter level
...
Includes a revision of the AutowireCandidateResolver SPI with default methods.
Issue: SPR-15268
8 years ago
Stephane Nicoll
1b9e12f52f
Polish "Use Java 8 forEach method on Map"
...
Closes gh-1404
8 years ago
Jon Borenstein
13dc0cd828
Use Java 8 forEach method on Map
8 years ago
Juergen Hoeller
c668d9a473
Polishing
8 years ago
Juergen Hoeller
a95843a068
Dependency tracking for Supplier-created beans
...
Issue: SPR-15417
8 years ago
Sebastien Deleuze
e2fd398bad
Specify explicitly Kotlin extensions return type
...
The main purpose is to specify nullability.
8 years ago
Sam Brannen
7a01771a45
Polishing
8 years ago
Sebastien Deleuze
9963c4a495
Fix Kotlin warnings
8 years ago
Juergen Hoeller
6556b40c2b
Upgrade to SnakeYAML 1.18 (with updated duplicate key tests)
...
Includes updates to Caffeine 2.4, Jetty 9.4.2, Undertow 1.4.11, RxJava 1.2.7 and Groovy 2.4.9.
8 years ago
stonio
7d062df992
Use String#isEmpty()
...
Closes gh-1335
8 years ago
Juergen Hoeller
0da8dee289
Polishing
8 years ago
Juergen Hoeller
8d707eb530
Polishing
8 years ago
Juergen Hoeller
9543384d9e
Avoid deprecated comparators in tests
...
Issue: SPR-14779
8 years ago
Kazuki Miyahara
e95391765c
Fix typo in Javadoc
8 years ago
Stephane Nicoll
d4dd8baed5
Update copyright header
...
Closes gh-1327
8 years ago
hengyunabc
2723bd092c
Fix typo
...
See gh-1327
8 years ago
Juergen Hoeller
65d8d698cd
Test for ObjectFactory injection at constructor level
...
Issue: SPR-15222
8 years ago
Juergen Hoeller
1b2dc3638f
Revisit Assert to avoid single-arg assert methods (with refined messages)
...
Issue: SPR-15196
8 years ago
Juergen Hoeller
4a57d4512e
Reset cached ResolvableType on increaseNestingLevel/setContainingClass
...
Issue: SPR-15160
8 years ago
Juergen Hoeller
5e946c2700
Consistent type variable resolution for arrays/collections (in particular at field level)
...
Dropping GenericCollectionTypeResolver in favor of direct ResolvableType usage.
Issue: SPR-15160
8 years ago
Juergen Hoeller
ed40b1c8ee
Remove outdated abstractions/delegates from core/util
...
Issue: SPR-15159
8 years ago
Juergen Hoeller
ac6aa53031
Drop outdated BeanFactoryLocator / beanRefContext.xml mechanism
...
Issue: SPR-15154
8 years ago
Juergen Hoeller
46fc7fba8f
Polishing
8 years ago
Juergen Hoeller
32fc855dd1
Introspect FactoryBean class declaration if no early instantiation possible
...
Issue: SPR-15125
8 years ago
Juergen Hoeller
1cb381e9a7
Consistent deprecation markers on JDK 9
8 years ago
Juergen Hoeller
8084da59a7
Map resolution for multiple beans applies to plain Map interface declaration only
...
Issue: SPR-15117
8 years ago
Juergen Hoeller
9e6aa0ff59
BeanDefinitionBuilder supports factory method on factory bean
...
Issue: SPR-15098
8 years ago
Sebastien Deleuze
0a988fd2b1
Remove object wrappers in Kotlin extensions
...
This commit also improve significantly Kotlin extensions
documentation.
Issue: SPR-15127
8 years ago
Sebastien Deleuze
4f1fe74912
Polish ListableBeanFactoryExtension
8 years ago
Sebastien Deleuze
f8461d856a
Support Gradle-style Kotlin bean API
...
val context = GenericApplicationContext {
registerBean<Foo>()
registerBean { Bar(it.getBean<Foo>()) }
}
Issue: SPR-15126
8 years ago
Juergen Hoeller
e8a082fbe1
Clarified setAutowireCandidate semantics (plus attribute reordering in BeanDefinition)
...
Issue: SPR-15072
8 years ago
Juergen Hoeller
fc629bb508
Polishing
8 years ago
Juergen Hoeller
edc62be231
@Scheduled reliably applies after other post-processors and shuts down before TaskScheduler
...
Issue: SPR-14692
Issue: SPR-15067
8 years ago
Juergen Hoeller
209e7a700d
Avoid FactoryBean initialization on isSingleton check for decorated bean definition
...
Issue: SPR-14892
Issue: SPR-15042
8 years ago
Sebastien Deleuze
6a850ee688
Polishing
8 years ago
Juergen Hoeller
64d6561cbb
AbstractNestablePropertyAccessor's setPropertyValue refactored into several delegate methods
...
Issue: SPR-15053
8 years ago
Sebastien Deleuze
ff675f5226
Add Kotlin extensions for bean registration and retrieval
...
Issue: SPR-15048
8 years ago
Juergen Hoeller
f805427629
Detect generic type match behind interface-based proxy as well
...
Issue: SPR-14097
8 years ago
Juergen Hoeller
fd41f63ec0
Clarify programmatic contract (no annotation-driven injection)
...
Issue: SPR-8704
8 years ago
Juergen Hoeller
d3f97e3092
ObjectProvider offers getIfAvailable/getIfUnique variants with default supplier
...
Issue: SPR-14980
8 years ago
Juergen Hoeller
e788b8467d
GenericApplicationContext offers Supplier-based registration with BeanDefinitionCustomizer callback
...
Issue: SPR-14832
8 years ago
Juergen Hoeller
154ef8bf10
Polishing
8 years ago