Commit Graph

442 Commits

Author SHA1 Message Date
Stephane Nicoll 2c92d7da8f Harmonize RuntimeHintsRegistrar implementations
Closes gh-28801
2022-07-12 18:30:23 +02:00
Sébastien Deleuze 16c43c2041 Add resource hints for Javamail mime.types
Closes gh-28690
2022-06-23 19:04:10 +02:00
Sam Brannen ee209de9cf Merge branch '5.3.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
#	spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
2022-05-31 14:15:36 +02:00
Sam Brannen 1beb7068f6 Use new AssertJ exception assertions 2022-05-31 14:08:28 +02:00
Juergen Hoeller 35de7e19ee Introduce initializer callback for Bean Validation Configuration
Closes gh-27956
2022-04-08 14:39:36 +02:00
Sam Brannen c8d0146bcc Polish contribution
See gh-28075
2022-03-29 13:39:40 +02:00
Loïc Ledoyen 7f7fb58dd0 Deprecate SerializationUtils#deserialize
Since SerializationUtils#deserialize is based on Java's serialization
mechanism, it can be the source of Remote Code Execution (RCE)
vulnerabilities.

Closes gh-28075
2022-03-29 13:07:36 +02:00
Sam Brannen 8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
Juergen Hoeller 3eb9886724 Merge branch '5.3.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/scheduling/commonj/WorkManagerTaskExecutor.java
#	spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java
#	spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java
#	spring-tx/src/main/java/org/springframework/jca/work/SimpleTaskWorkManager.java
#	spring-tx/src/main/java/org/springframework/jca/work/WorkManagerTaskExecutor.java
2022-02-04 23:24:21 +01:00
Juergen Hoeller a71a45e719 Deprecate AsyncTaskExecutor.execute(Runnable task, long startTimeout)
Closes gh-27959
2022-02-04 23:21:00 +01:00
Sam Brannen 54565e95b5 Merge branch '5.3.x' 2022-02-03 14:58:36 +01:00
Sam Brannen f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01:00
Sam Brannen d57bc176f2 Merge branch '5.3.x' 2022-01-10 14:21:25 +01:00
Sam Brannen df263d01b9 Use idiomatic AssertJ assertions for true, false, and null 2022-01-10 14:15:55 +01:00
izeye f0125afb5e Remove references to JCacheConfigurerSupport and CachingConfigurerSupport
See gh-27863
2021-12-29 10:53:56 +01:00
Stephane Nicoll 2f3a9dbc68 Deprecate CachingConfigurerSupport and AsyncConfigurerSupport
Closes gh-27813
2021-12-15 12:03:39 +01:00
Stephane Nicoll b6faaf1fc1 Merge branch '5.3.x' 2021-12-15 10:59:50 +01:00
Stephane Nicoll c7642422c3 Stop resolving CachingConfigurer instances eagerly
Closes gh-27751
2021-12-15 10:52:09 +01:00
Juergen Hoeller bdbcc4f98c Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2021-12-14 18:37:46 +01:00
Juergen Hoeller f191cf4eb3 Revised comment on explicit LocalDataSourceJobStore configuration
See gh-27709
2021-12-14 18:32:32 +01:00
Juergen Hoeller bfdb93b406 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	src/docs/asciidoc/integration.adoc
2021-12-14 16:51:00 +01:00
Juergen Hoeller d7b9270672 Clarify SchedulerFactoryBean's LocalDataSourceJobStore overriding
Includes clarification of interface-level cache annotations for target-class proxies.

Closes gh-27709
See gh-27726
2021-12-14 16:46:13 +01:00
Stephane Nicoll 8d93dc4abb Merge branch '5.3.x' 2021-12-14 14:05:18 +01:00
Stephane Nicoll 8422d9d22f Add default methods to CachingConfigurer
This commit adds default methods to CachingConfigurer and
JCacheConfigurer and removes the reference to their respective support
classes as they are now irrelevant.

Closes gh-27811
2021-12-14 13:49:57 +01:00
Juergen Hoeller 7f43128a0e Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-web/src/main/java/org/springframework/web/server/MediaTypeNotSupportedStatusException.java
#	spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerMappingIntrospector.java
2021-12-03 22:42:05 +01:00
Juergen Hoeller 14f24f43d7 Polishing 2021-12-03 22:36:31 +01:00
Sam Brannen 1e36518182 Merge branch '5.3.x' 2021-10-23 16:08:43 +02:00
Sam Brannen 995aaa6159 Polishing 2021-10-23 16:08:00 +02:00
Sam Brannen 2c89ff934d Update copyright date
See gh-27560
2021-10-23 15:59:46 +02:00
Daniil Pozdeev c58853f5e5 Use LocalDataSourceJobStore only if one is not set via Quartz properties
Prior to this commit, Spring's SchedulerFactoryBean always set the
"org.quartz.jobStore.class" property to LocalDataSourceJobStore even if
the user had already specified a custom JobStore implementation via the
Quartz properties file or Properties object, thereby effectively
ignoring the user configuration.

This commit addresses this by configuring Quartz to use Spring's
LocalDataSourceJobStore only if a JobStore has not already been
specified via user configuration.

Closes gh-27560
2021-10-23 15:22:42 +02:00
Sam Brannen b3473a3e81 Apply "instanceof pattern matching" Eclipse clean-up in spring-context-support
This has only been applied to `src/main/java`.
2021-10-14 17:45:56 +02:00
Sam Brannen 030ba52805 Merge branch '5.3.x' 2021-09-29 16:56:33 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Juergen Hoeller d84ca2ba90 Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
2021-09-17 09:14:07 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Juergen Hoeller 90af2d5794 Log delegate service initialization at debug level (instead of info)
Closes gh-26810
2021-05-11 15:46:41 +02:00
Brian Clozel e02d3f32b4 Requalify tests as LONG_RUNNING
Prior to this commit, some tests would belong to the PERFORMANCE
`TestGroup`, while they were not testing for performance but rather
performing functional tests that involve long running operations or
timeouts.

This commit moves those tests to the LONG_RUNNING `TestGroup`.

See gh-24830
2020-09-25 13:43:38 +02:00
Juergen Hoeller bbe74635eb Merge branch '5.2.x' 2020-09-18 18:16:33 +02:00
Juergen Hoeller 9dfef59af2 Construct StringWriter instances with appropriate initial size
Closes gh-25789
2020-09-18 18:14:57 +02:00
Juergen Hoeller 6e3ed6038b MimeMessageHelper does not encode attachment filenames by default anymore
Closes gh-25770
2020-09-14 22:31:05 +02:00
Juergen Hoeller 07b3e92bae Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	src/docs/asciidoc/core/core-aop-api.adoc
2020-09-14 22:22:02 +02:00
Juergen Hoeller 49d65d5c41 Configurable filename encoding in MimeMessageHelper
Closes gh-25755
2020-09-14 22:15:44 +02:00
Juergen Hoeller 3aae0fc91b Merge branch '5.2.x' 2020-09-03 19:21:44 +02:00
Juergen Hoeller 670b9fd60b Retry SQLErrorCodesFactory retrieval if DatabaseMetaData access failed
Includes deprecation of JdbcUtils.extractDatabaseMetaData(DataSource, String) in favor of the now generified version of extractDatabaseMetaData(DataSource, DatabaseMetaDataCallback).

Closes gh-25681
Closes gh-25686
2020-09-03 19:16:14 +02:00
Сергей Цыпанов 1f3e52d932 gh-25650 Replace remaining usage of LinkedList with ArrayList in tests 2020-08-31 14:33:14 +02:00
Juergen Hoeller 874574513c Replace remaining usage of LinkedList with ArrayList/ArrayDeque
Closes gh-25650
2020-08-26 18:32:08 +02:00
Juergen Hoeller ff11467a0c Avoid resizing of fixed-size HashMap/LinkedHashMap variants
Closes gh-25349
2020-08-25 19:26:18 +02:00
Stephane Nicoll 4d446f9659 Polish 2020-08-07 10:40:00 +02:00
Stephane Nicoll f3cedf268b Consistently support LoadingCache
This commits make sure that CaffeineCache handles consistently the
contract of LoadingCache.

Closes gh-25173
2020-08-07 10:38:27 +02:00
Sam Brannen cdc234d7db Polish contribution
See gh-25446
2020-07-22 14:06:29 +02:00
XenoAmess c547809e89 Use instanceof instead of Class#isInstance where feasible
Closes gh-25446
2020-07-22 14:06:29 +02:00
Juergen Hoeller 17cab9660c Deprecate TransactionSynchronizationAdapter
Closes gh-21725
2020-06-17 11:02:31 +02:00
Sam Brannen 8099fc8178 Use try-with-resources language construct where feasible
Closes gh-2063

Co-authored-by: igor-suhorukov <igor.suhorukov@gmail.com>
2020-06-16 22:57:45 +02:00
Juergen Hoeller 1279b3b822 Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context-support/src/main/java/org/springframework/cache/jcache/config/AbstractJCacheConfiguration.java
2020-06-11 23:53:27 +02:00
Juergen Hoeller e46ccd74b1 Consistent abstract declaration of "Abstract" base classes
Closes gh-25240
2020-06-11 23:43:41 +02:00
Juergen Hoeller 663f2e8afd Merge branch '5.2.x' 2020-06-10 22:53:06 +02:00
Juergen Hoeller ae1ed9d458 Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:52:01 +02:00
Juergen Hoeller 8697026987 Support for custom cache registration in CaffeineCacheManager
Closes gh-25230
2020-06-10 22:50:11 +02:00
Juergen Hoeller 399453d9f1 Merge branch '5.2.x'
# Conflicts:
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
2020-05-22 17:16:09 +02:00
Juergen Hoeller d7161f5e5e Polishing 2020-05-22 16:23:46 +02:00
Juergen Hoeller 3c1ee64b7f Explicit nullability declarations for all AOP Alliance methods
Includes consistent declarations in AOP Alliance related Spring AOP code.

Closes gh-24117
2020-05-13 23:33:47 +02:00
Juergen Hoeller f09093132e Use proxyBeanMethods=false on remaining internal configuration classes
Closes gh-24511
2020-05-12 22:19:44 +02:00
Sam Brannen 12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +02:00
Qimiao Chen 1f9fa3bab8
Remove useless .gitignore files
Closes gh-24790
2020-03-26 15:53:39 +01:00
Sam Brannen 16e49bf0c9 Simplify getCache() implementation in CaffeineCacheManager
Closes gh-24376
2020-01-16 15:07:14 +01:00
Sam Brannen 5581f3b77b Use Gradle test fixture support for spring-tx
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 0335db23c9 Use Gradle test fixture support for spring-context-support
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller 32e7adfa32 Polishing 2019-12-01 02:00:40 +01:00
stsypanov f2b3953d76 Use array.clone() instead of manual array creation 2019-11-13 13:53:42 +01:00
Sebastien Deleuze b24ac74106 Restore TransactionOperations Kotlin API compatibilty
This commit renames the Runnable variant to executeWithoutResult
and uses a Consumer<TransactionStatus> parameter for better
consistency with TransactionCallbackWithoutResult.

Closes gh-23724
2019-09-29 19:31:12 +02:00
Sam Brannen 455ad71863 Polish contribution
See gh-23629
2019-09-12 17:02:35 +02:00
douddle 93ddfb9cae Add SVG mapping to mime.types file for JavaMail support
Closes gh-23629
2019-09-12 16:52:59 +02:00
Phillip Webb deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Sam Brannen ad6231ad29 Add missing @Override annotations 2019-08-23 13:50:58 +02:00
Sam Brannen 288461a541 Introduce @EnabledForTestGroups in Spring's test suite
Closes gh-23476
2019-08-17 14:47:24 +02:00
Sam Brannen 3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Juergen Hoeller 8aa0b07768 Consistent early eviction tests in regular and transactional scenarios
See gh-23192
2019-07-20 15:05:07 +02:00
Juergen Hoeller ffc1f242ca Introduce evictIfPresent/invalidate operations on Cache abstraction
@CacheEvict.beforeInvocation suggests immediate execution even in case of transactional caches. The cache interceptor delegates to the new evictIfPresent/invalidate operations now which imply immediate execution semantics (and also provide an indication for whether any corresponding entries where present when programmatically called).

Closes gh-23192
2019-07-17 22:37:55 +02:00
Juergen Hoeller a5cb8799fa Merge branch '5.1.x' 2019-07-05 18:22:02 +02:00
Juergen Hoeller 7a7d4109ac Polishing 2019-07-05 17:47:36 +02:00
Juergen Hoeller aeef95938e SpringValidatorAdapter's ObjectError subclasses are serializable
Closes gh-23181
2019-07-05 17:07:01 +02:00
Sam Brannen 9b084bb3ea Polish contribution
See gh-23073
2019-06-08 22:22:27 +03:00
Issam El-atif ab36a0a82f Improve FreeMarker tests in spring-webmvc and spring-context-support
This commit improves FreeMarkerConfigurerTests in spring-webmvc by
testing against FreeMarkerConfigurer instead of
FreeMarkerConfigurationFactoryBean and moves the original
FreeMarkerConfigurationFactoryBeanTests to spring-context-support in
the org.springframework.ui.freemarker package.

Closes gh-23073
2019-06-08 22:21:09 +03:00
Sebastien Deleuze 098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Juergen Hoeller 8f972a5a60 Merge branch '5.1.x' 2019-05-24 23:46:25 +02:00
Juergen Hoeller 80c6f2bcf9 Polishing 2019-05-24 23:31:32 +02:00
Phillip Webb 9d74da006c Migrate JUnit 4 assertions to AssertJ
Migrate all existing JUnit 4 `assert...` based assertions to AssertJ
and add a checkstyle rule to ensure they don't return.

See gh-23022
2019-05-23 15:52:49 -07:00
Phillip Webb 95a9d46a87 Migrate Hamcrest assertions to AssertJ
Migrate all existing `assertThat(..., Matcher)` assertions to AssertJ
and add checkstyle rules to ensure they don't return.

See gh-23022
2019-05-23 15:49:59 -07:00
Phillip Webb 02850f357f Migrate exception checking tests to use AssertJ
Migrate tests that use `@Test(expectedException=...)` or
`try...fail...catch` to use AssertJ's `assertThatException`
instead.
2019-05-20 10:47:53 -07:00
Sam Brannen 64819bbc1d Clean up warnings 2019-05-10 18:00:29 +02:00
Phillip Webb 816bbee8de Remove '.*' imports from tests
Organize test imports to expand all '.*' static imports into
fully qualified imports.

This update will allow us to use additional checkstyle rules in
the future, and will also help if we migrate fully to AssertJ.
2019-05-08 09:55:09 -07:00
Phil Webb d7320de871 Migrate away from ExpectedException (#22922)
* Add limited checkstyles to test code

Add a limited set of checkstyle rules to the test codebase to improve
code consistency.

* Fix checksyle violations in test code

* Organize imports to fix checkstyle for test code

* Migrate to assertThatExceptionOfType

Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.

See gh-22894
2019-05-08 16:25:52 +02:00
Sam Brannen c79fdfb668 Use assertThat from Hamcrest instead of JUnit 4
org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
2019-05-05 18:09:11 +02:00
Juergen Hoeller a2a6bc3d47 Introduce TransactionDefinition.withDefaults() shortcut
Such a static unmodifiable TransactionDefinition with defaults can be used for getTransaction(null) calls, now also possible for getReactiveTransaction. Furthermore, it can be used for a simple TransactionalOperator.create(ReactiveTransactionManager) method without an internal dependency on the transaction.support package.

See gh-22646
2019-05-03 12:28:41 +02:00