Commit Graph

236 Commits

Author SHA1 Message Date
Juergen Hoeller 9962df6527 Polishing 2018-02-28 00:09:15 +01:00
igor-suhorukov 7bce04c06c Polish: combine catches block with same body 2018-02-27 12:51:28 +01:00
igor-suhorukov 49fd724d8f Polish: String function use should be optimized for single characters 2018-02-25 20:48:47 +01:00
Juergen Hoeller a5cbf5fe24 Consistent use of Collection.toArray with zero-sized array argument
Includes consistent use of ClassUtils.toClassArray (as non-null variant)

Issue: SPR-16523
2018-02-22 11:29:46 +01:00
Juergen Hoeller de7ff556d9 Polishing 2018-02-14 17:41:08 +01:00
Juergen Hoeller 3b810f3544 Consistent Class array vs vararg declarations (and related polishing) 2018-02-14 14:44:00 +01:00
igor-suhorukov 0ee505b73e Polish: assertion arguments should be passed in the correct order,
use assertNull instead of assertEquals(null, value),
declare delta as double value in assertEquals
2018-02-10 17:17:28 +01:00
Juergen Hoeller 0ac117ff27 Explicit notes on isolation level handling in participating transactions
Issue: SPR-16463
2018-02-05 22:51:43 +01:00
Juergen Hoeller 9d0e62ef68 Javadoc format and related polishing 2018-01-22 11:43:21 +01:00
Skelotron b9e03cb06b SPR-16316 — fix transaction timeout value overflow 2018-01-07 23:48:24 +01:00
Juergen Hoeller b1c657fa4b Consistent nullability in DataAccessUtils through nullableSingleResult
Issue: SPR-16225
2017-11-26 17:16:39 +01:00
Juergen Hoeller efe943df72 WebSphereUowTransactionManager logs overridden application exceptions
Issue: SPR-16102
2017-10-24 13:14:22 +02:00
Juergen Hoeller c7100f771c Explicit notes on advice mode proxy vs aspectj
Issue: SPR-16092
2017-10-22 20:34:34 +02:00
Sam Brannen e9367a11f6 Delete unused import 2017-10-15 16:15:44 +02:00
Robin Wang d9c0151d41 Fix typo
Closes gh-1545
2017-10-01 09:23:07 +02:00
Juergen Hoeller e2882fe1db Build against EE 8 API level wherever possible
Upgrade to JAXB 2.3, JAX-WS 2.3, Annotations 1.3.1, Interceptor 1.2.1.
Also includes Log4J 2.9.1 and Asciidoctor 1.5.6.
2017-09-24 17:18:21 +02:00
Juergen Hoeller 9190b76ab9 Latest dependency updates (POI 3.17, Rome 1.8, EhCache 3.4, Caffeine 2.5.6, RxJava 2.1.4, Tomcat 8.5.21, JRuby 9.1.13, Rhino 1.7.7.2) 2017-09-23 11:28:19 +02:00
Juergen Hoeller 7ae59d0c2a Nullability refinements on private and static methods
Based on IntelliJ IDEA 2017.3 introspection results.

Issue: SPR-15756
2017-09-22 18:22:14 +02:00
Sebastien Deleuze 1bc93e3d0f Revisit nullability annotations
This commit introduces the following changes.

1) It adds a new Spring @NonNull annotation which allows to apply
@NonNullApi semantic on a specific element, like @Nullable does.
Combined with @Nullable, it allows partial null-safety support when
package granularity is too broad.

2) @Nullable and @NonNull can apply to ElementType.TYPE_USE in order
to be used on generic type arguments (SPR-15942).

3) Annotations does not apply to ElementType.TYPE_PARAMETER anymore
since it is not supported yet (applicability for such use case is
controversial and need to be discussed).

4) @NonNullApi does not apply to ElementType.FIELD anymore since in a
lot of use cases (private, protected) it is not part for the public API
+ its usage should remain opt-in. A dedicated @NonNullFields annotation
has been added in order to set fields default to non-nullable.

5) Updated Javadoc and reference documentation.

Issue: SPR-15756
2017-09-15 13:26:41 +02:00
Brian Clozel 2eeb428e95 Move modules to independent build files
The main `build.gradle` file contains now only the common build
infrastructure; all module-specific build configurations have
been moved to their own build file.

Issue: SPR-15885
2017-08-21 14:41:55 +02:00
Juergen Hoeller b94302b5bd Enforce non-null value from getBean and at injection points
Bean-derived null values may still get passed into bean properties and injection points but only if those are declared as non-required. Note that getBean will never return null; a manual bean.equals(null) / "null".equals(bean.toString()) check identifies expected null values now.  This will only ever happen with custom FactoryBeans or factory methods returning null - and since all common cases are handled by autowiring or bean property values in bean definitions, there should be no need to ever manually check for such a null value received from getBean.

Issue: SPR-15829
2017-08-18 00:11:35 +02:00
Sebastien Deleuze 73cf07e9a4 Fix overridden methods nullability
Issue: SPR-15869
2017-08-17 15:02:59 +02:00
Juergen Hoeller 697d14a028 Unit tests for transaction annotations on parent interfaces
Issue: SPR-15833
2017-08-01 12:08:21 +02:00
Juergen Hoeller 46eba3dbfa Nullability fine-tuning around declaration inconsistencies
Issue: SPR-15720
Issue: SPR-15792
2017-07-19 22:22:20 +02:00
Sebastien Deleuze fb4ddb0746 Make getters and setters null-safety consistent
This commit ensure that null-safety is consistent between
getters and setters in order to be able to provide beans
with properties with a common type when type safety is
taken in account like with Kotlin.

It also add a few missing property level @Nullable
annotations.

Issue: SPR-15792
2017-07-19 09:07:56 +02:00
Juergen Hoeller c292a89b24 Http(Async)Client not actually nullable, plus MethodInterceptor nullability
Issue: SPR-15720
2017-07-19 00:15:37 +02:00
Juergen Hoeller cc74a2891a @Nullable all the way: null-safety at field level
This commits extends nullability declarations to the field level, formalizing the interaction between methods and their underlying fields and therefore avoiding any nullability mismatch.

Issue: SPR-15720
2017-06-30 01:54:16 +02:00
Stephane Nicoll 1ab678a2a3 Polish "Refactor iterator of Map with Java8's Map.forEach"
Closes gh-1459
2017-06-13 16:06:20 +02:00
diguage 1ef5f61ab2 Refactor iterator of Map with Java8's Map.forEach
See gh-1459
2017-06-13 16:06:20 +02:00
Juergen Hoeller 779deb0fa7 Cleanup of duplicate semicolons
Issue: SPR-15654
2017-06-13 11:38:05 +02:00
Stephane Nicoll fc64b8040f Polish "Replace relevant code with lambda"
Closes gh-1454
2017-06-13 09:42:20 +02:00
diguage 4b1478d830 Replace relevant code with lambda
See gh-1454
2017-06-13 08:55:38 +02:00
Juergen Hoeller fd53d2a51a Consistent use of @Nullable in spring-test
This commit also removes nullability from two common spots: ResolvableType.getType() and TargetSource.getTarget(), both of which are never effectively null with any regular implementation. For such scenarios, a non-null empty type/target is the cleaner contract.

Issue: SPR-15540
2017-06-08 22:52:59 +02:00
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
2017-06-07 14:19:15 +02:00
Sebastien Deleuze 1f28825f9d Add more @Nullable parameters based on null usage
Issue: SPR-15540
2017-05-31 21:42:23 +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 42d6d7ec4e Transaction annotations on interface methods with CGLIB proxies
Issue: SPR-14322
2017-04-26 18:16:31 +02:00
Juergen Hoeller 4e82bf30c6 TransactionSynchronization declared with default methods
Issue: SPR-14432
2017-03-14 15:18:53 +01:00
Juergen Hoeller 8b741508a6 Explicit notes on transaction phase processing
Issue: SPR-15323
2017-03-07 13:50:01 +01:00
Stephane Nicoll 05787f314f Update copyright header
Closes gh-1343
2017-03-03 09:28:56 +01:00
nkjackzhang 0e49c0e152 Remove unecessary "<<"
See gh-1343
2017-03-03 09:28:17 +01:00
Juergen Hoeller 2b3fb2f5cc Polishing 2017-02-28 18:37:33 +01:00
Juergen Hoeller d003f6614b Tests for annotation lookups in interfaces (currently ignored for CGLIB proxies)
Issue: SPR-15271
Issue: SPR-14949
Issue: SPR-14322
2017-02-28 13:11:15 +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 0f51ff5ebc Reset global rollback-only status when rolling back to savepoint
Issue: SPR-6568
2017-02-17 23:40:44 +01:00
Juergen Hoeller e9019cd7d1 Polishing 2017-02-10 10:56:40 +01:00
Juergen Hoeller b630c9bea7 Clear synchronization before triggering afterCompletion callbacks
Issue: SPR-15194
Issue: SPR-11590
2017-02-10 10:39:33 +01:00
Juergen Hoeller acf511ac0e Polishing 2017-02-02 20:11:06 +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