Commit Graph

972 Commits

Author SHA1 Message Date
Sebastien Deleuze
1f28825f9d Add more @Nullable parameters based on null usage
Issue: SPR-15540
2017-05-31 21:42:23 +02:00
Sebastien Deleuze
c3e6afb879 Improve null-safety to fix some Spring Boot warnings
Issue: SPR-15540
2017-05-31 17:14:49 +02:00
Sebastien Deleuze
b47d713e14 Add missing @Nullable annotations on parameters
Issue: SPR-15540
2017-05-31 16:56:08 +02:00
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
2017-05-27 08:57:01 +02:00
Juergen Hoeller
3cc94ae8b5 Consistently accept "taskExecutor" bean of type Executor (as stated in @EnableAsync's javadoc)
Issue: SPR-15566
2017-05-25 23:37:02 +02:00
Juergen Hoeller
cb3d1befcd LocalValidatorFactoryBean properly supports unwrap at ValidatorFactory level
Also documents limitation for Bean Validation 2.0's getClockProvider() method.

Issue: SPR-15561
Issue: SPR-13482
2017-05-18 21:00:56 +02:00
Juergen Hoeller
ba501791c9 Consistent use of WebFlux terminology over Web Reactive 2017-05-05 14:21:01 +02:00
Juergen Hoeller
1ea54eb2c6 GenericFilterBean lazily initializes its default environment
Alignment with HttpServletBean; consistent use of EnvironmentCapable.

Issue: SPR-15469
2017-04-27 21:38:30 +02:00
Juergen Hoeller
8b50f887db Caching annotations on interface methods with CGLIB proxies
Issue: SPR-15271
2017-04-26 18:16:47 +02:00
Juergen Hoeller
6c43d14a77 Async annotations on interface methods with CGLIB proxies
Issue: SPR-14949
2017-04-26 18:16:40 +02:00
Juergen Hoeller
91df0653fe Polishing 2017-04-17 15:05:34 +02:00
Juergen Hoeller
5d3249f692 Recommendation for consistent @Profile declarations on overloaded @Bean methods
Issue: SPR-15266
2017-04-17 14:52:06 +02:00
Juergen Hoeller
022aefdfe8 Explicit note about @Profile declarations on overloaded @Bean methods
Also marks @Conditional as @Documented, aligned with other annotations.

Issue: SPR-15266
2017-04-15 14:17:45 +02:00
Juergen Hoeller
9abf249cee Explicitly replace target ApplicationListener with singleton proxy, if any (avoiding double registration/invocation)
Issue: SPR-15452
2017-04-15 14:10:28 +02:00
Juergen Hoeller
0b118322b0 Polishing 2017-04-13 16:17:05 +02:00
Juergen Hoeller
1735ba22cb ShadowingClassLoader can be constructed without default excludes
Issue: SPR-15439
2017-04-12 15:34:50 +02:00
Juergen Hoeller
c4e0d6c2a2 UnknownHostException as resource-not-found for properties files
Plus first-class declaration of FileNotFoundException in Resource javadoc.

Issue: SPR-15433
2017-04-11 11:45:30 +02:00
Juergen Hoeller
15b5dd9f12 Polishing 2017-04-10 15:36:45 +02:00
Juergen Hoeller
67ea4b3a05 package-info for repackaged libraries (and other polishing) 2017-04-06 14:10:46 +02:00
Juergen Hoeller
917207b7ae Support for @Order on nested configuration classes
Issue: SPR-15384
2017-04-04 17:17:03 +02:00
Sam Brannen
51f23cb424 Polish JavaDoc for date-time and number format annotations 2017-04-03 16:48:05 +02:00
Sam Brannen
279c56a385 Fix typo in JavaDoc 2017-04-03 16:43:55 +02:00
Sam Brannen
7a01771a45 Polishing 2017-03-28 19:27:03 +02:00
QBNemo
26101892c1 Fix typo
Closes gh-1354
2017-03-27 10:11:50 +02:00
Grant Hutchins
e087db1ecb Fix typo
Closes gh-1364
2017-03-27 10:04:15 +02:00
Juergen Hoeller
e892e02f41 Polishing 2017-03-21 17:44:47 +01:00
Juergen Hoeller
fc2e635c05 Lookup methods work on configuration classes as well
Issue: SPR-15316
2017-03-07 13:51:43 +01:00
Juergen Hoeller
6d6cf01a42 Polishing 2017-02-28 13:13:23 +01:00
Juergen Hoeller
d4a1b59b4c Skip transaction/caching metadata retrieval for java.lang.Object methods
Also retrieves CacheConfig as merged annotation now, aligned with other caching annotations.

Issue: SPR-15296
2017-02-28 13:08:55 +01:00
Juergen Hoeller
7fb0ad37da ConfigurationClassEnhancer explicitly handles non-interceptable FactoryBeans
Issue: SPR-15275
2017-02-22 15:32:04 +01:00
Juergen Hoeller
370e3d683a Polishing 2017-02-20 23:00:12 +01:00
Stephane Nicoll
1c74a1a0fe Improve allowNullValue handling when a null value is provided
This commit improves `AbstractValueAdaptingCache` to throw a dedicated
exception if `allowNullValues` is `false` and a `null` value is provided
anyway. This avoid a lower-level exception from the cache library that
will miss some context.

Issue: SPR-15173
2017-02-20 16:08:08 +01:00
Juergen Hoeller
1ee0626c94 Polishing 2017-02-17 21:06:58 +01:00
Juergen Hoeller
8d707eb530 Polishing 2017-02-16 15:37:31 +01:00
Juergen Hoeller
599c1ba73e Polishing 2017-02-15 18:05:38 +01:00
Juergen Hoeller
54f01cffaf Drop weaving support for pre-Servlet-3.1 servers
Issue: SPR-14467
2017-02-15 18:03:49 +01:00
Juergen Hoeller
44ec6e0037 Polishing 2017-02-13 15:07:07 +01:00
Juergen Hoeller
e1bb697cf9 Correct explanation of example patterns
Issue: SPR-15240
2017-02-10 10:56:17 +01:00
Juergen Hoeller
448ea4cdfe Consistent logging in ignoreResourceNotFound scenarios
Issue: SPR-15218
2017-02-10 10:41:10 +01:00
Juergen Hoeller
5015613934 Enforce delegation through single overridable registerBean method
Issue: SPR-14832
2017-02-10 10:38:01 +01:00
Juergen Hoeller
1b2dc3638f Revisit Assert to avoid single-arg assert methods (with refined messages)
Issue: SPR-15196
2017-01-30 22:15:55 +01:00
Stephane Nicoll
d550eb152c Polish contribution
Closes gh-1307
2017-01-27 14:17:13 +01:00
Ruben Dijkstra
f1c7e0f5b2 Check for null on the argument instead of the message
See gh-1307
Issue: SPR-15196
2017-01-27 14:15:24 +01:00
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
2017-01-24 18:00:17 +01:00
Juergen Hoeller
7d3fcaa934 Consider abstract classes with @Lookup methods as candidate components
Issue: SPR-14550
2017-01-23 17:28:18 +01:00
Juergen Hoeller
6fe7e56598 Document further configuration class restrictions
Issue: SPR-14602
2017-01-23 13:39:11 +01:00
Juergen Hoeller
253060c21c Only expose ASM-driven method order if the methods match
Issue: SPR-14505
2017-01-23 13:37:22 +01:00
Juergen Hoeller
a9ae2c3402 Polishing 2017-01-23 12:42:01 +01:00
Juergen Hoeller
e566e25b6f Clear nonAnnotatedClasses cache in afterSingletonsInstantiated
Issue: SPR-15175
2017-01-23 12:29:38 +01:00
Alexey Nikolaenko
644b0b8beb Fix Javadoc for CronSequenceGenerator
Closes gh-1294
2017-01-20 17:26:49 +01:00