Compare commits

...

3721 Commits

Author SHA1 Message Date
Spring Buildmaster 967637d763 Release v5.3.1 2020-11-10 08:59:43 +00:00
Rossen Stoyanchev 2899652d8e Fix checkstyle violation 2020-11-09 22:30:35 +00:00
Rossen Stoyanchev 560a504a83 Polishing in DefaultWebClient 2020-11-09 22:07:31 +00:00
Rossen Stoyanchev 79f79e9306 WebClient method to populate the Reactor Context
The alternative is to use a filter but this makes it a little easier
and also guarantees that it will be downstream from all filters
regardless of their order, and therefore the Context will be visible
to all of them.

Closes gh-25710
2020-11-09 22:07:31 +00:00
Juergen Hoeller bd2640a9d6 Strict nullability for field assignment 2020-11-09 21:33:32 +01:00
Juergen Hoeller 6825287360 Polishing 2020-11-09 18:18:33 +01:00
Sébastien Deleuze 737d77a739 Fix @Transactional support on functions returning Flow
Closes gh-26052
2020-11-09 17:45:28 +01:00
Sébastien Deleuze 1f13516528 Fix @Transactional support on suspending function
With this commit, @Transactional on suspending functions
returning a value now commits the transaction properly.

Closes gh-25998
2020-11-09 17:43:31 +01:00
Rossen Stoyanchev 6bb3ad793e Add isOpen to WebSocketSession in WebFlux
Closes gh-26043
2020-11-09 14:06:43 +00:00
Sébastien Deleuze c73cff8bad Use RxJava 2/3 fromPublisher() when possible in ReactiveAdapterRegistry
Closes gh-26051
2020-11-09 14:49:45 +01:00
Juergen Hoeller e592634290 Polishing 2020-11-09 13:32:41 +01:00
Juergen Hoeller b25637e8ad Make setTaskScheduler and setTcpClient chaining-friendly
Closes gh-26049
2020-11-09 13:32:34 +01:00
izeye 0c347769a2 Fix wrong reference in UrlPathHelper.removeSemicolonContentInternal()
This commit also changes to short-circuit when `slashIndex` is -1.
2020-11-09 13:08:44 +01:00
Juergen Hoeller 2497d4285f Detect existing DispatcherServlet strategy beans in parent context as well
Closes gh-25290
2020-11-09 12:39:09 +01:00
Sébastien Deleuze 32238cc996 Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:19:24 +01:00
Sébastien Deleuze d80dd50c9d Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:11:39 +01:00
Sébastien Deleuze bdf120f1ef Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:10:25 +01:00
Sébastien Deleuze e781d21097 Add CoroutinesAnnotationTransactionInterceptorTests
suspendingValueSuccess() currently fails due to an
unexpected rollback on transactional suspending functions
returning a value.

See gh-25998
2020-11-09 10:10:13 +01:00
Sébastien Deleuze 8cef13cc30 Upgrade to Kotlin Coroutines 1.4.1 2020-11-09 09:34:46 +01:00
Rüdiger Schulz 2214ff8ce0 Fix Kotlin example code which does not compile
This kotlin code does not compile:
Overload resolution ambiguity. All these functions match.
default <R> RowsFetchSpec<R> map(Function<Row, R> mappingFunction)
<R> RowsFetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);

Closes gh-26016
2020-11-08 15:43:30 +01:00
Sam Brannen 411539ffef Update copyright date
See gh-26044
2020-11-08 15:41:31 +01:00
NaNRailgun 11aa901634 Delete explicit type arguments that can be inferred
Closes gh-26044
2020-11-08 15:40:01 +01:00
Rossen Stoyanchev 6e51370490 AbstractJackson2Encoder support for MappingJacksonValue
Closes gh-26035
2020-11-06 20:46:35 +00:00
Rossen Stoyanchev bcd2b9a8a7 Further refine logging in StompErrorHandler
In 5.3.x and forward, completely avoid logging unsent CONNECT messages
that are most likely authentication issues before the session is even
established.

Closes gh-26026
2020-11-05 21:50:12 +00:00
Rossen Stoyanchev 17dd7785f6 Refine logging in StompErrorHandler
Avoid a full stacktrace at ERROR level for a client message that could
not be sent to a MessageChannel.

See gh-26026
2020-11-05 21:34:56 +00:00
Juergen Hoeller 21f9d05bd9 Upgrade to Jetty 9.4.34, AssertJ 3.18, Mockito 3.6 2020-11-05 19:21:54 +01:00
Juergen Hoeller 19911af30a Polishing 2020-11-05 19:09:58 +01:00
Juergen Hoeller 6acb091c4e Upgrade SpelCompiler bytecode level to 1.8 and optimize for concurrent access
Closes gh-26033
2020-11-05 17:44:40 +01:00
Juergen Hoeller 99ed01e3f7 Optimize locking in AspectJProxyFactory for concurrent aspect instantiation
Closes gh-26034
2020-11-05 13:11:16 +01:00
Juergen Hoeller 2657757566 Separate assignment statements for local variable and instance field
See gh-25899
2020-11-05 13:10:45 +01:00
Сергей Цыпанов e1f51b4bf8 Avoid multiple volatile reads/writes in a row where only one is enough 2020-11-05 12:25:24 +01:00
Juergen Hoeller f2f84bfa7a Polishing 2020-11-05 00:04:33 +01:00
Juergen Hoeller 6d67bdf04f Polishing 2020-11-04 23:43:43 +01:00
Juergen Hoeller 97c8628bd6 Suppress NotWritablePropertyException in case of ignoreUnknown=true
Closes gh-25986
2020-11-04 23:42:37 +01:00
Juergen Hoeller 990a9c74b9 Restore removal of trailing semicolon content
See gh-26012
2020-11-04 23:42:28 +01:00
Juergen Hoeller b815accca9 Upgrade to Hibernate ORM 5.4.23 2020-11-04 16:52:40 +01:00
Juergen Hoeller 4e8d6bea4d Fix test code formatting 2020-11-04 16:52:11 +01:00
Juergen Hoeller 079ca80854 SpEL supports record-style accessor methods as well
Closes gh-26029
2020-11-04 16:51:54 +01:00
Juergen Hoeller 412aa06d86 Reliably refresh metadata for dynamically changing prototype bean class
Closes gh-26019
2020-11-04 16:48:54 +01:00
Juergen Hoeller d5b3e65718 Add since tag
See gh-26025
2020-11-04 16:46:44 +01:00
Juergen Hoeller a4679b87b9 Fix Checkstyle violation and rearrange getAdvisorCount declaration
See gh-26017
2020-11-04 16:43:31 +01:00
Erik van Paassen fbf8e37f94 Add FullyQualifiedAnnotationBeanNameGenerator.INSTANCE
Adds a static INSTANCE to FullyQualifiedAnnotationBeanNameGenerator,
just like its parent class, AnnotationBeanNameGenerator, does.

The class doesn't have any state and overriding/hiding the INSTANCE of
the superclass, this prevents unintended use of a regular
AnnotationBeanNameGenerator through
FullyQualifiedAnnotationBeanNameGenerator.INSTANCE.
2020-11-04 16:29:31 +01:00
Сергей Цыпанов 8c3cab7ead Improve usage of AdvisedSupport.getAdvisors() 2020-11-04 16:29:09 +01:00
Сергей Цыпанов 0015fd6734 Improve URI/query strings sanitization 2020-11-04 16:28:51 +01:00
Sam Brannen b077e4cd85 Use MergedAnnotationCollectors again in TestContextAnnotationUtils
See gh-26031
2020-11-04 14:42:19 +01:00
Sam Brannen 0a0299693b Do not create intermediate list in MergedAnnotationCollectors.toAnnotationSet()
Prior to this commit, MergedAnnotationCollectors.toAnnotationSet()
created an intermediate ArrayList for storing the results prior to
creating a LinkedHashSet in the finishing step.

Since the creation of the intermediate list is unnecessary, this commit
simplifies the implementation of toAnnotationSet() by using the
Collector.of() factory method that does not accept a `finisher` argument.
The resulting Collector internally uses a `castingIdentity()` function
as the `finisher`.

Closes gh-26031
2020-11-04 14:19:58 +01:00
Rossen Stoyanchev 41bdde5d6b Polishing 2020-11-03 19:31:02 +00:00
Rossen Stoyanchev 2e2d662158 Add toEntityFlux methods
Closes gh-26023
2020-11-03 19:31:02 +00:00
Sam Brannen 68934f1b79 Use TYPE_HIERARCHY strategy in AnnoDescr.findAllLocalMergedAnnotations()
Prior to this commit, the findAllLocalMergedAnnotations() method in
AnnotationDescriptor altered between the use of TYPE_HIERARCHY and
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES for the SearchStrategy, depending
on @NestedTestConfiguration semantics; however, when searching for
"local" annotations, there is no need to search the enclosing class
hierarchy since AnnotationDescriptor#next() handles that use case.

This commit therefore switches to using only the TYPE_HIERARCHY
strategy.

This commit also discontinues the use of
MergedAnnotationCollectors.toAnnotationSet() in order to avoid the
unnecessary creation of a temporary List when collecting synthesized
annotations in a LinkedHashSet.

Closes gh-25985
2020-11-03 16:17:15 +01:00
hzmpay f781c459b4 Simplify AbstractBeanFactory.registerCustomEditors()
This commit avoids an unnecessary non-null check in
registerCustomEditors().

Closes gh-26022
2020-11-03 14:52:23 +01:00
Sam Brannen 5628c8cd63 Polish ActiveProfilesUtils 2020-11-03 14:46:17 +01:00
Rossen Stoyanchev 0f6038af70 Log can[Se]Deserialize error in Jackson codecs
Closes gh-25892
2020-11-02 17:25:57 +00:00
Rossen Stoyanchev 3eb2c5e22f Use static accessors in DefaultSimpUserRegistry
Closes gh-26010
2020-11-02 17:25:57 +00:00
Brian Clozel 3f722a9c7f Set DEBUG logs for release tasks in CI pipeline
This commit configures the logging level to DEBUG for the concourse
release scripts tasks.

This is useful to get a clue on where those long-running tasks are at.
2020-11-02 17:17:02 +01:00
Sam Brannen acbbf61be8 Preserve registration order in @ActiveProfiles
With this commit, bean definition profiles declared via @ActiveProfiles
are once again stored in registration order, in order to support use
cases in Spring Boot and other frameworks that depend on the
registration order.

This effectively reverts the changes made in conjunction with gh-25973.

Closes gh-26004
2020-11-02 16:39:59 +01:00
Sam Brannen 154f0c71c9 Polishing 2020-11-02 15:47:15 +01:00
Rossen Stoyanchev 7be7e5beb4 Ensure response not closed by MappingJackson2HttpMessageConverter
Closes gh-25987
2020-10-30 18:31:30 +00:00
Stephane Nicoll 37504e75e9 Merge pull request #25999 from izeye
* pr/25999:
  Fix a broken Asciidoctor syntax in core-resources.adoc

Closes gh-25999
2020-10-30 09:33:00 +01:00
izeye b89b37729c Fix a broken Asciidoctor syntax in core-resources.adoc
See gh-25999
2020-10-30 09:32:42 +01:00
Rossen Stoyanchev 141c79bc8f Default resolution of non-annotated Principal argument
Closes gh-25981
2020-10-29 21:29:35 +00:00
Arjen Poutsma 885a5048c1 Copy default headers, cookies in WebClient builder
This commit makes copies of the default headers and cookies when a
WebClient is built, so that subsequent changes to these do not affect
previously built clients.

Closes: gh-25992
2020-10-29 13:37:25 +01:00
Arjen Poutsma e981bf34b3 Removed unused sample code 2020-10-29 13:37:25 +01:00
Aakarshit Uppal 44239b2d7b Remove rogue semicolon 2020-10-29 12:32:20 +00:00
Stephane Nicoll a00c483927 Merge branch '5.2.x' 2020-10-27 16:56:22 +01:00
Spring Buildmaster 96ffa14141 Next development version (v5.3.1-SNAPSHOT) 2020-10-27 14:52:47 +00:00
Rossen Stoyanchev 9f632cf0c1 Upgrade to RSocket 1.1.0
Closes gh-25956
2020-10-27 14:05:05 +00:00
Spring Buildmaster a9dec6a4af Next Development Version 2020-10-27 13:48:52 +00:00
Sam Brannen 9c2fd0bd05 Document @DynamicPropertySource use cases that require @DirtiesContext
Closes gh-25850
2020-10-27 14:26:40 +01:00
Nick Hitchan 6e936a4081 Remove absolute URI check from ReactorClientHttpConnector
This allows maknig use of the Unix Domain Socket support in Reactor 1.0.

Closes gh-25929
2020-10-27 12:54:18 +00:00
Sébastien Deleuze b2d337c527 Fix Coroutines minimal version in the refdoc
See gh-25969
2020-10-27 12:48:29 +01:00
Rossen Stoyanchev 24cef14683 Merge branch '5.2.x' into master 2020-10-27 11:21:41 +00:00
Rossen Stoyanchev bb4e802af5 Full header support HTTP HEAD Resource requests
Allow the body to be written in order for all headers to be set
as they would be on HTTP GET. The body content is ignored as a
lower level.

See gh-25976
2020-10-27 11:14:37 +00:00
Sam Brannen b01adadf60 Improve documentation for SpEL property reference syntax
See gh-25538
2020-10-27 11:48:44 +01:00
Yanming Zhou 9c11887fe8 Use lowercase property names in SpEL examples
Closes gh-25538
2020-10-27 11:48:44 +01:00
Sébastien Deleuze 4503260282 Fix Dokka warnings 2020-10-27 11:21:55 +01:00
Rossen Stoyanchev d91b66a04c Allow Resource to add headers for range requests
Closes gh-25976
2020-10-27 10:15:56 +00:00
Sam Brannen d1e6883d5d Fix issues in Javadoc 2020-10-27 11:05:31 +01:00
Sébastien Deleuze 5170f3f594 Fix a Kotlin test compile warning 2020-10-27 09:41:59 +01:00
Stephane Nicoll a4d546a9d6 Upgrade to Reactor 2020.0.0
Closes gh-25947
2020-10-27 03:08:54 +01:00
Sam Brannen fc9650a9a6 Finalize API for TestContextAnnotationUtils 2020-10-27 00:22:03 +01:00
Sam Brannen 82fa3f3fc1 Reinstate tests for deprecated MetaAnnotationUtils 2020-10-27 00:18:25 +01:00
Juergen Hoeller 1fb33fbd3c Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-10-26 23:23:59 +01:00
Juergen Hoeller b6dae6acba Upgrade to JUnit 5.6.3, Woodstox 6.2.3, BlockHound 1.0.4 2020-10-26 23:20:14 +01:00
Rossen Stoyanchev a3cd8e11b0 Merge branch '5.2.x' into master 2020-10-26 21:49:14 +00:00
Rossen Stoyanchev f50c2caf59 Upgrade to RSocket 1.0.3
Closes gh-25957
2020-10-26 21:42:54 +00:00
Juergen Hoeller 0aa3205e38 Fix nullability warnings 2020-10-26 22:19:26 +01:00
Sébastien Deleuze 5b910a87c3 Polishing 2020-10-26 20:10:54 +01:00
Sébastien Deleuze 9ebd3ee1fe Upgrade to Kotlin Coroutines 1.4.0
Closes gh-25969
2020-10-26 20:10:54 +01:00
Sébastien Deleuze 3f01af6f7c Add kotlinx.serialization JSON support to Spring Messaging
Closes gh-25883
2020-10-26 20:10:54 +01:00
Juergen Hoeller f329748657 Merge branch '5.2.x' 2020-10-26 18:32:16 +01:00
Juergen Hoeller d12996a6a8 Polishing 2020-10-26 18:18:33 +01:00
Sébastien Deleuze d04c5f8b2c Support multiple matchers in MockMvc Kotlin DSL
Previous incarnation of MockMvc Kotlin DSL tried to reuse directly
Java APIs like ModelResultMatchers or StatusResultMatchers, but
when using multiple matchers in DSL blocks like model { } or
status { }, only the last statement was taken in account which
was very confusing.

This refactoring provides dedicated Kotlin DSLs for matchers.

The main API breaking changes is that functions like isOk() need to be
invoked with the parenthesis, isOk is not supported anymore (on purpose).

Closes gh-24103
2020-10-26 18:13:55 +01:00
Juergen Hoeller 41247d49ba R2DBC javadoc and code style revision
See gh-25065
2020-10-26 17:47:20 +01:00
Juergen Hoeller 16c8676e5b Use ConcurrentLruCache (aligned with NamedParameterJdbcTemplate)
See gh-24197
2020-10-26 17:37:20 +01:00
Juergen Hoeller d7f1813cd7 R2DBC and Hibernate documentation revision
Closes gh-25860
Closes gh-25533
2020-10-26 17:33:00 +01:00
Sam Brannen ada255d584 Ignore duplicate config metadata for cache key in TestContext framework
Prior to this commit, if a developer accidentally copied and pasted the
same @ContextConfiguration or @TestPropertySource declaration from a
test class to one of its subclasses or nested test classes, the Spring
TestContext Framework (TCF) would merge the inherited configuration
with the local configuration, resulting in different sets of
configuration metadata which in turn resulted in a different
ApplicationContext instance being loaded for the test classes. This
behavior led to unnecessary creation of identical application contexts
in the context cache for the TCF stored under different keys.

This commit ignores duplicate configuration metadata when generating
the ApplicationContext cache key (i.e., MergedContextConfiguration) in
the TCF. This is performed for the following annotations.

- @ContextConfiguration
- @ActiveProfiles (support already existed prior to this commit)
- @TestPropertySource

Specifically, if @ContextConfiguration or @TestPropertySource is
declared on a test class and its subclass or nested test class with the
exact same attributes, only one instance of the annotation will be used
to generate the cache key for the resulting ApplicationContext. The
exception to this rule is an "empty" annotation declaration. An empty
@ContextConfiguration or @TestPropertySource declaration signals that
Spring (or a third-party SmartContextLoader) should detect default
configuration specific to the annotated class. Thus, multiple empty
@ContextConfiguration or @TestPropertySource declarations within a test
class hierarchy are not considered to be duplicate configuration and
are therefore not ignored.

Since @TestPropertySource is a @Repeatable annotation, the same
duplicate configuration detection logic is applied for multiple
@TestPropertySource declarations on a single test class or test
interface.

In addition, this commit reinstates validation of the rules for
repeated @TestPropertySource annotations that was removed when support
for @NestedTestConfiguration was introduced.

Closes gh-25800
2020-10-26 17:17:53 +01:00
Stephane Nicoll 7aef0c78a0 Merge branch '5.2.x' 2020-10-26 17:02:11 +01:00
Stephane Nicoll 188a5a086b Upgrade to Reactor Dysprosium-SR13
Closes gh-25946
2020-10-26 17:00:46 +01:00
Sam Brannen 705cf09ad7 Merge branch '5.2.x' 2020-10-26 15:05:35 +01:00
Sam Brannen 449377908f Fix JUnit 4 to AssertJ migration bugs
The migration from JUnit 4 assertions to AssertJ assertions resulted in
several unnecessary casts from int to long that actually cause
assertions to pass when they should otherwise fail.

This commit fixes all such bugs for the pattern `.isNotEqualTo((long)`.
2020-10-26 14:53:09 +01:00
Sam Brannen b1fef925af Cache DefaultActiveProfilesResolver instance since it is stateless 2020-10-26 13:58:45 +01:00
Sam Brannen 9287c15583 Simplify implementation of DefaultActiveProfilesResolver 2020-10-26 13:53:23 +01:00
Sam Brannen 9a4a593c7f Merge branch '5.2.x' 2020-10-26 12:53:53 +01:00
Sam Brannen c840ba9989 Avoid cache miss for @ActiveProfiles w/ same profiles but different order
Prior to this commit, two @ActiveProfiles declarations with the same
profiles but different order resulted in an identical, duplicate
ApplicationContext in the context cache in the Spring TestContext
Framework.

This commit uses a TreeSet to ensure that registered active profiles
are both unique and sorted, thereby avoiding cache misses for
semantically identical active profiles configuration on different test
classes.

Closes gh-25973
2020-10-26 11:42:28 +01:00
Juergen Hoeller 3924947773 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/util/LinkedMultiValueMap.java
2020-10-26 11:27:05 +01:00
Juergen Hoeller 9d70d2023c Upgrade to SnakeYAML 1.27 2020-10-26 11:16:52 +01:00
Juergen Hoeller 82835b99ec Restore independent LinkedMultiValueMap implementation (without base class)
Closes gh-25960
2020-10-26 11:16:33 +01:00
Juergen Hoeller a3f3a136c4 Make MultiValueMapAdapter public (as base class for LinkedMultiValueMap)
Closes gh-25960
2020-10-26 10:41:59 +01:00
Sébastien Deleuze a2ff03074f Polishing 2020-10-26 09:57:30 +01:00
Sébastien Deleuze a3fcfc5d2a Add SAM conversion example for MockMvcResultHandlersDsl.handle()
See gh-23757
2020-10-26 09:57:30 +01:00
Sam Brannen 1247e4a0e8 Use new ConcurrentLruCache#clear() method in TestContextAnnotationUtils 2020-10-26 09:48:33 +01:00
Rossen Stoyanchev 1676470729 Merge branch '5.2.x' into master 2020-10-26 07:49:51 +00:00
Rossen Stoyanchev 4726663f81 Correct Javadoc link core-resources.adoc
Closes gh-25970
2020-10-26 07:43:30 +00:00
Rossen Stoyanchev 86af93a504 Correct sample in webmvc.adoc
Closes gh-25965
2020-10-26 07:40:33 +00:00
Sébastien Deleuze efe933ad83 Polish Coroutines detection 2020-10-25 18:33:57 +01:00
Sébastien Deleuze 5429c7afeb Support suspending functions annotated with @Transactional
This commit makes TransactionInterceptor and TransactionAspectSupport
Coroutines aware, adapting Reactive transaction support to Coroutines.

Suspending functions returning a Flow are handled like Flux, for other
return types, they are handled like Mono.

Closes gh-23575
2020-10-25 18:33:42 +01:00
Juergen Hoeller 73eefeac5f Expose contains, remove and clear methods on ConcurrentLruCache
Closes gh-25963
2020-10-24 23:48:13 +02:00
Sam Brannen 1a50732daa Attempt to fix failing CI builds 2020-10-24 23:27:18 +02:00
Sam Brannen 1c82ba425b Reduce surface area of public API for AnnotationDescriptor types 2020-10-24 22:45:17 +02:00
Sam Brannen 946e5c9bbf Delete trailing whitespace 2020-10-24 22:29:38 +02:00
Sam Brannen af4d68b1a5 Cache default EnclosingConfiguration mode in TestContextAnnotationUtils 2020-10-24 22:26:29 +02:00
Rossen Stoyanchev a40cc8bbe0 Polishing contribution
Closes gh-25647
2020-10-23 18:27:49 +01:00
Riley Park 6e640c806f Improve support for Content-Disposition types
See gh-25647
2020-10-23 18:16:05 +01:00
Rossen Stoyanchev e66e34766e Support Optional in UriComponentsBuilder#queryParam
Closes gh-25951
2020-10-23 18:09:22 +01:00
Rossen Stoyanchev 5644a7aebb Polishing contribution
Closes gh-25951
2020-10-23 17:43:17 +01:00
Robin Roos 7af726480f Add queryParamIfPresent to UriComponentsBuilder
See gh-25951
2020-10-23 17:07:39 +01:00
Rossen Stoyanchev 51fb49be34 Correct outdated error message 2020-10-23 17:05:00 +01:00
Sam Brannen c524849774 Deleted unused field in DefaultListableBeanFactoryTests 2020-10-23 17:06:26 +02:00
Sam Brannen f2eb67373a Polish TestContextAnnotationUtils 2020-10-23 17:00:39 +02:00
Rossen Stoyanchev cf988f81b5 Merge branch '5.2.x' into master 2020-10-23 15:14:05 +01:00
Arjen Poutsma 417e7e03d4 Introduce RouterFunction attributes
This commit introduces support for router function attributes, a
way to associate meta-data with a route.

Closes: gh-25938
2020-10-23 14:58:49 +02:00
Sam Brannen 8d86d61f9f Introduce TestContextAnnotationUtils to avoid package cycles
This commit introduces TestContextAnnotationUtils as a replacement for
MetaAnnotationUtils, with dedicated support for honoring the new
@NestedTestConfiguration annotation and related annotation search
semantics.

MetaAnnotationUtils has been reverted to its previous scope and is now
deprecated.

See gh-19930
2020-10-23 14:24:33 +02:00
Rossen Stoyanchev fb4363e4e0 Refactor DataBufferUtils Matcher implementation
The existing implementation was exposed to very poor performance when matching
with multiple delimiters against a large buffer with many delimiters. In that
case all matchers are invoked many times (as many as the number of delimiters)
even though some of them found no match at all on the first pass.

The revised implementation uses a single index and advances all matchers
together, checking one byte a time, and not letting any one of them search to
the end of the entire buffer on a single pass.

Closes gh-25915
2020-10-23 13:23:51 +01:00
Juergen Hoeller 1ec6843913 Upgrade CGLIB to ASM9 level as well
See gh-24872
2020-10-23 11:47:03 +02:00
Juergen Hoeller cff57ca1fe Upgrade to R2DBC Arabba-SR8, Jetty 9.4.33, Woodstox 6.2.3, Mockito 3.5.15 2020-10-23 09:30:43 +02:00
Rossen Stoyanchev 784d72cc56 Fix checkstyle violations 2020-10-23 08:22:23 +01:00
Rossen Stoyanchev 4480269432 Upgrade to RSocket 1.1 snapshots
See gh-25956
2020-10-22 21:55:44 +01:00
Rossen Stoyanchev 9a1323aad5 Update StringDecoderBenchmark
See gh-25915
2020-10-22 21:50:27 +01:00
Rossen Stoyanchev eec6ec8f44 Merge branch '5.2.x' into master 2020-10-22 21:48:45 +01:00
Rossen Stoyanchev 6946fe2f74 Upgrade to RSocket 1.0.3 snapshots
See gh-25957
2020-10-22 21:46:17 +01:00
Rossen Stoyanchev db9e0b0ccb Refactor StringDecoder
Simplify and optimize the processing of the input stream.

The existing implementation was using bufferUntil and creating a List
for every line along with an EndFrameBuffer inserted for the
bufferUntil predicate. So the larger the input buffer and the more
lines it contained, the greater the overhead.

The new implementation avoids bufferUntil for all lines and
instead uses concatMapIterable to aggregate the lines from a buffer
into a single list. So the larger the input buffer and the more
lines it contains, the better the throughput. The only buffering
used then is for partial chunks and those are accumulated in a list.

See gh-25915
2020-10-22 21:29:54 +01:00
Sam Brannen aaa2d21058 Polish TestPropertySourceUtils 2020-10-22 17:31:59 +02:00
Sam Brannen b8b854db8c Discover @Sql annotations on enclosing class for nested test class
This commit introduces support for discovering @Sql, @SqlGroup,
@SqlConfig, and @SqlMergeMode on enclosing classes for @Nested test
classes in JUnit Jupiter.

Closes gh-25913
2020-10-22 17:08:10 +02:00
Juergen Hoeller 95110d8257 Introduce TransactionalApplicationListener interface (with callback support)
Includes forPayload methods and common adapter classes for programmatic usage.
Aligns default order values for event handling delegates to LOWEST_PRECEDENCE.

Closes gh-24163
2020-10-22 15:19:32 +02:00
Rossen Stoyanchev cfc3522641 Add jmh benchmark for StringDecoder
See gh-25915
2020-10-21 22:06:55 +01:00
Juergen Hoeller 621295dbd8 Deprecate StringUtils.isEmpty(Object) and replace remaining usage
Closes gh-25945
2020-10-21 16:09:26 +02:00
Stephane Nicoll 07769ddcc6 Start building against Reactor 2020.0.0 snapshots
See gh-25947
2020-10-21 14:21:49 +02:00
Stephane Nicoll c748870853 Merge branch '5.2.x' 2020-10-21 14:20:58 +02:00
Stephane Nicoll f7ec92c647 Start building against Reactor Dysprosium-SR13 snpshots
See gh-25946
2020-10-21 14:19:59 +02:00
Brian Clozel bd91dc70d5 Merge branch '5.2.x' 2020-10-20 15:41:02 +02:00
Brian Clozel 7bee3d1574 Optimize Jackson resource management in codecs
Prior to this commit, references to `JsonGenerator` and
`ByteArrayBuilder` were not closed/released within codecs calls.
This prevents Jackson from reusing more efficiently shared memory
resources.

This commit properly closes/releases Jackson resources in Spring MVC,
Spring WebFlux and Spring Messaging codecs.
A benchmark on WebFlux codecs (in both single value/streaming mode)
shows significant throughput and allocation improvements for small
payloads.

Closes gh-25910
2020-10-20 15:36:23 +02:00
jacopo-salamina dff9924a0c WebSocketTransportRegistration: javadoc typo
The documentation written for the method WebSocketTransportRegistration.setSendTimeLimit(int timeLimit) mentions that, if no time limit is specified, a default value of 10 seconds is used; however, later on the exact default value employed is incorrectly typed as 10 * 10000 ms, which would result in 100 seconds instead.
The javadoc has been updated in order to show the correct value in milliseconds (10 * 1000).
2020-10-20 12:52:46 +01:00
Rossen Stoyanchev bfb2ce6e2a SimpUser exposes Principal
Closes gh-25191
2020-10-19 21:40:09 +01:00
Rossen Stoyanchev 76eb5e6e2c Use of TcpClient extensible per connection
Closes gh-25889
2020-10-19 21:40:09 +01:00
Jupiter 43f595f80e Wording changes. Fixed typo 'CorsConfiguraiton' 2020-10-19 14:17:23 +01:00
Rossen Stoyanchev 6f131ba1c4 Polishing 2020-10-19 13:10:56 +01:00
Rossen Stoyanchev d18fbab7a8 Heartbeat in lieu of non-broker destination message
Closes gh-22822
2020-10-19 13:06:30 +01:00
Rossen Stoyanchev a4d0af802a Merge branch '5.2.x' into master 2020-10-16 19:16:11 +01:00
Rossen Stoyanchev db3d537e72 Protect SseEmitter against early I/O errors
Closes gh-25442
2020-10-16 19:08:30 +01:00
Rossen Stoyanchev a0727191e1 Polishing 2020-10-16 19:08:13 +01:00
Juergen Hoeller 702a05e926 Merge branch '5.2.x' 2020-10-16 15:33:37 +02:00
Brian Clozel 0df6d60fea Fix GitHub icon in build pipeline 2020-10-16 15:29:50 +02:00
Juergen Hoeller 5ab1097b43 Consistent dependency declaration order 2020-10-16 15:19:25 +02:00
Juergen Hoeller d77ecb26a9 Fail on warnings with compileGroovy (since it compiles Java code as well) 2020-10-16 15:18:48 +02:00
Brian Clozel 6d4b286b1a Generate release notes in release pipeline
This commit adds new tasks to the release pipeline, generating release
notes automatically using the issues in the current milestone and
pushing that as the content of the GitHub release.

Closes gh-25922
2020-10-16 14:51:44 +02:00
Brian Clozel 970afbc614 Remove Slack "here" mentions for failed builds
This was introduced by mistake in 6b978cb5dc
2020-10-16 14:51:44 +02:00
Juergen Hoeller f13c43bafe Consistent dependency declaration order 2020-10-16 12:22:04 +02:00
Juergen Hoeller 23211c784e Upgrade to Netty 4.1.53 and Tomcat 9.0.39
Correct version declaration for Apache HttpClient 5 and its reactive module.
2020-10-16 12:20:15 +02:00
Rossen Stoyanchev a2ff139edd Resolve UriComponentsBuilder argument with contextPath
Closes gh-25822
2020-10-15 22:08:32 +01:00
Rossen Stoyanchev 424e28bc35 Merge branch '5.2.x' into master 2020-10-15 17:18:33 +01:00
Rossen Stoyanchev 4952336419 Polishing contribution
See gh-25856
2020-10-15 17:14:27 +01:00
Rostislav Svoboda babcbd0d2b Simplify code for SimpleClientHttpRequestFactory.prepareConnection 2020-10-15 17:14:27 +01:00
Rossen Stoyanchev c45b106d95 Fix race issue and improve readAsynchronousFileChannel
Before this commit, ReadCompletionHandler delayed closing the channel
to allow an ongoing read to complete/fail so we can get a hold of the
associated DataBuffer and release it. This can be problematic since the
read take time to complete but even more importantly there was a race
condition where we didn't check if we've been disposed concurrently
while releasing the read flag.

This commit removes the delay and closes the channel immediately from
cancel() and that should in turn fail any ongoing read operation,
according to AsynchronousChannel, and the DataBuffer is released.

Further improvements include:
- combining the "reading" and "disposed" AtomicBoolean's into a
single "state" AtomicReference.
- an optimistic check to remain in READING mode and avoid state
switches when there is demand to continue reading.

Closes gh-25831
2020-10-15 17:10:22 +01:00
Brian Clozel b7d1bbb991 Configure Concourse release pipeline
Closes gh-25911
2020-10-15 18:06:37 +02:00
Brian Clozel 603a1dd319 Upgrade to Concourse Release Scripts 0.2.1
This release fixes a bug where Spring Boot specifics were baked in the
application itself.
2020-10-15 18:02:32 +02:00
Brian Clozel 6b978cb5dc Refactor Concourse pipeline
Extract duplicate snippets as document anchors.
2020-10-15 18:02:00 +02:00
Sam Brannen b79548d12e Add notes regarding enclosing test configuration inheritance
See gh-25912
2020-10-15 16:23:29 +02:00
Sam Brannen f9e11593a6 Document @NestedTestConfiguration support in reference manual
See gh-25912
2020-10-15 16:04:59 +02:00
Sam Brannen 57ac32b808 Upgrade to Gradle 6.7
Closes gh-25918
2020-10-15 13:48:50 +02:00
Sam Brannen 2eee56d0e2 Polish TestPropertySourceUtils 2020-10-14 15:03:22 +02:00
Sam Brannen a271a0a2bf Ignore @NestedTestConfiguration on enclosing class for nested interface
Closes gh-25917
2020-10-14 14:21:25 +02:00
Sam Brannen 69af56c4e9 Polish MetaAnnotationUtils 2020-10-14 14:21:13 +02:00
Sam Brannen a924677b49 Document @NestedTestConfiguration support in reference manual
See gh-25912
2020-10-14 11:04:46 +02:00
Rossen Stoyanchev 7e647ab1d8 HttpHeadResponseDecorator sets Content-Length for Mono only
See gh-25908
2020-10-13 23:45:51 +01:00
Rossen Stoyanchev abd79d43af Merge branch '5.2.x' into master 2020-10-13 23:42:43 +01:00
Rossen Stoyanchev 431ec906c4 Ensure buffers released in HttpHeadResponseDecorator
See gh-25908
2020-10-13 23:38:59 +01:00
Rossen Stoyanchev 1d96f6a266 HttpHeaderResponseDecorator checks for "Transfer-Encoding"
This commit extends the fix from b86c11cc9b
by checking for both existing Content-Length and Transfer-Encoding.

Closes gh-25908
2020-10-13 23:06:06 +01:00
Sam Brannen e5ae2cb0fe Support Propagation.NEVER for disabling test-managed transactions
Prior to this commit only Propagation.NOT_SUPPORTED was supported for
disabling test-managed transactions via the `propagation` attribute of
`@Transactional`.

This commit allows users to specify Propagation.NOT_SUPPORTED or
Propagation.NEVER to disable test-managed transactions.

Closes gh-25909
2020-10-13 18:30:50 +02:00
Sébastien Deleuze 33fcba55d1 Disable KotlinPropertyResolverExtensionsTests for now
Those tests produce intermittent build errors.
2020-10-13 16:19:01 +02:00
Sébastien Deleuze 3ed8813bbf Upgrade to Coroutines 1.4.0-M1 and use awaitSingle()
This commit raises the minimum Coroutines version supported
to 1.4.0-M1 and above, and changes usages of awaitFirst() or
awaitFirstOrNull() to awaitSingle() or awaitSingleOrNull()
to fix gh-25007.

Closes gh-25914
Closes gh-25007
2020-10-13 15:26:39 +02:00
Juergen Hoeller cd835b3124 Merge branch '5.2.x'
# Conflicts:
#	spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilderTests.java
#	spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBeanTests.java
2020-10-13 11:35:36 +02:00
Juergen Hoeller 7b6293fa05 Avoid outdated Jackson API in tests
See gh-25907
2020-10-13 11:13:54 +02:00
Juergen Hoeller a6e48811c0 Compatibility with Jackson 2.12 (tested against 2.12.0-rc1)
Closes gh-25907
2020-10-13 11:04:55 +02:00
Sam Brannen 4a608e97dc Cross reference @NestedTestConfiguration and supported annotations
See gh-19930
2020-10-13 10:35:51 +02:00
Sam Brannen 74c2df43cc Improve Javadoc for @NestedTestConfiguration
See gh-19930
2020-10-13 09:58:07 +02:00
Sam Brannen 2934a823ed Suppress deprecation warnings in MvcNamespaceTests 2020-10-13 09:44:42 +02:00
Juergen Hoeller 379d9167d9 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-10-13 01:41:48 +02:00
Juergen Hoeller cd7e5f61f0 Upgrade to Caffeine 2.8.6 and OpenPDF 1.3.22 2020-10-13 01:39:42 +02:00
Juergen Hoeller 06b6a4be16 Polishing 2020-10-13 01:39:12 +02:00
Juergen Hoeller e9cd37a4ee Merge branch '5.2.x'
# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java
2020-10-13 00:25:04 +02:00
Juergen Hoeller f3f19504c6 Polishing 2020-10-13 00:21:07 +02:00
Juergen Hoeller 72b2dda17f Avoid creation of unused logger instance in AbstractMediaTypeExpression
Closes gh-25901
2020-10-13 00:20:06 +02:00
Sam Brannen 0af09e076b Make default @NestedTestConfiguration mode configurable
Prior to this commit, the EnclosingConfiguration mode used in
conjunction with @NestedTestConfiguration defaulted to INHERIT.

In other to allow development teams to change the default to OVERRIDE
(e.g., for compatibility with Spring Framework 5.0 through 5.2), this
commit introduces support for changing the default EnclosingConfiguration
mode globally via a JVM system property or via the SpringProperties
mechanism.

For example, the default may be changed to
EnclosingConfiguration.OVERRIDE by supplying the following JVM system
property via the command line.

-Dspring.test.enclosing.configuration=override

Closes gh-19930
2020-10-13 00:12:52 +02:00
Juergen Hoeller 7f365942a5 Nullability refinements and related polishing 2020-10-13 00:08:15 +02:00
Juergen Hoeller 1b63c31722 Avoid creation of unnecessary logger instances in web request abstraction
Closes gh-25900
2020-10-13 00:06:38 +02:00
Rossen Stoyanchev 37e35b37d4 Upgrade to RSocket 1.1 RC1
See gh-25898
2020-10-12 20:06:59 +01:00
Juergen Hoeller a9d458f5fc Merge branch '5.2.x' 2020-10-12 19:54:21 +02:00
Juergen Hoeller e176c4e799 Polishing 2020-10-12 19:40:50 +02:00
Juergen Hoeller 9dc64f5f5f Upgrade to Commons Pool 2.9 2020-10-12 18:37:36 +02:00
Juergen Hoeller ca2b412905 Merge branch '5.2.x' 2020-10-12 18:36:35 +02:00
Juergen Hoeller 690e219fe8 Upgrade to Commons Pool 2.8.1 and WebJars Locator 0.46 2020-10-12 18:34:17 +02:00
Sam Brannen fbb3c5cce7 Switch the default @NestedTestConfiguration mode to INHERIT.
See gh-19930
2020-10-12 18:33:20 +02:00
Juergen Hoeller 66a67ec807 Polishing 2020-10-12 18:26:14 +02:00
Juergen Hoeller 69c330d905 Attempt fallback Part resolution even without StandardMultipartHttpServletRequest
Closes gh-25829
2020-10-12 18:25:55 +02:00
Juergen Hoeller 8c47c7c797 Upgrade to Jetty 9.4.32 and JUnit 4.13.1 2020-10-12 18:07:17 +02:00
Juergen Hoeller 21f2863d8e ControllerAdvice resolution detects @Order declared on @Bean method as well
Closes gh-25872
2020-10-12 18:07:17 +02:00
Juergen Hoeller 83bfee9201 Return null in case of no matching part even for array/collection parameter
Closes gh-25819
2020-10-12 18:07:17 +02:00
Juergen Hoeller 50b9542402 Apply handleMissingValue in case of null conversion result as well
Closes gh-23939
2020-10-12 18:07:17 +02:00
Juergen Hoeller 2a34c0ea70 Return early from composed Converter if initial conversion step returned null
See gh-23379
2020-10-12 18:07:17 +02:00
Sam Brannen fec89af239 Upgrade to JUnit 4.13.1
See gh-22894
2020-10-12 17:51:24 +02:00
Sam Brannen 6641dbc852 Discover test config on enclosing classes for nested test classes
Prior to this commit (and since Spring Framework 5.0), Spring's
integration with JUnit Jupiter supported detection of test
configuration (e.g., @ContextConfiguration, etc.) on @Nested classes.
However, if a @Nested class did not declare its own test configuration,
Spring would not find the configuration from the enclosing class. This
is in contrast to Spring's support for automatic inheritance of test
configuration from superclasses. The only workaround was to
copy-n-paste the entire annotation configuration from enclosing classes
to nested tests classes, which is cumbersome and error prone.

This commit introduces a new @NestedTestConfiguration annotation that
allows one to choose the EnclosingConfiguration mode that Spring should
use when searching for test configuration on a @Nested test class.
Currently, the options are INHERIT or OVERRIDE, where the current
default is OVERRIDE. Note, however, that the default mode will be
changed to INHERIT in a subsequent commit. In addition, support will be
added to configure the global default mode via the SpringProperties
mechanism in order to allow development teams to revert to the behavior
prior to Spring Framework 5.3.

As of this commit, inheritance of the following annotations is honored
when the EnclosingConfiguration mode is INHERIT.

- @ContextConfiguration / @ContextHierarchy
- @ActiveProfiles
- @TestPropertySource / @TestPropertySources
- @WebAppConfiguration
- @TestConstructor
- @BootstrapWith
- @TestExecutionListeners
- @DirtiesContext
- @Transactional
- @Rollback / @Commit

This commit does NOT include support for inheriting the following
annotations on enclosing classes.

- @Sql / @SqlConfig / @SqlGroup

In order to implement this feature, the search algorithms in
MetaAnnotationUtils (and various other spring-test internals) have been
enhanced to detect when annotations should be looked up on enclosing
classes. Other parts of the ecosystem may find the new
searchEnclosingClass() method in MetaAnnotationUtils useful to provide
similar support.

As a side effect of the changes in this commit, validation of user
configuration in repeated @TestPropertySource declarations has been
removed, but this may be reintroduced at a later date.

Closes gh-19930
2020-10-12 17:34:47 +02:00
Rossen Stoyanchev b9f7b0d955 Upgrade to Reactor 2020.0-RC2
See gh-25884
2020-10-12 14:26:51 +01:00
Rossen Stoyanchev 809851c0fe Replace MonoProcessor with AtomicRef for RSocket RESPONSE_HEADER
See gh-25884
2020-10-12 11:55:20 +01:00
Rossen Stoyanchev 5b1b20c8c0 Polishing and minor refactoring
See gh-25884
2020-10-12 11:55:20 +01:00
xuxiang 66138f0dce Fix a few typos in the web reference docs
Closes gh-25893

Co-authored-by: zhiyi.xx <zhiyi.xx@antfin.com>
2020-10-10 16:35:56 +02:00
Rossen Stoyanchev e73e489fd8 Remove use of MonoProcessor.fromSinks
See gh-25884
2020-10-09 20:46:21 +01:00
Sébastien Deleuze cdd48ddd7f Improve Coroutines support consistency 2020-10-09 12:51:08 +02:00
Sébastien Deleuze c4de445822 Upgrade to kotlinx.serialization 1.0.0 2020-10-09 12:41:52 +02:00
Sébastien Deleuze 94a42a3086 Support suspending handler methods in Spring MVC
This commit adds support for Kotlin Coroutines suspending functions to
Spring MVC, by converting those to a Mono that can then be handled by
the asynchronous request processing feature.

It also optimizes Coroutines detection with the introduction of an
optimized KotlinDetector.isSuspendingFunction() method that does not
require kotlin-reflect.

Closes gh-23611
2020-10-09 12:25:32 +02:00
Juergen Hoeller fad7243733 Upgrade to RxJava 3.0.7, Undertow 2.2.2, WebJars Locator 0.46 2020-10-09 09:21:46 +02:00
Rossen Stoyanchev d49a7a105d Fix failing tests from Reactor snapshot changes
See gh-25884
2020-10-08 18:38:05 +01:00
Rossen Stoyanchev 24bd0148d5 Switch to Reactor snapshots
See gh-25884
2020-10-08 14:59:36 +01:00
Rossen Stoyanchev fee8abfa5f Drop "[]" from parameter names in data binding
Closes gh-25836
2020-10-07 16:44:58 +01:00
Juergen Hoeller d05803aa04 Upgrade to Jackson 2.11.3, Apache HttpClient 5.0.3, HtmlUnit 2.44 2020-10-07 15:51:30 +02:00
Juergen Hoeller d55c5b30d7 Merge branch '5.2.x' 2020-10-07 15:34:57 +02:00
Juergen Hoeller ec9de943ee Construct StringBuilder in StreamUtils with appropriate initial size
Closes gh-25789
2020-10-07 15:11:53 +02:00
Rossen Stoyanchev 1c1bc41e24 Merge branch '5.2.x' into master 2020-10-07 12:45:51 +01:00
Rossen Stoyanchev eb11c6fa23 Reinstate removal of jsessionid from lookup path
Closes gh-25864
2020-10-07 11:31:52 +01:00
Sébastien Deleuze 7d7ed88739 Provide WebClient#exchange() alternative for Coroutines
This commit adds awaitExchange { } and
exchangeToFlow { } extensions as Coroutines variants for
exchangeToMono() and exchangeToFlux().

Closes gh-25751
2020-10-07 11:09:12 +02:00
Sébastien Deleuze e899397438 Add missing ClientResponse Coroutines extensions
This commit adds awaitBodilessEntity() and
createExceptionAndAwait() missing ClientResponse
Coroutines extensions.

Closes gh-25866
2020-10-07 11:06:43 +02:00
Arjen Poutsma b2d8180f82 Add params and remoteAddress to request builder
This commit adds methods for adding/changing parameters and remote
address in the WebMvc.fn request builder.

Closes gh-25776
2020-10-07 10:30:02 +02:00
Sébastien Deleuze 9990bd2ea8 Fix checkstyle errors
See gh-25771
2020-10-06 23:13:38 +02:00
Sébastien Deleuze 92b2c45281 Add kotlinx.serialization JSON support to Spring WebFlux
Flow decoding is not supported yet since it depends on
kotlin/kotlinx.serialization#1073, but it will be
enabled when this issue will be fixed.

Closes gh-25771
2020-10-06 23:02:33 +02:00
Rossen Stoyanchev 1cd8871d7f FormHttpMessageConverter preserves MediaType parameters
Closes gh-25839
2020-10-06 18:28:39 +01:00
Rossen Stoyanchev 1c5b95db0b Revert workaround in Jetty connector
The workaround was removed in the 5.3 milestone phase and in master
only because the referenced Jetty issue is marked fixed. However,
what we need to replace it with should be a little more involved
and also it's not entirely clear if the fixes in Jetty aligns with
our release and retain semantics so that needs to be investigated
more thoroughly.
2020-10-06 18:18:26 +01:00
Rossen Stoyanchev 30c7940483 Fix recent regression in WebTestClient
Closes gh-25854
2020-10-06 17:04:48 +01:00
Juergen Hoeller e78aa6b8f8 Upgrade to Groovy 3.0.6 2020-10-06 16:55:58 +02:00
Juergen Hoeller f5d9babfd2 Avoid reflection when creating instances of well-known View classes
Closes gh-25847
2020-10-06 16:55:42 +02:00
Brian Clozel a0af552d0f Add option for ignoring last-modified for static resources
Prior to this commit, the resource handler serving static resources for
Spring MVC and Spring WebFlux would always look at the
`Resource#lastModified` information, derive the `"Last-Modified"` HTTP
response header and support HTTP conditional requests with that
information.

In some cases, builds or packaging tools choose to set this last
modification date to a static date in the past. This allows tools to
have reproducible builds or to leverage caching given the static
resources content didn't change.

This can lead to problems where this static date (e.g. "1980-01-01") is
used literally in HTTP responses and will make the HTTP caching
mechanism counter-productive: the content of the resources changed, but
the application insists on saying it didn't change since the 80s...

This commit adds a new configuration option to disable this support -
there is no way to automatically discard those dates: there is no
standard for that and many don't use he "EPOCH 0 date" as it can lead to
compatibility issues with different OSes.

Closes gh-25845
2020-10-06 16:30:35 +02:00
Philippe Marschall cf61545f41 Add Dependencies Manifest Entry to spring-core
Add a Dependencies manifest entry with the value jdk.unsupported to
spring-core.
2020-10-06 15:45:49 +02:00
Сергей Цыпанов 8a04910bdd Drop explicit zeroing at instantiation of Atomic* objects 2020-10-06 15:45:12 +02:00
Juergen Hoeller b7e1553c9d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java
2020-10-06 15:37:54 +02:00
Arjen Poutsma 392895e256 Revert errorhandler order in RouterFunctionBuilder
Prior to this commit, error handlers in the WebMvc.fn and WebFlux.fn
router function builders had to be registered in an unintuitive, reverse
order, due to the filter chain composition model used.
This commit reverses the error handler order, so that more specific
error handlers can come before generic ones.

Closes gh-25541
2020-10-06 15:32:22 +02:00
Juergen Hoeller ca7fb23432 Upgrade to Hibernate ORM 5.4.22, Hibernate Validator 6.1.6, Undertow 2.0.32, Checkstyle 8.36.2 2020-10-06 15:31:46 +02:00
Juergen Hoeller f83bb7183e Polishing 2020-10-06 15:31:34 +02:00
Juergen Hoeller 1745a3f25d Consistent @Nullable declarations on overridden converter methods 2020-10-06 15:31:26 +02:00
Juergen Hoeller e417318915 Revise native Hibernate 5 bootstrapping with JTA transaction manager
Closes gh-25858
2020-10-06 15:31:19 +02:00
Arjen Poutsma 200b33b26a Add no path HTTP method variants for route builder
This commit adds two overloaded methods for each HTTP method in the
WebFlux.fn and WebMvc.fn route builders: one method taking just a
handler function, the other a request predicate and handler function.

After this commit, it is no longer required to provide a String path,
which is particularly useful when nesting routes, and the path would be
"".

Closes gh-25752
2020-10-06 11:00:17 +02:00
Rossen Stoyanchev d3087537d5 Merge branch '5.2.x' into master 2020-10-02 14:39:27 +01:00
Arjen Poutsma 444c8185b6 Add document on async support in WebMvc.fn
This commit adds reference documentation about the support for
asynchronous types in WebMvc.fn.
2020-10-02 15:04:25 +02:00
Rossen Stoyanchev 2533ba5253 Use Mono.fromDirect for Jetty ReactiveRespnose
Closes gh-25849
2020-10-02 13:43:42 +01:00
Rossen Stoyanchev e44b08f1fc Minor refactoring in JettyClientHttpConnector
See gh-25849
2020-10-02 13:32:00 +01:00
Arjen Poutsma 3303a68436 Use registry to convert to CompletableFuture
Use the ReactiveAdapterRegistry to convert to CompletableFuture,
and remove the ToFutureSubscriber.
2020-10-02 11:39:31 +02:00
Arjen Poutsma 4e76a4780c Add ServerResponse.async() in WebMvc.fn
This commit introduces a new async(Object) method in the WebMvc.fn,
taking a asynchronous response as argument in the form of a
CompletableFuture or Publisher. This allows for asynchronous setting
of headers and status (and not just body, which was already possible).

Closes gh-25828
2020-10-02 10:36:16 +02:00
Sam Brannen c083b95ce1 Polishing 2020-10-01 15:42:06 +02:00
Sam Brannen 92cc006b2c Delete unused code 2020-10-01 15:14:55 +02:00
Rossen Stoyanchev dfb7ca733a Merge branch '5.2.x' into master 2020-09-30 22:10:42 +01:00
Rossen Stoyanchev 86f2ebec1b Fix recursion issue caused by previous commit
See gh-25821
2020-09-30 22:03:46 +01:00
Rossen Stoyanchev 7ad60d385b Fix issue with copying headers in NativeMessageHeaderAccessor
Closes gh-25821
2020-09-30 21:42:26 +01:00
Rossen Stoyanchev 4b9c3fa739 Polishing Javadoc
See gh-25821
2020-09-30 21:42:26 +01:00
Sam Brannen a6bede22c1 Polish contribution
See gh-23379
2020-09-29 14:25:04 +02:00
Josh Cummings a0c00362c3 Introduce Converter.andThen(...)
Closes gh-23379
2020-09-29 14:04:57 +02:00
Arjen Poutsma 8057fb38b2 DefaultPartHttpMessageReader reference docs
This commit changes the WebFlux reference documentation from the
SynchronossPartHttpMessageReader to the DefaultPartHttpMessageReader.

Closes gh-25827
2020-09-28 10:19:49 +02:00
Sam Brannen ba94a1216c Deprecate HttpStatus.Series.valueOf(HttpStatus) and polish
See gh-22366
2020-09-26 16:06:31 +02:00
Nico Heller 97cc89630d Remove inefficiency in HttpStatus.series()
Prior to this commit, the Series value for an HttpStatus was always
evaluated which resulted in an allocation of a Series array by invoking
Series.values() which makes a defensive copy.

This commit addresses this issue by hardcoding the corresponding Series
within the HttpStatus constructor, thereby avoiding any unnecessary
computations. In addition, a unit test has been added to verify that
all HttpStatus enum constants have a properly configured Series.

Closes gh-22366
2020-09-26 15:04:15 +02:00
Sam Brannen b34778d220 Polishing 2020-09-26 15:02:15 +02:00
Rossen Stoyanchev c45be0bf27 Polishing contribution
Closes gh-25780
2020-09-25 21:53:20 +01:00
Anthony Raymond 10eb5bde59 Do not resolve Principal argument if annotated
Closes gh-25780
2020-09-25 21:47:35 +01:00
Rossen Stoyanchev 52084ed954 Update WebFlux docs on logging with async appenders
Closes gh-25547
2020-09-25 21:44:35 +01:00
Rossen Stoyanchev b9ef5416b9 Expose combine method in CorsConfiguration
Closes gh-25716
2020-09-25 21:36:18 +01:00
Rossen Stoyanchev 852e904b08 Exposes getter for part converters in FormHttpMessageConverter
Closes gh-25817
2020-09-25 21:31:44 +01:00
Rossen Stoyanchev bedf2de614 Merge branch '25751-exchange-deprecation' into master
Closes gh-25751
2020-09-25 21:17:25 +01:00
Rossen Stoyanchev 10c5f85a9f WebTestClient documentation updates
See gh-25751
2020-09-25 21:17:07 +01:00
Rossen Stoyanchev db9190e0e6 Remove use of WebClient#exchange from WebTestClient
The exchange() method is now deprecated because it is not safe for
general use but that doesn't apply to the WebTestClient because it
exposes a different higher level API for response handling that
ensures the response is consumed. Nevertheless WebTestClient cannot
call WebClient.exchange() any more.

To fix this WebTestClient no longer delegates to WebClient and thus
gains direct access to the underlying ExchangeFunction. This is
not a big deal because WebClient and WebTestClient do the same
only when it comes to gathering builder options and request input.

See gh-25751
2020-09-25 21:16:44 +01:00
Rossen Stoyanchev 1404dd768f Add exchangeToMono and exchangeToFlux + deprecate exchange()
See gh-25751
2020-09-25 21:16:44 +01:00
Juergen Hoeller 3e4ce9a348 Upgrade to OpenPDF 1.3.22 and Mockito 3.5.13 2020-09-25 20:49:40 +02:00
Juergen Hoeller 7116e5f755 Polishing 2020-09-25 20:40:54 +02:00
Sébastien Deleuze 2dbceb9053 Deprecate LiveBeansView
This commit deprecates LiveBeansView and related classes in order to allow
a future removal in order to increase the separation of concerns between
Spring Framework and Spring Boot, and the consistency between JVM
and native.

Closes gh-25820
2020-09-25 20:04:34 +02:00
Sébastien Deleuze 84b1efa4b8 Merge branch '5.2.x' 2020-09-25 15:23:31 +02:00
Sam Brannen 6aa522b3c1 Apply LONG_RUNNING test group properly
See gh-24830
2020-09-25 14:25:16 +02:00
Sébastien Deleuze b322cbd625 Add missing @Nullable to WebFlux RequestMappingHandlerMapping
Closes gh-25657
2020-09-25 14:22:53 +02:00
Brian Clozel e33e7d7681 Remove TestGroup.PERFORMANCE
Now that there's a new JMH infrastructure for benchmarks and that
performance tests have been rewritten to use it, we should remove the
`PERFORMANCE` `TestGroup` to avoid introducing such tests in the future.

Closes gh-24830
2020-09-25 13:43:38 +02:00
Brian Clozel 61d893257e Rewrite "performance" test to JMH benchmarks
This commit rewrites the remaining "fastEnough" performance tests into
proper JMH benchmarks.

See gh-24830
2020-09-25 13:43:38 +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 f89bd47188 Merge branch '5.2.x' 2020-09-25 12:52:56 +02:00
Juergen Hoeller d022fcf32f Explicit note on TransactionalEventListener versus reactive transactions
Closes gh-25805
2020-09-25 12:49:45 +02:00
Juergen Hoeller e028ef8170 Add MariaDB to the supported database products for functions as well
Closes gh-25811
2020-09-25 12:47:31 +02:00
Juergen Hoeller 6c631e3d5c Merge branch '5.2.x'
# Conflicts:
#	spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java
2020-09-25 11:36:18 +02:00
Igor Manushin 9ad5a8ead0 Add KClass variant to Coroutines web API
Closes gh-24967
2020-09-25 11:32:20 +02:00
Juergen Hoeller 6e4fcb69f0 Polishing 2020-09-25 11:26:01 +02:00
Juergen Hoeller 392ad09990 Add MariaDB to the list of supported database products for procedures
Closes gh-25811
2020-09-25 11:25:05 +02:00
Juergen Hoeller 21cb9e8bff Translate NullBean result to null for lookup method with bean name
Closes gh-25806
2020-09-25 11:24:50 +02:00
Juergen Hoeller c83f6adc24 Revise event multicaster locking for non-synchronized retriever caching
Closes gh-25799
2020-09-25 11:24:26 +02:00
Juergen Hoeller d9da663f6d Optimize String argument resolution in MessageTag
Closes gh-25809
2020-09-25 11:23:38 +02:00
Juergen Hoeller c04400890f Avoid repeated Charset resolution in MimeType
Closes gh-25808
2020-09-25 11:23:12 +02:00
Sam Brannen 00651a3e38 Fix forward-merge errors in 6f04c7b60e and 687c3985d5
See gh-24865
2020-09-25 11:22:29 +02:00
Sam Brannen d7fab85f51 Merge branch '5.2.x' 2020-09-25 11:17:24 +02:00
Sam Brannen bf00db3c6c Avoid AssertJ deprecation warning 2020-09-25 11:08:51 +02:00
Sam Brannen f5d36aa47a Revert use of Map::computeIfAbsent in thread and tx scopes
Issues gh-25038 and gh-25618 collectively introduced a regression for
thread-scoped and transaction-scoped beans.

For example, given a thread-scoped bean X that depends on another
thread-scoped bean Y, if the names of the beans (when used as map keys)
end up in the same bucket within a ConcurrentHashMap AND an attempt is
made to retrieve bean X from the ApplicationContext prior to retrieving
bean Y, then the use of Map::computeIfAbsent in SimpleThreadScope
results in recursive access to the same internal bucket in the map.

On Java 8, that scenario simply hangs. On Java 9 and higher,
ConcurrentHashMap throws an IllegalStateException pointing out that a
"Recursive update" was attempted.

In light of these findings, we are reverting the changes made to
SimpleThreadScope and SimpleTransactionScope in commits 50a4fdac6e and
148dc95eb1.

Closes gh-25801
2020-09-25 11:00:06 +02:00
Juergen Hoeller 9795883d91 Avoid repeated Charset resolution in MimeType
Closes gh-25808
2020-09-25 10:51:08 +02:00
Juergen Hoeller 214bc407b4 Provide Gson/JSON-B MessageConverter for spring-messaging (aligned with spring-web)
Closes gh-21496
2020-09-25 10:48:25 +02:00
Shenker93 ad5072a43c optimize StringUtils trimLeadingWhitespace() / trimTrailingWhitespace() & trimLeadingCharacter() / trimTrailingCharacter() utility methods 2020-09-25 10:44:02 +02:00
Brian Clozel 687c3985d5 Fix merge-forward 2020-09-24 19:54:04 +02:00
Brian Clozel 6f04c7b60e Merge branch '5.2.x' 2020-09-24 18:11:32 +02:00
Brian Clozel a532c527dd Fix missing reference doc from docs archive
Prior to this commit, the `docsZip` task would not reference the new
output locations for the `asciidoctor` and `asciidoctorPdf` tasks.
This results with missing reference docs in the docs zip.

This commit updates the input locations of the Zip task to include the
produced reference docs.

Fixes gh-25783
2020-09-24 17:49:37 +02:00
Brian Clozel 6e7be76278 Upgrade to AsciidoctorJ 3.1.0
Closes gh-24991
2020-09-23 10:06:13 +02:00
Rossen Stoyanchev 1061bcdba2 Set sameSite in ClientHttpResponse implementations
Closes gh-25785
2020-09-22 07:36:29 +01:00
Sam Brannen a5a4960859 Do not generate reference docs for include-files
Prior to this commit, the Asciidoctor Gradle tasks generated top-level
HTML and PDF documents for AsciiDoc files that are included in other
top-level documents. This causes slower builds and results in each
include-file being published twice:

1) inline in the including document (as intended)
2) as a top-level document but missing surrounding context (unintended)

The reason these include-files are generated as top-level documents is
that the asciidoctor and asciidoctorPdf Gradle tasks are configured to
use '*.adoc' as the input source files.

This commit addresses this issue by moving the following include-files
to new subdirectories. Locating the include-files in the subdirectories
causes them to be ignored in the '*.adoc' pattern used to identify
input source files.

- data-access-appendix.adoc -> data-access/data-access-appendix.adoc
- integration-appendix.adoc -> integration/integration-appendix.adoc
- testing-webtestclient.adoc -> testing/testing-webtestclient.adoc

Closes gh-25783
2020-09-21 11:51:50 +02:00
Sam Brannen 2342f5f48a Remove unnecessary folders and files from PDF reference documentation
Prior to this commit, the asciidoctor Gradle task was configured to
generate both the HTML5 and PDF backends. Unfortunately, this resulted
in resources such as HTML, JavaScript, CSS, and images being published
alongside the generated PDF documents.

This commit addresses this issue by introducing the use of a dedicated
asciidoctorPdf Gradle task. The existing asciidoctor Gradle task has
been modified to only generate HTML5 output. Both of these tasks now
share common configuration supplied by the updated asciidoctorj Gradle
task.

In addition, the asciidoctor task now depends on the asciidoctorPdf
task. Thus, invoking `./gradlew asciidoctor` will still generate both
the HTML5 and PDF outputs; whereas, `./gradlew asciidoctorPdf` will
generate only the PDF outputs. We may later decide to rework the tasks
to introduce a dedicated asciidoctorHtml task so that we can generate
the HTML outputs without having to generate the PDF outputs (which are
more time consuming).

See gh-25783
2020-09-21 11:43:08 +02:00
Sam Brannen 87399aedf7 Do not generate reference docs for include-files
Prior to this commit, the Asciidoctor Gradle tasks generated top-level
HTML and PDF documents for AsciiDoc files that are included in other
top-level documents. This causes slower builds and results in each
include-file being published twice:

1) inline in the including document (as intended)
2) as a top-level document but missing surrounding context (unintended)

The reason these include-files are generated as top-level documents is
that the asciidoctor and asciidoctorPdf Gradle tasks are configured to
use '*.adoc' as the input source files.

This commit addresses this issue by moving the following include-files
to new subdirectories. Locating the include-files in the subdirectories
causes them to be ignored in the '*.adoc' pattern used to identify
input source files.

- data-access-appendix.adoc -> data-access/data-access-appendix.adoc
- integration-appendix.adoc -> integration/integration-appendix.adoc
- testing-webtestclient.adoc -> testing/testing-webtestclient.adoc

Closes gh-25783
2020-09-19 14:54:27 +02:00
Juergen Hoeller 2a74f20c99 Merge branch '5.2.x' 2020-09-18 19:14:57 +02:00
Juergen Hoeller f5d7161d6b Consistent flushing of given OutputStream 2020-09-18 19:14:11 +02:00
Juergen Hoeller 82e64af5a5 Avoid throwing plain RuntimeException (plus related polishing)
See gh-24805
2020-09-18 19:01:49 +02:00
Juergen Hoeller bbe74635eb Merge branch '5.2.x' 2020-09-18 18:16:33 +02:00
Juergen Hoeller c1617d3c52 Polishing 2020-09-18 18:15:36 +02:00
Juergen Hoeller 9dfef59af2 Construct StringWriter instances with appropriate initial size
Closes gh-25789
2020-09-18 18:14:57 +02:00
Sam Brannen 4179ea6f22 Remove unnecessary folders and files from PDF reference documentation
Prior to this commit, the asciidoctor Gradle task was configured to
generate both the HTML5 and PDF backends. Unfortunately, this resulted
in resources such as HTML, JavaScript, CSS, and images being published
alongside the generated PDF documents.

This commit addresses this issue by introducing the use of a dedicated
asciidoctorPdf Gradle task. The existing asciidoctor Gradle task has
been modified to only generate HTML5 output. Both of these tasks now
share common configuration supplied by the updated asciidoctorj Gradle
task.

In addition, the asciidoctor task now depends on the asciidoctorPdf
task. Thus, invoking `./gradlew asciidoctor` will still generate both
the HTML5 and PDF outputs; whereas, `./gradlew asciidoctorPdf` will
generate only the PDF outputs. We may later decide to rework the tasks
to introduce a dedicated asciidoctorHtml task so that we can generate
the HTML outputs without having to generate the PDF outputs (which are
more time consuming).

See gh-25783
2020-09-18 18:10:28 +02:00
Sam Brannen e58e33606a Polish WebTestClient ref docs and fix example 2020-09-18 15:33:54 +02:00
Juergen Hoeller 1eef0beda1 Upgrade to Tomcat 9.0.38 and Mockito 3.5.11 2020-09-18 10:23:54 +02:00
Juergen Hoeller ec225b07fa Remove unnecessary @SuppressWarnings 2020-09-18 10:22:53 +02:00
Juergen Hoeller 051de3f179 Configurable java.time.Clock on TaskScheduler implementations
Closes gh-25782
2020-09-18 10:21:48 +02:00
Brian Clozel 5f587faffa Update CI to JDK 15 GA 2020-09-17 13:22:41 +02:00
Stephane Nicoll ec97089dff Upgrade to Kotlin 1.4.10
Closes gh-25779
2020-09-16 14:11:45 +02:00
Sam Brannen 9c8a8d82b9 Merge branch '5.2.x' 2020-09-15 17:18:39 +02:00
Sam Brannen a6daed1b71 Fix example in Javadoc for Assert.notNull(object, messageSupplier)
Closes gh-25774
2020-09-15 16:27:21 +02:00
Stephane Nicoll e9065402f2 Update CI pipeline to release RCs 2020-09-15 15:32:51 +02:00
Sam Brannen fe9f29f031 Suppress deprecation warning in AbstractDataBufferAllocatingTests 2020-09-15 14:34:41 +02:00
Sam Brannen 0556fdecaa Delete unused code in DataClassRowMapper 2020-09-15 14:25:33 +02:00
Juergen Hoeller e4a3d5bf66 Deprecation wording with suggested alternative and without removal hint
See gh-25733
See gh-25736
2020-09-15 13:22:34 +02:00
Rossen Stoyanchev 09080bcbf5 Upgrade to Netty 4.1.52 2020-09-15 11:45:22 +01:00
Rossen Stoyanchev 8b8b59bf80 Merge branch '5.2.x' into master 2020-09-15 11:37:00 +01:00
Rossen Stoyanchev 28df426798 Update AbstractDataBufferAllocatingTests
We are passing custom values to the constructor of PooledByteBufAllocator in
tests in order to turn of caching. This is based on:
https://github.com/netty/netty/issues/5275#issuecomment-220547057

Netty 4.1.52 has significant changes in PooledByteBufAllocator:
https://github.com/netty/netty/pull/10267

After the changes, our current value for maxOrder=2, which results in
chunkSize=16K, causes an assert failure in PoolChunk where the runSize
exceeds the chunkSize.
2020-09-15 11:31:59 +01:00
Stephane Nicoll c27419f74d Merge branch '5.2.x' 2020-09-15 10:51:03 +02:00
Spring Buildmaster 845cb715e7 Next Development Version 2020-09-15 08:31:10 +00:00
Juergen Hoeller d5fed34642 Merge branch '5.2.x' 2020-09-15 10:09:18 +02:00
Juergen Hoeller f010368a66 Polishing 2020-09-15 10:08:01 +02:00
Juergen Hoeller f4bdc0284e Polishing 2020-09-15 09:56:53 +02:00
Juergen Hoeller 801c8ed8ac Revise type resolution for alignment with AbstractJsonHttpMessageConverter
See gh-21188
2020-09-15 09:41:14 +02:00
Andreas Ahlenstorf cd6085a310 Add kotlinx.serialization JSON support to Spring MVC
Closes gh-21188

Co-authored-by: Sebastien Deleuze <sdeleuze@vmware.com>
2020-09-14 23:25:16 +02:00
Juergen Hoeller b8c12a3aa1 Upgrade to Undertow 2.2 (and R2DBC Arabba-SR7) 2020-09-14 22:59:46 +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 3ec4538981 Upgrade to Checkstyle 8.36.1 2020-09-14 22:19:25 +02:00
Juergen Hoeller 3c84863271 Polishing 2020-09-14 22:18:30 +02:00
Juergen Hoeller c2f6a98c90 Lenient handling of empty Content-Disposition filename
Closes gh-25769
2020-09-14 22:16:12 +02:00
Juergen Hoeller 49d65d5c41 Configurable filename encoding in MimeMessageHelper
Closes gh-25755
2020-09-14 22:15:44 +02:00
Rossen Stoyanchev 29885e2b9f Upgrade to RSocket 1.1-M2 and Reactor 2020.0.0-RC1
Closes gh-25729
Closes gh-25728
2020-09-14 20:12:04 +01:00
Ruslan Stelmachenko 3b0f14fd2e Fix typo in Regular Expression Pointcuts docs
Closes gh-25767
2020-09-14 21:01:13 +02:00
Rossen Stoyanchev bd277819fd Merge branch '5.2.x' into master 2020-09-14 15:43:38 +01:00
Rossen Stoyanchev 16d125ce76 Extend Content-Disposition "inline" to error responses
We don't expect a browser to save error responses to a file but we
extend this protection anyway since "inline" is only a suggestion
that shouldn't have any side effects.
2020-09-14 15:28:53 +01:00
Rossen Stoyanchev dccc78146a Expose defaultCharset in StringDecoder
Closes gh-25762
2020-09-14 14:28:02 +01:00
Arjen Poutsma 74f64c4e3b Wrap exceptions in WebClient
This commit makes sure that exceptions emitted by WebClient are wrapped
by WebClientExceptions:

- Exceptions emitted by the ClientHttpConnector are wrapped in a new
  WebClientRequestException.

- Exceptions emitted after a response is received are wrapped in a
  WebClientResponseException

Closes gh-23842
2020-09-14 15:06:46 +02:00
Rossen Stoyanchev dde79a9b65 Upgrade to Reactor Dysprosium-SR12
Closes gh-25730
2020-09-14 14:06:15 +01:00
Sokrato 4dfecde694 fix core doc English regarding @AspectJ 2020-09-14 10:20:31 +01:00
Sam Brannen dc26968224 Upgrade to JUnit 5.7
Closes gh-25527
2020-09-13 23:34:44 +02:00
Rossen Stoyanchev ef10ac6b29 Align WebFlux with WebMvc for pathWithinHandlerMapping
See gh-25174
2020-09-13 21:53:51 +01:00
Rossen Stoyanchev 3295034839 Merge branch '5.2.x' into master 2020-09-13 21:30:02 +01:00
Rossen Stoyanchev b50ad1b9aa AbstractServerHttpResponse skips commit actions on 2nd pass
Closes gh-25753
2020-09-13 21:21:07 +01:00
Rossen Stoyanchev 49356b2c0f SimpleIdGenerator rolls over at Long.MAX_VALUE
Closes gh-25485
2020-09-13 21:09:08 +01:00
Rossen Stoyanchev 852718ec0e Minor fix in PathResourceResolverTests
Closes gh-25671
2020-09-13 21:09:08 +01:00
Sébastien Deleuze 0db3f2b4de Publish documentation under reference/html folder
This is done:
 - For consistency with other Spring projects
 - Because it is probably a better option to use reference instead of
   spring-framework-reference (spring-framework is already present in
   the URL)
 - To improve PDF documentation discoverability

As a consequence:
 - spring-framework-reference HTML documentation is now published
   under reference/html
 - spring-framework-reference/pdf PDF documentation is now published
   under reference/pdf

The following permanent redirect should be created before Spring
Framework 5.3.0 release:
 - current/spring-framework-reference/pdf/* to current/reference/pdf/*
 - current/spring-framework-reference/* to current/reference/html/*

Closes gh-25071
2020-09-12 18:14:36 +02:00
xuxiang f37e0c6a1b Fix typo regarding Ordered interface in core-aop.adoc
Closes gh-25759
2020-09-12 13:57:11 +02:00
Sam Brannen 31316a11fd Polishing 2020-09-11 16:37:11 +02:00
Brian Clozel b2a0978c12 Prepare for Sinks API updates in Reactor
See reactor/reactor-core#2374
All usages of this API are in tests, which are not checking overflow or
concurrent emissions - so a simple replacement with `try***` equivalents
is fine.
2020-09-11 16:34:31 +02:00
Sam Brannen af3dc5d440 Upgrade to Gradle 6.6.1
See gh-25578
2020-09-11 16:18:47 +02:00
Brian Clozel 8473f71a42 Update JDK 15 version in CI image
This also switches to the adoptopenjdk-produced binaries for better
consistency with other JDK versions in our CI.
2020-09-11 13:45:46 +02:00
Brian Clozel b61d0584a9 Update after RSocket SNAPSHOT changes 2020-09-11 13:45:22 +02:00
Arjen Poutsma 3bd96a665f Merge branch '5.2.x' into master 2020-09-10 11:34:44 +02:00
Arjen Poutsma 07d2c08f48 Do not tokenize Forward header value
This commit remove the tokenization previously used in
UriComponentsBuilder#adaptFromForwardedHeaders, in order to support
Forwarded headers that have multiple, comma-separated 'for' elements.

Closes gh-25737
2020-09-09 16:31:24 +02:00
Juergen Hoeller fe6962051e Upgrade to XStream 1.4.13 2020-09-08 17:17:20 +02:00
Juergen Hoeller a958633b7a Merge branch '5.2.x' 2020-09-08 17:09:58 +02:00
Juergen Hoeller ed3b7cd10f Upgrade to HSQLDB 2.5.1 and Woodstox 6.2.1 2020-09-08 17:09:13 +02:00
Juergen Hoeller 4d1d60ac42 Check log level before delegating Supplier-based message to target Log
Closes gh-25741
2020-09-08 16:50:40 +02:00
Brian Clozel f7a014d7dc Improve MIME type subtype suffix handling
Prior to this commit, the subtype suffix of a MIME type (see RFC 6839)
was not properly taken into account when checking compatibility between
MIME types.

For example, `"application/*"` was not considered as compatible with
`"application/vnd.io.spring+json"`.

This commit adds a new `MimeType#getSubtypeSuffix()` method to easily
extract the subtype suffix information. This method is then reused in
the `isCompatibleWith` implementation to better handle these cases.

Fixes gh-25350
2020-09-08 14:46:48 +02:00
Brian Clozel 93f201a414 Deprecate AppCacheManifestTransformer
This commit deprecates the `AppCacheManifestTransformer` implementations
since the appcache feature is being removed from the browsers.

Closes gh-25733
2020-09-08 14:46:48 +02:00
Brian Clozel 078543ce67 Deprecate Joda time support
This commit deprecates the Joda time support and schedules it for
removal in 6.0.

Closes gh-25736
2020-09-08 14:46:48 +02:00
Juergen Hoeller 7dbb40ffa0 Merge branch '5.2.x' 2020-09-08 12:24:18 +02:00
Juergen Hoeller c6cc6705ef FileUrlResource.isWritable() exclusively relies on getFile() implementation
Closes gh-25584
2020-09-08 12:23:27 +02:00
Juergen Hoeller ae1d15c8f4 Declare protected getCharset method as non-static
See gh-25509
2020-09-08 12:22:25 +02:00
Arjen Poutsma 91b609817e Do not use BitSet in BitsCronField
This commit changes BitsCronField to use a long instead of a BitSet,
since the later can use significant memory.

Closes gh-25687
2020-09-08 10:11:32 +02:00
Rossen Stoyanchev dd011c991c Merge branch '5.2.x' into master 2020-09-07 21:41:30 +01:00
Rossen Stoyanchev d616c6632d Remove session on 4xx response from WebSocket handshake
Closes gh-25608
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev 94c91c9e9c Explain how to provide serialization view programmatically
Closes gh-25596
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev b6ff12d2f5 Expose protected method in AbstractJackson2HttpMessageConverter
Closes gh-25509
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev b1d84067cd UriComponentsBuilder Javadoc update
Closes gh-25604
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev c19fc9d53f Switch to Reactor Dysprosium snapshots
See gh-25730
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev 899761f0a8 Avoid unnecessary parsing of path params
See gh-25690
2020-09-07 21:27:52 +01:00
Rossen Stoyanchev f88759c3c9 Shared read-only instances of UrlPathHelper
UrlPathHelper is often created and used without customizations or with
the same customizations. This commit introduces re-usable, instances.
Effectively a backport of commit 23233c.

See gh-25690
2020-09-07 21:27:52 +01:00
Brian Clozel 59ecedea46 Remove artifactory oss snapshot repository
The RSocket SNAPSHOTs are now mirrored on the Spring SNAPSHOT
repository.
2020-09-07 20:05:19 +02:00
Juergen Hoeller 0d699840ad Upgrade to Mockito 3.5.10 and R2DBC Arabba-SR6 2020-09-07 19:36:00 +02:00
Juergen Hoeller 3cc0db5fc3 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-09-07 19:27:25 +02:00
Juergen Hoeller 4f0f29880f Upgrade to AssertJ 3.17.2 and Undertow 2.0.31 2020-09-07 19:25:46 +02:00
Juergen Hoeller 4b211fb18c Javadoc refinements 2020-09-07 19:20:26 +02:00
Juergen Hoeller a93af329fc Fix javadoc typos (from ASM master)
See gh-24872
2020-09-07 17:55:41 +02:00
Juergen Hoeller 75f394ca85 Merge branch '5.2.x' 2020-09-07 17:54:51 +02:00
Juergen Hoeller e797398b10 CallParameterMetaData detects function return parameter specifically
Closes gh-25588
2020-09-07 17:51:23 +02:00
Juergen Hoeller 613b05d814 Properties loading with ignoreResourceNotFound covers SocketException as well
Closes gh-25717
2020-09-07 17:51:14 +02:00
Rossen Stoyanchev 30d556b9ef Support for LoadbalanceRSocketClient
Closes gh-25333
2020-09-07 16:31:12 +01:00
Rossen Stoyanchev 71ecca7443 DefaultRSocketRequesterBuilder internal refactoring 2020-09-07 13:48:27 +01:00
Rossen Stoyanchev 8c2852607d Switch to Reactor and RSocket snapshots 2020-09-07 13:30:28 +01:00
Brian Clozel c5694506ae Early configuration of ApplicationStartup on BeanFactory
Prior to this commit, the `GenericApplicationContext` configured the
`AppliationStartup` on the `BeanFactory` only right before refreshing it.
Delaying this has no purpose and we should instead configure it as soon
as possible by overriding the setter method.

Closes gh-25718
2020-09-07 10:48:59 +02:00
Juergen Hoeller 3fd89c3ac1 Fix merge result
See gh-25706
2020-09-05 13:12:19 +02:00
Juergen Hoeller 9d7849c539 Merge branch '5.2.x'
# Conflicts:
#	spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
2020-09-05 13:02:01 +02:00
Juergen Hoeller 939c76c4a5 Revise documentation notes on getParameterType performance issues
See gh-25679
2020-09-05 13:00:06 +02:00
Juergen Hoeller 40bf83c9e5 Restore original 4.x behavior for initialization of function return name
Closes gh-25707
2020-09-05 12:59:34 +02:00
Juergen Hoeller c368ce8223 Fix SpEL generated code for default method invocation
Closes gh-25706
2020-09-05 12:59:12 +02:00
Andy Clement a404bf5a94 Fix SpEL generated code for default method invocation
Closes gh-25706
2020-09-04 22:23:13 -07:00
Juergen Hoeller 4044f4c30f Polishing 2020-09-03 23:56:36 +02:00
Yanming Zhou a2bb59f1b8 Replace StringBuffer with StringBuilder where possible 2020-09-03 22:40:51 +02:00
Juergen Hoeller 33195da64f Fix assertion for the revised SQLExceptionTranslator contract in 5.3
See gh-25681
2020-09-03 19:34:54 +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
Arjen Poutsma d550d344d5 Respect context path in WebMvc.fn & WebFlux.fn
This commit makes several changes in both WebMvc.fn as well as
WebFlux.fn.

 - ServerRequest now exposes a RequestPath through requestPath(), and
   pathContainer() has been deprecated.

 - The PathPredicate and PathResourceLookupFunction now respects this
   RequestPath's pathInApplication() in their path-related
   functionality.

 - When nesting, the PathPredicate now appends the matched part of the
   path to the current context path, instead of removing the matched
   part (which was done previously). This has the same result: the
   matched part is gone, but now the full path stays the same.

Closes gh-25270
2020-09-03 15:10:56 +02:00
Brian Clozel 88249b2d9a Polish StartupStep "tags" method
Renaming the `tags` method to `getTags` for overall consistency, and
fixing the Javadoc to mention that this returns an immutable collection.

Closes gh-25678
2020-09-02 17:57:38 +02:00
Stephane Nicoll f55b48f4b4 Merge branch '5.2.x' 2020-09-02 14:44:22 +02:00
Stephane Nicoll c2363a6ef9 Make DataSize serializable
Closes gh-25675
2020-09-02 14:39:12 +02:00
Stephane Nicoll a06deac5db Merge branch '5.2.x' 2020-09-02 11:29:25 +02:00
Stephane Nicoll cdfdc340d2 Log cache hit and cache miss for synchronized access
Closes gh-25248
2020-09-02 11:29:03 +02:00
Rossen Stoyanchev e02ccc9374 Optional WebSocket engine presence in WebFlux config
Closes gh-22587
2020-09-02 10:05:58 +01:00
Juergen Hoeller 689adb4bd0 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-09-01 23:46:11 +02:00
Juergen Hoeller 7bd6b8d279 Upgrade to Checkstyle 8.36 2020-09-01 23:41:34 +02:00
Juergen Hoeller 141470ff58 Explicit nullability declarations for getTarget() implementations 2020-09-01 23:26:22 +02:00
Juergen Hoeller e20bff9c64 Consistent data class constructor resolution with clear error message
MVC data class processor constructs target instance even in case of binding failure, as long as the corresponding method parameter is not marked as optional.

Closes gh-24372
2020-09-01 19:10:32 +02:00
Juergen Hoeller 278c6d5cdb Redeclare postProcessProperties callback to skip postProcessPropertyValues
See gh-25165
2020-09-01 11:12:06 +02:00
Rossen Stoyanchev 25165f552d Remove erroneously committed change 2020-09-01 09:42:38 +01:00
Juergen Hoeller e365e0221a Merge branch '5.2.x'
# Conflicts:
#	spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java
2020-09-01 10:30:59 +02:00
Juergen Hoeller d62202f464 Polishing 2020-09-01 10:27:36 +02:00
Juergen Hoeller bcdc2503fa Avoid repeated calls to getPathWithinApplication from getLookupPathForRequest
Closes gh-25669
2020-09-01 10:27:04 +02:00
tristeza 61311248bf change assert in replaceOverride constructor from methodName to methodReplacerBeanName 2020-09-01 10:10:08 +02:00
Johnny Lim 603d7e93b9 Copy httpHandlerDecorator in copy constructor for WebHttpHandlerBuilder
This commit also polishes its Javadoc and fixes its test along the way.
2020-09-01 10:09:34 +02:00
Rossen Stoyanchev e34c800467 More updates to Web testing section
See gh-19647
2020-09-01 08:56:57 +01:00
Rossen Stoyanchev c6b87b3ef4 Updates to Web testing sections of reference docs
Closes gh-19647
2020-08-31 21:15:17 +01:00
Rossen Stoyanchev 9b6476c0a1 Rename MockMvcTestClient to MockMvcWebTestClient
Closes gh-19647
2020-08-31 21:15:17 +01:00
Rossen Stoyanchev 591ab8a00a @EnableWebFlux setup supports WebSocketHandler
Closes gh-22587
2020-08-31 21:15:17 +01:00
Juergen Hoeller 8f369ffed5 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-08-31 18:07:04 +02:00
Juergen Hoeller 3a73533b1c Upgrade Gradle plugins to latest patch releases 2020-08-31 18:01:22 +02:00
Juergen Hoeller d8c420ab75 Avoid full singleton lock for getSingleton(beanName, false)
Closes gh-25667
2020-08-31 18:00:51 +02:00
Сергей Цыпанов 1f3e52d932 gh-25650 Replace remaining usage of LinkedList with ArrayList in tests 2020-08-31 14:33:14 +02:00
Juergen Hoeller 79cf6b4353 Merge branch '5.2.x' 2020-08-30 12:18:49 +02:00
Juergen Hoeller 97d84d9ab8 Upgrade to AssertJ 3.17.1 2020-08-30 12:16:14 +02:00
Juergen Hoeller ae4160e131 Avoid direct use of non-exported XStream CompositeClassLoader class
Closes gh-25662
2020-08-30 12:15:45 +02:00
Сергей Цыпанов a033660425 Improve performance of JdkDynamicAopProxy.getProxy() 2020-08-30 11:40:08 +02:00
Rossen Stoyanchev 7bc8035989 Replace http with https in docs sample 2020-08-28 22:30:57 +01:00
Rossen Stoyanchev 42aeb6cd93 Update docs on timeouts with WebClient
Closes gh-25115
2020-08-28 22:19:01 +01:00
Rossen Stoyanchev c4e1e4ee1e WebFlux AbstractUrlHandlerMapping support URI vars
Closes gh-25648
2020-08-28 21:56:28 +01:00
Rossen Stoyanchev a8d953afa4 CloseStatus implements Serializable
Closes gh-25507
2020-08-28 20:43:45 +01:00
Rossen Stoyanchev bb941b6180 OrderedMessageChannelDecorator doesn't preclude send limits
Closes gh-25581
2020-08-28 20:40:55 +01:00
Juergen Hoeller c4f4fbc003 Polishing 2020-08-28 20:14:24 +02:00
Juergen Hoeller 00c5dbf11a Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
2020-08-28 20:01:17 +02:00
Juergen Hoeller bb9e79daa7 Polishing 2020-08-28 19:58:56 +02:00
Juergen Hoeller 6d9d4157ef Specifically detect Joda-Time 2.x
Closes gh-25655
2020-08-28 19:57:51 +02:00
Juergen Hoeller d37eaa5941 Introduce DataClassRowMapper with record-style constructor binding support
Closes gh-24695
2020-08-28 18:52:35 +02:00
Juergen Hoeller d4192b9d35 Expose record-style accessor methods for instance fields as bean properties
Closes gh-24391
2020-08-28 18:51:27 +02:00
Violeta Georgieva 1fe2ea5a87 Add logPrefix to the log statement
Add logPrefix to the log statement to provide better debugging experience
2020-08-28 10:53:07 +01:00
Rossen Stoyanchev f4f1abb27a Revert "OrderedMessageSender throughput improvement"
This reverts commit f5c287a6e6.

See gh-25581
2020-08-28 09:43:51 +01:00
Rossen Stoyanchev f98719902b Revert "Polishing OrderedMessageSender"
This reverts commit d014d88937.

See gh-25581
2020-08-28 09:43:01 +01:00
Juergen Hoeller 7288ae1c16 Upgrade to Protobuf 3.13, JRuby 9.2.13, Mockito 3.5.7 2020-08-27 17:49:14 +02:00
Juergen Hoeller 0f2cc53be7 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-08-27 17:32:20 +02:00
Juergen Hoeller 387eddcf75 Upgrade to Hibernate ORM 5.4.21, HtmlUnit 2.43, AspectJ 1.9.6 2020-08-27 17:29:06 +02:00
Juergen Hoeller 71e70aed14 Polishing 2020-08-27 17:13:33 +02:00
Juergen Hoeller 2080878d82 Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
2020-08-27 14:40:54 +02:00
Juergen Hoeller a8b295c516 Consistent javadoc for ParseState and its entry classes 2020-08-27 14:37:42 +02:00
Juergen Hoeller cf2e0c7959 Selected use of ArrayList instead of LinkedList in common places
See gh-25652
2020-08-27 14:14:44 +02:00
Juergen Hoeller 589060d10f Avoid LinkedList performance issues through use of ArrayDeque
Closes gh-25652
2020-08-27 14:14:08 +02:00
Juergen Hoeller 60fa704f78 Consistent behavior for overloaded @Bean methods with ASM processing
Closes gh-25263
2020-08-27 14:13:33 +02:00
Rossen Stoyanchev d014d88937 Polishing OrderedMessageSender
See gh-25581
2020-08-27 13:08:41 +01:00
Rossen Stoyanchev f5c287a6e6 OrderedMessageSender throughput improvement
Before this change messages were sent serially across sessions but
ordering is important only within a session. This leads to head of
line blocking when a session is slow to send, and also enforcement of
send buffer size and time limits is precluded because it happens at
a lower level in the transport.

This change ensures messages are held up only if there is another
from the same session is being sent. This allows messages from each
session to flow independent of other.

See gh-25581
2020-08-27 13:08:41 +01:00
Rossen Stoyanchev 568b44eb9d Consistent generics in spring-test Matcher declarations
Closes gh-25610
2020-08-27 10:50:30 +01:00
Rossen Stoyanchev 21d25b23d9 WebFlux extension point to decorate the HttpHandler
Closes gh-25633
2020-08-27 10:50:30 +01:00
Rossen Stoyanchev 9c7b4ff9ba Public method to register RSocket handler methods
Closes gh-25639
2020-08-27 10:50:30 +01: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 d198c4426f Extract ConcurrentLruCache for reuse in NamedParameterJdbcTemplate
Closes gh-24197
2020-08-26 14:35:01 +02:00
Riley Park 6884a3ac56 Fix appendix typos in ContentDisposition 2020-08-26 11:33:27 +01:00
Juergen Hoeller 2b47e779ac Explicit explanation that no resize/rehash operations will be needed
See gh-25349
2020-08-26 11:48:50 +02:00
Juergen Hoeller ff11467a0c Avoid resizing of fixed-size HashMap/LinkedHashMap variants
Closes gh-25349
2020-08-25 19:26:18 +02:00
Juergen Hoeller 241afeb1b7 Upgrade to JUnit 5.7 RC1 (and RxJava 3.0.6)
See gh-25527
2020-08-25 16:26:57 +02:00
Juergen Hoeller 5d96a2dc9e Defensive null handling for exception message
See gh-24878
2020-08-25 16:26:23 +02:00
Juergen Hoeller 7324140d20 Merge branch '5.2.x' 2020-08-25 16:21:00 +02:00
Juergen Hoeller f43c39c905 Upgrade to Hibernate ORM 5.4.20 2020-08-25 16:17:35 +02:00
Juergen Hoeller 6f0461c569 Polishing 2020-08-25 16:17:22 +02:00
Juergen Hoeller 04df9b8f49 Efficient checks for empty strings and single character matches
Closes gh-25552
Closes gh-25553
2020-08-25 16:17:12 +02:00
Juergen Hoeller 0d4040aa63 Avoid potential integer overflow in seconds->millis transformation
Closes gh-25613
2020-08-25 16:16:34 +02:00
Marten Deinum 74a014743a Call StartupStep.end in finally block
Prior to this commit it was possible that a StartupStep was
started but never ended. This was the case when an exception
occured during bean initializing. To always call the method
regardless of the outcome, the call to StartupStep.end has
been moved to a finally block.

When an exception occurs the StartupStep is also enriched with
the exception class and message for diagnostic purposes.

See gh-22776
Closes gh-25572
2020-08-24 09:48:54 +02:00
Rossen Stoyanchev 7adeb461e0 WebClient exposes API for access to native request
Closes gh-25115, gh-25493
2020-08-24 07:58:35 +01:00
Sam Brannen 0f7ad1b5bf Merge branch '5.2.x' 2020-08-22 23:50:28 +02:00
Sam Brannen 148dc95eb1 Fix regressions in SimpleThreadScope and SimpleTransactionScope
PR gh-25038 introduced regressions in SimpleThreadScope and
SimpleTransactionScope in Spring Framework 5.2.7. Specifically, if a
thread-scoped or transaction-scoped bean has a dependency on another
thread-scoped or transaction-scoped bean, respectively, a
ConcurrentModificationException will be thrown on Java 11 or higher.

The reason is that Java 11 introduced a check for concurrent
modification in java.util.HashMap's computeIfAbsent() implementation,
and such a modification can occur when a thread-scoped bean is being
created in order to satisfy a dependency of another thread-scoped bean
that is currently being created.

This commit fixes these regressions by switching from HashMap to
ConcurrentHashMap for the instance maps in SimpleThreadScope and
SimpleTransactionScope.

Closes gh-25618
2020-08-22 23:19:58 +02:00
Oleksii Klochko 7205edac85 Fix typo in websocket.adoc
Closes gh-25630
2020-08-22 22:56:36 +02:00
Stephane Nicoll 8047a0bb78 Upgrade to Kotlin 1.4.0
Closes gh-25617
2020-08-20 11:12:22 +02:00
Rossen Stoyanchev ccb719eae3 Merge branch 'webtestclient-experiment' 2020-08-19 21:16:04 +01:00
Rossen Stoyanchev 3426e6274c Add MockMvcTestClient
See gh-19647
2020-08-19 21:15:20 +01:00
Rossen Stoyanchev 128acaff8a WebTestClient cookie assertion support
See gh-19647
2020-08-19 21:15:20 +01:00
Rossen Stoyanchev 6e8bb6c4a9 WebTestClient header assertion improvements
Provides parity with similar options in MockMvc:
 - compare header using a long value
 - compare header using a date/time value
 - dedicated method for "Location" header (redirect)
 - let Hamcrest assert a header even when missing

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev f500ab0f9b Add mechanism to expose mock server results
WebTestClient is an actual client and generally it's only possible
to assert the client response (i.e. what goes over HTTP). However,
in a mock server scenario technically we have access to the server
request and response and can make those available for further
assertions.

This will be helpful for the WebTestClient integration with MockMvc
where many more assertions can be performed on the server request
and response when needed.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev cb02b0e776 WebTestClient releases body on returnResult(Void.class)
The original behavior was to ignore the body which came with odd
warnings in the Javadoc and potential leaks that could be reported
from tests causing unnecessary concern.

This change causes the body to be released and effectively still
ignores it but minus the potential leaks.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev dd7369df48 WiretapConnector.Info is private
The claimRequest method was not intended to be public and couldn't
have been used since the Info type it returned was package private.
This change completely hides the Info.

See gh-19647
2020-08-19 21:14:13 +01:00
Rossen Stoyanchev 4116e6dd18 Pull up method to ConfiugrableMockMvcBuilder
See gh-19647
2020-08-19 21:13:17 +01:00
Rossen Stoyanchev 443e9ee618 MockMvc applies StandardMultipartHttpServletRequest wrapper
This is necessary to correctly process multipart requests and resolve
@RequestPart arguments and MultipartFile arguments.

Closes gh-25602
2020-08-19 09:06:20 +01:00
Sam Brannen 50b20c2bb7 Merge branch '5.2.x' 2020-08-17 16:01:32 +02:00
Sam Brannen d939016a09 Polish contribution
See gh-25600
2020-08-17 15:53:45 +02:00
Maciej Miklas a83529c844 Introduce createContext() factory method in AbstractGenericContextLoader
Prior to this commit it was possible to configure the
DefaultListableBeanFactory used by the GenericApplicationContext
created by AbstractGenericContextLoader, but it was not possible to
completely replace the bean factory.

This commit introduces a new createContext() factory method in
AbstractGenericContextLoader which indirectly allows subclasses to
supply a custom DefaultListableBeanFactory implementation to the
GenericApplicationContext.

Closes gh-25600
2020-08-17 15:38:24 +02:00
Sam Brannen 32e851617e Fix Javadoc formatting in GenericGroovyXmlContextLoader 2020-08-17 15:37:51 +02:00
Sam Brannen 1891f8af70 Merge branch '5.2.x' 2020-08-16 20:04:24 +02:00
Sam Brannen 93e5214d01 Revise Javadoc regarding log level for non-static BFPP @Bean method
Closes gh-25590
2020-08-16 20:03:46 +02:00
Rossen Stoyanchev 7758ba3c7e Refactor MonoToListenableFutureAdapter
Closes gh-25561
2020-08-14 15:18:39 +01:00
Rossen Stoyanchev a7f71f4d9b Support filename hint for client side too
Closes gh-25516
2020-08-14 15:18:39 +01:00
York Lee 36553264ce Fix document for core-bean.adoc
This is the orginal "A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container". Here's an extra word of "otherwise".
2020-08-14 11:04:27 +01:00
Sam Brannen 13183c89ce Update tests due to deprecations in Reactor 2020-08-12 13:46:32 +02:00
Sam Brannen 4d3dd9b9f6 Clean up warnings in Gradle build 2020-08-11 17:20:27 +02:00
Sam Brannen c558391e2c Declare interfaces as @FunctionalInterface where feasible
This commit declares each of the following public interfaces as a
@FunctionalInterface.

- org.springframework.context.ApplicationContextInitializer
- org.springframework.test.web.servlet.DispatcherServletCustomizer
- org.springframework.validation.MessageCodeFormatter
- org.springframework.util.IdGenerator
- org.springframework.beans.factory.config.YamlProcessor.MatchCallback
- org.springframework.beans.factory.config.YamlProcessor.DocumentMatcher

Closes gh-25580
2020-08-11 17:01:03 +02:00
Sam Brannen 596936f18c Polishing 2020-08-11 16:42:18 +02:00
Sam Brannen 6a2939a4d4 Suppress deprecation warnings in JmsInvokerTests 2020-08-11 12:12:01 +02:00
Sam Brannen 45491f0756 Upgrade to Gradle 6.6
Closes gh-25578
2020-08-11 12:10:35 +02:00
Sam Brannen 2c757399b2 Polish spring-jcl documentation 2020-08-11 11:58:49 +02:00
Rossen Stoyanchev 63a4873edb Upgrade to RSocket 1.1.0-M1
Closes gh-25331
2020-08-10 20:39:44 +01:00
Rossen Stoyanchev 7d41c5fa2e Upgrade to Reactor 2020.0.0-M2
Closes gh-25373
2020-08-10 18:50:18 +01:00
Juergen Hoeller 9d92fa79d3 Upgrade to AspectJ 1.9.6, RxJava 3.0.5, HtmlUnit 2.43 2020-08-10 19:05:59 +02:00
Vitalii Ananev 890f29e832 Add spring-jcl information to reference doc
Closes gh-22158
2020-08-10 16:52:45 +02:00
Sébastien Deleuze 79dfda7369 Add a comment about gradle/gradle#14017
See gh-24171
2020-08-10 16:49:00 +02:00
Sam Brannen 5de549d7d4 Update contentType property via MockHttpServletResponse::setCharacterEncoding()
Prior to this commit, MockHttpServletResponse's setCharacterEncoding()
method did not update the contentType property, which violates the
Servlet 2.4 Javadoc for getContentType() and setCharacterEncoding().

This commit addresses this issue; however, some existing tests may have
to be updated as a result of this change.

For example, note how some of the tests in this commit have been
refactored to use MediaType##isCompatibleWith() instead of asserting
exact matches for the value returned by MockHttpServletResponse's
getContentType() method.

Closes gh-25536
2020-08-10 16:05:18 +02:00
Sam Brannen c5bb5d6c03 Polish ViewResolutionTests 2020-08-10 15:31:51 +02:00
Сергей Цыпанов c2122551c8 Improve UriComponents.sanitizeSource() 2020-08-10 14:47:20 +02:00
Juergen Hoeller 7b6e1c957f Merge branch '5.2.x' 2020-08-10 14:44:22 +02:00
Juergen Hoeller 9bf5cba3c2 Drop outdated notes on handler type versus handler method restrictions
Closes gh-25482
2020-08-10 14:43:27 +02:00
Juergen Hoeller 7d56c303a4 Use getType with allowFactoryBeanInit=false during advisor retrieval
Closes gh-25546
2020-08-10 14:43:02 +02:00
Sam Brannen 1f35cc5cae Polish contribution
See gh-25506
2020-08-10 14:17:04 +02:00
Qimiao Chen af8ab2e3a8 Optimize DefaultLifecycleProcessor::startBeans
Closes gh-25506
2020-08-10 14:08:14 +02:00
Sam Brannen 1dcaa04224 Fix typo in reference manual 2020-08-10 12:22:06 +02:00
diguage 2c274cf0aa Use Groovy syntax highlighting in reference manual
Closes gh-25554
2020-08-10 12:11:03 +02:00
Sam Brannen e0d79f5dbb Merge branch '5.2.x' 2020-08-10 11:36:19 +02:00
Sam Brannen bd65762582 Polish Javadoc for MessagePostProcessor interfaces
See gh-25571
2020-08-10 11:26:41 +02:00
Philippe Marschall 6a7e58ac82 Add @FunctionalInterface to MessagePostProcessor
Add the @FunctionalInterface annotation to the MessagePostProcessor
interfaces in the spring-jms and spring-messaging projects.

Closes gh-25571
2020-08-10 11:19:35 +02:00
Brian Clozel 88ccab8f13 Revert timeout inscreases in STOMP tests
This change is not fixing tests but rather increasing their duration, so
we're reverting this change as a result.
2020-08-08 16:39:56 +02:00
Sam Brannen d0cf90bb8e Update tests due to deprecations in Reactor 2020-08-08 12:40:23 +02:00
Sam Brannen 01b79514da Update ReactiveTypeHandlerTests due to deprecations in Reactor 2020-08-08 12:33:26 +02:00
Sam Brannen 17acc3554c Sync MockServerHttpResponse changes 2020-08-08 12:31:50 +02:00
Sam Brannen 0b57368d5f Merge branch '5.2.x' 2020-08-08 12:23:45 +02:00
Sam Brannen e25e690ad4 Assert preconditions for MergedAnnotations.from() factory methods
Prior to this commit, if null values were supplied for the
RepeatableContainers or AnnotationFilter arguments to `from()` factory
methods in MergedAnnotations, certain operations would eventually
result in a NullPointerException. This is to be expected; however, the
NullPointerException is often swallowed and only logged at INFO level
with an exception message similar to the following.

> Failed to introspect annotations on org.example.MyClass: NullPointerException

In such cases, the INFO log message is not helpful in diagnosing the
problem. Furthermore, since the exception is swallowed, the desired
operation (e.g., MergedAnnotations.stream(...)) simply returns no
results.

This commit improves the user experience by eagerly asserting non-null
preconditions for required arguments in MergedAnnotations.from()
factory methods.

Closes gh-25568
2020-08-08 12:21:15 +02:00
Sam Brannen a614abe17b Polish Javadoc for MergedAnnotations 2020-08-08 11:59:24 +02:00
Brian Clozel 3c832f0ec8 Upgrade ActiveMQ and extend timeout in STOMP tests 2020-08-08 11:44:16 +02:00
Juergen Hoeller e87a49c61c Merge branch '5.2.x' 2020-08-07 21:43:33 +02:00
Juergen Hoeller 292f581cdd Populate dependencies metadata for resolved target behind lazy dependency proxy
Closes gh-25562
2020-08-07 21:42:02 +02:00
Brian Clozel 617ec359bd Update after MonoProcessor deprecation in Reactor
This commit adapts the usage of `MonoProcessor` after deprecations
introduced in reactor/reactor-core#1053
2020-08-07 18:59:21 +02:00
Juergen Hoeller 922f9452f2 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-08-07 16:05:14 +02:00
Juergen Hoeller 686f5d4a5e Upgrade to Jackson 2.10.5 2020-08-07 15:55:10 +02:00
Juergen Hoeller 3b9558a269 Polishing 2020-08-07 15:51:33 +02:00
Juergen Hoeller a6af1def57 Polishing 2020-08-07 13:31:21 +02:00
Juergen Hoeller f4c0ceb1cc Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java
#	spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java
2020-08-07 13:15:36 +02:00
Juergen Hoeller 692c5f292d Polishing 2020-08-07 13:11:48 +02:00
Juergen Hoeller 7fdb33a105 Upgrade to Jetty 9.4.31, Groovy 2.5.13, Hibernate ORM 5.4.19, EclipseLink 2.7.7, Checkstyle 8.35 2020-08-07 13:03:28 +02:00
Juergen Hoeller 8dd285f877 Polishing 2020-08-07 13:02:43 +02:00
Juergen Hoeller 94eee6a32a Provide access to AbstractRoutingDataSource's resolved target DataSources
Closes gh-25544
2020-08-07 13:00:35 +02:00
Juergen Hoeller 96a4e1150e Avoid unnecessary computation of cleaned URL
Closes gh-25531
2020-08-07 12:59:41 +02:00
Juergen Hoeller 14839b1f4a Sort detected PersistenceExceptionTranslator beans
Closes gh-24644
2020-08-07 12:08:03 +02:00
Juergen Hoeller b345019415 Introduce getBeanProvider variants with allowEagerInit flag
Closes gh-25559
2020-08-07 12:07:13 +02:00
Stephane Nicoll 392f51cdd6 Merge branch '5.2.x' 2020-08-07 11:06:21 +02:00
Stephane Nicoll 6acbc5093a Indicate caches should be initialized in SimpleCacheManager
Closes gh-22988
2020-08-07 11:01:39 +02:00
Tadaya Tsuyukubo 83df467b3b Remove @Nullable from CookieLocaleResolver#determineDefaultLocale()
By definition, this method should not return `null`.
2020-08-07 10:51:02 +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
Juergen Hoeller b6ef3cfad5 Refactor HandlerExecutionChain towards List-centric interceptor storage
Closes gh-25500
2020-08-07 00:32:52 +02:00
Juergen Hoeller d61c0ee57d Consistent support for path variable and multipart binding
Closes gh-24107
Closes gh-22169
Closes gh-25265
2020-08-06 18:28:09 +02:00
Brian Clozel 5bdbbdfcfb Require RSocket 1.0+
This commit removes the previously deprecated classes in Spring
Framework 5.2.x. By doing so, Spring Framework now requires RSocket
1.0+.

Closes gh-25548
2020-08-06 14:45:38 +02:00
Sam Brannen 2087f3586c Merge branch '5.2.x' 2020-08-06 14:26:21 +02:00
diguage 0501999e43 Fix comment syntax in xml examples
See gh-25537
2020-08-06 14:25:30 +02:00
Juergen Hoeller c99c3142ad HibernateJpaDialect/HibernateTransactionManager alignment for 5.2+
See gh-25533
2020-08-06 12:00:20 +02:00
Brian Clozel df98d0c661 Update CI to concourse-release-scripts 0.2.0 2020-08-06 10:17:19 +02:00
Brian Clozel 38690bdc7c Upgrade CI image to jdk8u265-b01 2020-08-06 10:05:13 +02:00
Stephane Nicoll 6d164b1445 Merge branch '5.2.x' 2020-08-06 09:30:17 +02:00
Stephane Nicoll b6842730f7 Merge pull request #25539 from diguage
* pr/25539:
  Fix asciidoctor syntax for source

Closes gh-25539
2020-08-06 09:27:38 +02:00
diguage 5cb2cc2466 Fix asciidoctor syntax for source
See gh-25539
2020-08-06 09:27:09 +02:00
Stephane Nicoll c7b74c4358 Merge pull request #25537 from diguage
* pr/25537:
  Fix comment syntax in xml examples

Closes gh-25537
2020-08-06 09:10:42 +02:00
diguage e150a95685 Fix comment syntax in xml examples
See gh-25537
2020-08-06 09:10:10 +02:00
Sam Brannen dded51fa80 Merge branch '5.2.x' 2020-08-05 17:47:44 +02:00
Sam Brannen 96da1ff9ea Support @RestControllerAdvice in Standalone MockMvc again
Since Spring Framework 5.2, @RestControllerAdvice registered with
MockMvc when using MockMvcBuilders.standaloneSetup() has no longer been
properly supported if annotation attributes were declared in the
@RestControllerAdvice annotation. Prior to 5.2, this was not an issue.

The cause for this regression is two-fold.

1. Commit 50c257794f refactored
   DefaultListableBeanFactory so that findAnnotationOnBean() supports
   merged annotations; however, that commit did not refactor
   StaticListableBeanFactory#findAnnotationOnBean() to support merged
   annotations.

2. Commit 978adbdae7 refactored
   ControllerAdviceBean so that a merged @ControllerAdvice annotation
   is only looked up via ApplicationContext#findAnnotationOnBean().

The latter relies on the fact that findAnnotationOnBean() supports
merged annotations (e.g., @RestControllerAdvice as a merged instance of
@ControllerAdvice). Behind the scenes, MockMvcBuilders.standaloneSetup()
creates a StubWebApplicationContext which internally uses a
StubBeanFactory which extends StaticListableBeanFactory. Consequently,
since the implementation of findAnnotationOnBean() in
StaticListableBeanFactory was not updated to support merged annotations
like it was in DefaultListableBeanFactory, we only see this regression
with the standalone MockMvc support and not with MockMvc support for an
existing WebApplicationContext or with standard Spring applications
using an ApplicationContext that uses DefaultListableBeanFactory.

This commit fixes this regression by supporting merged annotations in
StaticListableBeanFactory#findAnnotationOnBean() as well.

Closes gh-25520
2020-08-05 17:40:16 +02:00
Sam Brannen 40fc472c70 Polish ExceptionHandlerTests 2020-08-05 17:24:45 +02:00
Juergen Hoeller ba65cef52b Upgrade Hibernate support baseline to 5.2+
Closes gh-25533
Closes gh-22326
2020-08-05 14:14:31 +02:00
Brian Clozel b6d2a2980d Update for Reactor API changes 2020-08-05 13:31:39 +02:00
Arjen Poutsma b0d273e047 Polishing 2020-08-05 11:26:25 +02:00
Arjen Poutsma 4d670ee25d Drop support for standalone "L" in CronExpression
This commit removes support for a standalone "L" in the
day-of-week of a cron expression, which used a locale-dependent
API to determine what the last day of the week is (Saturday or
Sunday ?).
Alternatively, we could have implement this in the exact way as Quartz
has done (i.e. treat the "L" like "SAT"), but we opted not to do that,
as having an explicit SAT or SUN is much clearer.
2020-08-05 09:42:18 +02:00
Arjen Poutsma 762cf0ffe8 Check for asterisk range in CronExpression
This commit makes sure that in CronExpression, the asterisk is only used
in a range field, and is not surrounded by unexpected characters.

Closes gh-19500
2020-08-04 16:34:02 +02:00
Sam Brannen 3dc4f43852 Merge branch '5.2.x' 2020-08-04 15:13:35 +02:00
Sam Brannen 7a31885ae5 Fix bug in StaticListableBeanFactory.isSingleton()
Prior to this commit, StaticListableBeanFactory.isSingleton() returned
false for singleton beans unless they were created by a FactoryBean.

StaticListableBeanFactory.isSingleton() now properly returns true for
all beans not created by a FactoryBean.

Closes gh-25522
2020-08-04 15:13:10 +02:00
Stephane Nicoll 1dcd7f418f Access connection factory from DatabaseClient
This commit provides an accessor for the underlying ConnectionFactory
that a DatabaseClient uses.

Closes gh-25521
2020-08-04 11:47:34 +02:00
Stephane Nicoll 673f83e388 Adapt to API changes in the latest reactor snapshot 2020-08-04 11:41:30 +02:00
Arjen Poutsma 93b53dae29 Add support for Quartz features in CronExpression
This commit introduces support for Quartz-specific features in
CronExpression. This includes support for "L", "W", and "#".

Closes gh-20106
Closes gh-22436
2020-08-04 08:41:18 +02:00
Arjen Poutsma 1a8906bdc3 Support macros in CronExpression
This commit introduces supports for macros like "@yearly", "@monthly",
etc. in CronExpression.

Closes gh-25471
2020-08-04 07:51:32 +02:00
Juergen Hoeller ea52627c38 Upgrade to Jackson 2.11.2, Jetty 9.4.31, Hibernate ORM 5.4.19, Groovy 3.0.5, JRuby 9.2.12, Protobuf 3.12.4, HSQLDB 2.5.1, TestNG 7.3, Mockito 3.4.6, Checkstyle 8.35
Closes gh-25398
2020-08-03 20:25:19 +02:00
Arjen Poutsma dbec16d566 Add test for Friday 13th crontab failure
Added test for Friday 13th trigger, i.e. an uncommon crontab expression.
With the new CronExpression in place, this failure does not occur
anymore.

Closes gh-21574
2020-08-03 16:55:55 +02:00
Arjen Poutsma 72895f0810 Add test for combination of fixed date fields
Added test for a fixed day-of-week and day-of-month combination.
With the new CronExpression in place, this failure does not occur
anymore.

Closes gh-13621
2020-08-03 16:49:21 +02:00
Arjen Poutsma 87c3bb5797 Introduce CronExpression
This commit introduces CronExpression, a new for representing cron
expressions, and a direct replacement for CronSequenceGenerator.
2020-08-03 16:37:31 +02:00
Sam Brannen c17f2047f6 Merge branch '5.2.x' 2020-08-03 13:44:39 +02:00
Sam Brannen 91d1383e93 Use Spliterators.emptySpliterator() in TypeMappedAnnotations
For greater clarity, this commit invokes Spliterators.emptySpliterator()
directly instead of going through java.util.Collections.EmptyList.
2020-08-03 13:44:02 +02:00
Sam Brannen d646e602d9 Merge branch '5.2.x' 2020-08-03 12:19:49 +02:00
Sam Brannen 969aa8ad47 Update copyright date 2020-08-03 12:19:21 +02:00
Sam Brannen d8554c498c Merge branch '5.2.x' 2020-08-01 16:42:31 +02:00
Sam Brannen 482adb9478 Fix error message for type mismatch in jsonPath().value()
Prior to this commit, if a value existed at the specified JSON path but
had an incompatible type, the AssertionError thrown contained a message
stating that the value did not exist (i.e., "No Value at JSON Path"),
which was not only misleading but also technically incorrect.

This commit fixes the error message for such use cases. For example, the
AssertionError thrown in such use cases now resembles the following.

  At JSON path "$.name", value <Lisa> of type <java.lang.String> cannot
  be converted to type <byte[]>

Closes gh-25480
2020-08-01 16:35:54 +02:00
Sam Brannen 5a12e7b2c5 Fix typo in test method names 2020-08-01 16:30:12 +02:00
Sam Brannen 58412affaa Merge branch '5.2.x' 2020-08-01 14:02:22 +02:00
Sam Brannen 5576321b04 Reset charset field in MockHttpServletResponse
Prior to this commit, calling reset() on MockHttpServletResponse did not
reset the `charset` field to `false` which could result in the
"Content-Type" header containing `;charset=null` which in turn would
result in errors when parsing the "Content-Type" header.

This commit resets the charset field to `false` in
MockHttpServletResponse's reset() method to avoid such errors.

Closes gh-25501
2020-08-01 14:01:39 +02:00
Sam Brannen 785ab5798a Sync MockHttpServletResponse changes 2020-08-01 12:43:26 +02:00
Sam Brannen 6f716e6965 Merge branch '5.2.x' 2020-08-01 12:29:41 +02:00
Sam Brannen 89bb9cb749 Polish Javadoc 2020-08-01 12:26:56 +02:00
Sam Brannen 9b0729007f Polish MockHttpServletResponseTests 2020-08-01 12:26:38 +02:00
Brian Clozel 9aae5ed3fa Update Reactor Netty modules
Since reactor/reactor-netty#739, the `reactor-netty` module is now split
into two: `reactor-netty-core` and `reactor-netty-http`.

This commit updates the Spring Framework build accordingly.
2020-08-01 11:49:15 +02:00
Andy Wilkinson c1b2e23029 Disable unwanted Kotlin Stdlib dependencies 2020-07-30 18:27:27 +02:00
Sam Brannen f28918e91d Merge branch '5.2.x' 2020-07-30 13:38:32 +02:00
Sébastien Deleuze 2d08c76ab5 Bring back kotlin-script-runtime dependency
See gh-24171
2020-07-30 10:57:53 +02:00
Sébastien Deleuze 5c456db3cc Upgrade to Kotlin 1.4 RC
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-07-30 10:18:33 +02:00
Brian Clozel 83e3c332a5 Upgrade Ubuntu in CI images 2020-07-30 09:13:12 +02:00
Sam Brannen 7dbf42e858 Polish contribution
See gh-25483
2020-07-29 20:16:21 +02:00
Brian Clozel 16eebf2911 RSocket SNAPSHOTs are now part of /snapshot 2020-07-29 18:32:49 +02:00
yilianhuaixiao 83a95832e6 Filter repeatable annotations in AnnotationTypeMappings
Prior to this commit, AnnotationTypeMappings did not filter repeatable
annotations with the supplied annotation filter.

Closes gh-25483
2020-07-29 17:11:24 +02:00
Sam Brannen b841e8560c Polish MergedAnnotation API internals 2020-07-29 17:08:58 +02:00
Rossen Stoyanchev 683cc2eb7f Add NDJSON and deprecate application/stream+json
Closes gh-21283
2020-07-28 17:53:37 +03:00
Rossen Stoyanchev 354635ede0 Polishing 2020-07-28 17:53:37 +03:00
Brian Clozel f19afe0c76 Upgrade JDK 11, 14 and 15 EA 2020-07-28 14:56:12 +02:00
Brian Clozel be801fc5fc Polish
See gh-24878
2020-07-28 14:48:25 +02:00
Juergen Hoeller 77137719d8 Polishing 2020-07-28 11:29:57 +02:00
Juergen Hoeller a1a9bb3e7f Explicit note on phasing out serialization-based remoting
See gh-25379
2020-07-28 11:28:34 +02:00
Juergen Hoeller adce6593af Move metrics package to org.springframework.core
See gh-24878
2020-07-28 11:28:10 +02:00
Juergen Hoeller 9f211de113 Turn MethodArgumentNotValidException into subclass of BindException
Closes gh-23107
2020-07-28 11:08:04 +02:00
Sam Brannen 8a394c2b07 Merge branch '5.2.x' 2020-07-28 10:00:21 +02:00
Sam Brannen 2b3fdfabb2 Remove unused class filtering support in AnnotationScanner
PR gh-25429 brought it to our attention that there was a bug in
AnnotationScanner when using a non-null class filter that filtered out
classes; however, it turns out that there is no production code that
utilizes the package-private class filtering support.

This commit therefore removes all class filtering support from
AnnotationScanner since that functionality is effectively unused.

Closes gh-25477
2020-07-28 09:58:14 +02:00
Brian Clozel 87c5b5a664 Upgrade to JDK 8u262 2020-07-27 22:59:08 +02:00
Brian Clozel 9301d7a294 Add application startup metrics support
This commit adds a new `StartupStep` interface and its factory
`ApplicationStartup`. Such steps are created, tagged with metadata and
thir execution time can be recorded - in order to collect metrics about
the application startup.

The default implementation is a "no-op" variant and has no side-effect.
Other implementations can record and collect events in a dedicated
metrics system or profiling tools. We provide here an implementation for
recording and storing steps with Java Flight Recorder.

This commit also instruments the Spring application context to gather
metrics about various phases of the application context, such as:

* context refresh phase
* bean definition registry post-processing
* bean factory post-processing
* beans instantiation and post-processing

Third part libraries involved in the Spring application context can
reuse the same infrastructure to record similar metrics.

Closes gh-24878
2020-07-27 22:37:14 +02:00
Rossen Stoyanchev 4252b7fd7d @ExceptionHandler support for non-@Controller handlers
Closes gh-22619
2020-07-27 21:20:50 +03:00
Rossen Stoyanchev a4c157fc09 Check for native WebSocket message
In addition to the changes in
313a7836b0 to support passing on a
the underlying WebSocket message, this commits checks for its
availability.

Closes gh-25099
2020-07-27 21:20:50 +03:00
Sam Brannen 86c52a842f Support multiple Content-Language values in MockHttpServletResponse
Prior to this commit, if the user supplied a comma-separated list such
as "en, it" as the Content-Language header value to
MockHttpServletResponse's setHeader() method, only the first language
was actually set in the response's Content-Language header (e.g., "en").

This commit ensures that all supplied content languages are set in the
response's Content-Language header.

Closes gh-25281
2020-07-27 17:47:46 +02:00
Sam Brannen d2db43a900 Polish Javadoc 2020-07-27 14:38:24 +02:00
Sam Brannen 27e0febacf Polish MockHttpServletResponseTests 2020-07-26 09:57:25 +02:00
Sam Brannen a03f894a14 Merge branch '5.2.x' 2020-07-25 15:48:53 +02:00
Sam Brannen 5442d8779a Polish contribution
See gh-25429
2020-07-25 15:24:36 +02:00
yilianhuaixiao 650cbeee14 Avoid infinite loop in AnnotationScanner
Prior to this commit, scanning for annotations resulted in an infinite
loop when using the INHERITED_ANNOTATIONS search strategy and a class
filter that filters out visited classes.

This commit avoids an infinite loop in AnnotationsScanner's
processClassInheritedAnnotations(...) method by skipping the current
level of the class hierarchy when the current source class has been
filtered out.

Closes gh-25429
2020-07-25 15:23:21 +02:00
Arjen Poutsma cf8c36adf3 Javadoc
Add Javadoc note explaining that StringUtils.cleanPath should not be
depended on in security context.
2020-07-23 17:43:20 +02:00
Sébastien Deleuze 05683fed7a Skip LoadTimeWeaverAwareProcessor with native images 2020-07-23 12:13:20 +02:00
Juergen Hoeller 718d46adac Check for alias overriding bean definition of same name
Closes gh-25430
2020-07-22 18:42:53 +02:00
Sam Brannen 32b35e9a23 Merge branch '5.2.x' 2020-07-22 17:28:57 +02:00
Sam Brannen 335c3d5db6 Polish contribution
See gh-25445
2020-07-22 17:26:59 +02:00
XenoAmess ab859fcc96 Refine use of substring operations
Closes gh-25445
2020-07-22 17:26:42 +02:00
Sam Brannen a8901e3cf8 Polish contribution
See gh-25445
2020-07-22 16:36:14 +02:00
XenoAmess edfc6c0293 Refine use of substring operations
Closes gh-25445
2020-07-22 16:28:58 +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
Rossen Stoyanchev 9fe1feea9a Provide access to underlying RSocketClient
The recently introduced support for RSocketClient in commit
7c98251142 did not expose the underlying
client in order to avoid a hard dependency on RSocket 1.1 for the time
being. However such access appears to be necessary, e.g. for Spring
Integration, where the connection needs to be established (warmed up)
ahead of actual requests.

See gh-25332
2020-07-22 14:57:33 +03:00
Rossen Stoyanchev f9ba58eab9 Match subscriptions to remove by id
Commit 524ca1a676 unintentionally changed
how subscriptions to be removed are matched. This commit restores that.

See gh-25298
2020-07-22 13:22:29 +03:00
Sam Brannen 471577a11b Polish contribution
See gh-25454
2020-07-22 11:35:31 +02:00
XenoAmess 523d2f88be Use List.sort instead of Collection.sort in tests
Closes gh-25454
2020-07-22 11:32:50 +02:00
Sam Brannen ae5913f3b6 Polish tests
See gh-25456
2020-07-22 11:09:52 +02:00
XenoAmess cd12583e13 Use Integer.parseInt instead of Integer.valueOf for primitive int
Closes gh-25456
2020-07-22 10:54:32 +02:00
Sam Brannen 24f9b1d966 Delete unused import 2020-07-22 10:40:59 +02:00
XenoAmess e4a139e70e Use System.currentTimeMillis() in AbstractSockJsService
Closes gh-25447
2020-07-22 10:39:27 +02:00
XenoAmess 3b12beb1b8 Simplify if-statements with instanceof checks
Closes gh-25449
2020-07-22 10:34:27 +02:00
XenoAmess c7f44ff671 Fix links in Javadoc
Closes gh-25448
2020-07-22 10:24:55 +02:00
XenoAmess fa0a1446f0 Use StringBuilder instead of StringBuffer in tests
Closes gh-25450
2020-07-22 10:21:06 +02:00
Sungho Hwang 2522fe0292 Fix typos in Javadoc
Closes gh-25458
2020-07-22 10:18:36 +02:00
Sam Brannen 2719dcb29b Delete unused imports 2020-07-22 10:14:08 +02:00
XenoAmess b6c463676a Use Stream#toArray in TestCompiler
Closes gh-25453
2020-07-21 20:44:54 +02:00
XenoAmess e71f702bb9 Use static private instead of private static for method declarations
Closes gh-25452
2020-07-21 18:26:28 +02:00
Brian Clozel 05ef630f4f Merge branch '5.2.x' 2020-07-21 11:05:32 +02:00
Spring Buildmaster fc6b38a8f6 Next Development Version 2020-07-21 08:20:59 +00:00
Jay Bryant 674bad0c59 Wording changes
Replace potentially insensitive language with more neutral language.

See gh-25314
2020-07-20 20:08:54 +02:00
Sam Brannen 3d64f8162c Merge branch '5.2.x' 2020-07-20 18:38:32 +02:00
Jay Bryant 1c83b3fc22 Wording changes
Replace potentially insensitive language with more neutral language.

Closes gh-25314
2020-07-20 17:14:13 +02:00
Juergen Hoeller 6b6e8be313 Upgrade to Mockito 3.4.4 2020-07-20 17:07:23 +02:00
Rossen Stoyanchev 7ce4d150ce Merge branch '5.2.x' 2020-07-20 18:02:22 +03:00
Rossen Stoyanchev 913eca9e14 ReactorNettyRequestUpgradeStrategy uses unique builder per request
See gh-25315
2020-07-20 17:55:23 +03:00
Juergen Hoeller 6c7f18e902 Upgrade to Jetty Reactive HttpClient 1.1.4 2020-07-20 16:47:52 +02:00
Juergen Hoeller 64f4703445 Defer creating logger in StandardWebSocketHandlerAdapter to instantiation time
Closes gh-25427
2020-07-20 16:47:32 +02:00
Rossen Stoyanchev eb032a50a0 Upgrade to Reactor Dysprosium-SR10
Closes gh-25376
2020-07-20 16:48:33 +03:00
Arjen Poutsma 74d3044641 Merge pull request #25415 from thenx-wei/master
* gh-25415:
  Simplify PathResourceLookupFunction
2020-07-20 11:11:14 +02:00
May 24b1caf434 Simplify PathResourceLookupFunction
This commit simplified two return statements.
2020-07-20 11:04:32 +02:00
Juergen Hoeller 88394bff66 Merge branch '5.2.x' 2020-07-20 07:21:36 +02:00
Juergen Hoeller 65e601090f Copy queryParams MultiValueMap through addAll (for independent List entries)
Closes gh-25423
2020-07-20 07:07:17 +02:00
Juergen Hoeller f1345aadf5 Defensively access existing beanDefinitionMap entries
See gh-22263
2020-07-20 07:04:45 +02:00
Juergen Hoeller e4e54b3c4a Merge branch '5.2.x' 2020-07-19 20:01:21 +02:00
Juergen Hoeller 43e315f10c Unwrap SqlParameterValue for disposable value detection in cleanupParameters
Closes gh-22972
2020-07-19 19:59:15 +02:00
Juergen Hoeller 30bc5e09e7 Defensively catch NoSuchBeanDefinitionException on beanDefinitionNames traversal
Closes gh-22263
2020-07-19 19:56:33 +02:00
Juergen Hoeller 7b6924522a Avoid unnecessarily alarming stack trace logged during scheduler resolution
Closes gh-23268
2020-07-19 19:55:19 +02:00
Juergen Hoeller 9a618dc7a1 Enforce ConditionalContentCachingResponseWrapper in ShallowEtagHeaderFilter
Closes gh-24976
2020-07-19 19:53:29 +02:00
Juergen Hoeller 165a6f186d Expose setExceptionListener on AbstractJmsListenerContainerFactory
Closes gh-22102
2020-07-19 19:53:01 +02:00
Juergen Hoeller 4f2aaa49a9 Replace javadoc references to deprecated query methods
See gh-25272
2020-07-19 18:59:26 +02:00
Juergen Hoeller 6317bc2262 Upgrade to Protobuf 3.12.2 and Rome 1.15 2020-07-17 19:33:32 +02:00
Juergen Hoeller e0d05153aa Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-07-17 19:30:03 +02:00
Juergen Hoeller bd3b44838f Upgrade to Checkstyle 8.34 and HtmlUnit 2.42 2020-07-17 19:24:50 +02:00
Juergen Hoeller 0b697a3068 Polishing 2020-07-17 19:24:23 +02:00
Juergen Hoeller 198d64d539 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-07-17 17:52:08 +02:00
Juergen Hoeller 851908851d Upgrade to Tomcat 9.0.37, Netty 4.1.51, Apache Johnzon 1.2.8, OpenPDF 1.3.20, Caffeine 2.8.5, Hessian 4.0.63 2020-07-17 17:49:24 +02:00
Juergen Hoeller e9898f7d52 Polishing 2020-07-17 17:48:33 +02:00
Juergen Hoeller 30bf870810 Check JDBC 4 getFunctions (for compatibility with PostgreSQL driver 42.2.11)
Closes gh-25399
2020-07-17 17:47:53 +02:00
Juergen Hoeller 01bab89dba Consistently use PropertySource.getName() for comparison
Includes synchronization for mutators on MutablePropertySources.

Closes gh-25369
2020-07-17 17:45:58 +02:00
Juergen Hoeller 5846d9c2ea Clarify enforceInitMethod/enforceDestroyMethod default values
Closes gh-25402
2020-07-17 17:44:59 +02:00
Sam Brannen 111899aa63 Add @Nullable declaration to getDefaultConstructor()
See gh-25367
2020-07-16 17:32:16 +02:00
Rossen Stoyanchev b451379c2f Update eviction queue before size
See gh-25298
2020-07-16 17:28:32 +03:00
Rossen Stoyanchev 44f1f94f97 Polishing contribution
Renaming, trimming of method parameters, minor refactoring of helper
methods, comments, etc. Completely functionally neutral.

See gh-25298
2020-07-16 17:28:32 +03:00
Tomas Drabek 524ca1a676 DefaultSubscriptionRegistry: Reduced thread contention
* DestinationCache is now synchronized on multiple 'destination' locks
 (previously a single shared lock)
* DestinationCache keeps destinations without any subscriptions
 (previously such destinations were recomputed over and over)
* SessionSubscriptionRegistry is now a
 'sessionId -> subscriptionId -> (destination,selector)' map
 for faster lookups
 (previously 'sessionId -> destination -> set of (subscriptionId,selector)')

closes gh-24395
2020-07-16 17:28:32 +03:00
Sam Brannen b0570cd3a6 Polish contribution
See gh-25367
2020-07-16 15:56:17 +02:00
Martin Knopf 35c0ae7b0c Allow auto grow for entries w/o default constructor in SpEL
Prior to this commit, The "auto grow" feature in SpEL expressions only
worked for element types with a default constructor. For example, auto
grow did not work for a list of BigDecimal elements.

This commit inserts a null value in the list when no default
constructor can be found for the element type.

Closes gh-25367
2020-07-16 15:31:33 +02:00
Yanming Zhou d2e1150c79 Fix typo in javadoc for @RequestMapping
Closes gh-25396
2020-07-16 08:41:39 +02:00
Sam Brannen 4578e49213 Merge branch '5.2.x' 2020-07-15 19:04:05 +02:00
Sam Brannen fcf20bab2a Delete duplicate code block in WebHttpHandlerBuilder.applicationContext()
This commit deletes a duplicated code block that was accidentally
introduced in a8a1fc6de5.

Closes gh-25389
2020-07-15 18:58:31 +02:00
Rossen Stoyanchev 7c98251142 Support for making requests via RSocketClient
Closes gh-25332
2020-07-14 12:07:59 +03:00
Rossen Stoyanchev e4a3c1570d Upgrade to RSocket 1.1.0 snapshots
See gh-25331
2020-07-13 17:02:05 +03:00
Rossen Stoyanchev b54853484e Merge branch '5.2.x' 2020-07-13 16:59:32 +03:00
Rossen Stoyanchev 03fa48919e Switch to Reactor Dysprosium snapshots
See gh-25376
2020-07-13 16:51:09 +03:00
Rossen Stoyanchev 1dec4f3d0f DefaultServerRequest parses the path if necessary
Closes gh-25353
2020-07-13 13:16:49 +03:00
May 490bdd11a5 Use Math.min() in ExponentialBackOff
Use Math.min() instead of doing it manually in ExponentialBackOff.

Closes gh-25381
2020-07-13 11:53:30 +02:00
Sam Brannen abe16eeb6e Use test name as thread name prefix in scheduling TaskExecutor tests
This commit also deletes a duplicate copy of the assertThreadNamePrefix()
method.
2020-07-11 17:01:54 +02:00
Sam Brannen 54d9dfa84f Merge branch '5.2.x' 2020-07-10 15:40:43 +02:00
Sam Brannen b769b73960 Improve JavaDoc for ConfigurableApplicationContext.refresh()
Closes gh-25380
2020-07-10 15:39:45 +02:00
Brian Clozel d9ccd618ea Deprecate remoting technologies support
Because of security and broader industry support, support for several
remoting technologies is now deprecated and scheduled for removal in
Spring Framework 6.0.

This commit deprecates the following remoting technologies:

* HTTPInvoker
* RMI
* Hessian
* JMS remoting

Other remoting technologies like EJB or JAXWS might be deprecated in the
future depending on industry support.

Closes gh-25379
2020-07-10 12:04:24 +02:00
Brian Clozel 92cdf526fb Upgrade CI images to ubuntu:bionic-20200630 2020-07-09 21:54:12 +02:00
Rossen Stoyanchev 313a7836b0 Provide access to Netty's WebSocketFrame
Closes gh-25099
2020-07-09 15:42:28 +03:00
Rossen Stoyanchev 37366e0c91 Support for custom status in ResponseStatusException
Closes gh-20336
2020-07-09 15:06:33 +03:00
Rossen Stoyanchev 4d7418841c AbstractHandlerMethodMapping refactoring
Remove convenience Map that is to avoid. The only downside is that
getHandlerMethods requires a transformation but that should not be used frequently.

See gh-22961
2020-07-09 12:11:15 +03:00
Rossen Stoyanchev 0584c289ab Support for direct path lookups in WebFlux
Closes gh-22961
2020-07-09 11:26:04 +03:00
Rossen Stoyanchev 47a3a5c970 Switch to Reactor 2020.0.0 snapshots
See gh-25373
2020-07-08 19:52:50 +03:00
Sam Brannen c972d861ed Revert "Use correct link to MaxInMemorySize"
This reverts commit 90467ba568.
2020-07-08 15:25:46 +02:00
Johnny Lim 90467ba568 Use correct link to MaxInMemorySize
Closes gh-25368
2020-07-08 15:05:24 +02:00
Rossen Stoyanchev 0e4e25d227 Updates to CORS patterns contribution
Closes gh-25016
2020-07-08 13:18:46 +03:00
Rossen Stoyanchev 1181bb1852 Rename originsPattern to originPatterns
See gh-25016
2020-07-08 13:18:46 +03:00
Ruslan Akhundov 8632118e8d CorsConfiguration now supports pattern based origins.
Closes gh-24763
2020-07-08 13:18:46 +03:00
Juergen Hoeller a1bab14140 Upgrade to ASM 9.0 beta
Closes gh-24872
2020-07-07 16:17:58 +02:00
Sam Brannen 8e02d2706e Merge branch '5.2.x' 2020-07-07 14:18:56 +02:00
Sam Brannen 2c9e794676 Make Profiles created via Profiles.of() comparable
Prior to this commit, a Profiles instance created via Profiles.of() was
not considered equivalent to another Profiles instance created via
Profiles.of() with the exact same expressions. This makes it difficult
to mock invocations of Environment#acceptsProfiles(Profiles) -- for
example, when using a mocking library such as Mockito.

This commit makes Profiles instances created via Profiles.of()
"comparable" by implementing equals() and hashCode() in ParsedProfiles.

Note, however, that equivalence is only guaranteed if the exact same
profile expression strings are supplied to Profiles.of(). In other
words, Profiles.of("A & B", "C | D") is equivalent to
Profiles.of("A & B", "C | D") and Profiles.of("C | D", "A & B"), but
Profiles.of("X & Y") is not equivalent to Profiles.of("X&Y") or
Profiles.of("Y & X").

Closes gh-25340
2020-07-07 14:17:36 +02:00
Sam Brannen 882668c1bc Merge branch '5.2.x' 2020-07-06 16:33:01 +02:00
Sam Brannen 8734c64b75 Remove invalid import from Kotlin example 2020-07-06 16:31:33 +02:00
Sam Brannen 8be2a43d52 Rename SystemArchitecture aspect to CommonPointcuts in AOP ref doc
See gh-25357
2020-07-06 16:20:05 +02:00
Johnny Lim 364939b2a3 Remove redundant Character.toLowerCase() in BeanPropertyRowMapper
This commit removes a redundant Character.toLowerCase() invocation in
BeanPropertyRowMapper.underscoreName().

Closes gh-25361
2020-07-06 15:31:18 +02:00
Sam Brannen 33643593e2 Merge branch '5.2.x' 2020-07-06 14:51:15 +02:00
Sam Brannen 52c2ca610b Polish AOP reference documentation
- fix formatting
- fix syntax
- use consistent example package name
2020-07-06 14:50:44 +02:00
Rossen Stoyanchev 34607d96f1 PathPattern caching with HandlerMappingIntrospector
This commit evolves the solution from M1 by parsing and caching patterns with the
target HandlerMapping's PathPatternParser. This makes it unnecessary for callers to
be aware of pattern parsing.

Closes gh-25312
2020-07-06 15:31:35 +03:00
Brian Clozel 32ab596e94 Upgrade CI to JDK15ea30 2020-07-06 11:32:07 +02:00
Sam Brannen 4ae9895814 Upgrade to Gradle 6.5.1 2020-07-04 15:00:38 +02:00
Sam Brannen 362e228142 Merge branch '5.2.x' 2020-07-03 12:04:34 +02:00
Sam Brannen 35582ded0e Use System.nanoTime() for Random seed in SocketUtils
Prior to this commit, SocketUtils used System.currentTimeMillis() for
the seed for the java.util.Random instance used internally. The use of
the milliseconds value returned by currentTimeMillis() can lead to
collisions for randomly selected free ports for tests executing in
parallel on the same computer.

This commit therefore switches to System.nanoTime() for the Random seed
used in SocketUtils in an attempt to avoid such collisions for tests
executing in parallel in different JVMs on the same computer.

Closes gh-25321
2020-07-03 12:04:02 +02:00
Johnny Lim 72e92211ce Polish mutateContextPathWithoutUpdatingPathShouldFail()
Closes gh-25352
2020-07-02 16:58:32 +02:00
Sam Brannen 85a46882ce Merge branch '5.2.x' 2020-07-02 15:29:32 +02:00
Maksim 008a0a1bdd Fix interface and class names in examples in core-aop doc
Closes gh-25351
2020-07-02 15:28:05 +02:00
Arjen Poutsma f13ab6d18c Merge branch '5.2.x' 2020-07-01 13:29:15 +02:00
Arjen Poutsma 5b94d9b00b Use UTF-8 for application/*+json
This commit makes sure that the StringHttpMessageConverter reads
input with "application/*+json" as Content-Type with the UTF-8
character set.

Closes gh-25328
2020-07-01 10:46:58 +02:00
Rossen Stoyanchev 5e1b6e3386 Merge branch '5.2.x' 2020-07-01 08:07:56 +01:00
Rossen Stoyanchev 3aaff40e2e Replace explicit use of PooledDataBuffer.release() 2020-07-01 08:07:50 +01:00
Rossen Stoyanchev b2a4d1c5b1 Avoid re-creating connect Mono<RSocket>
Closes gh-25330
2020-07-01 08:02:03 +01:00
Sébastien Deleuze 9d37794ebc Avoid using LiveBeansView in GraalVM native images
Closes gh-25344
2020-06-30 15:52:50 +02:00
Arjen Poutsma e251075d6c Merge branch '5.2.x' 2020-06-30 15:49:19 +02:00
Arjen Poutsma 79c339b03e Support for ASCII in Jackson codec & converter
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See gh-25322
2020-06-30 15:46:54 +02:00
Arjen Poutsma 20254f02d2 Polishing 2020-06-30 11:33:12 +02:00
Arjen Poutsma e9d9de5f99 RouterFunction honors PathPatternParser in config
This commit introduces a way to change the PathPatternParser used in
PathPredicates, by way of a ChangePathPatternParserVisitor. This
visitor is used by both WebFluxConfigurationSupport and
WebMvcConfigurationSupport to make sure the configured parser is used.

Closes gh-23236
2020-06-30 11:33:12 +02:00
Sébastien Deleuze 671d4519b2 Fix checkstyle error 2020-06-30 07:58:05 +02:00
Sébastien Deleuze 02b539c5f5 Leverage spring.ignore.xml flag to avoid XmlBeanDefinitionReader
Closes gh-25338
2020-06-30 07:38:30 +02:00
Sébastien Deleuze 06b364fefe Leverage spring.ignore.xml flag to avoid SQLStateSQLExceptionTranslator
Closes gh-25335
2020-06-30 07:34:50 +02:00
Sam Brannen a92441186c Check for valid IPv6 host in UriComponentsBuilder.fromUriString
PR gh-358 introduced a "scheme but no host" check in the fromHttpUrl()
method in UriComponentsBuilder, but a similar check was not added to
fromUriString() at that time.

This commit introduces a "scheme but no host" check in fromUriString()
to align with the functionality in fromHttpUrl().

Note, however that the regular expressions used to match against the
hostname or IP address are inexact and still permit invalid host names
or IP addresses. True validation of the host portion of the URI is out
of scope for this commit.

Closes gh-25334
2020-06-29 18:36:21 +02:00
Sam Brannen 622ccc5767 Merge branch '5.2.x' 2020-06-27 14:34:18 +02:00
Sam Brannen 51a5517a45 Polishing 2020-06-27 14:33:44 +02:00
Sam Brannen d599ec906a Merge branch '5.2.x' 2020-06-27 14:27:58 +02:00
Сергей Цыпанов d08ce303f1 Extract Class.getName() from String concatenation
This commit extracts a Class.getName() invocation from String
concatenation in AbstractMonitoringInterceptor to avoid an issue
related to profile pollution.

Closes gh-25324
2020-06-27 14:24:49 +02:00
Sam Brannen df673e65e8 Polish contribution
See gh-25300
2020-06-26 19:20:54 +02:00
May 43df06b905 Replace anonymous inner classes with lambda expressions
Closes gh-25319
2020-06-26 18:47:38 +02:00
Sam Brannen ba5f4f5414 Merge branch '5.2.x' 2020-06-26 18:31:07 +02:00
Sam Brannen 9876ca003b Support fragments in UriComponentsBuilder.fromHttpUrl()
Prior to this commit, UriComponentsBuilder.fromHttpUrl() threw an
IllegalArgumentException if the provided URL contained a fragment.

This commit aligns the implementation of fromHttpUrl() with that of
fromUriString(), by parsing a fragment and storing it in the builder.

Closes gh-25300
2020-06-26 18:30:09 +02:00
Sam Brannen dd11dbf3b1 Polish UriComponentsBuilderTests 2020-06-26 14:58:06 +02:00
Rossen Stoyanchev 115ea253f6 Fix typo 2020-06-24 16:29:47 +01:00
Rossen Stoyanchev b16f6fa456 Shared static instance of DefaultDataBufferFactory 2020-06-24 16:12:56 +01:00
Juergen Hoeller 3a06622270 Include module names into alphabetical order 2020-06-24 16:08:21 +02:00
Sam Brannen 049f5250fe Suppress varargs warning
Prior to this commit, the Gradle build failed due to a varargs warning.

See gh-25311
2020-06-24 15:38:39 +02:00
Philippe Marschall a142d21700 Use @SafeVarargs in Jackson builder and factory
Using @SafeVarargs in Jackson mapper builder and factory bean classes
allows the varargs methods to be used without a compiler warning. The
implementations of these methods do not perform unsafe operations on
their varargs parameter. It is therefore safe to add this annotation.

The following two methods are changed:

- add @SafeVarargs to Jackson2ObjectMapperBuilder#modulesToInstall
  and make it final
- add @SafeVarargs to
  Jackson2ObjectMapperFactoryBean#setModulesToInstall and make it final

This is a backwards incompatible change as these methods now have to be
declared final. Existing subclasses that override one of these methods
will break.

Closes gh-25311
2020-06-24 15:38:21 +02:00
Sam Brannen b33d2fe683 Clean up warnings in Gradle build, polishing, etc. 2020-06-24 15:02:24 +02:00
May bc9b9bc477 Replace cascading if statements with switch statement
Closes gh-25308
2020-06-24 13:54:17 +02:00
Sam Brannen 751739442b Polishing 2020-06-24 13:49:33 +02:00
Arjen Poutsma 51cc719c00 Remove UndertowDataBuffer
This commit removes the UndertowDataBuffer, in favor of using regular
DataBuffers from the DataBufferFactory. During the development of the
DefaultPartHttpMessageReader, it was determined that invoking various
slicing and releasing operators on the UndertowDataBuffer resulted in
memory leaks. This commit fixes that.
2020-06-24 10:31:48 +02:00
Arjen Poutsma 973ee9b852 (Re)introduce DefaultMultipartMessageReader
This commit introduces the DefaultMultipartMessageReader, a fully
reactive multipart parser without third party dependencies.

An earlier version of this code was introduced in fb642ce, but removed
again in 77c24aa because of buffering issues.

Closes gh-21659
2020-06-24 10:31:48 +02:00
Rossen Stoyanchev 57f868fcbd Direct matches by URL path work again
This commit fixes a recent regression as a result of 5225a57411
with the determination of non-pattern vs pattern URLs. That in turn affects the ability to perform
direct matches by URL path.

There is also a fix in PathPattern to recognize "catch-all" patterns as pattern syntax.

See gh-24945
2020-06-24 08:07:40 +01:00
Juergen Hoeller 7e71749e34 Merge branch '5.2.x' 2020-06-23 23:26:52 +02:00
Juergen Hoeller fb903f34b0 Upgrade to Hibernate ORM 5.4.18 2020-06-23 23:21:12 +02:00
Juergen Hoeller b0cabb29f3 Polishing 2020-06-23 23:20:45 +02:00
Rossen Stoyanchev 19fb0f113b Merge branch '5.2.x' 2020-06-23 20:47:49 +01:00
Rossen Stoyanchev 4716e48241 Upgrade to Reactor 2020.0.0-M1
See gh-25085
2020-06-23 20:38:18 +01:00
Rossen Stoyanchev 22bf62def1 Replace remaining use of deprecated Processors in tests
See gh-25085
2020-06-23 20:29:35 +01:00
Rossen Stoyanchev 21d069695f Refine solution for 21de09
The following was reported after the change and is related to it:
https://github.com/reactor/reactor-netty/issues/1170. An HTTP HEAD with the body
not consumed. Connection is disposed and closed leading to subsequent request to
fail. Adding toBodilessEntity() helps.

This change does not close the connection but rather drains the body which does
not impact subsequent re-use of the connection. This however may compete with a
late subscriber actually attempting to read the response. At that point there is
little choice but to raise an ISE with a more specific description.

See gh-25216
2020-06-23 19:58:57 +01:00
Sam Brannen 0e83aaa756 Fix hanging test
Partially reverts 1edc08fb84
2020-06-23 18:08:24 +02:00
Sam Brannen 1edc08fb84 Polishing 2020-06-23 17:45:23 +02:00
Sam Brannen f9331d921f Merge branch '5.2.x' 2020-06-23 17:10:33 +02:00
Juergen Hoeller d0209e5f1f Nullability refinements and related polishing 2020-06-23 16:55:09 +02:00
Juergen Hoeller 56c661829b Avoid package cycle through dedicated ResourcePropertiesPersister
See gh-25151
2020-06-23 16:54:55 +02:00
Marten Deinum 8eedd9d5cc Use JDBC 4 API for connection validation
With this commit use the JDBC 4.0 isValid method to
validate the connection. This is favorable over a
validation query.
2020-06-23 16:50:57 +02:00
DK Lee 6419b18bee Fix typo in Java example for handler class
Closes gh-25302
2020-06-23 16:46:14 +02:00
Rossen Stoyanchev eee0b76ef3 Merge branch '5.2.x' 2020-06-23 15:19:03 +01:00
Rossen Stoyanchev 837dfe285a Set PathPatternParser in RouterFunctionMapping
See gh-24945
2020-06-23 15:18:25 +01:00
Rossen Stoyanchev 734f4a4706 Replace of ReplayProcessor in RSocket tests
See gh-25085
2020-06-23 14:25:16 +01:00
Rossen Stoyanchev f0b8e638ad Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
2020-06-23 14:20:24 +01:00
Juergen Hoeller 97efacc9a4 Merge branch '5.2.x'
# Conflicts:
#	spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj
2020-06-23 12:01:24 +02:00
Juergen Hoeller 9e12a20324 Polishing 2020-06-23 11:35:22 +02:00
yanghuai9 b67de25d67 add @Override in class AnnotationBeanConfigurerAspect 2020-06-23 10:29:03 +02:00
Juergen Hoeller 41b7686378 Upgrade to XStream 1.4.12, HtmlUnit 2.41, Apache HttpClient 5.0.1 2020-06-23 10:27:50 +02:00
izeye a678db3888 Polish
Closes gh-880
2020-06-23 09:51:45 +02:00
Kamil Szymanski 23aeba0e46 Fix typos in WebRequest.checkNotModified docs
Closes gh-1035
2020-06-23 09:45:07 +02:00
Marten Deinum 6316a353bb Reduce String creation in BeanPropertyRowMapper
Prior to this commit the BeanPropertyRowMapper used
String.substring and String.toLowerCase to parse the
field names. This would generate more String than needed.

Instead one could iterate over the internal char[] of the
String and use the Character methods instead. This reduces
the String creation.

Closes gh-25301
2020-06-23 08:53:41 +02:00
Brian Clozel 1f78cede72 Merge branch '5.2.x' 2020-06-22 19:21:32 +02:00
Brian Clozel c4326cb0f5 Fix missing contextPath when mutating ServerHttpRequest
This commit ensures that when mutating `ServerHttpRequest` instances,
the original contextPath information is copied to the request being
built.

Note that mutation on the `contextPath(String)` or `path(String)` should
be reflected to the other. (See their Javadoc for more information).

Fixes gh-25279
2020-06-22 19:13:10 +02:00
Sam Brannen eeb6c10fb7 Polishing 2020-06-22 14:03:06 +02:00
Sam Brannen b733474c64 Polish contribution
See gh-25292
2020-06-22 13:23:40 +02:00
Undefined 53df8ca1f5 Introduce unit tests for IntegerToEnumConverterFactory
Closes gh-25292
2020-06-22 13:12:37 +02:00
Sam Brannen bf5033281b Merge branch '5.2.x' 2020-06-22 11:38:50 +02:00
Sam Brannen 80d1aaec0c Add spring-r2dbc and spring-rsocket to Stack Overflow tags 2020-06-22 11:38:04 +02:00
Arjen Poutsma ed648b793b Merge branch '5.2.x' 2020-06-22 09:50:04 +02:00
Arjen Poutsma 405fdd3a57 Map from charset name rather than Charset
With this commit it is no longer assumed that all charset names in the
JsonEncoding can be resolved by Charset.forName. Instead, we store the
charset name itself, rather than the Charset object.
2020-06-22 09:48:41 +02:00
Rossen Stoyanchev 7cf1ccc415 Use MonoProcessor instead of FluxIdentityProcessor
We just need to signal completion when close() is called. MonoProcessor
should suffice and we can avoid a hard dependency on Reactor 3.4.

See gh-25085
2020-06-22 05:46:25 +01:00
Rossen Stoyanchev 96bbec7ab2 Restore use of tcpConfiguration method
The method wasn't available at first but has been added since to allow
being compatible with both Reactor Netty 0.9 and 1.0.

See gh-25085
2020-06-22 05:45:41 +01:00
Rossen Stoyanchev d627f6049e Update "Forwarded: for" contribution
Closes gh-23582
2020-06-22 05:40:13 +01:00
Kirill Serebrennikov 883ad098f9 Add support for X-Forwarded-For and Forwarded for
See gh-23260, gh-23582
2020-06-22 05:40:13 +01:00
Rossen Stoyanchev ff9daa9377 Adjust WebFlux behavior for @RequestPart List<T>
List<T> support was added relatively late, incorrectly decoding each
part to T which means no way to decode a single part to List<T> and
thatis the most common case (vs multipart parts with the same name).
This behavior was further misaligned with Spring MVC as well as with
the behavior for T[].

Closes gh-22973
2020-06-22 05:40:13 +01:00
Sam Brannen 01fa923e96 Merge branch '5.2.x' 2020-06-21 19:42:43 +02:00
Sam Brannen 0a208a4941 Fix broken link to Stack Overflow tags 2020-06-21 19:41:56 +02:00
Sam Brannen c6e2d1d405 Upgrade JDK 15 CI image to JDK 15 build 28 2020-06-21 19:33:51 +02:00
Sam Brannen ab0e651547 Polish SerializationTestUtils, clean up warnings, etc. 2020-06-20 18:17:03 +02:00
Sam Brannen 9d5881e0ad Suppress warnings, remove unused code, etc. 2020-06-20 17:15:35 +02:00
Sébastien Deleuze 2f0970b184 Fix an AllEncompassingFormHttpMessageConverter regression
Restore previous behavior to configure
Jaxb2RootElementHttpMessageConverter when JAXB but not Jackson are present.

Closes gh-25291
2020-06-20 17:05:13 +02:00
Sébastien Deleuze 63dff520e6 Disable and remove unsupported features from native images
This commit removes load time weaving, CGLIB and Objenesis support
from native images.

GraalDetector has been removed for now because of
https://github.com/oracle/graal/issues/2594. It should be reintroduced
when this bug will be fixed with NativeImageDetector class name.

Closes gh-25179
2020-06-20 17:05:13 +02:00
Rossen Stoyanchev 2d8b2fed8b Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
2020-06-20 15:56:35 +01:00
Rossen Stoyanchev 78d1591e2d Merge branch '5.2.x' 2020-06-19 22:09:43 +01:00
Rossen Stoyanchev b1da89344f MatchableHandlerMapping is backwards compatible 2020-06-19 22:01:51 +01:00
Rossen Stoyanchev f35903f23d Catch IllegalReferenceCountException
Closes gh-22594
2020-06-19 21:58:03 +01:00
Rossen Stoyanchev 21de098756 Dispose on cancel if response not subscribed
Closes gh-25216
2020-06-19 21:58:03 +01:00
Brian Clozel 7391f9b392 Fix Reactor Core DirectProcessor deprecation
As of reactor/reactor-core#2188, `DirectProcessor` variants are
deprecated. This commit replaces them with the new
`FluxIdentityProcessor` variant.

See gh-25085
2020-06-19 22:13:15 +02:00
Brian Clozel 34cb4895c4 Update CI images to use ubuntu:bionic-20200526 2020-06-19 21:50:18 +02:00
Juergen Hoeller 3a653bd35f Deprecate JCA CCI support
Closes gh-25287
2020-06-19 19:19:14 +02:00
Brian Clozel e0e1c12402 Merge branch '5.2.x' 2020-06-19 16:45:35 +02:00
Brian Clozel 9b615ed8c6 Fix missing sslInfo with Reactor Netty and http/2
Prior to this commit, the `SslInfo` would be missing for WebFlux apps
when deployed on Reactor Netty with http/2.

This commit ensures that the request adapter checks the current channel
and the parent channel for the presence of the `SslHander`.
In the case of http/2, the `SslHander` is tied to the parent channel.

Fixes gh-25278
2020-06-19 16:43:34 +02:00
Sam Brannen c418cef68f Merge branch '5.2.x' 2020-06-19 14:42:50 +02:00
Sam Brannen d07be59801 Improve Javadoc for @Value regarding supported expressions
Closes gh-25284
2020-06-19 14:32:36 +02:00
Sébastien Deleuze 1e501f2583 Provide a flag to disable XML support
This commit introduces a spring.xml.ignore system property
which when set to true avoid initializing XML infrastructure.

A typical use case is optimizing GraalVM native image footprint
for applications not using XML. In order to be effective, those
classes should be initialized at build time:

- org.springframework.util.DefaultPropertiesPersister
- org.springframework.core.io.support.PropertiesLoaderUtils
- org.springframework.web.servlet.function.support.RouterFunctionMapping
- org.springframework.web.client.RestTemplate
- org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver
- org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
- org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
- org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter
- org.springframework.http.codec.support.BaseDefaultCodecs
- org.springframework.beans.PropertyEditorRegistrySupport

Closes gh-25151
2020-06-19 09:42:12 +02:00
Rossen Stoyanchev ce728a6c4b Update docs for PathPattern support in WebMvc
Closes gh-24945
2020-06-18 21:16:43 +01:00
Juergen Hoeller 2d5f9723fa Deprecate superseded Object[] signatures in JdbcOperations/JdbcTemplate
Closes gh-25272
2020-06-18 17:47:27 +02:00
Sébastien Deleuze 1c75f95be0 Provide a flag to disable SpEL support
This commit introduces a spring.spel.ignore system property
which when set to true avoid initializing SpEL infrastructure.

A typical use case is optimizing GraalVM native image footprint
for applications not using SpEL. In order to be effective, those
classes should be initialized at build time:

- org.springframework.context.support.AbstractApplicationContext
- org.springframework.core.SpringProperties
- org.springframework.context.event.EventListenerMethodProcessor

Closes gh-25153
2020-06-18 17:08:15 +02:00
Sam Brannen dc3801043f Merge branch '5.2.x' 2020-06-18 14:55:02 +02:00
Sam Brannen 46c786167e Replace "blacklist" with alternative words
See gh-25262
2020-06-18 14:54:33 +02:00
Sam Brannen 96b03c587f Revert "Upgrade to Kotlin 1.4 M2" for spring-r2dbc 2020-06-18 14:14:42 +02:00
Sébastien Deleuze 6b355df903 Revert "Upgrade to Kotlin 1.4 M2"
This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
2020-06-18 14:06:39 +02:00
Brian Clozel 6615e9c5ef Support multi-value X-Forwarded-Prefix headers
Prior to this commit, the Forwarded headers for Spring MVC and Spring
WebFlux did not support multiple prefix values for the
`"X-Forwarded-Prefix"` HTTP header.

This commit splits and processes multiple prefixes defined in the
dedicated header.

Closes gh-25254
2020-06-18 13:18:02 +02:00
Marten Deinum bad81cef8a Align DispatcherServlet defaults for Java and XML
Prior to this commit some of the default strategies defined
for the DispatcherServlet weren't included in the default
configuration for both Java and XML configuration.

The following default beans have been added to the configuration
with the name as expected by the DispatcherServlet:

- org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
- org.springframework.web.servlet.theme.FixedThemeResolver
- org.springframework.web.servlet.support.SessionFlashMapManager
- org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator

Closes gh-25209
2020-06-18 12:30:49 +02:00
Sam Brannen edf25ce98a Polish ResourceBundleMessageSourceTests
- suppress warnings
- make tests faster (by sleeping less)
2020-06-18 11:49:44 +02:00
陈其苗 d60c55c296 Use computeIfAbsent in ResourceBundleMessageSource
Closes gh-25072
2020-06-18 11:07:24 +02:00
Sam Brannen 30263137c4 Suppress warnings in Gradle build 2020-06-18 10:55:44 +02:00
Rossen Stoyanchev 533608b0a1 Merge branch 'pr/23772'
Closes gh-23772, gh-23671
2020-06-18 07:50:30 +01:00
Rossen Stoyanchev de0a043739 Add contains form data RequestMatcher
See gh-23671
2020-06-18 07:49:27 +01:00
Rossen Stoyanchev bc33ae3f8b Update multipart RequestMatcher
See gh-23772
2020-06-18 07:49:27 +01:00
vspac e01160db31 Multipart RequestMatcher's
See gh-23772
2020-06-18 07:49:27 +01:00
Mark Paluch aff601edf1 Add support for R2DBC
This commit introduces support for R2DBC ("Reactive Relational Database
Connectivity") with custom ConnectionFactory implementations, a
functional DatabaseClient for SQL execution, transaction management, a
bind marker abstraction database initialization utilities, and
exception translation.

Closes gh-25065
2020-06-17 19:29:48 +02:00
Juergen Hoeller 7f79a373c3 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-06-17 15:42:18 +02:00
Juergen Hoeller 0a14ea6c57 Upgrade to Jetty 9.4.30 2020-06-17 15:40:00 +02:00
Juergen Hoeller a08bf8c063 Avoid misleading log message for commit-triggering exception
Closes gh-25253
2020-06-17 15:39:41 +02:00
Mark Paluch 217b6e37a6 Rollback reactive transaction on cancel
This commit introduces a change in reactive transaction semantics for
cancel signals. Canceling a subscription now rolls back a reactive transaction
to achieve a deterministic transaction outcome.

Previously, cancel signals committed a transaction which could
cause partially committed transactions depending on when the cancel happened.
2020-06-17 15:04:54 +02:00
Sam Brannen 8853f4b883 Merge branch '5.2.x' 2020-06-17 14:47:53 +02:00
Sam Brannen d51abe462e Upgrade to nohttp 0.0.5
Closes gh-25266
2020-06-17 14:46:23 +02:00
Sam Brannen 775d99ac78 Merge branch '5.2.x' 2020-06-17 14:23:27 +02:00
Sam Brannen 9acb5b1a4a Replace "black box" with alternative term
See gh-25262
2020-06-17 14:22:26 +02:00
Sam Brannen 9984a335ca Merge branch '5.2.x' 2020-06-17 14:01:36 +02:00
Sam Brannen 972c01cbbd Replace "blacklist" with alternative words
See gh-25262
2020-06-17 14:00:26 +02:00
Sam Brannen 77dd05853c Polishing 2020-06-17 13:35:14 +02:00
Juergen Hoeller 17cab9660c Deprecate TransactionSynchronizationAdapter
Closes gh-21725
2020-06-17 11:02:31 +02:00
Juergen Hoeller d36407d585 Deprecate rarely used bean definition variants
Closes gh-24875
2020-06-17 10:59:55 +02:00
Juergen Hoeller 6ea7ff1c6d Upgrade to ASM master (8.1 beta)
Closes gh-24872
2020-06-17 10:56:40 +02:00
Сергей Цыпанов 7949937655 Remove redundant assignment of default values to volatile fields 2020-06-17 10:50:51 +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
Sam Brannen 456d2c46e3 Suppress warnings in Gradle build
See gh-24655
2020-06-16 17:43:40 +02:00
Sam Brannen 50391ad3d7 Add @author tags for JDBC KeyHolder support
See gh-24655
2020-06-16 17:37:11 +02:00
Sébastien Deleuze e2944c37e4 Make DispatcherServlet.properties loading lazy
With #25209, DispatcherServlet.properties loading and parsing
will be useless for most of use cases, and it requires
configuration on GraalVM native images.

The purpose of this issue to make such loading and parsing lazy,
only invoked in getDefaultStrategies() if needed.

Closes gh-25257
2020-06-16 17:25:05 +02:00
Sébastien Deleuze 2a74eff10f Upgrade to Kotlin 1.4 M2
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- A workaround for Gradle build is required for now, see
  https://youtrack.jetbrains.com/issue/KT-39610 for more details.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-06-16 15:21:57 +02:00
Arjen Poutsma 97aba77cc1 Merge branch '5.2.x' 2020-06-16 14:30:43 +02:00
Sam Brannen cc301011b2 Polish JDBC KeyHolder support
See gh-24655
2020-06-16 14:17:43 +02:00
eXsio b50cf9dad2 Support user-defined key type in JDBC KeyHolder
Prior to this commit, the JDBC KeyHolder API only supported keys of
type Number. However, a generated key can be a UUID or something else,
and developers shouldn't have to go manually through complex
collections to access it.

This commit adds a new getKeyAs(Class<T> keyType) method to the
KeyHolder API that allows the user to specify the key type.

Closes gh-24655
2020-06-16 12:04:09 +02:00
Arjen Poutsma 9c3417f703 Convert non-unicode input when reading w/ Jackson
This commit makes sure that Jackson-based message converters and
decoders can deal with non-unicode input. It does so by reading
non-unicode input messages with a InputStreamReader.

This commit also adds additional tests forthe canRead/canWrite methods
on both codecs and message converters.

Closes: gh-25247
2020-06-16 11:45:53 +02:00
Rossen Stoyanchev b572f7618f HandlerMappings expose usesPathPatterns() method
See gh-24945
2020-06-15 15:53:40 +01:00
Sam Brannen bb7e5f0172 Merge branch '5.2.x' 2020-06-15 14:59:30 +02:00
wonwoo fd7e6486de Fix syntax in validation examples
Closes gh-25251
2020-06-15 14:58:27 +02:00
Rossen Stoyanchev 5225a57411 Support for parsed PathPatterns in Spring MVC
See gh-24945
2020-06-15 11:25:35 +01:00
Rossen Stoyanchev a0f4d81db7 Remove http -> web package dependency
See gh-24406
2020-06-15 11:25:35 +01:00
Sam Brannen adc76a1d8f Suppress warnings in ResponseCreatorsTests 2020-06-14 19:45:51 +02:00
Sam Brannen e190851aee Merge branch '5.2.x' 2020-06-13 14:53:35 +02:00
Sam Brannen 94d7462891 Ensure spring-core JAR is reproducible
Prior to this commit, a change to Javadoc in any class in spring-core
would result in ALL tests in the entire test suite being re-run via the
Gradle build.

Thanks to a tip from @melix, this commit aims to ensure that the
spring-core JAR is "reproducible".
2020-06-13 14:53:06 +02:00
Sam Brannen 3f7e86eadd Update Javadoc for Assert regarding Guava Preconditions 2020-06-13 14:53:06 +02:00
Sam Brannen 50a0094a47 Ensure spring-core JAR is reproducible
Prior to this commit, a change to Javadoc in any class in spring-core
would result in ALL tests in the entire test suite being re-run via the
Gradle build.

Thanks to a tip from @melix, this commit ensures that the spring-core
JAR is "reproducible".
2020-06-13 14:36:27 +02:00
Sam Brannen 30385dae8d Upgrade JDK 15 CI image to JDK 15 build 26 2020-06-12 09:56:46 +02:00
Sam Brannen d9969d1e4d Update Javadoc for Assert regarding Guava Preconditions 2020-06-12 09:49:47 +02:00
Roland Weisleder f9cca5d9d6 Add tests for Assert.noNullElements(Collection, ...)
Commit 4000b244ff introduced new variants for noNullElements in
org.springframework.util.Assert.

This commit adds the corresponding tests to AssertTests.

Closes gh-25239
2020-06-12 09:37:25 +02:00
Juergen Hoeller b66e718560 Upgrade to Rome 1.13.1 2020-06-12 00:58:44 +02:00
Juergen Hoeller 188722a358 Merge branch '5.2.x' 2020-06-12 00:52:00 +02:00
Juergen Hoeller 5e24085061 Upgrade to Apache Johnzon 1.2.7 and OpenPDF 1.3.19 2020-06-12 00:47:31 +02:00
Juergen Hoeller b24a337146 Polishing 2020-06-12 00:39:58 +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 9138a04a0a Polishing 2020-06-11 23:45:23 +02:00
Juergen Hoeller e46ccd74b1 Consistent abstract declaration of "Abstract" base classes
Closes gh-25240
2020-06-11 23:43:41 +02:00
Sam Brannen bc4945d677 Ensure non-null condition comes 1st in ternary operator
See gh-25232
2020-06-11 15:11:48 +02:00
GardenLee e866fac8e7 Wrap ternary operator within parentheses as outlined in Code Style
Closes gh-25232
2020-06-11 15:11:48 +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
Sam Brannen b0e07cc7e3 Delete dead code in spring-webmvc 2020-06-10 18:35:03 +02:00
Sam Brannen 335ca75ec2 Polish contribution
See gh-25078
2020-06-10 18:25:31 +02:00
liym@home 8fb7399a0c Upgrade to Dom4j 2.1.3 and Jaxen 1.2.0
Closes gh-25078
2020-06-10 16:38:43 +02:00
Arjen Poutsma 202799e6fe Rethrow XMLStreamExceptions as DecodingExceptions
Prior to this commit, Jaxb2XmlDecoder and XmlEventDecoder threw
XMLStreamExceptions instead of DecodingExceptions (as the Decoder
contract defines).

This commit resolves this issue.

Closes: gh-24778
2020-06-10 15:56:45 +02:00
GardenLee eb3be3ad88 Refactor method name dispatching to switch statements in AutowireUtils
Closes gh-25199
2020-06-09 23:46:29 +02:00
Sam Brannen b9e52a8089 Delete dead code in MockServerHttpRequest 2020-06-09 17:38:34 +02:00
Sam Brannen 905483be30 Polish Javadoc for @PropertySource 2020-06-09 16:39:58 +02:00
Rossen Stoyanchev 33181daeac Merge branch '5.2.x' 2020-06-09 11:57:40 +01:00
Rossen Stoyanchev 1d0fe1223d Fix checkstyle violation 2020-06-09 11:47:05 +01:00
Rossen Stoyanchev 3cc7efc841 Merge branch '5.2.x' 2020-06-09 09:02:52 +01:00
Rossen Stoyanchev b48ddef4c6 Upgrade to RSocket 1.0.1 2020-06-09 08:59:55 +01:00
Stephane Nicoll e0d712946c Merge branch '5.2.x' 2020-06-09 09:56:49 +02:00
Spring Buildmaster d0a9e359aa Next Development Version 2020-06-09 06:51:55 +00:00
Rossen Stoyanchev 1984cfe9d7 Merge branch '5.2.x' 2020-06-08 21:20:44 +01:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01:00
Juergen Hoeller 21b1f30660 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-06-08 20:26:14 +02:00
Juergen Hoeller 4c29bbb77f Upgrade to Reactor Dysprosium-SR8
Closes gh-25210
2020-06-08 20:23:37 +02:00
Juergen Hoeller d2cd4c50f4 Upgrade to Tomcat 9.0.36 2020-06-08 19:38:23 +02:00
Juergen Hoeller c777468056 Polishing 2020-06-08 19:37:58 +02:00
Juergen Hoeller 9c1c787ee9 Polishing 2020-06-08 19:27:38 +02:00
Sam Brannen edbc54fe78 Merge branch '5.2.x' 2020-06-08 19:17:01 +02:00
Sam Brannen 721fd20708 Document advice precedence in reference manual
This commit documents the precedence for advice declared within the
same @Aspect class or within the same <aop:aspect> element.

See gh-25186
2020-06-08 19:06:46 +02:00
Sam Brannen 0b760c15ea Polish AOP chapter in reference manual 2020-06-08 19:06:46 +02:00
Rossen Stoyanchev 150fe96a98 Merge branch '5.2.x' 2020-06-08 17:44:42 +01:00
Rossen Stoyanchev 9e1121fd8d Document behavior on reactive tx cancellation
Closes gh-25091
2020-06-08 17:43:52 +01:00
Arjen Poutsma 8b59b6a7f4 Merge branch '5.2.x' 2020-06-08 15:43:49 +02:00
Arjen Poutsma 0ccf5e19aa Undo MockServerRequest deprecation
Setting path variables (and making sure they are available in a
HandlerFunction) is more convenient with MockServerRequest than
having to set attributes in MockServerWebExchange.

This commit removes MockServerRequest's deprecation.

Closes gh-25087
2020-06-08 15:40:09 +02:00
Sam Brannen 0bfcabebf3 Merge branch '5.2.x' 2020-06-08 14:21:50 +02:00
Sam Brannen 0998bd49ef Implement reliable advice invocation order within an @Aspect
The AspectJPrecedenceComparator was designed to mimic the precedence
order enforced by the AspectJ compiler with regard to multiple 'after'
methods defined within the same aspect whose pointcuts match the same
joinpoint. Specifically, if an aspect declares multiple @After,
@AfterReturning, or @AfterThrowing advice methods whose pointcuts match
the same joinpoint, such 'after' advice methods should be invoked in
the reverse order in which they are declared in the source code.

When the AspectJPrecedenceComparator was introduced in Spring Framework
2.0, it achieved its goal of mimicking the AspectJ compiler since the
JDK at that time (i.e., Java 5) ensured that an invocation of
Class#geDeclaredMethods() returned an array of methods that matched the
order of declaration in the source code. However, Java 7 removed this
guarantee. Consequently, in Java 7 or higher,
AspectJPrecedenceComparator no longer works as it is documented or as
it was designed when sorting advice methods in a single @Aspect class.
Note, however, that AspectJPrecedenceComparator continues to work as
documented and designed when sorting advice configured via the
<aop:aspect> XML namespace element.

PR gh-24673 highlights a use case where AspectJPrecedenceComparator
fails to assign the highest precedence to an @After advice method
declared last in the source code. Note that an @After advice method
with a precedence higher than @AfterReturning and @AfterThrowing advice
methods in the same aspect will effectively be invoked last due to the
try-finally implementation in AspectJAfterAdvice.invoke() which invokes
proceed() in the try-block and invokeAdviceMethod() in the
finally-block.

Since Spring cannot reliably determine the source code declaration
order of annotated advice methods without using ASM to analyze the byte
code, this commit introduces reliable invocation order for advice
methods declared within a single @Aspect. Specifically, the
getAdvisors(...) method in ReflectiveAspectJAdvisorFactory now hard
codes the declarationOrderInAspect to `0` instead of using the index of
the current advice method. This is necessary since the index no longer
has any correlation to the method declaration order in the source code.
The result is that all advice methods discovered via reflection will
now be sorted only according to the precedence rules defined in the
ReflectiveAspectJAdvisorFactory.METHOD_COMPARATOR. Specifically, advice
methods within a single @Aspect will be sorted in the following order
(with @After advice methods effectively invoked after @AfterReturning
and @AfterThrowing advice methods): @Around, @Before, @After,
@AfterReturning, @AfterThrowing.

The modified assertions in AspectJAutoProxyAdviceOrderIntegrationTests
demonstrate the concrete effects of this change.

Closes gh-25186
2020-06-08 14:18:28 +02:00
Sam Brannen d6525cfb97 Polishing 2020-06-08 14:17:39 +02:00
Juergen Hoeller a34f1e3759 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java
2020-06-06 18:52:51 +02:00
Juergen Hoeller d01830355d Upgrade to Jetty Reactive HttpClient 1.1.3 2020-06-06 18:49:47 +02:00
Juergen Hoeller 65154170d3 Polishing 2020-06-06 18:49:32 +02:00
Juergen Hoeller d71957ce7c Polishing 2020-06-06 17:45:12 +02:00
Juergen Hoeller 7244f03064 Avoid unnecessary creation of not-found entity in ResponseEntity#of
Closes gh-25183
2020-06-06 17:44:30 +02:00
Juergen Hoeller 98030f3794 Avoid unnecessary copy of cookies map in DefaultWebClientBuilder
See gh-25034
2020-06-06 17:44:02 +02:00
Juergen Hoeller f860b35df8 Upgrade to Undertow 2.1.3 2020-06-06 16:10:49 +02:00
Juergen Hoeller 65b09be669 Polishing 2020-06-06 16:10:20 +02:00
Juergen Hoeller 5051d7302d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/main/java/org/springframework/http/HttpHeaders.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
2020-06-06 15:27:15 +02:00
Juergen Hoeller f3d4df2fd4 Consistently check available local/remote addresses for non-null 2020-06-06 15:15:16 +02:00
Juergen Hoeller 9cd9a8e86b Extend readOnlyWebSocketHttpHeaders deprecation to 5.1.16 2020-06-06 14:41:06 +02:00
Juergen Hoeller 7b7d0a353d Upgrade to Hibernate ORM 5.4.17 and Checkstyle 8.33 2020-06-06 13:22:55 +02:00
Juergen Hoeller d14140da69 Polishing 2020-06-06 13:21:46 +02:00
Juergen Hoeller 196bb6fe32 Support for shared GroovyClassLoader in GroovyScriptFactory
Exposes setClassLoader method in ConfigurableApplicationContext interface as obvious first-class configuration option.

Closes gh-25177
2020-06-06 13:21:20 +02:00
Juergen Hoeller ad5710c1d1 Restore original readOnlyHttpHeaders signature for binary compatibility
Closes gh-25034
2020-06-06 13:14:47 +02:00
Sam Brannen aaa7c6c422 Merge branch '5.2.x' 2020-06-05 15:35:05 +02:00
Sam Brannen fbeecf3bf8 Test status quo for invocation order of all advice types
Prior to this commit we did not have tests in place to verify the status
quo for the invocation order of all advice types when declared within
a single aspect, either via the <aop:aspect> XML namespace or AspectJ
auto-proxy support.

This commit introduces such tests that demonstrate where such ordering
is broken or suboptimal.

The only test for which the advice invocation order is correct or at
least as expected is the afterAdviceTypes() test method in
ReflectiveAspectJAdvisorFactoryTests, where an AOP proxy is hand crafted
using ReflectiveAspectJAdvisorFactory without the use of Spring's
AspectJPrecedenceComparator.

See gh-25186
2020-06-05 15:30:57 +02:00
Sam Brannen 04c8de4e50 Polishing 2020-06-05 15:22:41 +02:00
Arjen Poutsma 5f1326f233 Respect MimeType charset in Jackson codecs
Before this commit, Jackson2CodecSupport and subclasses
did not check media type encoding in the supportsMimeType
method (called from canEncode/canDecode).
As a result, the encoder reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

Closes: gh-25076
2020-06-05 15:09:05 +02:00
Arjen Poutsma 6a829a322a Respect MediaType charset in Jackson converters
Before this commit, AbstractJackson2HttpMessageConverter and subclasses
did not check media type encoding in the canRead and canWrite
methods. As a result, the converter reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

See: gh-25076
2020-06-05 15:09:05 +02:00
Martin Macko e11da64e9c Fix obsolete link in Kotlin docs
Closes gh-25192
2020-06-05 14:12:38 +02:00
Arjen Poutsma 847629412f Respect MimeType charset in Jackson codecs
Before this commit, Jackson2CodecSupport and subclasses
did not check media type encoding in the supportsMimeType
method (called from canEncode/canDecode).
As a result, the encoder reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

Closes: gh-25076
2020-06-05 10:53:28 +02:00
Arjen Poutsma eb0aae066c Respect MediaType charset in Jackson converters
Before this commit, AbstractJackson2HttpMessageConverter and subclasses
did not check media type encoding in the canRead and canWrite
methods. As a result, the converter reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

See: gh-25076
2020-06-05 10:52:42 +02:00
Sam Brannen a7df011471 Merge branch '5.2.x' 2020-06-04 18:52:28 +02:00
Sam Brannen a61ab5d296 Fix @since tags
See gh-25186
2020-06-04 18:51:51 +02:00
Sam Brannen 104f7f339a Merge branch '5.2.x' 2020-06-04 18:43:52 +02:00
Sam Brannen 63e8609f3b Test status quo for 'after' advice invocation order
See gh-25186
2020-06-04 18:37:24 +02:00
Sam Brannen 70b3de4afe Polish AspectJAdvisorFactory tests 2020-06-04 18:37:16 +02:00
Sam Brannen da7ead8914 Polishing 2020-06-03 15:05:58 +02:00
Sam Brannen 0b163fa536 Upgrade to Gradle 6.5
Closes gh-25180
2020-06-03 14:10:47 +02:00
Rossen Stoyanchev a7f8120164 Merge branch '5.2.x' 2020-06-03 06:14:20 +01:00
Rossen Stoyanchev 8dc8d88f88 Pre-calculated RequestMappingInfo hashcode
See gh-25143
2020-06-03 06:11:35 +01:00
Rossen Stoyanchev 1e25556049 Shared PathPatternParser instance
See gh-25143
2020-06-03 05:58:10 +01:00
Sam Brannen 0f0b1ffe0d Use computeIfAbsent in ScriptFactoryPostProcessor 2020-06-02 18:23:15 +02:00
Yoo In Keun 2549674f41 Refactor method name dispatching to switch statements
This commit refactors method name dispatching to switch statements in
WebSphereClassPreDefinePlugin.

Closes gh-25170
2020-06-02 17:29:55 +02:00
Sam Brannen 2a5fc08629 Merge branch '5.2.x' 2020-06-02 14:45:44 +02:00
Sam Brannen 1ced9370cd Configure Gradle wrapper validation action
This commit configures the Gradle Wrapper Validation Action
for GitHub actions.

See: https://github.com/gradle/wrapper-validation-action

Closes gh-25175
2020-06-02 14:43:45 +02:00
Juergen Hoeller e955e52f2f Refactor method name dispatching to switch statements
Closes gh-25163
2020-05-29 23:07:25 +02:00
Juergen Hoeller 7207f7645c Deprecate InstantiationAwareBeanPostProcessorAdapter
Consistently relying on default methods in the corresponding interfaces.

Closes gh-25165
2020-05-29 23:07:10 +02:00
Rossen Stoyanchev 1175b7eb52 Deprecate HandlerInterceptorAdapter
Closes gh-25147
2020-05-29 18:09:24 +01:00
Rossen Stoyanchev 8d449471c7 Polishing contribution
See gh-25148
2020-05-29 17:37:43 +01:00
Mihai Dumitrescu b31b8ce6c1 Polishing in MockServerHttpRequest
Closes gh-25109
2020-05-29 16:31:19 +01:00
Johnny Lim 30351c257c Deprecate methods in ReactorNettyWebSocketClient
Closes gh-25049
2020-05-29 16:24:52 +01:00
Rossen Stoyanchev 6d6269f1ee Switch to Reactor 2020.0.0 snapshots
A switch to RSocket 1.0.1 snapshots is also required to pick up a
for froward compatibility with Reactor Netty 1.0.

See gh-25085
2020-05-29 15:14:01 +01:00
Juergen Hoeller 42ff01b5aa Merge branch '5.2.x' 2020-05-29 15:57:32 +02:00
Juergen Hoeller 914425eefa Polishing 2020-05-29 15:52:39 +02:00
Juergen Hoeller cd4ef6f781 Consistently refer to FlushMode.MANUAL instead of outdated NEVER
Closes gh-25158
2020-05-29 15:51:54 +02:00
Juergen Hoeller 08474aa921 Clarify JDBC-defined negative values returned from batchUpdate
Closes gh-25138
2020-05-29 15:51:19 +02:00
Juergen Hoeller 2ff22510d9 Avoid earlyApplicationEvents iteration in case of empty Set
Closes gh-25161
2020-05-29 15:50:10 +02:00
Juergen Hoeller ef626e992d Document that MapPropertySource should not contain null values
Closes gh-25142
2020-05-29 15:49:36 +02:00
Juergen Hoeller bec89dba4c Consistent MultiValueMap behavior for empty list values
This commit extracts MultiValueMapAdapter from CollectionUtils and reuses its implementation as base class of LinkedMultiValueMap.

Closes gh-25140
2020-05-29 15:48:19 +02:00
Sam Brannen 5f9e9513ef Merge branch '5.2.x' 2020-05-29 13:33:34 +02:00
Sam Brannen 768257567d Make use of custom types configurable in YamlProcessor
Prior to this commit, there was no easy way to restrict what types could
be loaded from a YAML document in subclasses of YamlProcessor such as
YamlPropertiesFactoryBean and YamlMapFactoryBean.

This commit introduces a setSupportedTypes(Class<?>...) method in
YamlProcessor in order to address this. If no supported types are
configured, all types encountered in YAML documents will be supported.
If an unsupported type is encountered, an IllegalStateException will be
thrown when the corresponding YAML node is processed.

Closes gh-25152
2020-05-29 13:32:52 +02:00
Sam Brannen 7e2b81729e Polish ContentDisposition 2020-05-28 14:57:53 +02:00
Sam Brannen 967478b3a7 Merge branch '5.2.x' 2020-05-28 14:45:44 +02:00
Sam Brannen 3201671ceb Polish contribution
See gh-25149
2020-05-28 14:37:18 +02:00
dlsrb6342 fce972eec8 Fix BaseCodecConfigurer clone bug
Prior to this commit, ExchangeStrategies custom codec's reader and
writer were not registered due to a bug in BaseCodecConfigurer.

This commit fixes this by correcting the implementation of the
DefaultCustomCodecs constructor used within BaseCodecConfigurer.

Closes gh-25149
2020-05-28 12:34:29 +02:00
Rossen Stoyanchev d706899b7e Merge branch '5.2.x' 2020-05-28 06:52:23 +01:00
Rossen Stoyanchev a92f425529 Also use constant for custom mapping condition
See gh-25143
2020-05-28 06:51:57 +01:00
Rossen Stoyanchev 90ccabd60b Merge branch '5.2.x' 2020-05-27 19:12:57 +01:00
Rossen Stoyanchev c0c3c01afd Fix race condition in WriteResultPublisher
between subscription and error from the Publish

Closes gh-25096
2020-05-27 19:11:29 +01:00
Rossen Stoyanchev 955f77bf5d Add error message to MockServerHttpRequest
Closes gh-25109
2020-05-27 18:57:02 +01:00
Rossen Stoyanchev e9a9883aa9 Optimal initialization of empty request mapping conditions
Closes gh-25143
2020-05-27 18:57:02 +01:00
Sam Brannen cc061ca716 Merge branch '5.2.x' 2020-05-27 16:30:22 +02:00
Sam Brannen 3cbc297fc6 Polish contribution
See gh-25137
2020-05-27 16:29:34 +02:00
limo520 d6cab259c3 Fix URI pattern example in webflux.adoc
Closes gh-25137
2020-05-27 16:14:47 +02:00
Sam Brannen 763f7b9be8 Make TaskExecutor and TaskScheduler tests more robust 2020-05-27 15:25:39 +02:00
Sam Brannen c4ef002392 Stop to writing to STD_OUT in tests 2020-05-27 15:21:17 +02:00
Sam Brannen 83b564781f Upgrade to Gradle 6.4.1 2020-05-27 13:22:25 +02:00
Juergen Hoeller 929244215c Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-05-26 23:37:53 +02:00
Juergen Hoeller ae8d0d4a12 Upgrade to Groovy 2.5.12, Caffeine 2.8.4, Apache Johnzon 1.2.6 2020-05-26 23:35:58 +02:00
Juergen Hoeller 27d5fdc5aa Polishing 2020-05-26 23:35:38 +02:00
Juergen Hoeller 1dea55dc20 WebSphereUowTransactionManager sets timeout for actual transaction only
Closes gh-25132
2020-05-26 23:34:36 +02:00
Juergen Hoeller dfa948c2ca Introduce AutowireCandidateResolver.cloneIfNecessary() method
Closes gh-25131
2020-05-26 23:33:39 +02:00
Juergen Hoeller f9aae8dd5a Consistently determine minimum number of arguments from specified index
Closes gh-25130
2020-05-26 23:33:02 +02:00
Yanming Zhou 94f1d77e22 Polish StringHttpMessageConverter.getContentTypeCharset()
Closes gh-25126
2020-05-26 18:26:21 +02:00
Juergen Hoeller 67533a1b29 Upgrade to Groovy 3.0.4, RxJava 3.0.4, Undertow 2.1.1, EclipseLink 2.7.7, Caffeine 2.8.4, Apache Johnzon 1.2.6, Protobuf 3.12.1 2020-05-26 14:20:01 +02:00
Juergen Hoeller 9bf7ff23c0 Introduce EntityManager initialization callbacks
JpaVendorAdapter.postProcessEntityManager and EntityManagerFactoryInfo.createNativeEntityManager SPI, plus convenient setEntityManagerInitializer configuration options.

Closes gh-25125
2020-05-26 14:19:47 +02:00
Sam Brannen a853a58c62 Avoid duplicate addition of void.class in ClassUtils
This commit avoids duplicate addition of void.class to the temporary
primitiveTypes Set in the static initialization block in ClassUtils.

Closes gh-25128
2020-05-26 11:19:33 +02:00
Sam Brannen 5392ac2e07 Add dependency on BouncyCastle for JDK 15+
With a recent upgrade to an early access build for JDK 15,
ServerHttpsRequestIntegrationTests began failing since Netty's
SelfSignedCertificate could not be properly initialized.

This commit adds a test fixture dependency on BouncyCastle which is now
needed by Netty's SelfSignedCertificate on JDK 15 or higher, since JDK 15
no longer supports the javax.security.cert.X509Certificate.

See: https://bugs.openjdk.java.net/browse/JDK-8241039
2020-05-25 17:30:27 +02:00
Rossen Stoyanchev b5d9f27ca4 Merge branch '5.2.x' 2020-05-24 21:20:12 +01:00
Rossen Stoyanchev 4f65ba4e74 Simplify creation of HttpContext for Apache HttpClient
Closes gh-25066
2020-05-24 21:09:49 +01:00
Rossen Stoyanchev 23a66e016e UriBuilder javadoc update
Closes gh-25055
2020-05-24 21:09:13 +01:00
Rossen Stoyanchev c3e55d537e DefaultResponseErrorHandler javadoc update
Closes gh-25067
2020-05-23 10:41:35 +01:00
Rossen Stoyanchev d7a29bbcef DefaultClientResponseBuilder copies logPrefix
Closes gh-25069
2020-05-23 10:41:07 +01:00
Rossen Stoyanchev 8204055924 MockServerHttpRequest accepts custom HTTP method
Closes gh-25109
2020-05-23 10:40:25 +01: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 cd9ee98ff8 Upgrade to Jetty 9.4.29, Hibernate ORM 5.4.16, WebJars Locator 0.45 2020-05-22 17:08:02 +02:00
Juergen Hoeller 4018b462f1 JdbcOperations polishing (backported from master) 2020-05-22 16:35:34 +02:00
Juergen Hoeller d7161f5e5e Polishing 2020-05-22 16:23:46 +02:00
Juergen Hoeller e5c079edfc Introduce serializeToByteArray/deserializeFromByteArray on (De)Serializer
Closes gh-25117
2020-05-22 16:22:59 +02:00
Juergen Hoeller 807ded24c4 Avoid ClassCastException on IllegalArgumentException from sync invocation
Closes gh-25110
2020-05-22 16:12:49 +02:00
Brian Clozel 593928a9f3 Upgrade JDK 15 CI image to JDK 15 build 24 2020-05-22 15:41:38 +02:00
Sam Brannen 59443bfe18 Merge branch '5.2.x' 2020-05-20 14:28:56 +02:00
Sam Brannen 4f2b6473ac Honor attributes configured in ServerRequest.from() builder
Prior to this commit, if attributes were configured in the builder
returned by `ServerRequest.from(...)`, those attributes were not
available in the `ServerRequest` built by the builder. In addition, any
attributes in the original `ServerRequest` supplied to
`ServerRequest.from(...)` were also ignored.

This commit addresses this issue by ensuring that the attributes
configured via DefaultServerRequestBuilder are used as the attributes
in the resulting `ServerRequest`.

This commit also polishes the Javadoc in `ServerRequest` and
`ClientResponse` and avoids the use of lambda expressions in the
constructors for `DefaultServerRequestBuilder` and
`DefaultClientResponseBuilder`.

Closes gh-25106
2020-05-20 14:10:44 +02:00
Brian Clozel 7c2471e3cc Polish
Closes gh-24204
2020-05-19 16:45:23 +02:00
Rohit Pandey 8da5627c6c Fix ExceptionHandlerExceptionResolver.setResponseBodyAdvice behaviour
Prior to this commit, calling the `setResponseBodyAdvice` method would
clear all existing `ResponseBodyAdvice` instances present in the list
before adding provided one.
This behavior is inconsistent with the Javadoc and other
implementations.

This brings the method in line with the existing documentation.

See gh-24204
2020-05-19 16:28:57 +02:00
Sam Brannen da071c1fce Remove unused code 2020-05-19 15:59:17 +02:00
Sam Brannen 59cab5e7d9 Polishing 2020-05-19 15:54:34 +02:00
Juergen Hoeller d56ca04162 Introduce queryForStream on JdbcTemplate and NamedParameterJdbcTemplate
Closes gh-18474
2020-05-19 14:08:52 +02:00
Rossen Stoyanchev 5ca7928153 Use Servlet 4 mapping type if available
See gh-25100
2020-05-19 10:34:15 +01:00
Rossen Stoyanchev 23233c3041 Shared read-only instance of UrlPathHelper
In many places UrlPathHelper is created and used without any
customizations, in some cases repeatedly. This commit adds a
shared read-only UrlPathHelper instance with default settings.

See gh-25100
2020-05-19 10:34:15 +01:00
Sam Brannen 92f7587a40 Upgrade to JDK 15 build 23 on CI server 2020-05-19 09:23:58 +02:00
Juergen Hoeller 16f1414e5c Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-05-18 20:18:31 +02:00
Juergen Hoeller b5b718f1e5 Upgrade to AssertJ 3.16.1, Log4J 2.13.3, Vavr 0.10.3, JAMon 2.82, Joda-Time 2.10.6, Caffeine 2.8.3, OkHttp 3.14.9, OpenPDF 1.3.17, HtmlUnit 2.40 2020-05-18 20:09:37 +02:00
Juergen Hoeller 9631db71c4 Direct exposure of StringBuilder instead of intermediate String
Closes gh-25024
2020-05-18 20:09:24 +02:00
Juergen Hoeller 9999414b3b Merge branch '5.2.x' 2020-05-18 14:24:33 +02:00
Juergen Hoeller c35b21b49f Consistent not-null assertions for configured interceptors
Closes gh-25088
2020-05-18 14:23:05 +02:00
Juergen Hoeller 06cfd80c1c Avoid full synchronization in refreshable getBeanFactory() implementation
Closes gh-25081
2020-05-18 14:22:24 +02:00
Juergen Hoeller 35f3277910 Revised javadoc note on Lookup annotation limitations/recommendations
Closes gh-25044
2020-05-18 14:21:14 +02:00
Juergen Hoeller 28177ad91b Explicit notes on access to standard context beans in SpEL expressions
Closes gh-25037
2020-05-18 14:19:05 +02:00
Yanming Zhou 9d429e30de Fix SpelEvaluationException with example code
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'name' cannot be found on null
2020-05-18 14:16:15 +02:00
Brian Clozel 212bb7fef6 Add GenericConversionService JMH benchmark
This commit removes some of the deprecated "PERFORMANCE" tests and turns
them into JMH benchmarks.

See gh-24830
2020-05-15 22:46:05 +02:00
Сергей Цыпанов 703d54677e Avoid unnecessary boxing/unboxing of primitives
Closes gh-25080
2020-05-15 18:01:59 +02:00
Brian Clozel 567265123b Avoid using regex matching for static patterns
Prior to this commit (and the previous one), the `AntPathStringMatcher`
(inner class of `AntPathmatcher`) would compile `Pattern` instances and
use regex matching even for static patterns such as `"/home"`.

This change introduces a shortcut in the string matcher algorithm to
skip the `Pattern` creation and uses `String` equality instead.
Static patterns are quite common in applications and this change can
bring performance improvements, depending on the mix of patterns
configured in the web application.

In benchmarks (added with this commit), we're seeing +20% throughput
and -40% allocation. This of course can vary depending on the number of
static patterns configured in the application.

Closes gh-24887
2020-05-15 17:07:58 +02:00
Vlad Kisel 9bfe410a0c Avoid using regex for URL matching when possible
See gh-24887
2020-05-15 17:06:58 +02:00
Rossen Stoyanchev b1224835be Add metadataPush support to RSocketRequester
Closes gh-24322
2020-05-14 15:42:43 +01:00
Rossen Stoyanchev de378599d3 Provide access to CloseStatus in WebSocketSession
Closes gh-22079
2020-05-14 15:42:43 +01:00
Rossen Stoyanchev 6403a9f10e Defer decision on BindingResult type until access
Closes gh-24347
2020-05-14 15:42:43 +01:00
Sam Brannen fe3b36af68 Polishing 2020-05-14 13:18:49 +02:00
Juergen Hoeller 23498294de Upgrade to Undertow 2.1 and Jackson 2.11 2020-05-14 00:50:09 +02:00
Juergen Hoeller 26c205589b Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
2020-05-14 00:33:37 +02:00
Juergen Hoeller e660386670 Upgrade to Checkstyle 8.32, Tomcat 9.0.35, Netty 4.1.50, Jackson 2.10.4, Hibernate ORM 5.4.15, Hibernate Validator 6.1.5 2020-05-14 00:23:50 +02:00
Juergen Hoeller fe33822fa7 Polishing 2020-05-14 00:23:20 +02:00
Juergen Hoeller 8212aaf3bb ResolvableType ignores TypeNotPresentException from generic signature
Closes gh-25064
2020-05-14 00:22:58 +02:00
Juergen Hoeller 99bd1a1533 Defensive null check against name parameter in AutowireMode#from
See gh-24285
2020-05-13 23:35:17 +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
Brian Clozel 60fac67884 Polish 2020-05-13 21:59:16 +02:00
Brian Clozel 612a63c0f1 Optimize MediaType parsing
Prior to this commit, `MediaType.parseMediaType` would already rely on
the internal LRU cache in `MimeTypeUtils` for better performance. With
that optimization, the parsing of raw media types is skipped for cached
elements.
But still, `MediaType.parseMediaType` would first get a cached
`MimeType` instance from that cache and then instantiate a
`new MediaType(type, subtype, parameters)`. This constructor not only
replays the `MimeType` checks on type/subtyme tokens and parameters, but
it also performs `MediaType`-specific checks on parameters.
Such checks are not required, as we're using an existing `MimeType`
instance in the first place.

This commit adds a new protected copy constructor (skipping checks) in
`MimeType` and uses it in `MediaType.parseMediaType` as a result.

This yields interesting performance improvements, with +400% throughput
and -40% allocation/call in benchmarks. This commit also introduces a
new JMH benchmark for future optimization work.

Closes gh-24769
2020-05-13 21:36:06 +02:00
Brian Clozel 67547e61c6 Add JMH benchmark infrastructure
Prior to this commit, the Spring Framework test suite would rely only on
"Performance" tests associated with a specific CI build. As outlined in
gh-24830, the way they're built and executed is not working well
anymore.

This commit introduces a new JMH benchmark infrastructure in the build.
The goal here is not to run those benchmarks as part of a CI build, but
rather provide a proper infrastructure for writing and locally running
micro-benchmarks when working on specific optimizations.

This commit adds and configures a Gradle JMH plugin to allow for JMH
benchmark classes in Spring Framework modules (in `src/jmh/java` of each
`spring-*` module). It's also relaxing the checkstyle rules for JMH
classes, especially around Javadoc rules: this code is not meant to
have Javadocs.

Finally, this commit links to a new Wiki page on the project GitHub
repository documenting the infrastructure and helping contributors to
run and design benchmarks.

See gh-24830
2020-05-13 21:29:02 +02:00
Juergen Hoeller 5de6ae6fca Ignore resolved bean from non-active scope in getIfAvailable/getIfUnique
Closes gh-24822
2020-05-13 19:25:20 +02:00
Juergen Hoeller a3c5625d4e Internal cache of pre-filtered BeanPostProcessors (for faster iteration)
Also includes bulk addition in PostProcessorRegistrationDelegate.

Closes gh-24681
Closes gh-24756
2020-05-13 15:53:48 +02:00
Rossen Stoyanchev 875e7f8630 Match multiple values in HeaderAssertions
Closes gh-23878
2020-05-13 12:31:19 +01:00
Rossen Stoyanchev e88eb0ecf7 Option for advanced ObjectMapper customization
Closes gh-23017
2020-05-13 12:31:19 +01:00
Rossen Stoyanchev e881d4b144 Allow use of JsonInclude.Value
Closes gh-24824
2020-05-13 12:31:19 +01:00
Rossen Stoyanchev b31f2bdad2 @ExceptionHandler resolves nested exceptions
See gh-23380
2020-05-13 12:31:19 +01:00
Sam Brannen a16d178d72 Polish Javadoc for NameMatchTransactionAttributeSource 2020-05-13 13:29:07 +02:00
Juergen Hoeller f09093132e Use proxyBeanMethods=false on remaining internal configuration classes
Closes gh-24511
2020-05-12 22:19:44 +02:00
Juergen Hoeller dd0d0d51f6 Introduce resolvable timeout attribute on @Transactional and <tx:method>
Placeholders get resolved in timeoutString, qualifier and labels now.

Closes gh-25052
2020-05-12 21:55:22 +02:00
Sam Brannen 273d952ddf Merge branch '5.2.x' 2020-05-12 18:49:48 +02:00
Sam Brannen 3809d885b6 Fix Checkstyle violation 2020-05-12 18:49:41 +02:00
Andy Wilkinson 1015f79b42 Include timeout unit in shutdown failure logging
Closes gh-25058
2020-05-12 18:42:40 +02:00
Сергей Цыпанов 6305a69cc1 Avoid StringBuilder.append(Object) in ContentDisposition
This commit avoids invoking StringBuilder.append(Object) in favor
of explicit method calls to append(String) and append(char) in
ContentDisposition.escapeQuotationsInFilename(String).

Closes gh-25056
2020-05-12 18:36:31 +02:00
Qimiao Chen 311b333814 Use computeIfAbsent in ResourceBundleMessageSource
This commit optimizes code in ResourceBundleMessageSource
by using computeIfAbsent instead of putIfAbsent.

In addition, the content of some Javadoc has been adjusted.

Closes gh-25054
2020-05-12 14:55:58 +02:00
liym d54b903d28 Fix typo in RmiSupportTests
Closes gh-25051
2020-05-12 14:19:16 +02:00
Sam Brannen e8335c94d5 Update Javadoc for LazyInitTargetSourceCreator
See gh-24915
2020-05-12 13:48:48 +02:00
Rossen Stoyanchev c6e2a5ea33 Merge branch '5.2.x' 2020-05-12 12:00:17 +01:00
Rossen Stoyanchev ef27bc4b82 Upgrade to RSocket 1.0.0
Closes gh-25053
2020-05-12 12:00:06 +01:00
Rossen Stoyanchev 71d384f1f8 Upgrade to RSocket 1.0.0
Closes gh-25053
2020-05-12 11:46:13 +01:00
Sam Brannen b313b3395f Fix AutoProxyLazyInitTests
See gh-24915
2020-05-12 12:37:10 +02:00
Sam Brannen 3c3e8e6a8b Only proxy supported beans in BeanNameAutoProxyCreator
Prior to this commit, if a BeanNameAutoProxyCreator was configured with
a custom TargetSourceCreator, the TargetSourceCreator was applied to
all beans in the ApplicationContext. Thus, the list of supported
beanNames was effectively ignored when applying any
TargetSourceCreator. Consequently, if a TargetSourceCreator returned a
non-null TargetSource for a given bean, the BeanNameAutoProxyCreator
proxied the bean even if the bean name had not been configured in the
beanNames list.

This commit addresses this issue by ensuring that a custom
TargetSourceCreator is only applied to beans whose names match the
configured beanNames list in a BeanNameAutoProxyCreator.

Closes gh-24915
2020-05-12 11:59:51 +02:00
Sam Brannen a07dc80d72 Polishing 2020-05-12 11:15:14 +02:00
Rossen Stoyanchev 14e249aee3 Merge branch '5.2.x' 2020-05-12 09:01:36 +01:00
Rossen Stoyanchev 7c9ad6dd08 Add deprecation notes to the WebMvc config schema
Closes gh-23915
2020-05-12 06:50:09 +01:00
Brian Clozel b883aad1f1 Use weak ETags in VersionResourceResolver
Prior to this commit, the `VersionResourceResolver` implementations
would write a strong ETag HTTP response header with the resolved version
of the resource (the actual value depending on the chosen strategy).

This approach doesn't work well when combined with HTTP compression.
Web servers disable HTTP response copression in the presence of strong
ETags since mutating the response body would break the contract.

This commit changes this semantic and ensures that weak ETags are used
instead.

Closes gh-24898
2020-05-11 21:25:54 +02:00
Brian Clozel e4cb25f365 Reject "/path/**/other" patterns in PathPatternParser
Prior to this commit, patterns like `"/path/**/other"` would be treated
as `"/path/*/other"` (single wildcard, i.e. matching zero to many chars
within a path segment). This will not match multiple segments, as
expected by `AntPathMatcher` users or by `PathPatternParser` users when
in patterns like `"/resource/**"`.

This commit now rejects patterns like `"/path/**/other"` as invalid.
This behavior was previously warned against since gh-24958.

Closes gh-24952
2020-05-11 19:08:21 +02:00
Sam Brannen 7bcda3a29b Update Javadoc for TestContextTransactionUtils
See gh-24869
2020-05-11 14:10:06 +02:00
Sam Brannen 715e8c9ef6 Align TransactionManagementConfigurer support in TCF with production
This commit picks up where 613bd3be1d
left off by ensuring that a transaction manager configured via the
TransactionManagementConfigurer API takes precedence over any
transaction manager configured as a bean in the ApplicationContext
unless @Transactional is configured with a qualifier for the explicit
transaction manager to use in tests.

Closes gh-24869
2020-05-11 13:59:34 +02:00
Sam Brannen 65acda8d3e Polishing 2020-05-11 12:26:13 +02:00
Rossen Stoyanchev 2f80a085f5 Merge ClientResponse and related improvements
Closes gh-24680
2020-05-11 08:49:54 +01:00
Rossen Stoyanchev 94824e30a4 Avoid parse cookies when mutating request or response
When mutating a ServerHttpRequest or ClientResponse, the respective
builders no longer access cookies automatically which causes them to
be parsed and does so only if necessary. Likewise re-applying the
read-only HttpHeaders wrapper is avoided.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 0e9ecb6c99 Shortcut handling of bodyToFlux(DataBuffer.class)
Given that the body is a Flux<DataBuffer> there probably could be a
Flux<DataBuffer> body();

At least bodyToFlux(DataBuffer.class) which is used when mutating and
is a common case should not incur overhead.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 67a06f5edc Add mutate() to ClientResponse and deprecate from()
from() has the flaw of ignoring the body and it can't be fixed because
applications are guaranteed to be setting it already and if set twice
the builder drains the first body.

mutate() is a better fit in any case for what needs to be done in a
filter chain. It can be done more efficiently and is consistent with
similar options on the server side.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev c908ec1937 Wrappers for native headers on the client side
Native server request headers have been wrapped rather than copied
since 5.1. This commit applies the same change to the client side
where, to make matters worse, headers were copied repeatedly on every
access, see also previous commit ca897b95.

For Netty and Jetty the wrappers are the same as on the server side
but duplicated in order to remain package private.

See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev df99889aa6 Avoided repeated creation of ReadOnlyHttpHeaders wrapper
See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev 3276f81851 Avoid one layer of HttpHeaders wrapping
See gh-24680
2020-05-11 08:49:28 +01:00
Rossen Stoyanchev a64e7091e0 Deprecate support for RxJava 1.x
Closes gh-19628
2020-05-11 08:48:48 +01:00
Rossen Stoyanchev 7f59381c7d Add support for RxJava 3
Closes gh-24170
2020-05-11 08:48:48 +01:00
Sam Brannen 3f30dcae80 Merge branch '5.2.x' 2020-05-10 15:44:57 +02:00
Yanming Zhou 50a4fdac6e Use Map::computeIfAbsent to simplify scope implementations
Closes gh-25038
2020-05-10 15:41:00 +02:00
Sam Brannen 613bd3be1d Honor TxMgmtConfigurer when @Primary tx mgr is present in TCF
Prior to this commit, the Spring TestContext Framework (TCF) favored a
@Primary transaction manger over one configured via the
TransactionManagementConfigurer API, and this contradicts the behavior
in production Spring applications.

This commit aligns the transaction manger lookup within the TCF so that
a transaction manger configured via the TransactionManagementConfigurer
API is properly favored over a @Primary transaction manager.

Closes gh-24869
2020-05-09 20:09:27 +02:00
Sam Brannen 745cfcb161 Upgrade tests to TestNG 7.1
See gh-24298
2020-05-09 17:36:34 +02:00
stqp 73e3df5df5 Fix typo in core-beans.adoc
Closes gh-25040
2020-05-09 14:06:45 +02:00
Sam Brannen 2dc9020f80 Merge branch '5.2.x' 2020-05-09 13:57:41 +02:00
Sam Brannen f5d011cb82 Filter reactive tx managers in TransactionAttributeSourceClassFilter
Prior to this commit, the TransactionAttributeSourceClassFilter
filtered out PlatformTransactionManager but not
ReactiveTransactionManager implementations.

TransactionAttributeSourceClassFilter now filters out any
TransactionManager implementation, covering both imperative and
reactive transaction managers.
2020-05-09 13:57:03 +02:00
Sam Brannen 29fe8cecbb Merge branch '5.2.x' 2020-05-08 19:49:56 +02:00
Sam Brannen ec3d647d1d Update spring-tx.xsd regarding reactive tx mgmt support
Closes gh-25030
2020-05-08 19:49:00 +02:00
Sam Brannen 8f7debc769 Merge branch '5.2.x' 2020-05-08 19:26:00 +02:00
Sam Brannen 0f22a5e409 Update Javadoc regarding reactive tx mgmt support
See gh-25030
2020-05-08 19:25:22 +02:00
Sam Brannen 1e64ffa7ba Merge branch '5.2.x' 2020-05-08 18:19:17 +02:00
Sam Brannen e1b2cafb33 Polish reactive transaction mgmt documentation in reference manual
See gh-25030
2020-05-08 18:13:31 +02:00
Mark Paluch 7fbdc3ad11 Document ReactiveTransactionManager support in reference manual
See gh-25030.
2020-05-08 16:11:02 +02:00
Rossen Stoyanchev f3c616ca72 Merge branch '5.2.x' 2020-05-08 14:30:33 +01:00
Rossen Stoyanchev 706446a660 Deprecate unused method 2020-05-08 14:30:10 +01:00
Rossen Stoyanchev 8a59a63ade Merge branch '5.2.x' 2020-05-08 09:38:50 +01:00
Rossen Stoyanchev 19ba9087f5 HttpHeaders#equals handles wrapping correctly
Closes gh-25034
2020-05-08 09:37:37 +01:00
Rossen Stoyanchev 1da903dd59 Add PartHttpMessageWriter
Closes gh-24535
2020-05-08 07:54:50 +01:00
Brian Clozel 5af3223e76 Add Release pipeline for Milestone versions
This commit finishes the first step for migrating our complete build and
release pipeline to Concourse CI.

We're creating here a new "Release" jobs group in our pipeline.
We can now release Milestones from our pipeline with:

* the "stage-milestone" job, which creates and tags a new Milestone
version on the source repository, builds the artifacts and deploys them
in a staging repository and updates the version to the next SNAPSHOT.

* the "promote-milestone" fetches the build information from the staging
repository and promotes the released milestone in the official milestone
repository.

Interactions with the Artifactory and Bintray REST APIs are done using
the https://github.com/spring-io/concourse-release-scripts project.

Closes gh-22490
2020-05-07 21:35:56 +02:00
Sam Brannen 21800a5fa6 Polish @Transactional documentation in reference manual 2020-05-07 18:42:02 +02:00
Yanming Zhou 247662de6b Fix @Transactional syntax error in reference manual
Closes gh-25021
2020-05-07 18:10:50 +02:00
Sam Brannen 4e8a6b9695 Merge branch '5.2.x' 2020-05-07 12:37:08 +02:00
Sam Brannen 4805288122 Use SingletonSupplier for XStream instance in XStreamMarshaller
Closes gh-25017
2020-05-07 12:35:32 +02:00
Sam Brannen 4ca64684f6 Merge branch '5.2.x' 2020-05-06 18:52:00 +02:00
Sam Brannen ce11fdfa80 Fix concurrency issues in XStreamMarshaller
Prior to this commit, if an instance of XStreamMarshaller was used
concurrently from multiple threads without having first invoked the
afterPropertiesSet() method, the private `xstream` field could be
initialized multiple times resulting in a ConcurrentModificationException
in XStream's internal DefaultConverterLookup.

This commit fixes these concurrency issues by making the `xstream` field
volatile and by implementing a double-checked locking algorithm in
getXStream() to avoid concurrent instance creation.

Closes gh-25017
2020-05-06 18:49:47 +02:00
Sam Brannen 740f0d766f Polish XStreamMarshallerTests 2020-05-06 18:17:09 +02:00
Juergen Hoeller e9cded560d Introduce JdbcTransactionManager with SQLExceptionTranslator support
Closes gh-24064
2020-05-06 16:41:35 +02:00
Mark Paluch 2aa8aef216 Extend transaction attributes with labels
TransactionAttribute now exposes a labels attribute that associates a
descriptive array of labels with a transaction.

Labels may be of a pure descriptive nature or may get evaluated by
transaction managers to associate technology-specific behavior
with the actual transaction.
2020-05-06 16:28:21 +02:00
Rossen Stoyanchev 3e736898a6 Merge branch '5.2.x' 2020-05-06 14:31:58 +01:00
Rossen Stoyanchev 53e018362f Update samples to latest RSocket API
A follow-up fix on the upgrade to 1.0 RC7 in gh-24934,
2020-05-06 14:28:18 +01:00
Sam Brannen 12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +02:00
Sam Brannen b1c1a232ca Upgrade to Gradle 6.4
Closes gh-25020
2020-05-06 14:25:41 +02:00
Brian Clozel 1b85f6277d Upgrade to Concourse Java Script v0.0.3
This new release has been updated with the version scheme changes.
2020-05-06 13:53:24 +02:00
Sam Brannen 084b4003d1 Upgrade to openjdk-15-ea+21 for CI builds 2020-05-06 12:18:04 +02:00
Rossen Stoyanchev 76e58405b8 Merge pull request #24926 from kobaeugenea/master
Closes gh-24296
2020-05-06 10:53:37 +01:00
Rossen Stoyanchev 5883ea2721 Polishing contribution
See gh-24926
2020-05-06 10:53:25 +01:00
Evgenii Koba e15ed44a68 Make HtmlUnitRequestBuilder handle form data file properly
See gh-18551
2020-05-06 10:53:25 +01:00
Rossen Stoyanchev 04bbc2ac2b Merge pull request #24406 from parviz/93-22083-uri-template
Closes gh-24406
2020-05-06 10:51:28 +01:00
Rossen Stoyanchev f28e08eceb Improving contribution
See gh-24406
2020-05-06 10:50:51 +01:00
Parviz ROzikov 816466e492 #24406 - Add String based URI template variants 2020-05-06 10:50:51 +01:00
Rossen Stoyanchev d1708460e7 Log message for unused @ModelAttribute name
Closes gh-23877
2020-05-06 10:37:44 +01:00
Rossen Stoyanchev 66bb145247 Fix typo
See gh-23915, gh-25018
2020-05-06 06:35:43 +01:00
Rossen Stoyanchev 4d3668a0cb Merge pull request #24866 from encircled/bytebuf-encoder-decoder-24615
Closes gh-24866
2020-05-05 18:21:13 +01:00
Rossen Stoyanchev a7c736915a Polishing and completing contribution
See gh-24866
2020-05-05 18:20:45 +01:00
Vlad Kisel 3543e47841 Add ByteBufEncoder and ByteBufDecoder
See gh-24866
2020-05-05 18:20:45 +01:00
Rossen Stoyanchev 147b8fb755 Turn off use of path extensions by default
Closes gh-23915
2020-05-05 08:04:40 +01:00
Rossen Stoyanchev 153690e717 Merge branch '5.2.x' 2020-05-04 10:55:25 +01:00
swapy 9288067ea8 Add missing @PathVariable declarations in examples
Closes gh-25006
2020-05-04 11:19:19 +02:00
Sam Brannen 1b4b4c3302 Support @TestConstructor config via JUnit Platform config param
This commit introduces support for setting the
spring.test.constructor.autowire.mode property via a JUnit Platform
configuration parameter -- for example, via the
junit-platform.properties file.

Closes gh-24285
2020-05-03 19:02:44 +02:00
Rossen Stoyanchev 6659e96104 Fix failing test
See gh-24986
2020-05-01 18:20:26 +01:00
Rossen Stoyanchev aa97563853 Add UnknownContentTypeException
Closes gh-24964
2020-05-01 17:32:19 +01:00
Rossen Stoyanchev c35b3e5c82 Fix race condition in WriteResultPublisher
Closes gh-24989
2020-05-01 17:06:18 +01:00
Rossen Stoyanchev e17736dd0a Error handling improvement in AbstractSockJsSession
Closes gh-24986
2020-05-01 16:45:25 +01:00
Rossen Stoyanchev c2cce0c547 Add isDeferred to ReactiveTypeDescriptor
Closes gh-24995
2020-05-01 15:39:52 +01:00
Arjen Poutsma 8e81360eba Use pre-parsed PathContainer in WebMvc.fn
This commit makes the default ServerRequest implementation use a pre-
parsed path container, instead of parsing the path for each invocation
of pathContainer().
2020-04-29 17:17:05 +02:00
Sam Brannen 65e8d85142 Only include PNG files in reference manual
The `images` folder contains some files used to create the images, such
as OmniGraffle and SVG.

This commit modifies the `include` pattern to ensure that only `*.png`
files are copied from the source folder to the published reference
manual.
2020-04-29 17:14:11 +02:00
Sam Brannen 69b4f33cfa Move spring-framework.png to src/docs folder
Since the spring-framework.png file is not used in the generated
reference manual, this commit moves the spring-framework.png file from
the src/docs/asciidoc/images folder up to the src/docs folder.
2020-04-29 16:25:02 +02:00
Sam Brannen 48d06a4291 Prune images folder for reference manual
This commit deletes unused files in the asciidoc/images folder.
2020-04-29 16:21:07 +02:00
Brian Clozel fdfe58362e Upgrade Gradle plugins 2020-04-29 15:23:14 +02:00
Brian Clozel 95f76af19c Ensure that build directory exists before writing
This commit ensures that the build directory exists before writing the
build scan URL to it. This is useful when the `clean` task is executed
and the build folder is gone by the time the execution is done.

See gh-22490
2020-04-29 15:23:14 +02:00
Arjen Poutsma 7bd524e9d7 Add ClientHttpConnector test suite
This commit introduces a test suite for ClientHttpConnector
implementations, as well as fixes that resolve issues identified by
these tests.

Closes gh-24941
2020-04-29 15:21:22 +02:00
Arjen Poutsma 6b1170b19a Merge pull request gh-24700 from martin-tarjanyi:webclient_apache
* webclient_apache:
  Integrate Apache http client with WebClient
2020-04-29 15:20:20 +02:00
martin-tarjanyi 3bc1d42dcd Integrate Apache http client with WebClient
This commit introduces a ClientHttpConnector implementation backed by
Apache HttpComponents HttpClient 5.0.

Fixes gh-24700
2020-04-29 15:02:09 +02:00
Sam Brannen 859953fe81 Use same default ClassLoader in SpringFactoriesLoader
Prior to this commit, the loadFactoryNames() and loadFactories() methods
in SpringFactoriesLoader effectively used a different default
ClassLoader.

This commit ensures that the ClassLoader for SpringFactoriesLoader.class
is now consistently used as the default ClassLoader.

Closes gh-24992
2020-04-29 14:46:02 +02:00
Sam Brannen 5abca033d0 Revise duplicate filtering in SpringFactoriesLoader
This commit ensures that the static cache in SpringFactoriesLoader
contains unmodifiable lists of unique names of factory implementations.

See gh-24985
2020-04-29 14:05:14 +02:00
Brian Clozel a378480faf Fix Artifactory properties on published artifacts
This commit fixes the file pattern for the published zip artifacts.
Prior to this commit, the pattern was wrong and properties were not
applied to the published archives, preventing them from being published
automatically (javadoc, reference documentation, schemas...).

See gh-22490
2020-04-29 11:22:32 +02:00
Brian Clozel fbc1b96aa6 Add git repo as output for build tasks
This is required for exporting the Gradle Build Scan URL to
notifications.

See gh-22490
2020-04-29 11:05:50 +02:00
Brian Clozel 7b1de6e1a8 Fix Gradle build 2020-04-29 11:05:36 +02:00
Brian Clozel 749a4ac34a Fix JDK variants jobs inputs
The git repository input was missing.

See gh-22490
2020-04-29 10:54:09 +02:00
Brian Clozel a20e561897 Upgrade to Gradle Enterprise 3.2
Also use the "io.spring.gradle-enterprise-conventions" plugin for
configuring Gradle Enterprise Cache support.
2020-04-29 10:54:03 +02:00
Brian Clozel f0564b746a Add link to Gradle build scan in Slack notifications
See gh-22490
2020-04-28 17:31:46 +02:00
Sam Brannen c3f439417e Disable remaining JavaScript-based tests on Java 15+
This commit disables all remaining JavaScript-based tests on Java 15 or
higher since the Nashorn JavaScript engine is no longer part of the JDK.
2020-04-28 17:22:22 +02:00
Sam Brannen 71ed8143a1 Disable StandardScriptFactoryTests on Java 15+
This commit disables StandardScriptFactoryTests on Java 15 or higher
since the Nashorn JavaScript engine is no longer part of the JDK.
2020-04-28 16:56:15 +02:00
Sam Brannen 4e32615b22 Filter out duplicates in SpringFactoriesLoader
Prior to this commit, SpringFactoriesLoader discovered all registered
factory implementations for a given factory type even if duplicates
were registered within a single META-INF/spring.factories file or in
multiple such files in the classpath.

This commit updates the internals of SpringFactoriesLoader so that
duplicate registrations are ignored, thereby aligning with the
well-known semantics for java.util.ServiceLoader in this regard.

Closes gh-24985
2020-04-28 16:44:18 +02:00
Sam Brannen afc398333e Polishing 2020-04-28 16:34:58 +02:00
Brian Clozel 0a9c768b81 Run JDK variants builds once a day
See gh-22490
2020-04-28 16:04:21 +02:00
Arjen Poutsma 54e6103def Add ServerRequest::multipartData in WebMvc.fn
This commit adds the multipartData method to ServerRequest in WebMvc.fn,
returning a MultiValueMap<String, Part>.

Closes gh-24909
2020-04-28 15:43:59 +02:00
Brian Clozel 60725294e2 Only run checks in pipelines with JDK variants
This commit updates the build pipeline to only run the checks
(formatting and tests) with the build when non-JDK8 variants are used
for sanity checks.

See gh-22490
2020-04-28 15:34:37 +02:00
Brian Clozel 8ffc3334b4 Temporarily remove email notifications from build
See gh-22490
2020-04-28 15:14:53 +02:00
Brian Clozel 784a6d46c0 Remove BOM workaround
Since Gradle 6.2, the scope information is not published anymore with
the BOM, so we don't need to manually remove it anymore
2020-04-28 15:14:02 +02:00
Brian Clozel b71a7ee26f Upgrade to Gradle 6.3 2020-04-28 15:13:40 +02:00
Brian Clozel 893adb40e2 Skip SSL validation in send-email build task
See gh-22490
2020-04-28 15:03:35 +02:00
Jendrik Johannes 9bd60f6554 Update to Gradle 6.2
- Build Scan plugin is now Gradle Enterprise plugin applied in settings
- Compile task dependencies are now defined through classpath
- Test fixture publication can be disabled through public API

Closes gh-24384
2020-04-28 15:03:03 +02:00
Brian Clozel c0ccdc24a0 Add Concourse Build pipeline
This commit adds the Concourse build infrastructure under the "ci/"
folder. It contains:

* "images/", the definitions of container images used in the pipeline
* "pipeline.yml" the build pipeline definition
* "parameters.yml" the parameters for the pipeline definition
* "tasks/" the tasks used by the build pipeline
* "scripts/" scripts used by pipeline tasks

This first iteration of the Concourse pipeline builds CI container
images for JDK8, JDK11, JDK14 and JDK15.
These images are used for building and publishing the master branch of
Spring Framework using JDK8. Other JDK variants are sanity checks and
don't actually publish the produced artifacts.

See gh-22490
2020-04-28 14:37:34 +02:00
Brian Clozel be560d7ad5 Remove artifactory plugin from build
As we're moving the build to Concourse CI, we don't need to use the
Artifactory plugin anymore. Our build will publish the artifacts to a
repository on the local filesystem and will push its content to
Artifactory with the spring-io/artifactory-resource.

This commit also adds the conditional configuration for publishing to a
local repository.

See gh-22490
2020-04-28 14:34:40 +02:00
Juergen Hoeller e7e230608e Upgrade to Groovy 3.0.3 (with FindBugs workaround for groovy-templates)
Closes gh-24215
2020-04-28 14:00:24 +02:00
Sam Brannen e74f868a23 Revise generics support in BeanUtils.copyProperties()
Closes gh-24187
2020-04-28 13:25:28 +02:00
Kunal Patel 89ee0b077f Honor generic type information in BeanUtils.copyProperties()
Prior to this commit, BeanUtils.copyProperties() ignored generic type
information when comparing candidate source and target property types.

This commit reworks the implementation of BeanUtils.copyProperties() so
that generic type information is taken into account when copying
properties.

See gh-24281
2020-04-28 13:25:28 +02:00
Sam Brannen cdde19c0bc Polishing 2020-04-28 13:25:00 +02:00
Sam Brannen e9d63a0a7c Revert "Upgrade to Groovy 3.0.3"
This reverts commit ff65ccba3e.

Compiling against Groovy 3.0.3 currently results in the following two
warnings that cause the build to fail.

warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings': class file for edu.umd.cs.findbugs.annotations.SuppressFBWarnings not found

warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
2020-04-28 13:16:19 +02:00
Juergen Hoeller cdadb834b0 Redefine DefaultResourceLoader default constructor for late TCCL access
Closes gh-24957
2020-04-28 13:02:39 +02:00
Juergen Hoeller ff65ccba3e Upgrade to Groovy 3.0.3
Closes gh-24215
2020-04-28 13:02:04 +02:00
Sam Brannen 27adbb9a35 Use googlecode syntax highlighting in reference manual
Closes gh-24865
2020-04-28 12:25:24 +02:00
Sam Brannen b69f081a79 Upgrade to spring-doc-resources 0.2.2.RELEASE 2020-04-28 12:20:04 +02:00
Sam Brannen d163711def Upgrade to TestNG 7.1.0
Closes gh-24298
2020-04-28 12:13:15 +02:00
Sam Brannen 34067678a1 Upgrade to JUnit 4.13
Closes gh-22894
2020-04-28 12:04:32 +02:00
Stephane Nicoll 5dfdee6d7d Merge branch '5.2.x' 2020-04-28 11:00:49 +02:00
Stephane Nicoll a5c6294d62 Next Development Version 2020-04-28 10:58:49 +02:00
Spring Buildmaster db6d7e2c69 Next Development Version 2020-04-28 08:23:23 +00:00
Rossen Stoyanchev d2bcf1ed71 Upgrade to RSocket 1.0.0-RC7
Closes gh-24934
2020-04-28 06:28:04 +01:00
Rossen Stoyanchev afc8a5d786 Upgrade to Reactor Dysprosium-SR7
Closes gh-24892
2020-04-27 13:24:53 +01:00
Rossen Stoyanchev f425a993e7 Ignore missing STOMP decoder if session closed
Closes gh-24842
2020-04-27 13:19:43 +01:00
Juergen Hoeller 57f1e86a35 AnnotationBeanNameGenerator caches meta-annotations for stereotype check
Closes gh-24980
2020-04-27 13:47:58 +02:00
Juergen Hoeller 73fadd8b7c Polishing 2020-04-27 11:45:41 +02:00
Juergen Hoeller 127e879726 Store source in index-derived ScannedGenericBeanDefinition as well
Includes consistent constructor-level storage of derived resource in ScannedGenericBeanDefinition and ConfigurationClassBeanDefinition.

Closes gh-24978
2020-04-27 11:45:08 +02:00
Sam Brannen 59ecd4997c Optimize toString() for synthesized annotations
This commit moves the toString() implementation for synthesized
annotations from TypeMappedAnnotation to
SynthesizedMergedAnnotationInvocationHandler in order to take advantage
of the synthesized annotation attribute value cache introduced in
72b1abd226.

Closes gh-24970
2020-04-26 14:14:07 +02:00
Sam Brannen db45b80b1f Suppress warnings for deprecated AnnotationFilter.NONE enum constant
See gh-24932
2020-04-26 13:58:31 +02:00
Juergen Hoeller f6df21eaa9 Upgrade to Mockito 3.3.3, MockK 1.10, HtmlUnit 2.39, Checkstyle 8.31 2020-04-25 18:00:34 +02:00
Juergen Hoeller ad088f2157 Polishing 2020-04-25 17:59:04 +02:00
Juergen Hoeller 5bca18f091 Upgrade to Netty 4.1.49, Groovy 2.5.11, Log4J 2.13.2, Hibernate Validator 6.1.4 2020-04-25 16:37:58 +02:00
Juergen Hoeller af65b1ca62 Polishing 2020-04-25 16:37:16 +02:00
Juergen Hoeller e5a292fb34 Deprecate AnnotationFilter.NONE and document MergedAnnotations design
Closes gh-24932
2020-04-25 16:36:44 +02:00
Juergen Hoeller e36a415994 Explain FactoryBean lifecycle management and destroy method handling
Closes gh-24948
2020-04-25 16:34:59 +02:00
Juergen Hoeller 401f9599ca Caching of autowire candidate metadata for injection point matching
Closes gh-24904
2020-04-25 16:34:28 +02:00
Juergen Hoeller 0552102780 Enforce limit for storing suppressed exceptions
Closes gh-24902
2020-04-25 16:33:35 +02:00
liuhy365 3af54692fa Fix parent bean factory self-reference issue.
If set parent bean factory to self, once try to get an undefined bean,  bellow condition
if (parentBeanFactory != null && !containsBeanDefinition(beanName)) {
...
}
will always be true and  StackOverflowError will be thrown.
Sometimes, this issue is hard to detect during runtime, if self-reference is not allowed here, error will be found at the early time of startup.
Also, a self-reference parent bean factory is valueless.
2020-04-25 16:28:09 +02:00
mattbertolini 21887ad23b Allow override of data binder binding
Motivation
----------
The Spring MVC ModelAttributeMethodProcessor includes many helpful
extension methods that allow developers to extend and enhance the data
binding capabilities of the class. Unfortunately, Spring WebFlux's
equivalent class, the ModelAttributeMethodArgumentResolver, does not
include these same extension methods. I am leveraging these extension
methods, specifically the bindRequestParameters method, to provide
valuable enhancements to my application. I would like to provide these
same enhancements to the WebFlux portion of my application and am
unable to do so at this time. I would like to update the WebFlux
ModelAttributeMethodArgumentResolver to add the bindRequestParameters
method.

Modifications
-------------
I created a new method called bindRequestParameters and encapsulated
the WebExchangeDataBinder bind call inside of it. This method is
marked as protected as it should only be used by children of this
class. This change mirrors the behavior in the equivalent Spring MVC
class (ModelAttributeMethodProcessor).

Result
------
The WebFlux ModelAttributeMethodArgumentResolver can now accept
alternative data binding implementations mirroring the Web MVC
behavior.
2020-04-25 16:27:36 +02:00
Сергей Цыпанов bff1a1932f Rid pointless wrapping with BufferedInputStream from class reading 2020-04-25 16:27:01 +02:00
Sam Brannen 72b1abd226 Reintroduce synthesized annotation attribute value caching
Prior to the introduction of the MergedAnnotation API in Spring Framework
5.2, our SynthesizedAnnotationInvocationHandler utilized a cache for
annotation attribute values; whereas, the new
SynthesizedMergedAnnotationInvocationHandler has no such caching in
place.

Issues such as gh-24961 indicate a regression in performance caused by
the lack of such an attribute value cache. For example, the required
attribute in @RequestParam is looked up using the internal meta-model
in the MergedAnnotation API twice per request for each @RequestParam in
a given controller handler method.

This commit reintroduces the attribute value cache to avoid the
unnecessary performance overhead associated with multiple lookups of
the same attribute in a synthesized annotation. This applies not only
to direct attribute method invocations but also to invocations of
equals() and hashCode() on a synthesized annotation.

Note, however, that this commit does NOT address multiple lookups of
annotation attribute values for invocations of toString(). That behavior
currently remains unchanged in the implementation of
org.springframework.core.annotation.TypeMappedAnnotation.toString().

Closes gh-24970
2020-04-25 15:28:09 +02:00
rahulmlokurte 0e9da17910 Fix typo in webmvc-functional.adoc
Closes gh-24968
2020-04-25 09:24:15 +02:00
Rossen Stoyanchev 583435d068 Consistent ordering in MethodNotAllowedException
This caused random failures in a newly added test. Also remove defensive
check in ResponseStatusExceptionResolver.

See gh-24944
2020-04-25 07:33:30 +01:00
Rossen Stoyanchev 2002a1689a Adapt test to changes in RSocket Java
See gh-24934
2020-04-25 07:11:34 +01:00
Rossen Stoyanchev 18474c921d Document IAE in HttpHeaders methods that parse ETags
See gh-24950
2020-04-24 13:02:12 +01:00
Rossen Stoyanchev d9262b8a0c Suppress deprecated Reactor Netty call
See gh-24892
2020-04-24 12:57:16 +01:00
Rossen Stoyanchev e18901d6b1 Headers support in ResponseStatusExceptionResolver
Closes gh-24944
2020-04-24 12:53:00 +01:00
Sam Brannen 8265db0ae1 Avoid synthesizing annotations unnecessarily
Commit 31fa1569c5 introduced initial support for avoiding unnecessary
annotation synthesis in the MergedAnnotation API; however, it only
avoided synthesis for annotations that do not declare any attributes.

This commit reworks this support to avoid unnecessary annotation
synthesis for annotations that declare attributes.

Specifically, this commit introduces a new `isSynthesizable()` method
in AnnotationTypeMapping that allows the "synthesizable" flag to be
computed once and cached along with the other metadata already cached
in AnnotationTypeMapping instances. TypeMappedAnnotation now delegates
to this new method when determining whether it should synthesize an
annotation.

Closes gh-24861
2020-04-23 19:09:30 +02:00
Rossen Stoyanchev 0520ee0fb6 Use the Reactor Netty WebsocketServerSpec
Closes gh-24959
2020-04-23 13:50:00 +01:00
Brian Clozel dc4cda1b13 WARN against invalid patterns with PathPatternParser
As of gh-24952, `PathPatternParser` will strictly reject patterns with
`"**"` in the middle of them. `"**"` is only allowed at the end of the
pattern for matching multiple path segments until the end of the path.

Currently, if `"**"` is used in the middle of a pattern it will be
considered as a single `"*"` instead. Rejecting such cases should
clarify the situation.

This commit prepares for that upcoming change and:

* logs a warning message if such a case is used by an application
* expands the MVC and WebFlux documentation about URI matching in
general

Closes gh-24958
2020-04-23 13:03:05 +02:00
Sam Brannen 5eba1ae73c Avoid deprecation warning in DefaultRSocketRequesterBuilderTests 2020-04-22 19:19:34 +02:00
Sam Brannen a9cc7b3edc Improve tests for synthesized array of annotations 2020-04-22 15:17:33 +02:00
Sam Brannen 5721c747b2 Polishing 2020-04-21 18:47:28 +02:00
Sam Brannen 31fa1569c5 Avoid synthesizing annotations unnecessarily
Prior to Spring Framework 5.2, some of our annotation utilities would
not synthesize an annotation if it was already synthesized or not
synthesizable (i.e., did not declare local aliases via @AliasFor and
did not declare attributes that could override attributes in the
meta-annotation hierarchy above the given annotation); however, we lost
most of this functionality with the introduction of the new
MergedAnnotations API.

This commit revises the implementation of createSynthesized() in
TypeMappedAnnotation so that, for invocations of
MergedAnnotation.synthesize() and indirectly for invocations of
AnnotatedElementUtils.findMergedAnnotation(), etc.:

1. An annotation that was previously synthesized will not be
   synthesized again.

2. An annotation that is not "synthesizable" will not be synthesized.

For both of the above use cases, the original annotation is now
returned from createSynthesized().

Closes gh-24861
2020-04-21 13:31:06 +02:00
Rossen Stoyanchev 8d31dcaa29 Clarification on path extension deprecations
Closes gh-24642
2020-04-20 14:43:07 +01:00
Rossen Stoyanchev 4b85b44bbd Update Javadoc of InputStreamResource#contentLength
Closes gh-20990
2020-04-20 12:53:42 +01:00
Rossen Stoyanchev fa5e8485ab Update StackOverflow link 2020-04-20 12:32:11 +01:00
Rossen Stoyanchev 1904e9b7e7 Disable failing test temporarily 2020-04-20 10:16:40 +01:00
Sébastien Deleuze 6d5080825c Remove potentially confusing kotlin-reflect related log message
Closes gh-24935
2020-04-20 11:00:29 +02:00
Rossen Stoyanchev ed8c61a852 Upgrade to RSocket 1.0 RC7 snapshots 2020-04-20 09:42:28 +01:00
Sam Brannen 376434eb75 Polishing 2020-04-19 19:17:02 +02:00
Sam Brannen f42955c31b Polishing 2020-04-19 17:49:08 +02:00
Mikael d6c9c7d642 Simplify substring() usage in MimeTypeUtils
Closes gh-24933
2020-04-19 17:39:06 +02:00
Sam Brannen 3dadcaeb2d Polishing 2020-04-17 19:07:49 +02:00
Johnny Lim 87fa2c3b97 Avoid unnecessary String instantiation in StringUtils.deleteAny()
This commit avoids unnecessary String instantiation in
StringUtils.deleteAny() if nothing was deleted from the
input string.

Closes gh-24924
2020-04-17 18:44:16 +02:00
Deycoesr 87f28ce48e Simplify some control flow code
Closes gh-24925
2020-04-17 18:32:02 +02:00
Sam Brannen b8835c9f32 Copy MockHttpServletRequest changes to spring-web
See gh-24916
2020-04-17 16:20:42 +02:00
Sam Brannen 6b410df45b Retain brackets for IPV6 address in MockHttpServletRequest
According to the Javadoc for ServletRequest's getServerName() method,
when the `Host` header is set, the server name is "the value of the
part before ':' in the Host header value ...". For a value representing
an IPV6 address such as `[::ffff:abcd:abcd]`, the enclosing square
brackets should therefore not be stripped from the enclosed IPV6
address.

However, the changes made in conjunction with gh-16704 introduced a
regression in Spring Framework 4.1 for the getServerName() method in
MockHttpServletRequest by stripping the enclosing brackets from the
IPV6 address in the `Host` header. Similarly, the changes made in
conjunction with gh-20686 introduced a regression in Spring Framework
4.3.13 and 5.0.2 in the getRequestURL() method in
MockHttpServletRequest by delegating to the getServerName() method
which strips the enclosing brackets.

This commit fixes the implementation of getServerName() so that the
enclosing brackets are no longer stripped from an IPV6 address in the
`Host` header. The implementation of getRequestURL() is therefore also
fixed.

In addition, in order to avoid a NullPointerException, the
implementations of getServerName() and getServerPort() now assert that
an IPV6 address present in the `Host` header correctly contains an
opening and closing bracket and throw an IllegalStateException if that
is not the case.

Closes gh-24916
2020-04-17 15:01:35 +02:00
Sam Brannen 0017256968 Test that @TestConstructor can be used as a meta-annotation 2020-04-17 13:29:33 +02:00
Oliver Degener df291a39b1 Fix Javadoc link in DefaultCorsProcessor
Closes gh-24921
2020-04-17 09:26:53 +02:00
Brian Hartung 1658223e58 Fixed typo
Fixed another small documentation typo.
2020-04-15 14:20:35 +01:00
Brian Hartung 89775844ed Fixed typos
Fixed a couple of minor documentation typos
2020-04-15 14:20:35 +01:00
Juergen Hoeller d211381b58 Upgrade to Tomcat 9.0.34, Jetty 9.4.28, Hibernate ORM 5.4.14, Hibernate Validator 6.1.3 2020-04-15 13:05:02 +02:00
Sébastien Deleuze a33a6c310a Upgrade to Kotlin 1.3.72 2020-04-15 12:12:59 +02:00
Sébastien Deleuze 67955dfb35 Prevent duplicated Vary headers in CORS processing
Closes gh-24829
2020-04-15 11:23:59 +02:00
Stephane Nicoll ae8f333d36 Merge pull request #24908 from chenqimiao
* pr/24908:
  Fix typo in Javadoc

Closes gh-24908
2020-04-15 08:37:58 +02:00
陈其苗 1e1ea34e87 Fix typo in Javadoc
See gh-24908
2020-04-15 08:36:33 +02:00
onnadi-sa 75457c440c Fix typo in webflux-functional.adoc
Closes gh-24906
2020-04-14 15:42:50 +02:00
Sébastien Deleuze 884c7696ce Make it possible to run Spring MVC without kotlin-reflect
Closes gh-24828
2020-04-14 14:56:47 +02:00
Sam Brannen 3aa7f45738 Upgrade to JUnit 5.6.2 2020-04-14 14:49:11 +02:00
Sam Brannen 154fa29471 Upgrade to spring-doc-resources 0.2.1
See gh-24865
2020-04-14 13:36:11 +02:00
Stephane Nicoll 4523d9586f Start building against Reactor Dysprosium-SR7 snapshots
See gh-24892
2020-04-10 17:16:31 +02:00
Brian Clozel 39536acf9f Fix potential leak in MimeTypeUtils LRUCache
Prior to this commit, the `MimeTypeUtils` LRUCache would maintain a
queue to track least recently used cached values. In some cases,
concurrent access could create more entries in that unbounded queue than
expected and spend a significant amount of time removing entries in that
queue (i.e. iterating over a long list of elements).

This commit ensures that recently used entries are only added to the
queue if they've been removed by the current thread, in case of
concurrent access.

Fixes gh-24886
2020-04-09 15:38:01 +02:00
Juergen Hoeller de0d06fab5 Polishing 2020-04-09 11:49:35 +02:00
Lars Grefer 8682a5d89a Honor overriden AccepptHeaderLocaleContextResolver.getDefaultLocale() 2020-04-09 11:37:50 +02:00
Сергей Цыпанов e1951a098b Improve performance of StringUtils.deleteAny() 2020-04-09 11:36:32 +02:00
Sam Brannen 8c0aaf4863 Delete meaningless "performance" test
The test deleted in this commit didn't even assert anything to begin
with.

See gh-24830
2020-04-08 15:21:32 +02:00
Sam Brannen 9628038c58 Upgrade to BeanShell 2.0b6 2020-04-07 18:06:43 +02:00
Sébastien Deleuze 3c354a9b18 Avoid using Mockito argument matcher in Mockk test 2020-04-07 16:38:09 +02:00
Sam Brannen 6c26765985 Document default constructor as fallback for non-@Autowired constructors
Prior to this commit, it was unclear in the documentation that a default
constructor will be used by default for autowiring if multiple
constructors are present and none of them is annotated with @Autowired.

This commit improves the documentation in this regard.

Closes gh-24838
2020-04-07 14:35:40 +02:00
Sam Brannen a5498ba2ad Test status quo for @Primary + TransactionManagementConfigurer in TCF
This commit introduces an integration test for the status quo in the
Spring TestContext Framework (TCF) for multiple transaction managers
registered as @Primary and via the TransactionManagementConfigurer API.

In Spring Framework 5.3 we will revise the transaction manager lookup in
TestContextTransactionUtils so that the transaction manager configured
via the TransactionManagementConfigurer API is favored over a @Primary
transaction manager.

See gh-24869
2020-04-06 19:11:53 +02:00
Sam Brannen a42944d364 Consolidate TxMgr lookup tests in the TCF
This commit consolidates TransactionManager lookup tests in the Spring
TestContext Framework (TCF), migrates some to JUnit Jupiter, simplifies
their implementations, and removes duplicated test cases.
2020-04-06 18:21:48 +02:00
Sam Brannen 1d0c5195bc Polish Javadoc for TransactionManagementConfigurer 2020-04-06 15:31:48 +02:00
Sam Brannen 144b0e1437 Test status quo for @Primary + TransactionManagementConfigurer
This commit introduces tests for the status quo in production support
for multiple transaction managers registered as @Primary and via the
TransactionManagementConfigurer API.

See gh-24869
2020-04-06 15:16:31 +02:00
Sam Brannen dc5ddffd03 Polishing 2020-04-06 14:42:23 +02:00
Sam Brannen f8ab19dc68 Ensure @EnableTxMgmt tests actually test something 2020-04-06 14:32:34 +02:00
Qimiao Chen fd8d11c7e3 Use single String instead of String[] for varargs argument
Closes gh-24864
2020-04-04 20:05:19 +02:00
Juergen Hoeller 251501587b Consistent nullability of arguments array in JdbcOperations/Template
Closes gh-24839
2020-04-03 21:15:00 +02:00
Juergen Hoeller 6177e38eb6 Close-suppressing Connection proxy exposes target isClosed() state
Closes gh-24853
2020-04-03 21:13:53 +02:00
Juergen Hoeller a70ad0094f Clear by-type cache in case of no pre-existing bean definition as well
Closes gh-24852
2020-04-03 21:12:03 +02:00
Juergen Hoeller 151a18d691 Explicit notes on BeanFactory.getType vs bean class in bean definition
Closes gh-24816
2020-04-03 21:11:07 +02:00
Juergen Hoeller 8595f01e44 Polishing 2020-04-03 21:08:45 +02:00
Moran Avigdor 7d5e474e0d Recursively copy directory with symbolic link
The following modification will also recursively traverse the directory that the symbolic link points to.
This modification is not proposed for deleteRecursively, since it can be harmful if not intended.

This modification relates to the following commit:
Consistent use of NIO.2 for file read/write interactions
Issue: SPR-15748
12114a9
2020-04-03 21:05:26 +02:00
Sam Brannen 9f0ce09cf0 Update copyright date 2020-04-02 16:33:50 +02:00
Sam Brannen 0636ba68d7 Fix Javadoc in PathPattern (#24841)
* corrected javadoc

* Revert change to PathPattern Javadoc

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-04-02 16:29:27 +02:00
Sam Brannen c9e13d448a Revert change to PathPattern Javadoc 2020-04-02 16:28:26 +02:00
Rossen Stoyanchev 897557fd1b Fix faulty tests
The tests were doing Callable async request processing in the main
thread which was already bound (via HandlerInterceptor#preProcess).
This leads to an ISE from TransactionSynchronizationManager#bindResource
but it went unnoticed because there is no Servlet container and no
async dispatch to continue processing.

See gh-24835
2020-04-02 09:31:00 +01:00
Rossen Stoyanchev 6f0a76a65f Polishing
See gh-24835
2020-04-02 08:34:44 +01:00
Gurps Bassi 4aca91c3b0 corrected javadoc 2020-04-01 22:05:53 +01:00
Rossen Stoyanchev 7d0f48289b Improve error handling in WebAsyncManager
See gh-24835
2020-04-01 18:35:22 +01:00
Sam Brannen a842434bff Document precedence for @DynamicPropertySource
Closes gh-24837
2020-04-01 18:09:31 +02:00
Jay Bryant b7eb983107 Update to spring-doc-resources version 0.2.0
This commit updates the spring-doc-resources version to 0.2.0 to get the
latest look and feel in the HTML version of the reference manual.

Closes gh-24831
2020-04-01 14:52:58 +02:00
陈其苗 13970ae528 Use autoboxing instead of explicit wrapping in tests
Closes gh-24801
2020-04-01 14:34:20 +02:00
Sam Brannen d8567749b8 Fix Javadoc 2020-03-31 19:14:56 +02:00
Sam Brannen 01cf0a3d4e Polish MBeanClientInterceptorTests and recover two lost tests
Two test methods were missing the @Test annotation after the migration
from JUnit 3 to JUnit 4.
2020-03-31 19:02:15 +02:00
Sam Brannen 9bd74c270f Remove flaky check in MBeanClientInterceptorTests
Prior to this commit, the testTestLazyConnectionToRemote() method in
MBeanClientInterceptorTests expected an exception to be thrown while
attempting to access the state of a proxied MBean after the MBeanServer
had been shutdown; however, the test occasionally failed if the server
had not been properly shutdown.

Since an attempt to wait on the server to shutdown proved not to be
consistently helpful in this scenario, we are entirely removing this
check from the test.
2020-03-31 18:55:54 +02:00
Sam Brannen 89d282125a Ensure logPrefix is not null or blank in AbstractListenerWriteProcessor 2020-03-31 18:49:05 +02:00
Sam Brannen e87ab6f4ee Update Javadoc for AbstractListenerWriteProcessor.write()
Co-authored-by: Rossen Stoyanchev <rstoyanchev@pivotal.io>
2020-03-31 18:47:06 +02:00
Rossen Stoyanchev 99c2b1e242 Add snippet for maxInMemorySize config
See gh-23961
2020-03-31 17:08:12 +01:00
Juergen Hoeller 1795a6ad0a Upgrade to Hibernate ORM 5.4.13, Apache Johnzon 1.2.4, OpenPDF 1.3.14, Woodstox 6.1.1 2020-03-31 16:44:02 +02:00
Sam Brannen ddaf0029ae Polishing 2020-03-31 16:31:34 +02:00
Rossen Stoyanchev 95ef9c25c2 Reduce byte[] allocations in StompEncoder
Closes gh-24694
2020-03-31 12:56:10 +01:00
Sam Brannen 329f08ad08 Suppress warnings in Gradle build 2020-03-31 12:17:58 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Sam Brannen 53106d5741 Polishing 2020-03-31 10:40:04 +02:00
Juergen Hoeller 3ad42aa983 Upgrade to Tomcat 9.0.33, FreeMarker 2.3.30, Apache HttpClient 4.5.12, WebJars Locator 0.44, JRuby 9.2.11.1 2020-03-30 19:04:06 +02:00
Taehee Kim 8b3521d2bf Fix typo in webflux-cors.adoc
Closes gh-24815
2020-03-30 14:00:25 +02:00
Sam Brannen ee42e3e730 Polish StreamUtils 2020-03-30 13:57:09 +02:00
Sam Brannen 9e30620ac2 Polish contribution
See gh-24805
2020-03-30 13:47:00 +02:00
Сергей Цыпанов e63d1cf12d Improve usage of ByteArrayOutputStream/ByteArrayInputStream
Closes gh-24805
2020-03-30 13:22:21 +02:00
Qimiao Chen 821984a5cf Remove unnecessary assignment in PropertiesBeanDefinitionReader
Closes gh-24804
2020-03-30 12:41:19 +02:00
Qimiao Chen f8ff4e42b9 Use try-with-resource to close resources
Closes gh-24807
2020-03-30 12:05:29 +02:00
Qimiao Chen 7c831d2ef4 Replace anonymous inner classes with lambdas in tests
Closes gh-24808
2020-03-30 12:02:23 +02:00
Qimiao Chen 7db00c9e22 Remove incorrect @Nullable in DynamicPropertiesContextCustomizer
Closes gh-24796
2020-03-28 15:29:01 +01:00
Qimiao Chen 5d6139eb7a Set initialValue of NamedThreadLocal in XmlBeanDefinitionReader
This commit overrides initialValue() of NamedThreadLocal to lazily initialize
the set used in XmlBeanDefinitionReader.

Closes gh-24800
2020-03-27 14:58:55 +01:00
Sam Brannen 06fa8692cd Attempt to make MBeanClientInterceptorTests more robust 2020-03-27 11:18:45 +01:00
Qimiao Chen c77853b766 Remove unnecessary mem alloc in CollectingReaderEventListener
Closes gh-24799
2020-03-27 11:00:05 +01:00
Rossen Stoyanchev a606fb4b21 Fix checkstyle errors 2020-03-26 22:02:32 +00:00
Rossen Stoyanchev 6f1ea14718 Merge pull request #24786 from stsypanov/data-buffer
Closes gh-24786
2020-03-26 21:42:33 +00:00
Rossen Stoyanchev 3175f0771e Remove dumpString from DataBufferTestUtils
See gh-24786
2020-03-26 21:42:12 +00:00
Rossen Stoyanchev 7aa06b8610 Polishing contribution
See gh-24786
2020-03-26 21:42:12 +00:00
Сергей Цыпанов f17b0125ff Simplify conversion of DataBuffer to String
See gh-24786
2020-03-26 21:42:12 +00:00
Sam Brannen ac11acb532 Optimize sorting in PostProcessorRegistrationDelegate
Closes gh-24776
2020-03-26 17:32:38 +01:00
Rossen Stoyanchev dd3dd5d67d UriComponentsBuilder.cloneBuilder copies uriVariables
Closes gh-24772
2020-03-26 16:31:25 +00:00
Juergen Hoeller 593a2ade91 Expose context class for interface-based CGLIB proxies as well
Closes gh-24657
2020-03-26 17:30:37 +01:00
Rossen Stoyanchev f720225c22 Merge toBodilessEntity fix and refactoring
Closes gh-24788
2020-03-26 15:59:44 +00:00
Rossen Stoyanchev 1822f272c7 toBodilessEntity() actually drains response body
See gh-24788
2020-03-26 15:59:28 +00:00
Rossen Stoyanchev 5309757026 WebClientIntegrationTests refactoring
- consistent test naming
- grouping by category and logical ordering within category
- consolidate overlapping tests
- polishing

See gh-24788
2020-03-26 15:59:04 +00:00
Rossen Stoyanchev d1cf16320b Minor refactoring and polishing in WebClientUtils
See: gh-24788
2020-03-26 15:59:04 +00:00
Sam Brannen 6222efc54b Polish contribution
See gh-24785
2020-03-26 16:52:24 +01:00
Сергей Цыпанов 65aa2d03f0 Simplify conversion of ByteArrayOutputStream to String
Closes gh-24785
2020-03-26 16:52:14 +01:00
Andy Wilkinson 62c545d0ed Upgrade to Gradle Build Scan Plugin 3.2
Closes gh-24793
2020-03-26 16:27:06 +01:00
Qimiao Chen 9f2fd4f0d5 Fix broken link in Javadoc for DynamicPropertySource
Closes gh-24792

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-26 16:20:55 +01:00
Qimiao Chen 1f9fa3bab8 Remove useless .gitignore files
Closes gh-24790
2020-03-26 15:53:39 +01:00
Sam Brannen fb0b915e3d Remove obsolete comment in BeanDefinitionParserDelegate (#24789)
* Fix typo in BeanDefinitionParserDelegate

* Update spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-26 15:48:48 +01:00
Sam Brannen 3e9d51220d Update spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java 2020-03-26 15:47:46 +01:00
Mikael Elm 822ca0130a Fix typos and improve readability in Webflux documentation
Closes gh-24781
2020-03-26 15:16:22 +01:00
陈其苗 072961b91a Fix typo in BeanDefinitionParserDelegate 2020-03-26 20:11:06 +08:00
Sam Brannen 5c977ce119 Make remaining static fields final in CommonAnnotationBPP 2020-03-25 18:58:56 +01:00
Sam Brannen 6d0bab332c Polishing 2020-03-25 18:41:21 +01:00
Arjen Poutsma 9fb614a5c6 Clarify the role of views with Spring MVC
This commit adds a section to the reference docs that explains
views live within the trust boundary of the application, and the
security implications thereof.

Closes gh-24777
2020-03-25 15:05:50 +01:00
Qimiao Chen c42a0eeb38 Make resourceAnnotationTypes field final in CommonAnnotationBPP
Closes gh-24774
2020-03-25 14:34:29 +01:00
Johnny Lim 0f50a9a60a Fix empty domain handling in ResponseCookie
This commit also updates its test to use its intended inputs.
2020-03-25 08:18:03 +00:00
Sam Brannen c24fa22a1b Polishing 2020-03-24 14:22:42 +01:00
Sam Brannen 4be358e47f Cross reference Dynamic Property Sources section 2020-03-24 14:07:56 +01:00
Spring Buildmaster d26b84acd6 Next Development Version 2020-03-24 11:33:18 +00:00
Brian Clozel d97eabba2f Do not cache multipart MIME types in cache
Prior to this commmit, "mutipart/*" MIME types would be cached by the
`MimeTypeUtils` LRU cache. Since those MIME types are likely to have
random boundaries in them, they can waste space in the LRU cache.
This is not improving things since we're parsing them anyway.

This commit skips the caching step for all "multipart" MIME types.

Fixes gh-24767
2020-03-24 10:59:05 +01:00
Sébastien Deleuze 1cd0e720f7 Specify that Kotlin code samples leverage kotlin-allopen 2020-03-24 10:31:57 +01:00
Sébastien Deleuze 60dca027e7 Add Kotlin documentation and tests for @DynamicPropertySource
See gh-24540
2020-03-24 10:08:37 +01:00
Juergen Hoeller 2209e7cb92 Reuse empty class array constant in ClassUtils
Closes gh-24221
2020-03-24 00:08:43 +01:00
Juergen Hoeller fdc60311ed Avoid unnecessary trace logging in ProxyFactoryBean
Closes gh-24669
2020-03-24 00:07:40 +01:00
Christoph Dreis 1c6dda3ca4 Improve performance of StringUtils#cleanPath 2020-03-23 23:25:15 +01:00
Sam Brannen ac0363c94e Document @DynamicPropertySource support in the reference manual
Closes gh-24540
2020-03-23 20:43:38 +01:00
Sam Brannen a90716522c Include Testcontainers in Further Resources section 2020-03-23 20:05:58 +01:00
Rossen Stoyanchev b2fa574879 Upgrade to Reactor Dysprosium-SR6
Closes gh-24725
2020-03-23 17:36:39 +00:00
Juergen Hoeller 910d2788e9 Polishing 2020-03-23 18:02:55 +01:00
Juergen Hoeller 2e23cf32ce Clarify name generation responsibility for PropertySourceFactory impls
Closes gh-24757
2020-03-23 18:02:05 +01:00
Juergen Hoeller bb1699a9d3 Revise documentation for autowiring with annotated constructors
Closes gh-24711
2020-03-23 18:01:30 +01:00
Juergen Hoeller 10d47d4d21 Enable ASM8_EXPERIMENTAL for Java 14 record support
Closes gh-24722
2020-03-23 18:00:59 +01:00
Juergen Hoeller 1800b10717 Expose parameter annotations from interfaces across entire class hierarchy
Closes gh-24127
2020-03-23 17:57:44 +01:00
Juergen Hoeller 7ebd850b85 Mark MediaTypeNotSupportedStatusException as deprecated
Closes gh-24743
2020-03-23 17:56:28 +01:00
Juergen Hoeller fd1ca46ca1 Thread-safe access to WebSocketServerFactory and WebSocketExtensions
See gh-24745
2020-03-23 17:56:14 +01:00
Sébastien Deleuze b7b36891fb Upgrade to Kotlin 1.3.71 2020-03-23 17:41:55 +01:00
Sam Brannen cf7daa36c8 Add @DynamicPropertySource support in TestContext framework
This commit introduces a @DynamicPropertySource annotation that can be
used on methods in test classes that want to add properties to the
Environment with a dynamically supplied value.

This new feature can be used in conjunction with Testcontainers and
other frameworks that manage resources outside the lifecycle of a
test's ApplicationContext.

Closes gh-24540

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2020-03-23 17:10:18 +01:00
陈其苗 821a8eebdd Improve Javadoc in Configuration 2020-03-23 15:42:45 +01:00
陈其苗 0463d7fcb9 Set proxyBeansMethod to false when no method is called 2020-03-23 15:42:23 +01:00
陈其苗 0e5f27c94e Introduce NonNull to package-info 2020-03-23 15:42:02 +01:00
Rossen Stoyanchev e11373fe69 Unwrap XMLStreamException from cause
Closes: gh-24622
2020-03-23 12:22:43 +00:00
Sébastien Deleuze 623a019ef8 Upgrade to Dokka 0.10.1
Closes gh-24764
2020-03-23 13:01:06 +01:00
Sam Brannen b069efade4 Polish Javadoc for @ManagedAttribute
See gh-24742
2020-03-23 11:34:25 +01:00
Tom van den Berge 107f88a7e4 Allow non-public Kotlin classes/ctors to be instantiated
Closes gh-24712
2020-03-23 10:47:28 +01:00
Brian Clozel 831a95154e Polish ConcurrentLruCache
This commit improves the performance of the `ConcurrentLruCache` and
applies a consistent style to the code:

* separating read/write locks into different variables does not help
performance, so this change is reverted
* apply a consistent style for read/write locks and try/cactch calls
* the reordering of recently used keys is only done when the cache is
full

Fixes gh-24671
2020-03-22 21:49:07 +01:00
Kwangyong Kim 713a112812 Improve ConcurrentLruCache performance
- manage collection size manually
- check cache hit first before size check
- reduce read-lock scope
- use `map.get` to test cache instead of `queue.remove`

Closes gh-24469
See gh-24671
2020-03-22 21:48:55 +01:00
Sam Brannen 7e7e54b75e Upgrade to JUnit 5.6.1
Closes gh-24762
2020-03-22 20:56:57 +01:00
Sam Brannen 5be0db9259 Consistently refer to t_actor table 2020-03-22 20:32:45 +01:00
Sam Brannen b52136dfa5 Revert renaming of local variable
This commit fixes the example by reverting the renaming of the local
Actor variable to avoid a conflict with a same-named variable already
in the current scope.

See gh-24398
2020-03-22 20:28:59 +01:00
Rossen Stoyanchev 1f72ab4816 Add Javadoc to ManagedAttribute
Closes: gh-24742
2020-03-20 21:50:52 +00:00
陈其苗 45a629e20a Remove unnecessary check in ConvertingEncoderDecoderSupport 2020-03-20 21:25:29 +00:00
Rossen Stoyanchev 9685380334 Fix typos 2020-03-20 21:14:56 +00:00
Qimiao Chen 09b36380cd Fix typos in source files
Closes gh-24746
2020-03-20 20:06:52 +01:00
Sam Brannen 331b14bb0b Fix NoHttp violation 2020-03-20 19:43:00 +01:00
Sam Brannen 90268de9c0 Polish implementation of BeanDefinitionReaderUtils.generateBeanName()
Closes gh-24739
2020-03-20 19:13:29 +01:00
Rossen Stoyanchev 2ca93cbe1c Update Javadoc for WebClient onStatus handlers
Closes gh-24736
2020-03-20 18:02:18 +00:00
Sam Brannen 116a256e81 Fix typos in AnnotationsScannerTests 2020-03-20 15:03:01 +01:00
Qimiao Chen 2c5781473c Improve Javadoc in AnnotatedElementUtils
Closes gh-24740
2020-03-20 15:00:17 +01:00
Rossen Stoyanchev 7efb62091d MessagingRSocket correctly handles unconsumed input
Closes gh-24741
2020-03-20 10:03:56 +00:00
Rossen Stoyanchev 0d42a1bd7f Add retry for flaky test (suspected Tomcat issue) 2020-03-19 14:32:56 +00:00
Rossen Stoyanchev a7fe6b8f5c Avoid NPE in ResponseCookie on null domain
See gh-24663
2020-03-19 12:18:29 +00:00
Rossen Stoyanchev b121c0e2ea Avoid ClassCastException in TomcatHttpHandlerAdapter
Closes gh-24707
2020-03-19 12:17:24 +00:00
Rossen Stoyanchev 5b27df772a Suppress deprecation warning
See gh-24725
2020-03-19 07:21:21 +00:00
Juergen Hoeller c2149e38fc Upgrade to Kotlin Coroutines 1.3.5 (and Checkstyle 8.30) 2020-03-18 18:38:43 +01:00
Rossen Stoyanchev e7329271fa Switch to Reactor Dysprosium snapshots
See gh-24725
2020-03-18 17:20:03 +00:00
Sam Brannen 7b94112ec6 Update documentation for custom-java-home.gradle
See gh-24719
2020-03-18 17:10:16 +01:00
Sam Brannen e6814f6609 Clean up warnings in Jsr354NumberFormatAnnotationFormatterFactory 2020-03-18 17:04:28 +01:00
Sam Brannen 678b6edad2 Delete unused method in ConfigurationClassParser 2020-03-18 17:01:33 +01:00
Sam Brannen 4bd0ad5d2e Delete obsolete log4j config 2020-03-18 17:01:01 +01:00
Yoo In Keun eaabe21c7b Delete empty .gitignore file
Closes gh-24717
2020-03-18 16:13:56 +01:00
Sam Brannen edb5e73d48 Update Kotlin example based on feedback from @lnhrdt
See gh-24398
2020-03-18 15:34:27 +01:00
Juergen Hoeller d4b2860cc9 Upgrade to Groovy 2.5.10 (and Netty 4.1.48)
Closes gh-24719
2020-03-18 12:32:23 +01:00
Sam Brannen 14f5032e97 Update Kotlin example
See gh-gh-24398
2020-03-17 19:22:26 +01:00
Sam Brannen 17140c8d4b Polish contribution
See gh-24595
2020-03-17 17:15:12 +01:00
Andrew Woodbury 2fb13d410d Include response body in UnknownHttpStatusCodeException
Spring Framework 5.2.2 introduced a regression in
DefaultResponseErrorHandler.handleError(ClientHttpResponse)
Specifically, for use cases where the InputStream had already been
consumed by the first invocation of getResponseBody(), the second
invocation of getResponseBody() resulted in the response body being
absent in the created UnknownHttpStatusCodeException.

This commit fixes this by invoking getResponseBody() only once in
DefaultResponseErrorHandler.handleError(ClientHttpReponse) in order to
reuse the retrieved response body for creating the exception message
and as a separate argument to the UnknownHttpStatusCodeException
constructor.

Closes gh-24595
2020-03-17 17:06:57 +01:00
Sam Brannen 5e1e689739 Polishing 2020-03-17 15:06:10 +01:00
Sam Brannen 7dea2686b8 Polish contribution
See gh-24398
2020-03-17 15:06:10 +01:00
maxxedev 9b827283f1 Use more lambda expressions in data-access code examples
Closes gh-24398
2020-03-17 15:06:03 +01:00
Sam Brannen a8feb792da Fix broken Javadoc links 2020-03-16 16:30:27 +01:00
Sam Brannen e500456f1c Publish distribution zip files again
A change in `docs.gradle` in 5.2.4 resulted in distribution zip files
no longer being published to
https://repo.spring.io/release/org/springframework/spring/.

This commit fixes this by updating the `mavenContent` configuration as
suggested by @wilkinsona.

Closes gh-24605
2020-03-16 15:43:57 +01:00
Sam Brannen 35d0b3dba9 Fix Javadoc links accidentally broken in 7b6d83a106 2020-03-16 15:43:04 +01:00
Qimiao Chen 5f2e298c08 Extract isDebugEnabled() checks to local variables
Closes gh-24683
2020-03-16 15:25:05 +01:00
Qimiao Chen 193a76fe2a Avoid unnecessary sorting in AbstractHandlerMethodMapping
Closes gh-24704
2020-03-16 12:38:43 +01:00
Qimiao Chen 70581d1ea2 Improve javadoc in RollbackRuleAttribute regarding nested classes
Closes gh-24682

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-15 12:06:16 +01:00
Qimiao Chen d85a6c0bea Fix typos in MergedAnnotationsCollectionTests
Closes gh-24701
2020-03-15 11:48:29 +01:00
Stephane Nicoll 7411b2e025 Merge pull request #24697 from chenqimiao
* pr/24697:
  Fix typo in buildSrc/README.md

Closes gh-24697
2020-03-14 10:06:46 +01:00
陈其苗 fac1b94623 Fix typo in buildSrc/README.md
See gh-24697
2020-03-14 10:06:25 +01:00
Juergen Hoeller d91fc8c672 No log level check unless String concatenation is following 2020-03-14 00:01:13 +01:00
Juergen Hoeller 6599383dac Upgrade to RxJava 2.2.19, Undertow 2.0.30, HtmlUnit 2.38 2020-03-13 23:15:07 +01:00
Juergen Hoeller 33642345a4 Lazily check log level within validation conditions
See gh-24672
2020-03-13 23:14:38 +01:00
Arjen Poutsma 7c4f0318bb Improve efficiency of built RouterFunction
This commit changes the way RouterFunctions registered to the builder
are composed in both WebFlux.fn and WebMvc.fn.
Prior to this commit, all routes added to the build were composed with
`reduce`.
After this commit, all routes are stored in a special router function,
allowing for more efficient execution and smaller stack traces.

Closes gh-24652
2020-03-13 16:09:41 +01:00
Arjen Poutsma 54e2df2e0e Improve RouterFunction composition
This commit changes the way two RouterFunctions are composed in
WebFlux.fn. Prior to this commit, two were composed with
`switchIfEmpty()`, switching from the first to the second route if the
first did not provide an element.
After this commit, two router functions are compose using `concat`,
which results in a smaller stack trace.

See gh-24652
2020-03-13 16:09:41 +01:00
Rossen Stoyanchev f4ce22f6ba Merge branch '23828-sockjs' 2020-03-13 14:58:48 +00:00
Rossen Stoyanchev fa6ccc066d Do not raise exception for undelivered empty messages
Closes gh-23828
2020-03-13 14:58:31 +00:00
Rossen Stoyanchev 1a8caf9e2b Polishing and minor refactoring
See gh-23828
2020-03-13 14:58:31 +00:00
Rossen Stoyanchev 7b7dfcaaed Polishing contribution
See gh-24691
2020-03-13 14:58:01 +00:00
mdindoffer c11dd4a839 Do not mention credentials as enabled by default in CorsRegistry
Credentials are not enabled by default contrary to the javadocs. 
The credentials support must be enabled via #allowCredentials.

Closes gh-24691

Co-authored-by: Martin Dindoffer <martin.dindoffer@sigp.eu>
2020-03-13 15:21:53 +01:00
陈其苗 c5b8406def Add some test cases in StringUtilsTests 2020-03-13 12:35:04 +00:00
陈其苗 6013591fac Polish containsAny of CollectionUtils by reusing findFirstMatch 2020-03-13 12:32:43 +00:00
Qimiao Chen c8c1e61c0a Improve Javadoc in AutoProxyRegistrar
Closes gh-24688

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-13 10:01:58 +01:00
Qimiao Chen 201827cb0b Fix exception message in getMergedBeanDefinition
Closes gh-24686

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-03-13 09:47:57 +01:00
Rossen Stoyanchev a599859595 ServerCookie ignores empty domain with double quotes
Closes gh-24663
2020-03-12 12:21:19 +00:00
Rossen Stoyanchev 4aedf2ea13 MetadataEncoder expands vars correctly
Closes gh-24656
2020-03-12 11:35:08 +00:00
Arjen Poutsma 0dc1c7eb8b Add ServerRequest::checkNotModified
This commit adds the checkNotModified method to ServerRequest in both
WebFlux.fn and WebMvc.fn. Unlike other checkNotModified methods found
in the framework, this method does not return a boolean, but rather
a response wrapped in a Mono/Optional. If the resource has
not been changed, the not-modified response can be returned directly;
if the resource has changed, the user can create a corresponding
response using switchIfEmpty/orElse(Get).

Closes gh-24173
2020-03-11 16:45:00 +01:00
Juergen Hoeller 73e39726cd Upgrade to Kotlin 1.3.70
Includes latest dependency updates (Netty 4.1.47, Jetty 9.4.27, Jackson 2.10.3, Log4J 2.13.1, SnakeYAML 1.26, Vavr 0.10.2, Commons Pool 2.8, POI 4.1.2, OkHttp 3.14.7, Jetty Reactive HttpClient 1.1.2, JRuby 9.2.11, AssertJ 3.15)
2020-03-11 14:56:41 +01:00
Juergen Hoeller bcee6b9da4 Consistent assertions for supplier-based bean definition tests 2020-03-11 14:55:39 +01:00
Juergen Hoeller 7f26e8cfc6 Short-circuit interface visibility check in case of same ClassLoader
Closes gh-24664
2020-03-11 14:55:08 +01:00
Juergen Hoeller bee63e38c1 Create ScannedGenericBeanDefinitions for index-derived components as well
Closes gh-24638
2020-03-11 14:54:16 +01:00
Juergen Hoeller 193f419520 Deprecate PTM-based constructors in favor of generic TransactionManager
Closes gh-24612
2020-03-11 14:52:03 +01:00
Juergen Hoeller 6df80a8f70 Restore original JsonMappingException handling (assuming invalid input)
Closes gh-24610
Closes gh-24630
Closes gh-24646
2020-03-11 14:51:36 +01:00
Qimiao Chen 988aae4f2e Remove unnecessary variable declaration in ProxyCallbackFilter
Closes gh-24675
2020-03-11 13:51:13 +01:00
Arjen Poutsma 61569003b5 CORS support in HTTP header predicate
This commit introduces CORS support for the HeadersPredicate in
WebMvc.fn and WebFlux.fn.

Closes gh-24564
2020-03-10 17:22:26 +01:00
Сергей Цыпанов 1fd447f395 Reduce String garbage in CglibAopProxy.doValidateClass()
Closes gh-24672
2020-03-10 17:16:08 +01:00
Arjen Poutsma 3cbea86335 Deprecate MockServerRequest
Deprecate MockServerRequest in favor of ServerRequest::create
combined with a MockServerWebExchange.
2020-03-10 15:45:11 +01:00
Arjen Poutsma c03cdbac21 CORS support in HTTP method predicate
This commit introduces CORS support for the HttpMethodPredicate in
WebMvc.fn and WebFlux.fn.

Closes gh-24564
2020-03-10 15:45:11 +01:00
Arjen Poutsma fc12891006 Add ServerRequest::firstHeader
This commit introduces the method firstHeaderiin both WebMvc.fn and
WebFlux.fn, which return the first header value of a given header name,
if any.
2020-03-10 15:45:11 +01:00
Qimiao Chen b92515bdee Add logger.isInfoEnabled check before logger.info
Closes gh-24667
2020-03-10 14:41:20 +01:00
Sviatoslav Hryb 018ba92214 Fix formatting in AOP examples in documentation 2020-03-09 14:44:41 +00:00
Sviatoslav Hryb f5195887c9 Fix ampersands in AOP examples in documentation 2020-03-09 13:27:55 +00:00
Qimiao Chen 7ce22e2f3a Update IntroductionInfo example in reference manual
Closes gh-24650
2020-03-06 12:34:00 +01:00
Arjen Poutsma 2fb90cb16b Support for byte-range requests in WebMvc.fn
This commit introduces support for byte-range requests in Servlet
Functional endpoints.

Closes gh-24562
2020-03-05 15:32:31 +01:00
Rossen Stoyanchev c237338d8f Merge pull request #24632 from sada-sigsci/sse_content_type
Closes gh-24632
2020-03-04 19:28:05 +00:00
Rossen Stoyanchev 7e03728b2c Polishing contribution
See gh-24632
2020-03-04 19:27:37 +00:00
sada-sigsci cc1f57823b Remove charset from content-type in SseEmitter
See gh-24632
2020-03-04 19:27:37 +00:00
Rossen Stoyanchev b2fe494b9c Merge changes for ShallowEtagHeaderFilter
Closes gh-24635
2020-03-04 19:18:11 +00:00
Rossen Stoyanchev a98bf30ee6 ShallowEtagHeaderFilter checks for pre-existing eTag
The filter now checks for an explicitly set eTag and uses it instead of
generating one, and also suppresses caching.

Closes gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev c7e037da39 Remove unnecessary calls to disableContentCaching
These calls were added in error when trying to fix #22797 and #23775.
They are not needed in 304 scenarios. Those have no response content and
are skipped by ShallowETagHeaderFilter based on the status.

This leaves disableContentCaching invoked only in streaming scenarios,
which was the original intent and should be the only reason for that
method.

See gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev d3da7a50ec Polishing and minor refactoring
See gh-24635
2020-03-04 19:17:56 +00:00
Rossen Stoyanchev e7df445e37 Merge pull reqest #24617 from dreis2211/avoid-unnecessary-sorting
Closes gh-24617
2020-03-04 19:16:10 +00:00
Christoph Dreis 2093e35f27 Avoid unnecessary sorting 2020-03-04 19:10:14 +00:00
Rossen Stoyanchev 87230c4f1f Merge pull request #24589 from chenqimiao/fix404url-in-doc
Closes gh-24589
2020-03-03 15:40:32 +00:00
Rossen Stoyanchev e1b0296f9e Polishing contribution
See gh-24589
2020-03-03 15:38:47 +00:00
陈其苗 771fbde951 Fix URL to Spring Tool Suite
See gh-24589
2020-03-03 15:38:47 +00:00
Rossen Stoyanchev 2afae430eb Update list of support multipart media types
See gh-24582
2020-03-03 15:38:00 +00:00
Yoo In Keun e706fcba1f Fix typo in testing.adoc
Closes gh-24627
2020-03-02 16:25:28 +01:00
Johnny Lim 8285666ee8 Polish ReactorResourceFactory
Closes gh-24620
2020-03-02 13:48:19 +01:00
Sviatoslav Hryb 60fd95a354 Fix formatting for pointcut expression examples in documentation
Closes gh-24621
2020-03-02 13:42:09 +01:00
Adrian Cole 7f5395a216 Fix typos in AbstractClientHttpRequest
Closes gh-24623
2020-03-02 13:36:47 +01:00
陈其苗 8a7bb49436 Improve WebClient.Builder Javadoc 2020-02-28 17:07:58 +00:00
Rossen Stoyanchev 5f1e4ffc4f WebClient.Builder javadoc updates
Closes gh-24611
2020-02-28 15:55:53 +00:00
Brian Clozel 89560777e4 Upgrade Guava for API Diff plugin
Fixes gh-24606
2020-02-28 13:56:49 +01:00
Andreas Volkmann b30f9a1308 Fix typo in core-aop.adoc
Closes gh-24602
2020-02-26 18:33:25 +00:00
Florian Berger d4de3396f7 Fix typo about URI Encoding in docs
Closes gh-24603
2020-02-26 18:28:52 +00:00
wonwoo 5c2d65b8ef Fix typo in reference manual
Closes gh-24597
2020-02-26 14:34:25 +01:00
Sam Brannen 787b09b202 Relax GraalVM check in DefaultParameterNameDiscoverer
Prior to this commit, DefaultParameterNameDiscoverer did not register
any discovers when compiling or running as a GraalVM native image.

This commit relaxes the GraalVM check so that it is only applied to the
registration of KotlinReflectionParameterNameDiscoverer.

Consequently, StandardReflectionParameterNameDiscoverer and
LocalVariableTableParameterNameDiscoverer are once again always
registered by DefaultParameterNameDiscoverer.

Closes gh-24600
2020-02-26 14:18:56 +01:00
Sam Brannen c3bc28762e Delete unused import in ExpressionLanguageScenarioTests
See gh-24586
2020-02-26 14:09:01 +01:00
ZhangT c5fb7b9fb7 Simplify some redundant code
Closes gh-24586

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2020-02-26 12:29:09 +01:00
Spring Buildmaster 0ad942f337 Next Development Version 2020-02-25 16:42:55 +00:00
Juergen Hoeller d72c90cd7a Assign TokenBuffer field with createToken() result 2020-02-25 15:21:28 +01:00
Juergen Hoeller 6db20eb773 Avoid package import cycles 2020-02-25 14:55:53 +01:00
Rossen Stoyanchev 2f12351292 Refine BlockHound support
- disable for Java 14/15 for now until BlockHound support
- targeted installation of required integrations only
2020-02-25 10:07:29 +00:00
Rossen Stoyanchev b6f502db4e Polishing 2020-02-25 10:07:29 +00:00
Qimiao Chen 8cf70fe509 Improve documentation for @Autowired/@Value in @Configuration classes
Closes gh-24585
2020-02-25 11:01:19 +01:00
Rossen Stoyanchev 7e402ba4fe Improve docs on date and time formatting
Closes gh-24370
2020-02-24 19:05:09 +00:00
Juergen Hoeller c0fbf6fca1 Polishing 2020-02-24 19:50:12 +01:00
Juergen Hoeller 399b846458 Upgrade to Groovy 3.0.1, RxJava 2.2.18, Hibernate ORM 5.4.12, Protobuf 3.11.4 2020-02-24 19:08:33 +01:00
Juergen Hoeller 0e95282153 Polishing 2020-02-24 19:08:23 +01:00
Juergen Hoeller 2afe5802c0 Clarify setCacheMillis/setCacheSeconds vs java.util.ResourceBundle
Closes gh-24563
2020-02-24 19:08:13 +01:00
Rossen Stoyanchev 2ae91404d1 BlockHoundIntegration for spring-core 2020-02-24 17:19:32 +00:00
Brian Clozel f048f27d80 Configure Reactor Netty quiet shutdown period in tests
See gh-24538
2020-02-24 18:15:59 +01:00
Brian Clozel f1680e5cee Configure quiet period for shutting down Reactor resources
This commit adds two new properties to the `ReactorResourceFactory`.
This allows to configure the quiet and timeout periods when shutting
down Reactor resources. While we'll retain Reactor Netty's default for
production use, this option is useful for tests and developement
environments when developers want to avoid long waiting times when
shutting down resources.

Fixes gh-24538
2020-02-24 18:15:59 +01:00
Rossen Stoyanchev 96de4b3cee Upgrade to Reactor Dysprosium-SR5
Closes gh-24355
2020-02-24 17:08:00 +00:00
Sam Brannen 7778508e69 Fix typos in ResolvableTypeTests
See gh-24529

Co-authored-by: Qimiao Chen <chenqimiao1994@126.com>
2020-02-24 15:37:42 +01:00
Qimiao Chen 1de2e0a4a7 Fix formatting in webflux-webclient.adoc
Closes gh-24578
2020-02-24 15:00:11 +01:00
Hyunjin Choi ede2a1d4b2 Remove unnecessary semicolon in some enum classes 2020-02-24 14:56:12 +01:00
Sam Brannen d1a6e49475 Reset SecurityManager in finally-block and polish 2020-02-23 18:33:56 +01:00
Sam Brannen 809ed9d469 Rename PropertyResolverExtensionsTests to Kotlin* 2020-02-23 18:21:53 +01:00
Qimiao Chen f78c21e40b Fix typos in tests
Closes gh-24566
2020-02-22 18:32:02 +01:00
Rossen Stoyanchev 8219d06ae1 Merge pull request #24493 from chenqimiao-pr/AbstractPlatformTransactionManager
Closes gh-24493
2020-02-20 17:59:29 +00:00
Rossen Stoyanchev adc13f2030 Polishing contribution
See gh-24493
2020-02-20 17:58:47 +00:00
陈其苗 a09f02f64e Minor refactoring in AbstractPlatformTransactionManager
See gh-24493
2020-02-20 17:33:18 +00:00
Rossen Stoyanchev 97ba00eff2 Use try-with-resource in XmlBeanDefinitionReader
Closes gh-24492
2020-02-20 17:28:30 +00:00
Rossen Stoyanchev 96e77d417b Update WebFlux section on HTTP/2
Closes gh-24558
2020-02-20 16:28:22 +00:00
Rossen Stoyanchev ca6241a093 Merge pull request #24518 from pulse00-patch/web-session-debug-logs
Closes gh-24518
2020-02-20 15:57:13 +00:00
Rossen Stoyanchev de608a08ed Polishing contribution
See gh-24518
2020-02-20 15:56:13 +00:00
Robert Gründler ae9268004d Added debug logging to DefaultWebSessionManager
See gh-24518
2020-02-20 15:55:59 +00:00
Rossen Stoyanchev a134e92e7f Improve checks on URI string in MockMvc request builder
Closes gh-24556
2020-02-20 15:07:40 +00:00
Arjen Poutsma 4882eb278d Convert non-UTF-8 JSON
Jackson's asynchronous parser does not support any encoding except UTF-8
(or ASCII). This commit converts non-UTF-8/ASCII encoded JSON to UTF-8.

Closes gh-24489
2020-02-20 11:14:53 +01:00
Hyunjin Choi 7528b9487d Simplify code in spring-test by using Collections.addAll
Closes gh-24555
2020-02-19 17:28:22 +01:00
Sam Brannen e029dbf607 Polish Javadoc for ClientHttpResponse 2020-02-19 11:46:03 +01:00
Sam Brannen 8ff1ac59e0 Polishing 2020-02-19 11:29:51 +01:00
Qimiao Chen acae174f8f Fix javadoc in DependencyDescriptor
Closes gh-24551
2020-02-19 11:04:25 +01:00
Sviatoslav Hryb 2ad4602ca0 Correct Ant-style Patterns example in documentation
Closes gh-24552
2020-02-19 10:51:16 +01:00
Rossen Stoyanchev 68b980f849 Remove producible request attribute before mapping
The attribute was previously removed only before exception resolution
in the DispatcherServlet in order to allow error rendering to make an
independent choice on content negotation.

However, Boot rendering happens later in an ERROR dispatch which could
also be a nested dispatch on some servers. So the attribute must also
generally be removed prior to mapping.

We also move the methods where this is done to the base
RequestMappingInfoHandlerMapping class which also deals with the
produces condition and where the producible attribute is added in the
first place.

Closes gh-24466
2020-02-18 21:50:38 +00:00
Rossen Stoyanchev 87f866b688 Update DigestUtils Javadoc with regards to InputStream
Closes gh-24534
2020-02-18 19:56:25 +00:00
Hyunjin Choi 37ba57a921 Polish some test classes by using predefined constants
Closes gh-24532
2020-02-18 12:24:10 +01:00
Rossen Stoyanchev fb6ee01281 Consistently call setComplete before WS upgrade
Even thought Tomcat and Jetty, which commit the response more lazily,
were not impacted by this issue, it still makes sense for them to
complete the WebFlux response (and pre-commit actions) at the same time
as for other servers for consistent behavior.

See gh-24475
2020-02-18 09:44:04 +00:00
Rossen Stoyanchev df1145b797 Correct documentation error in section on BeanWrapper
Closes gh-24510
2020-02-18 09:44:04 +00:00
Brian Clozel 9036cc6899 Remove unnecessary dependency on spring-orm
Prior to this commit, spring-aspects would consider spring-orm as a
module providing aspects, which is not the case (anymore).
This commit removes that dependency as a result.

Fixes gh-24491
2020-02-17 20:54:58 +01:00
ZhangT 6add7b4dec Polishing
Closes gh-24543
2020-02-17 17:33:39 +01:00
Sviatoslav Hryb 9e7ab4d308 Correct formatting of MessageSource example in documentation
Closes gh-24531
2020-02-17 15:25:17 +01:00
Brian Clozel 13f23dc32b Mark response as complete before WebSocket upgrade
Prior to this commit, some WebSocket `RequestUpgradeStrategy` reactive
implementations would prevent the application from writing HTTP headers
and cookies to the response.

For Reactor Netty and Undertow, handling the upgrade and starting the
WebSocket communication marks the response status and headers as sent
and the application cannot update HTTP response headers after that.

This commit ensures that the `RequestUpgradeStrategy` implementations
mark the responses as "complete", so that headers are written before we
delegate to the server implementation.

Fixes gh-24475
2020-02-13 21:42:31 +01:00
Juergen Hoeller 4cbc61abfc Upgrade to Tomcat 9.0.31, Apache HttpClient 4.5.11, Mockito 3.2.4, HtmlUnit 2.37 2020-02-13 16:14:49 +01:00
Sam Brannen 05301d24c1 Upgrade to JUnit Jupiter 5.6
Closes gh-24299
2020-02-13 15:44:58 +01:00
Sam Brannen d481b81b7e Fix copy-n-paste error in custom_java_home.gradle script
See gh-24474
2020-02-12 23:08:42 +01:00
Juergen Hoeller a4179b4795 Polishing 2020-02-12 18:32:32 +01:00
Andy Wilkinson d0d8c6e749 Use Gradle Enterprise Conventions Plugin to configure build scans
Closes gh-24512
2020-02-12 18:14:33 +01:00
Juergen Hoeller 9f6572a095 Add missing final declaration for static field 2020-02-12 16:49:19 +01:00
Juergen Hoeller d1c7083e77 Consistent ROLE_INFRASTRUCTURE declarations for configuration classes
Closes gh-24509
2020-02-12 16:49:02 +01:00
Juergen Hoeller e0319b1f79 Raise log level for exceptions from EntityManager close call
Closes gh-24501
2020-02-12 16:48:42 +01:00
Juergen Hoeller b889700548 Differentiate MismatchedInputException versus ValueInstantiationException
Closes gh-24455
2020-02-12 16:48:32 +01:00
Sam Brannen a9d9b76d09 Support SpEL compilation of interface methods again
Spring Framework 5.1.8 introduced a regression for the compilation of
SpEL expressions referencing a method declared in an interface. An
attempt to compile such an expression resulted in a
SpelEvaluationException caused by an IncompatibleClassChangeError.

This commit fixes this regression by adding explicit support in
ReflectivePropertyAccessor.OptimalPropertyAccessor.generateCode() for
methods declared in interfaces.

Closes gh-24357
2020-02-12 15:33:01 +01:00
Sam Brannen de7bed2ab2 Simplify custom_java_home.gradle script
Setting `options.fork = true` causes the classpath in the forked
compiler process to include Class-Path entries from MANIFEST.MF files
in JARs in the classpath, which results in warnings about missing
classpath entries.

This commit removes the `options.fork = true` declaration and further
simplifies the script.

See gh-24474
2020-02-12 14:30:29 +01:00
Sam Brannen 9dbd411f81 Suppress warnings in Gradle build 2020-02-12 11:04:07 +01:00
Sam Brannen 5d4f1d9e09 Extract ValueExtractor functional interface
See gh-24375
2020-02-12 10:49:36 +01:00
Sam Brannen 974cacac31 Support nested annotations in ASM-based processing again
Spring Framework 5.0 introduced a regression in ASM-based annotation
processing. Specifically, nested annotations were no longer supported,
and component scanning resulted in an exception if a candidate
component was annotated with an annotation that contained nested
annotations.

This commit fixes this regression by introducing special handling in
AnnotationTypeMapping that supports extracting values from objects of
type TypeMappedAnnotation when necessary.

Closes gh-24375
2020-02-12 10:36:54 +01:00
Rossen Stoyanchev 9277b47040 Polishing: remove use of cast where avoidable 2020-02-11 16:51:35 +00:00
Rossen Stoyanchev d552105516 Eliminate windowUntil from StringDecoder
This is a follow-up on the earlier commit
28a95e89f3 eliminating windowUntil
entirely which generates a BubblingException wrapper. This also keeps
the chain a little simpler.

See gh-24355
2020-02-11 16:49:21 +00:00
Rossen Stoyanchev e35d3b8bb5 Update advice on RestTemplate
Closes gh-24503
2020-02-11 14:02:50 +00:00
Rossen Stoyanchev 0a974511bd Expose awaitTerminationMillis presion
Closes gh-24496
2020-02-11 14:02:50 +00:00
Rossen Stoyanchev 28a95e89f3 Upgrade to Dysprosium SR5 snapshots
See gh-24355
2020-02-11 12:52:04 +00:00
Rossen Stoyanchev 7d1d989535 Minor polishing in ConcurrentReferenceHashMap
Closes gh-24494
2020-02-11 10:49:28 +00:00
Rossen Stoyanchev e4a530efac Minor refactoring in CommonsLogWriter
Closes gh-24495
2020-02-11 10:40:24 +00:00
Juergen Hoeller d521d37f14 Upgrade to Hibernate ORM 5.4.11 and Groovy 3.0 final 2020-02-10 18:10:41 +01:00
Rossen Stoyanchev 009dfbfafc MockRestServiceServer clears failed requests map
Closes gh-24486
2020-02-10 15:01:47 +00:00
Rossen Stoyanchev df706f4c7c Restore use of Flux-based encode method in HTTP
Closes gh-24441
2020-02-07 21:44:44 +00:00
Arjen Poutsma a03a116f6b Force TokenBuffer to use BigDecimal if elementtype
This commit makes the Jackson2Tokenizer enable
TokenBuffer.forceUseOfBigDecimal if the element type given to the
Decoder is BigDecimal. Previous to this commit, values would be
converted to floats.

Closes gh-24479
2020-02-07 14:16:21 +01:00
Andy Wilkinson 02e90a8645 Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
0.4.0 provides built-in support for remembering a user's selections
using local storage. This replaces the custom switch language
JavaScript.

The selection is stored using a key derived from the
options that were available. Concretely, when the options are Java or
Kotlin, the local storage key is java-kotlin. Similarly, if the
choices were Java, Kotlin, and XML, the key would be java-kotlin-xml.

Given local storage's domain and protocol scoping, the nature of the
key that's used for storage will allow a user's selections to be
applied across all documentation hosted on https://docs.spring.io that
offer the same options.

Closes gh-24481
2020-02-07 12:16:02 +01:00
Sam Brannen c640d28a82 Polishing 2020-02-07 11:30:23 +01:00
Sam Brannen 51fa98a1b2 Apply compiler conventions to test fixtures 2020-02-07 11:04:03 +01:00
Arjen Poutsma 45555f77a6 Honour ObjectMapper feature in Jackson2Tokenizer
After this commit, Jackson2Tokenizer honours ObjectMapper's
DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS feature when creating
TokenBuffers.

Closes gh-24479
2020-02-07 10:45:00 +01:00
Sam Brannen c648425822 Ignore warnings for missing classpath elements with custom JAVA_HOME
Prior to this commit, the "-Werror" was removed as a command-line
argument in order not to fail the build for missing classpath elements.

This commit reinstates "-Werror" and removes "-Xlink:path" in order to
explicitly ignore warnings for missing classpath elements when executing
the build with a custom JAVA_HOME.

See gh-24474
2020-02-07 10:23:07 +01:00
Michael Simons 711fafc924 Improve assertion message in PersistenceExceptionTranslationInterceptor
Closes gh-24484
2020-02-06 15:41:33 +01:00
Sam Brannen ce2c0e4c79 Credit @marcphilipp and @snicoll
See gh-24474
2020-02-06 15:32:51 +01:00
Sam Brannen 8f02e1088d Support alternate JDK versions in Gradle build
This commit adds support for the following two JVM system properties
that control the Gradle build for alternative JDKs (i.e., a JDK other
than the one used to launch the Gradle process).

- customJavaHome: absolute path to the alternate JDK installation to
  use to compile Java code and execute tests. Setting this system
  property causes Groovy 3.0 RC3 to be used instead of 2.5.x. This
  system property is also used in spring-oxm.gradle to determine
  whether JiBX is supported.

- customJavaSourceVersion: Java version supplied to the `--release`
  command line flag to control the Java source and target compatibility
  version. Supported versions include 9 or higher. Do not set this
  system property if Java 8 should be used.

Examples:

./gradlew -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew --no-build-cache -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew -DcustomJavaHome=/opt/java/jdk-14 -DcustomJavaSourceVersion=14 test

See gh-24474
2020-02-06 15:24:19 +01:00
Juergen Hoeller b23049bd27 Polishing 2020-02-06 12:59:55 +01:00
Juergen Hoeller 669a689a50 Prevent unnecessary refresh for InjectionMetadata.EMPTY
Closes gh-24485
2020-02-06 12:44:05 +01:00
Stephane Nicoll 10d008e3db Upgrade to RSocket 1.0.0-RC6
Closes gh-24482
2020-02-06 08:56:18 +01:00
Rossen Stoyanchev ba5fc21ab4 Option to pair AnnotationIntrospector instances
Closes gh-22830
2020-02-05 20:49:07 +00:00
Rossen Stoyanchev 9aea10179b Insert StringMessageConverter for SSE
Closes gh-24465
2020-02-05 20:49:07 +00:00
Juergen Hoeller 65c8a10fb0 Upgrade to EclipseLink 2.7.6 and JiBX 1.3.3 2020-02-05 18:21:03 +01:00
Juergen Hoeller 82adb09490 ImportSelector.getExclusionFilter() naming and javadoc clarification
See gh-24175
2020-02-05 18:20:27 +01:00
Juergen Hoeller d93303c008 ImportSelector.getCandidateFilter() for transitive filtering of classes
Closes gh-24175
2020-02-05 12:35:16 +01:00
Sam Brannen c2367b3ad2 Polish contribution
See gh-24383
2020-02-04 14:48:13 +01:00
Hyunjin Choi 1acf5a7424 Use dedicated catch block for ScriptException
Closes gh-24383
2020-02-04 14:45:52 +01:00
Sam Brannen 7575616d26 Update copyright date
See gh-24385
2020-02-04 14:23:18 +01:00
Hyunjin Choi b4cf88499c Use try-with-resource in ScriptUtils
Closes gh-24385
2020-02-04 14:21:59 +01:00
Qimiao Chen 5aa37ea07b Let BFAwareGeneratorStrategy extend ClassLoaderAwareGeneratorStrategy
This commit updates BeanFactoryAwareGeneratorStrategy to extend 
ClassLoaderAwareGeneratorStrategy in order to avoid duplication of the
common generate() implementation.

Closes gh-24396
2020-02-04 14:10:59 +01:00
Sam Brannen 2b6117c0c2 Fix Checkstyle violation
See gh-24393
2020-02-04 13:45:02 +01:00
Sam Brannen 72685b1d81 Polish contribution
See gh-24393
2020-02-04 13:41:31 +01:00
Hyunjin Choi d624dc084f Add close() method in FileCopyUtils to reduce duplication
Closes gh-24393
2020-02-04 13:36:24 +01:00
Hyunjin Choi 550f13e8ed Simplify GenericConversionService.getMatchableConverters()
Closes gh-24403
2020-02-04 12:59:57 +01:00
Сергей Цыпанов a36168c972 Produce less String-related garbage when generating bean names
Closes gh-24476
2020-02-04 11:18:48 +01:00
Rossen Stoyanchev d8cd46121a Merge pull request #24386 from hyeonisism/Simplify-use-compute-if-absent
Closes gh-24386
2020-02-03 20:59:49 +00:00
Rossen Stoyanchev e7d40f930f Remove synchronized block
As per the Javadoc of ConcurrentHashMap its computeIfAbsent
implementation is atomic and hence already synchronized internally,
so we can remove the surrounding synchronization block.

See gh-24470
2020-02-03 20:59:30 +00:00
Hyunjin Choi bac5cd866e Simplify getSessionAttributesHandler() method 2020-02-03 20:43:45 +00:00
Rossen Stoyanchev adbc55e72a Merge pull request #24470 from hyeonisism/Remove-redundant-character
Closes gh-24470
2020-02-03 20:42:14 +00:00
Rossen Stoyanchev f5df422de9 Polishing contribution
See gh-24470
2020-02-03 20:32:36 +00:00
Hyunjin Choi 273812f9c5 Remove unnecessary escapes in regular expressions
See gh-24470
2020-02-03 20:22:40 +00:00
Sam Brannen cf9a052e3a Polish contribution
See gh-24428
2020-02-03 15:39:00 +01:00
Hyunjin Choi 1b39f138eb Test ObjectUtils.containsElement()
This commit introduces a unit test for the containsElement() method
in ObjectUtils.

Closes gh-24428
2020-02-03 15:34:47 +01:00
Hyunjin Choi 14a32d13d0 Fix typo in StringUtils class
Closes gh-24471
2020-02-03 15:23:32 +01:00
Sam Brannen d77a28aac3 Support optional command line arguments with empty values
Spring Framework provides two implementations of the
CommandLinePropertySource API: SimpleCommandLinePropertySource and
JOptCommandLinePropertySource.

Prior to this commit, JOptCommandLinePropertySource supported empty
values for optional arguments; whereas, SimpleCommandLinePropertySource
did not.

This commit modifies the implementation of SimpleCommandLinePropertySource
to allow empty values for optional arguments.

Closes gh-24464
2020-02-03 15:03:43 +01:00
Juergen Hoeller 8dfacbc210 Upgrade to Hibernate Validator 6.1.2 and OpenPDF 1.3.13 2020-02-03 12:01:40 +01:00
Sam Brannen cbb037bc68 Suppress deprecation warning in spring-test 2020-01-31 14:37:40 +01:00
Sam Brannen daebbf1960 Polishing 2020-01-31 14:34:50 +01:00
Johnny Lim f01de79fe2 Polish 2020-01-31 10:38:36 +00:00
Stephane Nicoll 3a90d8a64d Merge pull request #24460 from dreis2211
* pr/24460:
  Polish documentation format

Closes gh-24460
2020-01-31 08:56:25 +01:00
Christoph Dreis 15b651cdfe Polish documentation format
See gh-24460
2020-01-31 08:55:52 +01:00
Rossen Stoyanchev 547342b27d Status code as Integer methods in ServerHttpResponse
Closes gh-24400
2020-01-30 10:06:58 +00:00
Rossen Stoyanchev cc4261c30b Only non-null input resets scheme specific part
Closes gh-24444
2020-01-30 06:16:43 +00:00
Juergen Hoeller 688167a7df Upgrade to Checkstyle 8.29 and Apache Johnzon 1.2.3 2020-01-28 22:06:06 +01:00
Juergen Hoeller b4a9758d9b Polishing 2020-01-28 21:56:35 +01:00
Juergen Hoeller 8cced42fb2 Use local LoggerContext in Log4jLog when static field not initialized yet
Closes gh-24440
2020-01-28 21:06:48 +01:00
Juergen Hoeller d93403a257 Alphabetical order for database names
See gh-24443
2020-01-28 21:06:04 +01:00
wilrosco c86e164b03 Add Informix to the list of supported database products for procedure calls
Hi guys,

We're facing an issue in our application when we try to call a procedure in Informix database, 
our app uses standard JDBC (spring-jdbc and com.ibm.informix.jdbc.4.50.3) without Hibernate 
to connect to the database  

Issue:
When we trying to execute any procedure call in our Informix database there is no data returned.

Diagnostic:
It points to the Java class called CallMetaDataProviderFactory in spring-jdbc project.

Taking a look of this class there is no explicit support for Informix procedure calls, so I added "Informix Dynamic Server" to the 
list of supported databases and now I can execute procedures call without issues.

Basically I added the line "Informix Dynamic Server" to the list called "supportedDatabaseProductsForProcedures" 
of CallMetaDataProviderFactory class in my local environment and it worked as expected.


I really appreciate any feedback/suggestion for this approach due we would like to continue using the framework 
normally in our development without losing updates using a workaround in our end.

Many thanks in advance.
2020-01-28 20:57:52 +01:00
Сергей Цыпанов 64440a5f04 Some trivial improvements to reduce allocation pressure
Closes gh-24447
2020-01-28 11:07:40 +01:00
Sam Brannen 2c86d6ded2 Polishing 2020-01-28 10:50:15 +01:00
Sviatoslav eeaae16b17 Remove dated mention of "local" bean attribute
Closes gh-24430
2020-01-27 17:47:48 +00:00
Juergen Hoeller f9a73503f4 Upgrade to Hibernate Validator 6.1.1 2020-01-27 18:19:23 +01:00
Juergen Hoeller 75abd9fc7e Upgrade to ASM 7.3
Closes gh-24438
2020-01-27 18:18:16 +01:00
Anton c1218615df Update integration.adoc
Fix typo
2020-01-27 16:21:16 +00:00
Rob Winch e66e41029c Asciidoctor Warnings Are Fatal
Ensure we don't get any more warnings within Asciidoctor build

Issue gh-24427
2020-01-24 15:51:59 -06:00
Rossen Stoyanchev 2fcee5ae58 Append unique number to WebFlux server log prefix
Closes gh-22039
2020-01-24 15:57:56 +00:00
Rossen Stoyanchev d499e14b78 Update default value in ReactorResourceFactory
We used ConnectionProvider#elastic only to customize the name. Now that
Reactor Netty's TcpResources itself uses fixed 500 by default, we
update to have the same value which would apply when global resources
are not used.

Closes gh-24424
2020-01-24 15:40:16 +00:00
Rossen Stoyanchev b142f8e660 Remove no-op code in URI encoding
Closes gh-24413
2020-01-24 15:37:01 +00:00
Rob Winch ab70acb325 Fix Additional Asciidoctor Warnings
Fix "unknown style for example block: INFO"

Issue gh-24427
2020-01-24 09:29:13 -06:00
Sam Brannen 75a1395226 Link to BeanShell homepage 2020-01-24 16:20:02 +01:00
Rob Winch 754a8ca05a Fix Asciidoctor Warnings
- Fix "possible invalid reference" errors
  - Add <filename>.adoc where necessary
  - Remove invalid link to beans-servicelocator This section no longer exists
- Fix "skipping reference to missing attribute" errors
  - Add pass macro to escape literals interpreted as attributes
  - Add missing :api-spring-framework: attribute
  - Remove invalid {JB} attribute

Closes gh-24427
2020-01-24 09:14:07 -06:00
Juergen Hoeller 7c47e3ba2e Upgrade to Netty 4.1.45, Jetty 9.4.26, Groovy 2.5.9, Woodstox 6.0.3, Caffeine 2.8.1, OpenPDF 1.3.12 2020-01-24 14:55:08 +01:00
Juergen Hoeller 60c7af3625 Mention HikariCP next to DBCP and C3P0 in connection pool notes
Closes gh-24405
2020-01-24 14:54:02 +01:00
Kalmesh Sambrani d085577e0a Solve ReflectPermission Issue in Sandbox Security Policy Model 2020-01-24 14:15:39 +01:00
Hyunjin Choi a2af5a90dc Simplify UrlFileNameViewController#getViewNameForUrlPath()
Closes gh-24419
2020-01-24 11:39:05 +01:00
Johnny Lim 5a0b768a3d Fix typo in Javadoc 2020-01-23 15:52:46 +00:00
Rossen Stoyanchev 992e75303d Improve support for generics in Jackson codecs
Closes gh-23791
2020-01-23 12:31:00 +00:00
Rossen Stoyanchev 77517d6cff Merge path extension related deprecation changes
Closes gh-24179
2020-01-22 13:35:21 +00:00
Rossen Stoyanchev c69703ffdb Deprecate path extension strategies
This commit deprecates PathExtensionContentNegotiationStrategy and
ServletPathExtensionContentNegotiationStrategy and also updates code
that depends on them internally to remove that dependence.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 542e187831 Expose media type mappings in ContentNegotiationManager
ContentNegotiationManagerFactoryBean now ensures that
ContentNegotiationManager contains the MediaType mappings even if the
path extension and the parameter strategies are off.

There are also minor fixes to ensure the media type mappings in
ContentNegotiationManagerFactoryBean aren't polluted when mapping keys
are not lowercase, and likewise MappingMediaTypeFileExtensionResolver
filters out duplicates in the list of all file extensions.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 214ba63127 Deprecate config options for content negotiation by path extension
See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 7453c0d0cb Deprecate config options to match by path extension
See gh-24179
2020-01-22 13:35:09 +00:00
Arjen Poutsma 54669c51c9 Use Jackson SequenceWriter for streaming
Before this commit, the AbstractJackson2Encoder instantiated a
ObjectWriter per value. This is not an issue for single values or
non-streaming scenarios (which effectively are the same, because in the
latter values are collected into a list until offered to Jackson).
However, this does create a problem for SMILE, because it allows for
shared references that do not match up when writing each value with a
new ObjectWriter, resulting in errors parsing the result.

This commit uses Jackson's SequenceWriter for streaming scenarios,
allowing Jackson to reuse the same context for writing multiple values,
fixing the issue described above.

Closes gh-24198
2020-01-21 14:22:00 +01:00
Rossen Stoyanchev 5e9d29d813 Ability to customize default Smile codecs
Closes gh-24382
2020-01-20 17:29:59 +00:00
Rossen Stoyanchev a234b90abb Explicit content-type for resources
BodyInserters.ofResource now respects the Content-Type, if specified on
the client request or server response.

Closes gh-24366
2020-01-20 17:09:47 +00:00
Rossen Stoyanchev 5d8c5b0d9b Avoid NPE on comment SSE event
Closes gh-24389
2020-01-20 11:26:58 +00:00
Stephane Nicoll c20a7b4636 Upgrade to Reactor Dysprosium-SR4
Closes gh-24355
2020-01-20 09:17:02 +01:00
Sam Brannen b34404916a Update copyright date 2020-01-17 18:15:16 +01:00
Сергей Цыпанов 3adc7c3059 Hoist concatenation of two constant Strings out of loops
Closes gh-24388
2020-01-17 16:59:39 +01:00
Brian Clozel 59bef22235 Avoid setting special Content-* response headers for Tomcat
As of gh-21783, Spring WebFlux uses a `TomcatHeadersAdapter`
implementation to directly address the native headers used by the
server.

In the case of Tomcat, "Content-Length" and "Content-Type" headers are
processed separately and should not be added to the native headers map.

This commit improves the `HandlerAdapter` implementation for Tomcat and
removes those headers, if previously set in the map. The adapter
already has a section that handles the Tomcat-specific calls for such
headers.

Fixes gh-24361
2020-01-17 15:01:58 +01:00
Sam Brannen daa30a9f0b Consistent use of AnnotationUtils.rethrowAnnotationConfigurationException()
Closes gh-24379
2020-01-16 18:19:11 +01:00
Sam Brannen 984f9de191 Fix Checkstyle violation
See gh-24375
2020-01-16 18:14:14 +01:00
Sam Brannen 2a2efbe611 Introduce @Disabled regression test for gh-24375 2020-01-16 17:16:57 +01:00
Rossen Stoyanchev 19180e04d2 Merge pull request #24367 from JacobASeverson/gh-24331
Closes gh-24367
2020-01-16 16:01:56 +00:00
Rossen Stoyanchev b1d93bb307 Polishing contribution
See gh-24367
2020-01-16 16:01:31 +00:00
Jacob Severson 8e67b7b2cf Expose proxyPing Reactor Netty WebSocket
See gh-24331
2020-01-16 16:01:31 +00:00
Rossen Stoyanchev 3d33cf3764 Updates to Validation section in reference
Closes gh-24338
2020-01-16 15:42:28 +00:00
Rossen Stoyanchev ac8eaca475 HttpWebHandlerAdapter#formatRequest is protected
Closes gh-24352
2020-01-16 14:54:29 +00:00
Rossen Stoyanchev 3c0c0c0597 Fix issue with new line handling in StompDecoder
Closes gh-23713
2020-01-16 14:54:10 +00:00
Sam Brannen 16e49bf0c9 Simplify getCache() implementation in CaffeineCacheManager
Closes gh-24376
2020-01-16 15:07:14 +01:00
Andy Wilkinson 61d9787b98 Publish a build scan only if authenticated
Previously, anyone could publish a scan and publishing was performed
if the GRADLE_ENTERPRISE_URL environment variable was set.

ge.spring.io has now been locked down to prohibit anonymous build scan
publishing. This commit aligns with this change by only attempting to
publish a build scan when authenticated with the server.

Authentication is achieved via an access token that is made available
via an environment variable on CI and locally via a file in ~/.gradle.

One can obtain an access key by running the following command:

./gradlew provisionGradleEnterpriseAccessKey

Closes gh-24371
2020-01-16 11:26:36 +01:00
Gary Hale e864409c5f Update Artifactory plugin to 4.12.0
Closes gh-24250
2020-01-16 10:50:18 +01:00
Sam Brannen 3b983e2165 Include Objenesis NOTICE file contents in binary distributions
Closes gh-24326
2020-01-15 14:18:30 +01:00
Sam Brannen 734db23f4e Fix Checkstyle violation
See gh-gh-24358
2020-01-15 14:09:11 +01:00
Sam Brannen f527ca7515 Update copyright date 2020-01-15 14:04:50 +01:00
hyeonisism 89b8449999 Simplify getParsedSql() method in NamedParameterJdbcTemplate
Closes gh-24358
2020-01-15 14:01:38 +01:00
Sam Brannen 152254ab0a Document supported characters for identifiers in SpEL expressions
Closes gh-24359
2020-01-15 13:53:22 +01:00
Sam Brannen 6c2cb8ecf5 Polish contribution
See gh-24351
2020-01-14 17:33:02 +01:00
hyeonisism f1827cb1f9 Add tests for StringUtils split() method
Closes gh-24351
2020-01-14 17:20:38 +01:00
Spring Buildmaster 0f5103de45 Next Development Version 2020-01-14 08:00:45 +00:00
Rossen Stoyanchev 8740c2dc18 Warning against split URL handling in docs
Closes gh-24304
2020-01-13 21:33:11 +00:00
Stephane Nicoll 5debd866d4 Upgrade to Reactor Dysprosium SR3
Closes gh-24349
2020-01-13 20:22:47 +01:00
Sam Brannen 1c270d8d06 Fix Checkstyle violation 2020-01-13 18:21:36 +01:00
Rossen Stoyanchev 29fe65d23c Upgrade to Dysprosium snapshots
See gh-24349
2020-01-13 16:49:42 +00:00
Sam Brannen 8a6086774f Polishing regarding AJDT versions 2020-01-13 17:15:27 +01:00
Sam Brannen 33ffdd865d Update copyright date 2020-01-13 16:29:23 +01:00
Qimiao Chen c84dd55863 Fix typo in ReflectionUtilsTests
Closes gh-24344
2020-01-13 16:27:05 +01:00
Rossen Stoyanchev cbc57460b7 Support for maxInMemorySize in SSE reader
Closes gh-24312
2020-01-13 14:57:14 +00:00
Rossen Stoyanchev a741ae422b Improve limit handling in StringDecoder
The case of one data buffer containing multiple lines can could cause
a buffer leak due to a suspected issue in concatMapIterable. This
commit adds workarounds for that until the underlying issue is
addressed.

Closes gh-24339
2020-01-13 14:57:14 +00:00
Sam Brannen 850cbf032b Document Objenesis license in license.txt
Closes gh-24340
2020-01-13 14:42:04 +01:00
Sam Brannen a566083a07 Update ASM and CBLIB versions in license.txt 2020-01-13 13:16:50 +01:00
Sam Brannen 798744838c Revise exception handling in AbstractEmbeddedDatabaseConfigurer
See gh-24337
2020-01-13 12:51:31 +01:00
Sébastien Deleuze 3f1882c4eb Support noarg callable references in Kotlin beans DSL
Closes gh-23395
2020-01-13 10:53:23 +01:00
Juergen Hoeller 0801a7d7e4 Upgrade to RxJava 2.2.17, OkHttp 3.14.6, Jetty Reactive HttpClient 1.1.1 2020-01-13 10:40:01 +01:00
Sébastien Deleuze 6747cc1353 Make WebTestClientExtensions.expectBody generics compliant
Closes gh-24142
2020-01-13 10:06:03 +01:00
Sébastien Deleuze bc7d010485 Update CORS support
This commit updates CORS support in order to check Origin header
in CorsUtils#isPreFlightRequest which does not change how Spring
MVC or WebFlux process CORS request but is more correct in term
of behavior since it is a public API potentially used in another
contexts.

It also removes an unnecessary check in
AbstractHandlerMethodMapping#hasCorsConfigurationSource and processes
every preflight request with PreFlightHandler.

Closes gh-24327
2020-01-13 08:33:14 +01:00
Sam Brannen 8396e6bdd1 Link to ADJT in the Eclipse Marketplace 2020-01-11 13:11:17 +01:00
Sam Brannen cb8db1e6df Polish Javadoc 2020-01-10 16:05:33 +01:00
Brian Clozel a31a4f8148 Copy strategiesConfigurers when cloning WebClient.Builder
This commit fixes the missing `strategiesConfigurers` copy when the
`WebClient.Builder` is cloned.

Fixes gh-24329
2020-01-10 15:59:59 +01:00
Stephane Nicoll bdb9f9570e Polish 2020-01-09 17:08:48 +01:00
Juergen Hoeller f6ca21f6a4 Upgrade to SLF4J 1.7.30 and Checkstyle 8.28 2020-01-09 17:03:30 +01:00
Juergen Hoeller 4936a637fe Polishing 2020-01-09 17:03:17 +01:00
Sam Brannen e8ef93c508 Polish contribution
See gh-24321
2020-01-09 15:56:25 +01:00
lixiaolong11000 047eefd2e2 Improve exception message in AopContext.currentProxy()
Closes gh-24321
2020-01-09 15:56:09 +01:00
Juergen Hoeller b0e4b7e29c Re-calculate SimpleKey's hashCode field on deserialization
Closes gh-24320
2020-01-09 15:39:04 +01:00
Rossen Stoyanchev 08e9372ded Restore response after beforeCommit action errors
See gh-24186
2020-01-09 11:10:44 +00:00
Rossen Stoyanchev 34d32402d3 Return 500 if producible attribute present
When a request is mapped through a producible condition on an
@RequestMapping, then a failure to find a converter/decoder should be
a 500 because the return type + media type pair were declared by the
controller and that should be possible to render.

Closes gh-23287
2020-01-09 11:10:44 +00:00
Andy Wilkinson 1ec15ba9c2 Always configure PDF backend as task will only run on cache miss
Previously, the Asciidoctor task was not cacheable and generating the
PDF documentation was very slow. To improve build times, the PDF
documentation was not generated for snapshot builds.

The upgrade to 2.4.0 of the Asciidoctor Gradle pluging means that the
Asciidoctor task is now cacheable. As such, its tasks will only run
when the documentation has changed. This should allow PDF
documentation to be published for every build without slowing things
down too much and the cost of generating the documentation will only
be incurred when there is a change to the documentation.

See gh-24216
2020-01-09 10:17:44 +01:00
Andy Wilkinson 2ac5744323 Upgrade to Asciidoctor Gradle Plugin 2.4
This commit updates the build to use the latest version of the
Asciidoctor Gradle Plugin. One significant new feature is that the
plugin's tasks are now cacheable.

Closes gh-24216
2020-01-09 10:17:27 +01:00
Juergen Hoeller c39ed52f97 Add since tag to hasMethod(Class, Method)
See gh-24282
2020-01-08 19:05:03 +01:00
stsypanov 8e5cad2af3 Add fast path for ClassUtils.hasMethod() 2020-01-08 18:52:15 +01:00
Juergen Hoeller c562c3a0b3 Upgrade to Netty 4.1.44, Jetty 9.4.25, Undertow 2.0.29, OkHttp 3.14.5, Jackson 2.10.2 2020-01-08 18:38:55 +01:00
Juergen Hoeller 259ffe9b3b Thread-safe compiled expression evaluation in SpelExpression
Closes gh-24265
2020-01-08 18:37:07 +01:00
Rossen Stoyanchev 9d6e40fb1e Merge pull request #24143 from yoshikawaa/patch-1
Closes gh-24143
2020-01-08 16:48:54 +00:00
Rossen Stoyanchev d509d5ae6f Polishing contribution
See gh-24143
2020-01-08 16:47:33 +00:00
Astushi Yoshikawa 53b39eb753 MvcUriComponentsBuilder prepends slash
See gh-24143
2020-01-08 16:47:33 +00:00
Rossen Stoyanchev 1dd5db42ab Merge pull request #24292 from ofaizulin/rd-httpmsgconv-fix-isr-contentlength
Closes gh-24292
2020-01-08 16:19:42 +00:00
Rossen Stoyanchev 01827389ef Polishing contribution
See gh-24292
2020-01-08 16:19:25 +00:00
Oleh Faizulin e96b71acf3 contentLength support for Resource decoding
Expose the known content length, if known, in the InputStreamResource returned by ResourceHttpMessageConverter or
ResourceDecoder.

See gh-24292
2020-01-08 16:19:11 +00:00
Sam Brannen e3e7d90415 Improve documentation for FullyQualifiedAnnotationBeanNameGenerator
See gh-24114
2020-01-08 16:47:39 +01:00
Sam Brannen b4c91e7dac Introduce BeanNameGenerator based on fully qualified class name
Prior to this commit, Spring offered two top-level implementations of
the BeanNameGenerator strategy: DefaultBeanNameGenerator and
AnnotationBeanNameGenerator. The latter is used as the default bean
name generator for beans picked up via component scanning. In a typical
application, this strategy works well; however, if multiple component
scanned beans have the same simple class name (i.e., identical names
ignoring the package), a BeanDefinitionStoreException is thrown.

To address such naming conflicts, users of Spring have had to implement
a custom BeanNameGenerator based on the fully qualified class name of
such components.

Similar conflicts can arise with components registered via
configuration class imports (i.e., via @Import), and
ConfigurationClassPostProcessor addresses this via an anonymous inner
class that extends AnnotationBeanNameGenerator but falls back to using
the fully qualified class name if an explicit bean name is not provided
via an annotation.

This commit extracts the implementation of
ConfigurationClassPostProcessor's internal BeanNameGenerator into a new
top-level FullyQualifiedAnnotationBeanNameGenerator class that can be
used to disambiguate between same-named components residing in
different packages that are picked up via component scanning. This bean
name generator can be configured via @ComponentScan's nameGenerator
attribute.

Closes gh-24114
2020-01-07 19:39:28 +01:00
Sam Brannen e1fb4a1966 Polishing 2020-01-07 18:47:54 +01:00
Sam Brannen ef6b1ba034 Update copyright date 2020-01-07 17:15:23 +01:00
Rossen Stoyanchev 9d963abb7d Concrete MediaType check in StringHttpMessageConverter
Closes gh-23287
2020-01-07 15:02:39 +00:00
stsypanov c480a99a77 Trim line from LineInfo only once 2020-01-07 14:44:09 +01:00
Sam Brannen 55e0ff11ca Add note regarding ADJT development builds for Eclipse 4.10 2020-01-07 13:59:31 +01:00
Sam Brannen 12a78d1af2 Update copyright date
See gh-24305
2020-01-07 11:36:53 +01:00
GungnirLaevatain 4692f20aac Remove code duplication in AnnotationDrivenBeanDefinitionParser
This commit merges the implementations of getCallableInterceptors()
and getDeferredResultInterceptors() in order to remove code duplication.

Closes gh-24305
2020-01-07 11:35:38 +01:00
Sam Brannen 141dae6437 Polish contribution
See gh-24293
2020-01-07 11:07:03 +01:00
lixiaolong11000 132805133d Improve ExposeInvocationInterceptor exception message
Closes gh-24293
2020-01-07 11:03:11 +01:00
Brian Clozel ffc1f960f9 Polish
See gh-24238
2020-01-07 09:05:49 +01:00
Rossen Stoyanchev ea6d2ea1ce Multi-value headers in ResponseStatusException
Closes gh-24261
2020-01-06 22:13:55 +00:00
Brian Clozel f9c1565f4e Remove Content-* response headers for error handling
Prior to this commit, when WebFlux handlers added `"Content-*"` response
headers and an error happened while handling the request, all those
headers would not be cleared from the response before error handling.

This commit clears those headers from the response in two places:
* when invoking the handler and adapting the response
* when writing the response body

Not removing those headers might break HTTP clients since they're given
wrong information about how to interpret the HTTP response body: the
error response body might be very different from the original one.

Fixes gh-24238
2020-01-06 16:55:08 +01:00
Sam Brannen 59ade91694 Use HTTPS in link
See gh-24268
2020-01-06 14:45:17 +01:00
Sam Brannen c1d0060a6f Recommend third-party alternatives in BeanUtils Javadoc
See gh-24268
2020-01-06 14:41:00 +01:00
Sam Brannen 3299793c8a Polish [Simple]AliasRegistry[Tests] 2020-01-06 11:30:05 +01:00
Qimiao Chen d0c2812dad Optimize SimpleAliasRegistry hasAlias implementation
This commit reduces the number of loops and recursions in
the implementation of SimpleAliasRegistry#hasAlias().

Closes gh-24295
2020-01-06 11:28:24 +01:00
Sam Brannen 328e88d204 Document minimum Buildship and Eclipse requirements 2020-01-06 10:53:20 +01:00
Sam Brannen 22a888b53d Polish test fixture publication skipping config
Thanks to @jjohannes for the tip.

See gh-23550
2020-01-03 14:56:13 +01:00
Sam Brannen 081b3d304d Move JavaUtilLoggingConfigurer to spring-core test fixtures
See gh-23550
2020-01-03 14:34:29 +01:00
Rossen Stoyanchev 92a28392db Merge pull request #24287 from KangZhiDong/master
Closes gh-24287
2020-01-03 11:22:00 +00:00
Rossen Stoyanchev 510ef1ab2e Polishing contribution
See gh-24287
2020-01-03 11:21:07 +00:00
KangZhiDong f585eb0b79 Fix Javadoc typos
See gh-24287
2020-01-03 11:21:07 +00:00
Rossen Stoyanchev 03ea92df99 Improve RestClientException Javadoc
Closes gh-24288
2020-01-03 11:12:01 +00:00
Rossen Stoyanchev 68f9f8116c Fix typo in RSocket reference
See gh-24245
2020-01-03 08:11:14 +00:00
Sam Brannen 3aa2605fda Replace TestSourcesPlugin with Gradle test fixture support
Prior to this series of commits, the Spring Framework build used a
custom TestSourcesPlugin to share test utilities and fixtures between
projects. This plugin served its purpose; however, it also had its
drawbacks:

- All test code was visible in all other (downstream) projects, and that
  made it too easy to introduce unnecessary coupling. For example,
  this made it more difficult to migrate to JUnit Jupiter.

This commit addresses such issues by migrating to Gradle's first-class
support for "Java test fixtures".

- Having test fixture code in a dedicated source folder makes it
  readily apparent that the code is reused across the test suite.
- The build is now much cleaner since projects explicitly declare that
  they rely on specific test fixtures of upstream projects.
- Incremental builds are now much faster on average since downstream
  projects no longer have to be recompiled due to changes in tests in
  upstream projects.
- Prior to these commits we effectively had around 20 test fixture
  dependencies. With these commits we effectively now have only 7 test
  fixture dependencies (i.e., projects that share test fixtures).

Closes gh-23550
2020-01-02 16:01:56 +01:00
Sam Brannen d5f0bb23ae Disable publication of test fixture artifacts
Thanks to @melix for providing the code snippet necessary to achieve
this with Gradle 5.6.x.

See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen c91dd02905 Delete obsolete TestSourcesPlugin
Since we have migrated to Gradle's built-in test fixture support, the
custom TestSourcesPlugin Gradle plugin is now obsolete.

See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 7b6d83a106 Use Gradle test fixture support for spring-web
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 8a371c7669 Use Gradle test fixture support for spring-aop
See gh-23550
2020-01-02 16:01:35 +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 57b771ba92 Move common FactoryMethods to spring-beans test fixtures
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 94f8ef08e2 Move common TestPrincipal to spring-core test fixtures
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
Brian Clozel 75fd391fc7 Remove quality parameter from selected media type
Prior to this commit, WebFlux application would keep the quality
parameter from the "Accept" request header when selecting a media type
for the response. It would then echo it back to the client.

While strictly not wrong, this is unnecessary and can confuse HTTP
clients. This commit aligns WebFlux's behavior with Spring MVC.

Fixes gh-24239
2020-01-02 11:29:04 +01:00
Honnix 8082b338e2 Document that SpEL supports symbolic logical operators
Make it clear that symbolic logical operators are supported.

Closes gh-24276
2019-12-31 18:58:48 +01:00
Rossen Stoyanchev 956ffe6858 ContentDisposition refactoring
See gh-24220
2019-12-26 17:30:15 +00:00
Stephane Nicoll 3cf806a668 Merge pull request #24266 from PascalSchumacher
* pr/24266:
  Add missing space in AopConfigException message

Closes gh-24266
2019-12-26 09:55:41 +01:00
Pascal Schumacher e7d489667c Add missing space in AopConfigException message
See gh-24266
2019-12-26 09:52:54 +01:00
Stephane Nicoll 9c17eb59a4 Merge pull request #24252 from ghale
* pr/24252:
  Upgrade to Gradle build scan plugin 3.1.1

Closes gh-24252
2019-12-23 17:16:58 +01:00
Gary Hale 2d779857aa Upgrade to Gradle build scan plugin 3.1.1
See gh-24252
2019-12-23 17:09:48 +01:00
Stephane Nicoll 9c2d146a51 Merge pull request #24251 from ghale
* pr/24251:
  Upgrade to nohttp plugin 0.0.4.RELEASE

Closes gh-24251
2019-12-23 16:47:45 +01:00
Gary Hale b6b7162d61 Upgrade to nohttp plugin 0.0.4.RELEASE
See gh-24251
2019-12-23 16:46:35 +01:00
Ferdinand Jacobs 0b5ad09394 Fix example in RSocket docs
Closes gh-24245
2019-12-22 16:48:58 +01:00
Sam Brannen 1b4fd1cba1 Polishing 2019-12-22 16:00:45 +01:00
Rossen Stoyanchev 261956fd08 Improve UriBuilder Javadoc on query params
Add a note on encoding for query parameters specifically mentioning the
"+" sign and a link to the reference docs.

Also remove duplicate Javadoc in UriComponentsBuilder which is already
inherited from UriBuilder.
2019-12-20 11:03:08 +00:00
Rossen Stoyanchev a1b8b18282 Polishing logPrefix Javadoc in ClientRequest|Response
Closes gh-23791
2019-12-20 09:27:40 +00:00
Rossen Stoyanchev 7456fb9c65 Add failing test to be fixed
See gh-23791
2019-12-20 09:15:44 +00:00
Rossen Stoyanchev ea4f1ca5d5 Update ContentDisposition to RFC 6266
Close gh-24231
2019-12-19 16:27:40 +00:00
Rossen Stoyanchev 15321a3163 Fix checkstyle violations 2019-12-19 13:06:53 +00:00
Rossen Stoyanchev 41f40c6c22 Escape quotes in filename
Closes gh-24220
2019-12-19 12:23:12 +00:00
Rossen Stoyanchev 44da775134 CorsInterceptor skips async dispatch
Closes gh-24223
2019-12-18 16:48:49 +00:00
Rossen Stoyanchev 0eacb443b0 Reuse InputStream in ResourceRegionHttpMessageConverter
The converter now tries to keep reading from the same InputStream which
should be possible with ordered and non-overlapping regions. When
necessary the InputStream is re-opened.

Closes gh-24214
2019-12-18 16:22:53 +00:00
Juergen Hoeller 7474ee7041 Polishing 2019-12-16 16:50:30 +01:00
Juergen Hoeller 0711e58a5f Un-deprecate PathResource (for NIO Path resolution in createRelative)
Includes aligned createRelative signature and dedicated java.io.File test.

Closes gh-24211
2019-12-16 16:50:04 +01:00
Juergen Hoeller f353bc0c25 ConcurrentReferenceHashMap cache for getInterfaceMethodIfPossible results
Closes gh-24206
2019-12-16 16:49:39 +01:00
Juergen Hoeller 5836680490 Upgrade to Log4J 2.13 and RxJava 2.2.16 2019-12-15 23:28:04 +01:00
Rossen Stoyanchev 5f9178034c Merge pull request #2079
Closes gh-2079
2019-12-13 16:55:38 +00:00
Rossen Stoyanchev 542297b30d Polishing of contribution
See gh-2079
2019-12-13 16:54:53 +00:00
Dzmitry Kabysh f4509d6e3a Allow any Accept and Content-Type raw values
See gh-2079
2019-12-13 16:20:55 +00:00
wonwoo f8d6896e40 Replace context object with "it" argument
Closes gh-23482
2019-12-13 16:19:06 +00:00
Sam Brannen 6fdf5ef6ee Polish contribution
See gh-24205
2019-12-13 17:14:26 +01:00
Сергей Цыпанов d9cae339d6 Simplify AdvisedSupport.removeAdvisor()
Closes gh-24205
2019-12-13 17:12:18 +01:00
Sam Brannen 17edbec035 Polishing 2019-12-13 16:30:03 +01:00
Sam Brannen 47b18e5ea9 Polishing 2019-12-13 16:12:39 +01:00
lixiaolong11000 bee2b7cd73 Add missing test cases in XmlBeanFactoryTests
Closes gh-24189
2019-12-13 15:56:06 +01:00
Sam Brannen 49ddf798e0 Polish ClassUtils.resolvePrimitiveClassName()
See gh-24192
2019-12-13 15:47:05 +01:00
Arjen Poutsma 09b6730f3d Expose logPrefix in ClientResponse
This commit exposes the logPrefix field in the ClientResponse interface.

Closes gh-24146
2019-12-13 10:59:53 +01:00
Gary Russell 63844c6d74 MappingJackson2MessageConverter: fix javadoc typo
`getJavaTypeForMessage()` - wrong parameter description.
2019-12-13 09:58:46 +01:00
Rossen Stoyanchev 1dd0a0f009 Fix since tags from prior commit 2019-12-12 22:03:38 +00:00
Rossen Stoyanchev b23617637d Fix cloning issue in CodecConfigurer for multipart writers
Closes gh-24194
2019-12-12 21:58:14 +00:00
Rossen Stoyanchev dd9b6287b4 Expose ClientCodecConfigurer in WebClient.Builder
Using Consumer<ClientCodecConfigurer> instead of
Consumer<ExchangeStrategies> eliminates one level of nesting that is
also unnecessary since codecs are the only strategy at present.

Closes gh-24124
2019-12-12 21:58:14 +00:00
Rossen Stoyanchev 11e321b8e7 Add register methods to CodecConfigurer.CustomCodecs
The new register methods replace the now deprecated
encoder, decoder, reader, and writer methods, and also offer a choice
to opt into default properties such maxInMemorySize, if configured.

See gh-24124
2019-12-12 21:58:14 +00:00
Rossen Stoyanchev 9d65830133 CodecConfigurer implementation refactoring
See gh-24124
2019-12-12 21:57:45 +00:00
Juergen Hoeller fa8f08391f Consistent use of annotation-api dependency instead of tomcat-embed-core 2019-12-12 17:21:41 +01:00
Juergen Hoeller b679c3b6ec Upgrade to Tomcat 9.0.30 2019-12-12 16:44:21 +01:00
Juergen Hoeller 02b40223e5 Polishing 2019-12-12 16:43:00 +01:00
perceptron8 dafe57fc6e Add BeanPropertyRowMapper.newInstance(mappedClass, conversionService)
Similar to SingleColumnRowMapper.newInstance(requiredType,
conversionService) which was added in #1678.
2019-12-12 15:40:55 +01:00
Sam Brannen d757f73902 Handle exceptions in annotation searches again
Prior to Spring Framework 5.2, most annotation search algorithms made
use of AnnotationUtils.handleIntrospectionFailure() to handle exceptions
thrown while attempting to introspect annotation metadata. With the
introduction of the new MergedAnnotation API in Spring Framework 5.2,
this exception handling was accidentally removed.

This commit introduces the use of handleIntrospectionFailure() within
the new MergedAnnotation internals in order to (hopefully) align with
the previous behavior.

Closes gh-24188
2019-12-12 11:29:06 +01:00
Juergen Hoeller 9af8dc0980 Polishing 2019-12-11 17:04:49 +01:00
Johnny Lim 8ac222467b Short-circuit boolean logic in AbstractBeanDefinition.equals()
Closes gh-24185
2019-12-11 16:46:47 +01:00
Sam Brannen 6e21b19999 Make TYPE_HIERARCHY_AND_ENCLOSING_CLASSES annotation search strategy defensive
Prior to this commit, when searching for annotations using the
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy an exception could be
thrown while attempting to load the enclosing class (e.g., a
NoClassDefFoundError), thereby halting the entire annotation scanning
process.

This commit makes this search strategy defensive by logging exceptions
encountered while processing the enclosing class hierarchy instead of
allowing the exception to halt the entire annotation scanning process.

The exception handling is performed by
AnnotationUtils.handleIntrospectionFailure() which only allows an
AnnotationConfigurationException to propagate.

See gh-24136
2019-12-10 22:38:55 +01:00
Sam Brannen 16ed7e2a19 Only load enclosing class for TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Prior to this commit, the enclosing class was always eagerly loaded
even if the annotation search strategy was not explicitly
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES.

See gh-24136
2019-12-10 22:08:26 +01:00
Sam Brannen 76bc581528 Polishing 2019-12-10 22:06:22 +01:00
Rossen Stoyanchev 9b30d46ff4 JSON charset handling in StringHttpMessageConverter
This commit restores the interpretation of JSON as UTF-8 by default that
was removed in #bc205e0 and also ensures a charset is not appended
automatically to "application/json".

Closes gh-24123
2019-12-10 16:52:23 +00:00
Rossen Stoyanchev 70a0c93d69 Correct WebFlux docs on BindingResult with @RequestBody
Closes gh-22997
2019-12-10 16:01:33 +00:00
Rossen Stoyanchev c8bce9686f ContentDisposition trims charset in filename
Closes gh-24112
2019-12-10 15:38:28 +00:00
Rossen Stoyanchev f180bf7652 Add "application/*+xml" to XML decoders
Closes gh-24164
2019-12-10 15:18:04 +00:00
Rossen Stoyanchev 1b172c1d20 Expose localAddress in WebFlux server
Closes gh-24174
2019-12-10 15:10:13 +00:00
Sam Brannen 2bd821c909 Improve exception for mixed explicit/implicit aliases with @AliasFor
Given the following improperly configured composed @RequestMapping
annotation:

@Retention(RetentionPolicy.RUNTIME)
@RequestMapping
@interface PostApi {

	@AliasFor("value")
	String[] path() default {};

	@AliasFor(annotation = RequestMapping.class, attribute = "path")
	String[] value() default {};
}

Prior to this commit, an attempt to process the above annotation
resulted in an exception similar to the following, which is not
especially helpful to discern the problem.

> Attribute 'value' in annotation [PostApi] must be declared as an
> @AliasFor 'path', not 'path'.

This commit improves the exception message for such scenarios,
resulting in an exception message similar to the following.

> Attribute 'value' in annotation [PostApi] must be declared as an
> @AliasFor attribute 'path' in annotation [PostApi], not attribute
> 'path' in annotation [RequestMapping].

Closes gh-24168
2019-12-10 14:36:11 +01:00
Sam Brannen 4466114cfa Polishing 2019-12-10 14:26:48 +01:00
Stephane Nicoll 8d846500ef Merge pull request #24172 from izeye
* pr/24172:
  Use hasSize() where possible

Closes gh-24172
2019-12-10 07:59:17 +01:00
Johnny Lim 1e83e889aa Use hasSize() where possible
See gh-24172
2019-12-10 07:58:53 +01:00
Juergen Hoeller 0a2046e81c Upgrade to Hibernate ORM 5.4.10, Protobuf 3.11.1, Joda-Time 2.10.5, Commons Pool 2.7 2019-12-10 00:24:26 +01:00
Juergen Hoeller 2c03246f00 Polishing 2019-12-09 15:58:21 +01:00
Juergen Hoeller 2d2993dffb Cleanup of "varaible" typos in ResolvableTypeTests 2019-12-09 14:03:56 +01:00
Juergen Hoeller a4f75e9c6a Polishing 2019-12-09 13:29:00 +01:00
Juergen Hoeller 119dd04ae5 Avoid ByteArrayOutputStream for source values without the need to be encoded
Closes gh-24152
2019-12-09 13:28:39 +01:00
stsypanov ebbb562cb9 Hoist constant result of SerializableTypeWrapper.unwrap() out of loop 2019-12-09 13:14:10 +01:00
Sébastien Deleuze 0f41536820 Fix RSocketRequester Coroutines extensions
After gh-24073, some Coroutines extensions should be applied on
RetrieveSpec instead of RequestSpec.

Closes gh-24166
2019-12-09 11:50:06 +01:00
Stephane Nicoll b1e59961fb Merge pull request #24160 from PyvesB
* pr/24160:
  Polish DataBufferUtils javadoc

Closes gh-24160
2019-12-08 14:02:32 +01:00
PyvesB e15ccdb35d Polish DataBufferUtils javadoc
See gh-24160
2019-12-08 14:01:55 +01:00
Sam Brannen 2108bdf876 Introduce regression test for prototype @ControllerAdvice beans
See gh-24157
2019-12-07 18:30:56 +01:00
Sam Brannen fc42ca2866 Polish contribution
See gh-24157
2019-12-07 13:41:43 +01:00
yokotaso d7d474f658 Do not cache prototype @ControllerAdvice beans
Spring Framework 5.2 introduced support for caching @ControllerAdvice
beans; however, this caching was also applied incorrectly to
non-singleton beans.

This commit addresses this regression by only caching singleton
@ControllerAdvice beans.

Closes gh-24157
2019-12-07 13:39:30 +01:00
Sam Brannen 55ae3c5e87 Polishing 2019-12-07 12:59:03 +01:00
Sam Brannen de8a6c8c57 Polishing 2019-12-06 19:08:54 +01:00
Eric Helgeson d4d940e6e3 Add missing backtick in WebSocket documentation
Closes gh-24155
2019-12-06 19:02:22 +01:00
stsypanov 484006ce90 Hoist Class.getName() from String concatenation to dodge an issue related to profile pollution 2019-12-06 17:36:07 +01:00
Phillip Webb 7c84695333 Support variable resolution of wildcard types
Update `ResolvableType` so that variable referenced can be resolved
against wildcard types. Prior to this commit, given a type:

	Map<String, ? extends List<? extends CharSequence>>

Calling `type.getGeneric(1).asCollection().resolveGeneric()` would
return `null`. This was because the `List` variable `E` referenced a
wildcard type which `resolveVariable` did not support.

Closes gh-24145
2019-12-06 13:38:46 +01:00
Sam Brannen a4fa6a7a31 Test status quo for @Inherited annotation support in AnnotationMetadata 2019-12-05 23:30:14 +01:00
Sam Brannen 3b9d1a00b0 Polishing 2019-12-05 22:37:00 +01:00
Juergen Hoeller c2141e2e93 Add @since tags to firstElement methods 2019-12-05 16:36:55 +01:00
Vitalii Rastvorov d503bc2804 Add firstElement to CollectionUtils 2019-12-05 16:26:25 +01:00
Johnny Lim 14ce84cebb Fix status code in webflux.adoc 2019-12-05 12:25:04 +00:00
Rossen Stoyanchev 828fe39523 Consistently use releaseBody in DefaultWebClient
See gh-24125
2019-12-04 18:19:52 +00:00
Rossen Stoyanchev 3a48682226 Replace ReadCancellationException with takeWhile
Closes gh-24125
2019-12-04 18:19:52 +00:00
Rossen Stoyanchev b866d4209c Add UriUtils.encodeQueryParams
Closes gh-24043
2019-12-04 17:33:31 +00:00
Rossen Stoyanchev 797f618f2b Remove mismatched marker in core-beans.adoc
Closes gh-24132
2019-12-04 16:14:14 +00:00
Sam Brannen fb13f6f0bc Add integration test for gh-24110 2019-12-03 16:48:30 +01:00
wanxiangming1994 6f15f32be3 Honor default values for implicit aliases in composed annotations
Spring Framework 5.2 introduced a regression for implicit aliases
declared via @AliasFor. Specifically, Spring's merged annotation
algorithms stopped honoring default values for implicit alias pairs if
the composed annotation was used without specifying the aliased
attributes.

This commit fixes this regression.

Closes gh-24110
2019-12-03 16:14:49 +01:00
Spring Buildmaster 1bff7ce141 Next Development Version 2019-12-03 08:59:24 +00:00
Brian Clozel 21053780ef Polish 2019-12-02 23:13:44 +01:00
Brian Clozel decbb9ccf9 Provide default codecs config callback to custom codecs
As a follow-up of gh-23961, this change provides a way for custom codecs
to align with the default codecs' behavior on common features like
buffer size limits and logging request details.

Closes gh-24118
Co-authored-by: Rossen Stoyanchev <rstoyanchev@pivotal.io>
2019-12-02 22:52:55 +01:00
Wang Xuesong d1ab81587c [*.*] is displayed as [bold .] and needs to be escaped
execution(* com.xyz.service.*.*(..))  ->  execution(* com.xyz.service.\*.*(..))

Closes gh-24108
2019-12-02 19:14:18 +01:00
Rossen Stoyanchev fcbc437825 Polishing (follow-up on acfeb7) 2019-12-02 17:14:13 +00:00
Brian Clozel 35b7f3bf34 Unpublish Gradle metadata
See gh-23503
2019-12-02 16:43:02 +01:00
Sam Brannen 279777b2f3 Polishing 2019-12-02 16:22:40 +01:00
Rossen Stoyanchev 50ac8ad8b7 Fix checkstyle violation 2019-12-02 14:25:00 +00:00
Rossen Stoyanchev acfeb77d41 Polishing
See gh-23961
2019-12-02 14:12:59 +00:00
Brian Clozel d4209392d2 Allow ExchangeStrategies customizations in WebClient
Prior to this commit, developers could configure their WebClient to use
their custom `ExchangeStrategies`, by providing it in the
`WebClient.Builder` chain.
Once created, an `ExchangeStrategies` instance is not mutable, which
makes it hard for further customizations by other components. In the
case of the reported issue, other components would override the default
configuration for the codecs maxInMemorySize.

This commit makes the `ExchangeStrategies` mutable and uses that fact to
further customize them with a new `WebClient.Builder#exchangeStrategies`
`Consumer` variant. This commit is also deprecating those mutating
variants in favor of a new `WebClient.Builder#exchangeStrategies` that
takes a `ExchangeStrategies#Builder` directly and avoids mutation issues
altogether.

Closes gh-23961
2019-12-02 14:12:59 +00:00
Juergen Hoeller 17e2a0c7ea Upgrade to AspectJ 1.9.5 and Checkstyle 8.27 2019-12-02 12:59:02 +01:00
Brian Clozel 1560bbd81e Revert "Allow ExchangeStrategies customizations in WebClient"
This reverts commit b3020bc484.
2019-12-02 10:39:53 +01:00
Juergen Hoeller 1548a0c9a0 Upgrade to Mockito 3.2 2019-12-02 00:28:08 +01:00
Juergen Hoeller 32e7adfa32 Polishing 2019-12-01 02:00:40 +01:00
Juergen Hoeller 91b557eb4b Polishing 2019-12-01 01:21:53 +01:00
Juergen Hoeller 567c7695dd Polishing 2019-12-01 00:20:00 +01:00
Juergen Hoeller 2267080ff4 Upgrade to Protobuf 3.11 and Apache Johnzon 1.2.2 2019-12-01 00:14:16 +01:00
Brian Clozel b3020bc484 Allow ExchangeStrategies customizations in WebClient
Prior to this commit, developers could configure their WebClient to use
their custom `ExchangeStrategies`, by providing it in the
`WebClient.Builder` chain.
Once created, an `ExchangeStrategies` instance is not mutable, which
makes it hard for further customizations by other components. In the
case of the reported issue, other components would override the default
configuration for the codecs maxInMemorySize.

This commit makes the `ExchangeStrategies` mutable and uses that fact to
further customize them with a new `WebClient.Builder#exchangeStrategies`
`Consumer` variant. This commit is also deprecating those mutating
variants in favor of a new `WebClient.Builder#exchangeStrategies` that
takes a `ExchangeStrategies#Builder` directly and avoids mutation issues
altogether.

Closes gh-23961
2019-11-29 22:26:52 +01:00
Sam Brannen d7023fd02b Delete unused JdbcTemplate fields in examples
Closes gh-24085
2019-11-29 19:01:42 +01:00
Sam Brannen 52a1fc4329 Polish BatchPreparedStatementSetter example in reference manual
Closes gh-24084
2019-11-29 18:50:42 +01:00
Sam Brannen 5648ef3276 Fix examples for <tx:method/> settings in reference manual
Closes gh-24080
2019-11-29 18:41:59 +01:00
Andy Wilkinson 7f61f3852c Enable reading from the remote build cache for all
Previously, the remote build cache was only enabled if the
GRADLE_ENTERPRISE_URL environment variable was configured. This meant
that contributors would not benefit from the build time improvements
of the caching without some additional setup.

This commit updates the buildCache configuration so that reading from
the remote build cache at https://ge.spring.io is enabled for all.
Pushing to the cache continues to be disabled unless the required
credentials are provided. Build scan configuration has also been
updated in line with this change. While the server URL is now
hardcoded, publishing is still opt-in via an environment variable.
The exact mechanism by which someone can opt in will change in the
future once some server-side changes have been made. At this point,
only a change to publishAlwaysIf should be necessary.

Closes gh-24105
2019-11-29 17:58:09 +01:00
Sam Brannen 093323beeb Introduce Checkstyle rule to prohibit class names ending with "Test" 2019-11-29 17:30:29 +01:00
Rossen Stoyanchev c18d1ce7ca Merge pull request #24074
Closes gh-24074
2019-11-29 15:55:14 +00:00
Rossen Stoyanchev 395c1e415c Polishing contribution
See gh-24074
2019-11-29 15:54:58 +00:00
Frederik Boster a15a726fef Improve getMultipartContentType in mock request.
See gh-24074
2019-11-29 15:54:58 +00:00
Rossen Stoyanchev 47779df896 Merge pull request #24087
Closes gh-24087
2019-11-29 15:54:15 +00:00
Rossen Stoyanchev 25f3465f1f Polishing contribution
See gh-24087
2019-11-29 15:53:37 +00:00
Parviz ROzikov e858b21c60 #24022 - added protobuf MessageConverter 2019-11-29 14:20:05 +00:00
Sam Brannen d9ebc3bbc4 Polish StringArrayPropertyEditor[Tests] 2019-11-29 14:55:18 +01:00
Sam Brannen 7cedffc707 Support @Inherited again in reflection-based AnnotationMetadata
Spring Framework 5.2 introduced a regression in reflection-based
AnnotationMetadata. Specifically, as of 5.2, StandardAnnotationMetadata
no longer found @Inherited annotations from superclasses.

This commit fixes this regression by switching to the INHERITED_ANNOTATIONS
SearchStrategy when creating the MergedAnnotations used within
StandardAnnotationMetadata,

Note, however, that the discrepancy between StandardAnnotationMetadata
and SimpleAnnotationMetadata (i.e., reflection-based vs. ASM-based)
regarding @Inherited support still remains as it was prior to Spring
Framework 5.2.

Closes gh-24077
2019-11-29 00:07:44 +01:00
Sam Brannen 85016aef30 Test status quo for @Inherited annotations in AnnotationMetadata
This commit introduces failing assertions that are currently disabled
via a boolean reproduceGh24077 flag.

Setting that flag to true demonstrates the regression for
StandardAnnotationMetadata and inconsistencies for SimpleAnnotationMetadata.

See gh-24077
2019-11-28 18:45:58 +01:00
Sam Brannen d1f544209e Test status quo for AnnotatedTypeMetadata.getAnnotationAttributes()
See gh-24077
2019-11-28 13:50:35 +01:00
Rossen Stoyanchev b44daa8b71 Remove the few remaining usages of UriTemplate
Also update Javadoc of UriTemplate to point to UriComponentsBuilder and
UriBuilderFactory as more flexible options.

See gh-24094
2019-11-28 11:28:49 +00:00
Rossen Stoyanchev df2ed75df0 MultipartBodyBuilder Javadoc update
Closes gh-24031
2019-11-28 10:40:28 +00:00
Brian Clozel d8f7ed133f Puslish Gradle metadata
Closes gh-23503
2019-11-28 10:48:13 +01:00
Sébastien Deleuze 6f3909f2f0 Upgrade to Kotlin 1.3.61
Closes gh-24006
2019-11-28 09:44:50 +01:00
Johnny Lim 4aa013c508 Remove duplicate checks in ResponseCookieTests 2019-11-28 07:15:15 +00:00
stsypanov 62ca7c4e8f Hoist constant byte[] out of loop 2019-11-27 19:19:36 +01:00
Stephane Nicoll 52630b06f5 Upgrade to Reactor Dysprosium-SR2
Closes gh-24037
2019-11-27 11:52:43 +01:00
Stephane Nicoll c394bdbbc3 Merge pull request #24089 from ryenus
* pr/24089:
  Fix consecutive-word duplications in documentation

Closes gh-24089
2019-11-27 09:43:34 +01:00
ryenus 40331eaca3 Fix consecutive-word duplications in documentation
See gh-24089
2019-11-27 09:42:44 +01:00
Rossen Stoyanchev 26d800cc93 Fix empty payload handling in RSocketRequester
Closes gh-24088
2019-11-27 07:35:45 +00:00
Rossen Stoyanchev 5a552f1670 Update links between WebFlux and Web MVC 2019-11-26 21:50:01 +00:00
Rossen Stoyanchev 30d68f2de7 Reject user names with "%2F" in STOMP
Closes gh-23836
2019-11-26 16:21:48 +00:00
Rossen Stoyanchev 08669cc7c3 Updates to CONTRIBUTING.md
Closes gh-22892
2019-11-26 15:59:57 +00:00
jasdeepgill db97dac86d Improve readability of CONTRIBUTING.md
Closes gh-24068
2019-11-26 15:59:57 +00:00
Rossen Stoyanchev f57f337104 Protected method to decorate WebSocketHandler
See gh-24075
2019-11-26 12:08:22 +00:00
Rossen Stoyanchev 526d89e1e6 Refine Throwable handling in spring-websocket
This commit lowers the level of Throwable handling in parts of
spring-websocket which now handle Exception instead and allow any Error
to propagate.

Closes gh-24075
2019-11-26 12:04:00 +00:00
Rossen Stoyanchev 70a3dbff24 WebSession creation does not block
Closes gh-24027
2019-11-26 10:48:39 +00:00
Arjen Poutsma ddb38eefee Expose method to determine form content type
This commit exposes the method that returns the media type used to write
forms. By default, it includes the charset in the content type, which
can cause issues with certain consumers. This commit changes the method
from a private to a protected method, so that users can override the
default behavior.

Closes: gh-22971
2019-11-26 10:50:08 +01:00
Arjen Poutsma 2d86f221ce Remove println 2019-11-25 18:27:34 +01:00
Arjen Poutsma 5f3c7ca559 Fix NullPointerException in Jackson2SmileDecoder
Fix uncommon case in Jackson2SmileDecoder, where a null token,
incicating a document separator in streaming mode, is followed by
NOT_AVAILABLE.

Closes gh-24009
2019-11-25 16:23:27 +01:00
Arjen Poutsma a79eaded5d Javadoc 2019-11-25 16:23:27 +01:00
Rossen Stoyanchev 6ed1b5835b Separate step for retrieve in RSocketRequester
Closes gh-24073
2019-11-25 11:47:41 +00:00
Christoph Dreis b234c77b67 Add missing verify() in EncoderHttpMessageWriterTests
Closes gh-24062
2019-11-25 10:51:00 +00:00
Juergen Hoeller 88fd90c357 Upgrade to Tomcat 9.0.29, Jetty 9.4.24, RxJava 2.2.15 2019-11-24 19:58:19 +01:00
Sam Brannen 59e250c93c Consistent use of SCOPE_PROTOTYPE and SCOPE_SINGLETON constants
Closes gh-19905
2019-11-24 13:49:43 +01:00
Rossen Stoyanchev 7bed4f36da Add missing verify() in Jackson2TokenizerTests
Closes gh-24056
2019-11-22 16:38:43 +00:00
Rossen Stoyanchev 51b35e64cf Extra isReady-onWritePossible after last write
Closes gh-24050
2019-11-22 15:57:21 +00:00
Sébastien Deleuze 6c7250b0ae Make Kotlin DSL class constructors internal
Closes gh-24059
2019-11-22 16:10:42 +01:00
Sébastien Deleuze dc0ebefc56 Add support for asyncDispatch to MockMvc Kotlin DSL
Closes gh-23758
2019-11-22 15:03:17 +01:00
Sébastien Deleuze 712eac2915 Refine Coroutines annotated controller support
This commit refines Coroutines annotated controller support
by considering Kotlin Unit as Java void and using the right
ReactiveAdapter to support all use cases, including suspending
functions that return Flow (usual when using APIs like WebClient).

It also fixes RSocket fire and forget handling and adds related tests
for that use case.

Closes gh-24057
Closes gh-23866
2019-11-22 14:13:17 +01:00
Rossen Stoyanchev 21b2fc1f01 Improve HttpHandlerConnection completion
Before this commit the connector waited for a completed response (via
ServerHttpResponse#setComplete or ServerHttpResponse#writeWith) or an
error signal in handling, but it didn't deal explicitly with the case
where both can occur.

This commit explicitly waits for the completion of handling (success
or error) before passing the response downstream. If an error occurs
after response completion, it is wrapped in a dedicated exception that
also provides access to the completed response.

Close gh-24051
2019-11-22 10:28:05 +00:00
Juergen Hoeller b5529f3f2b Restore short-circuiting in equals implementation
Closes gh-24048
2019-11-21 18:20:17 +01:00
stsypanov 1f3b595a03 Use String.isEmpty() instead of String.equals("") 2019-11-21 16:42:01 +01:00
Qimiao Chen bb2e3ce6d1 Polish AbstractBeanDefinition
Closes gh-24048
2019-11-21 15:26:42 +01:00
Juergen Hoeller 336e0595c5 Upgrade to Jetty 9.4.23 and Woodstox 6.0.2 2019-11-21 13:22:30 +01:00
Rossen Stoyanchev 996f7290cf Allow async metadata in RSocketRequester
This commit allows single-value async producers for the values of
metadata entries in both the SETUP and for requests. The same is also
enabled for data in the SETUP frame.

Close gh-23640
2019-11-20 19:41:16 +00:00
Juergen Hoeller 82f4e933e0 Upgrade to Hibernate ORM 5.4.9, Hibernate Validator 6.1, Undertow 2.0.28 2019-11-20 17:37:58 +01:00
Juergen Hoeller a5f2d8c222 Mark SqlRowSet accessor methods as nullable (for alignment with JDBC)
Closes gh-24042
2019-11-20 17:37:40 +01:00
Arjen Poutsma e8b81ffc16 Improve documentation of WebClient.Builder::filter
Closes gh-23342
2019-11-20 11:55:25 +01:00
Stephane Nicoll 6fdeb10ee0 Start building against Reactor Dysprosium-SR2 snapshots
See gh-24037
2019-11-20 10:56:44 +01:00
Rossen Stoyanchev f4e0288357 Remove mentions of Tomcat async request timeout value
Close gh-24030
2019-11-19 17:08:43 +00:00
Sam Brannen 2728f10a07 Test instance behavior for request-scoped @ControllerAdvice beans
The test introduced in this commit is intended to serve as a regression
test for the status quo.

See gh-23985
2019-11-19 17:10:18 +01:00
Rossen Stoyanchev f08cf0e864 Add RSocketFrameTypeMessageCondition constants
See gh-23999
2019-11-19 16:03:56 +00:00
Sam Brannen cd619a2f09 Update @since tag 2019-11-19 16:07:12 +01:00
Sam Brannen fd6efb9a65 Polishing 2019-11-19 15:53:20 +01:00
Juergen Hoeller 06b1f31cdd SynthesizedMergedAnnotationInvocationHandler does not pre-load values
Closes gh-24029
2019-11-19 14:54:12 +01:00
Juergen Hoeller 4af6039359 Avoid substring allocation in StringUtils.replace
Closes gh-24023
2019-11-19 14:53:30 +01:00
Sam Brannen b4e1d48322 Ignore scoped proxy targets for @ControllerAdvice beans
Prior to this commit, methods in a @ControllerAdvice bean were
registered and invoked twice if the advice was a scoped bean (e.g.,
request or session scoped). In other words, both the proxy bean and the
target bean were wrapped in ControllerAdviceBean instances.

This commit fixes this bug by modifying the findAnnotatedBeans() method
in ControllerAdviceBean so that it filters out targets of scoped
proxies.

Closes gh-24017
2019-11-19 14:20:25 +01:00
Sébastien Deleuze 4c17314d0e Upgrade to Kotlin 1.3.60
Closes gh-24006
2019-11-19 10:50:05 +01:00
Arjen Poutsma 9f7dd9f352 Add test for usage of bodyToMono in WebClient.ResponseSpec::onStatus
See gh-23365
2019-11-19 10:22:54 +01:00
Sam Brannen 3a39b7fe82 Support scoped @ControllerAdvice beans again
Spring Framework 5.2 introduced support for implementing the Ordered
interface in a @ControllerAdvice bean. This support requires that
@ControllerAdvice beans be eagerly resolved from the BeanFactory in
order to invoke the getOrder() method defined in the Ordered interface.
Unfortunately doing so resulted in a regression in that an attempt to
eagerly resolve a scoped @ControllerAdvice bean throws a
BeanCreationException due to the lack of an active scope (e.g., request
or session scope).

This commit fixes this regression by avoiding eager resolution of scoped
@ControllerAdvice beans. As a direct consequence, the Ordered interface
is not supported for scoped @ControllerAdvice beans.

Closes gh-23985
2019-11-18 22:29:00 +01:00
Sam Brannen f0b2f7186a Polishing 2019-11-18 22:29:00 +01:00
Rossen Stoyanchev 842b424acd Use method signature to refine RSocket @MessageMapping
Before this change an @MessageMapping could be matched to any RSocket
interaction type, which is arguably too flexible, makes it difficult to
reason what would happen in case of a significant mismatch of
cardinality, e.g. request for Fire-And-Forget (1-to-0) mapped to a
method that returns Flux, and could result in payloads being ignored,
or not seen unintentionally.

This commit checks @ConnectMapping method on startup and rejects them
if they return any values (sync or async). It also refines each
@MessageMapping to match only the RSocket interaction type it fits
based on the input and output cardinality of the handler method.
Subsequently if a request is not matched, we'll do a second search to
identify partial matches (by route only) and raise a helpful error that
explains which interaction type is actually supported.

The reference docs has been updated to explain the options.

Closes gh-23999
2019-11-18 17:27:41 +00:00
Sam Brannen 769a15cb82 Polishing 2019-11-18 13:01:26 +01:00
denisgalaybo 9526e39f88 Fix errors in reference manual
Closes gh-24008
2019-11-17 13:50:50 +01:00
Sam Brannen d397baa559 Polish Javadoc for AutowiredAnnotationBeanPostProcessor 2019-11-15 12:43:55 +01:00
Juergen Hoeller 1607f1db0b Fix Checkstyle nohttp violation 2019-11-15 10:50:28 +01:00
Juergen Hoeller a43ae63f17 Upgrade to SLF4J 1.7.29, Jackson 2.10.1, WebJars Locator 0.43 2019-11-15 10:21:58 +01:00
Rossen Stoyanchev 9ec67bac82 Merge pull request #1885
Closes gh-1885
2019-11-14 17:38:15 +00:00
Rossen Stoyanchev c33cb26a73 Polishing contribution
See gh-1885
2019-11-14 17:38:01 +00:00
Mark Hobson 46fe74d2f9 Preserve media type parameters when setting charset
Issue: SPR-17040
2019-11-14 17:38:01 +00:00
Rossen Stoyanchev 905e3c1f9f Avoid indefinite wait in JettyWebSocketClient
Closes gh-23994
2019-11-14 17:37:10 +00:00
Juergen Hoeller 830f81210f Revise getElementTypeDescriptor javadoc (no IllegalStateException)
Closes gh-23996
2019-11-14 18:31:32 +01:00
Sam Brannen d38b07b450 Move JavaUtilLoggingConfigurer to web.reactive.fixtures package 2019-11-14 15:50:04 +01:00
Sébastien Deleuze 029e61f54a Refine MethodParameter#isOptional Kotlin implementation
This commit adds support for Continuation parameter that is now
considered as an optional parameter since it is never provided by
the user.

It also simplifies and optimizes the implementation.

Closes gh-23991
2019-11-14 15:28:06 +01:00
Sam Brannen 7991066345 Fix classpath 2019-11-14 15:25:26 +01:00
Sam Brannen 89b3a9cef2 Introduce JavaUtilLoggingConfigurer to configure JUL for tests 2019-11-14 14:30:21 +01:00
Stephane Nicoll 1b7ef7fce5 Merge pull request #23995 from izeye
* pr/23995:
  Polish CorsAbstractHandlerMappingTests

Closes gh-23995
2019-11-14 14:13:23 +01:00
Johnny Lim 56670ebec8 Polish CorsAbstractHandlerMappingTests
See gh-23995
2019-11-14 14:13:05 +01:00
Sam Brannen 8df3afd0b6 Polish contribution
See gh-23895
2019-11-14 13:26:38 +01:00
SchutzeHades 834ebc44f8 Fix inappropriate eager init. 2019-11-14 10:13:55 +01:00
Sam Brannen 8186b77b58 Polish contribution
See gh-23895
2019-11-14 09:59:42 +01:00
monosoul a0e4ac39bf Inverse condition to fix ISO-formatted Instant parsing
Prior to this commit, InstantFormatter was able to properly serialize
an Instant that is far in the future (or in the past), but it could not
properly deserialize it, because in such scenarios an ISO-formatted
Instant starts with a +/- sign.

This commit fixes this issue, while maintaining the previous contract,
and also introduces tests for InstantFormatter.

Closes gh-23895
2019-11-14 09:59:42 +01:00
Juergen Hoeller 3dc5e7b1d5 Avoid String concatenation for lookup in StaticMessageSource
Closes gh-22451
2019-11-13 23:41:26 +01:00
Sébastien Deleuze 6fa9871a70 Provide orNull extensions for WebFlux ServerRequest
Closes gh-23761
2019-11-13 17:59:51 +01:00
Juergen Hoeller 22211a01ce Polishing 2019-11-13 17:23:23 +01:00
Juergen Hoeller 32532a88c1 Polishing 2019-11-13 16:17:08 +01:00
Juergen Hoeller 55011e7a0f Note on injecting results from local @Bean methods (self references)
Closes gh-23934
2019-11-13 16:17:01 +01:00
Rossen Stoyanchev 2c1afca9c5 Reject null form data names
...or skip if there are no values either.

Closes gh-22372
2019-11-13 15:03:22 +00:00
Rossen Stoyanchev f2b9264674 Remove Jetbrains annotations 2019-11-13 14:42:32 +00:00
Rossen Stoyanchev e6a65804f5 Merge pull request #1956
Closes gh-1956
2019-11-13 14:24:23 +00:00
Rossen Stoyanchev 04aa3d05da Refactor solution for respones error details
See gh-1956
2019-11-13 14:24:12 +00:00
jerzykrlk 91ec274b10 SPR-17130 http error details in the exception message 2019-11-13 14:24:12 +00:00
JohnGrib 8bb165e55c Fix typo in EventSourceTransportHandler
Closes gh-23984

* https://github.com/spring-projects/spring-framework/blob/3a0f309e2c9fdbbf7fb2d348be861528177f8555/spring-web/src/main/java/org/springframework/http/codec/ServerSentEvent.java#L24
* https://github.com/spring-projects/spring-framework/blob/3a0f309e2c9fdbbf7fb2d348be861528177f8555/spring-web/src/main/java/org/springframework/http/codec/ClientCodecConfigurer.java#L88
* https://github.com/spring-projects/spring-framework/blob/ef14d76d3637abeb31edd8a22031c21f9445efef/spring-web/src/main/java/org/springframework/http/codec/ServerCodecConfigurer.java#L94
* https://github.com/spring-projects/spring-framework/blob/3a0f309e2c9fdbbf7fb2d348be861528177f8555/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/EventSourceTransportHandler.java#L33
2019-11-13 14:23:58 +00:00
YuDongYing 4e5ae54417 Fix schemaZip Gradle task on MS Windows
Prior to this commit, the schemaZip Gradle task failed to find Spring
schema files on MS Windows due to path separators hard coded to forward
slashes that are not compatible with the Windows operating system.

Consequently, a full build failed on Windows since the distZip task was
not able to locate the zipped schema archive that the schemaZip task
failed to create.

This commit fixes this by updating the schemaZip task to search for
schema files using backslashes as well as forward slashes.

Closes gh-23933
2019-11-13 14:49:25 +01:00
Sébastien Deleuze 7646895fd4 Support Kotlin synthetic classes in MethodParameter and SpEL
Closes gh-23812
2019-11-13 14:22:53 +01:00
stsypanov f2b3953d76 Use array.clone() instead of manual array creation 2019-11-13 13:53:42 +01:00
Juergen Hoeller f61d728db9 Fallback Locale other than the system Locale through setDefaultLocale
Closes gh-23977
2019-11-13 13:48:08 +01:00
Rossen Stoyanchev f4c847b723 MockHttpServletRequestBuilder sets content-length
Closes gh-23978
2019-11-12 17:33:14 +00:00
GungnirLaevatain 4bbf2d5785 polish 2019-11-12 17:40:28 +01:00
Rossen Stoyanchev a0cdbf5153 Merge pull request #23980
Closes gh-23980
2019-11-12 16:14:46 +00:00
Rossen Stoyanchev 16c7a40c53 Minor refactoring
See gh-23296
2019-11-12 16:14:02 +00:00
Johannes Teklote 879b2df052 queryParam options for MockMVC requeusts
See gh-23296
2019-11-12 16:13:51 +00:00
Sam Brannen a26d37b407 Polishing 2019-11-12 14:01:13 +01:00
Sam Brannen a276c667d1 Polishing 2019-11-12 13:48:48 +01:00
Juergen Hoeller 9cc06454aa Restore findAnnotation superclass traversal for java.lang annotations
Closes gh-23929
2019-11-12 11:51:44 +01:00
Rossen Stoyanchev fac9ca891a Fix copy-and-paste error in docs 2019-11-11 17:31:51 +00:00
Juergen Hoeller c4ec6aea68 Fix Checkstyle violations
See gh-23784
2019-11-11 17:18:52 +01:00
Arjen Poutsma a7a88371e7 Allow for decode method to return null in AbstractJackson2Decoder
Prior to this commit, the decoder did not allow for a null value
returned from the Jackson object reader.

Closes: gh-23935
2019-11-11 16:48:30 +01:00
Arjen Poutsma 789f6fc188 Add @Nullable annotation to decode method taking DataBuffer
Javadoc indicates the returned value can be null.
2019-11-11 16:48:30 +01:00
Rossen Stoyanchev 23ec6d243c Merge pull request #2023
Closes gh-2023
2019-11-11 15:04:50 +00:00
Rossen Stoyanchev 347f16c8ac Polishing
See gh-2023
2019-11-11 15:04:36 +00:00
Pat Turner 6db8306e46 XpathResultMatcher supports Hamcrest Matcher NodeList
Use when xpath result is XPathConstants.NODESET
2019-11-11 15:04:36 +00:00
Biju Kunjummen 5ee990e045 Use Function.identity
Closes gh-2024
2019-11-11 15:04:29 +00:00
Juergen Hoeller 990bfd8772 Support for new MySQL 8 error code 3572
Closes gh-23972
2019-11-11 15:55:26 +01:00
Juergen Hoeller 6d47e1e0a1 Fix getHeaderPredicate visibility to be declared as protected
Closes gh-23976
2019-11-11 15:55:06 +01:00
Steven Schlansker fc55e66d50 ApplicationListenerMethodAdapter: gracefully handle beans which are actually NullBean
Currently, if you have an optional event listener (via a @Bean method returning `null`)
this causes the event multicaster to explode violently.  Now, we just safely skip it.
2019-11-11 15:43:29 +01:00
GungnirLaevatain d494621ee3 avoid store all bean name 2019-11-11 15:43:05 +01:00
stsypanov 92efe95069 Simplify ConstructorResolver: do not sort intermediate array 2019-11-11 15:42:35 +01:00
Rossen Stoyanchev 51b43496f4 Update docs for ASYNC dispatch config
Closes gh-23958
2019-11-11 14:31:53 +00:00
Sam Brannen d03ab79531 Polish contribution
See gh-23970
2019-11-11 15:16:07 +01:00
Andy Wilkinson f7bc8c8268 Tidy up classpath pollution caused by resource creation in the tests
Previously, spring-webmvc and spring-webflux both contained tests
that would create gzipped files, write them to the filesystem
alongside the project's compiled test classes, and configure them to
be deleted on JVM exit. The output location placed the files on the
classpath, polluting it for every subsequent test that used the same
ClassLoader. The test-sources plugin combined with Gradle's use of
worker JVMs, broadens the scope of this pollution to other, downstream
projects in the same build. For example, the tests for
spring-websocket will have a different classpath depending on whether
or not the tests for spring-webmvc have already been run on the same
worker as part of the current build.

This commit updates the spring-webmvc and spring-webflux modules to
introduce a new JUnit Jupiter extension, GzipSupport. This extension
allows gzipped files to be created via an injectable GzippedFiles
class and automatically deletes each created file in an after-each
callback. This ensures that a gzipped file only exists on the
classpath for the duration of the test that needs it, avoiding the
pollution of the classpath of any subsequent tests.

Closes gh-23970
2019-11-11 15:11:10 +01:00
Andy Wilkinson b5fb28284e Upgrade to Shadow Plugin 5.2.0
Closes gh-23971
2019-11-11 14:56:40 +01:00
Rossen Stoyanchev ffe69a51e1 Javadoc update for content negotiation
Closes gh-23409
2019-11-11 12:04:28 +00:00
Rossen Stoyanchev 1403603b05 Doc update for ForwardedHeaderFilter
Closes gh-23954
2019-11-11 11:44:44 +00:00
Sam Brannen 64dfa462a6 Fix Javadoc for SmartLifecycle.DEFAULT_PHASE regarding ordering
Closes gh-23956
2019-11-09 18:03:07 +01:00
Sam Brannen 29185505b1 Polishing 2019-11-09 13:51:28 +01:00
Sam Brannen cb9d27b9b8 Polish contribution and fix build
See gh-1954
2019-11-09 12:45:02 +01:00
Rob Tompkins cfb7777a07 Exception response for MockRestServiceServer
Closes gh-1954
2019-11-08 18:09:49 +00:00
Muhammad Hewedy f638bfc6a9 Fix status code in webmvc.adoc
Closes gh-22396
2019-11-08 17:50:48 +00:00
Rossen Stoyanchev b98d8ef06f Merge pull request #22715
Closes gh-22715
2019-11-08 17:48:20 +00:00
Rossen Stoyanchev 32f82c0ed0 Polishing 2019-11-08 17:47:59 +00:00
Ilja 08f1cb454a Allow sending headers with the disconnect frame 2019-11-08 17:41:39 +00:00
denisgalaybo b0b6423714 Fixed error in webflux.adoc
Closes gh-23957
2019-11-08 17:19:53 +00:00
Rossen Stoyanchev fd453a0753 Merge branch 'pr/23417'
Closes gh-23417
2019-11-08 15:04:15 +00:00
Rossen Stoyanchev b2b02ad7a1 Polishing 2019-11-08 15:03:53 +00:00
Ilya Lukyanovich 801cca8cf8 Preserve ErrorMessage#getOriginalMessage()
See gh-23417
2019-11-08 15:03:53 +00:00
Tomo Suzuki 21d390a018 Replacing netty-all with specific dependencies 2019-11-08 13:00:37 +00:00
Qimiao Chen 9b8da04e64 Delete unnecessary variable assignment
Closes gh-23955
2019-11-08 13:39:02 +01:00
Rossen Stoyanchev a6dd63f9ca Merge pull request #23938 2019-11-08 09:18:06 +00:00
Rossen Stoyanchev 0e1a237139 Polishing 2019-11-08 09:17:25 +00:00
Johnny Lim 91f5f42d13 Add tests for PrincipalMethodArgumentResolver 2019-11-08 08:48:56 +00:00
Rossen Stoyanchev c7b9988033 Merge pull request #23855 2019-11-08 08:45:03 +00:00
Rossen Stoyanchev 1261e64465 Minor refactoring
Apply default Accept header for HttpUrlConnection only.

See gh-23855
2019-11-08 08:44:04 +00:00
Lorenzo Torracchi afae8c3045 Avoid default "Accept" from HttpUrlConnection
Closes gh-23740
2019-11-08 08:43:25 +00:00
Juergen Hoeller d394c7a5c0 Upgrade to RxJava 2.2.14, OkHttp 3.14.4, JRuby 9.2.9, Rhino 1.7.11, Awaitility 3.1.6 2019-11-07 22:08:52 +01:00
Juergen Hoeller 6a48bb7b4d Polishing 2019-11-07 22:08:29 +01:00
stsypanov f5ae3c77c6 Use Method::getParameterCount where possible 2019-11-07 18:00:15 +01:00
Arjen Poutsma 55f3f128c9 Polishing 2019-11-07 14:29:47 +01:00
Arjen Poutsma bf36f49dc5 Corrupt multipart should not hang SynchronossPartHttpMessageReader
This commit notifies the Synchronoss listener that the buffer stream
has ended.

Closes gh-23768
2019-11-07 09:10:07 +01:00
Rossen Stoyanchev 5d2fc2fc32 HttpHandlerConnector uses non-blocking thread
Closes gh-23936
2019-11-06 21:58:02 +00:00
Rossen Stoyanchev 627a9be654 Update WebMvcConfigurer#addInterceptors Javadoc
Closes gh-23908
2019-11-06 21:40:53 +00:00
Rossen Stoyanchev 203977972b Fix issue with path matching options
Closes gh-23907
2019-11-06 17:54:39 +00:00
Rossen Stoyanchev 3a241b546f Relax domain name checks in ResponseCookie
Closes gh-23924
2019-11-06 17:54:39 +00:00
Sam Brannen 29599a93a4 Re-enable support for invalid Expires attributes in MockCookie
Changes introduced in commit 9b2087618b
caused a regression for Cookie support in MockHttpServletResponse.
Specifically, an Expires attribute that cannot be parsed using
`ZonedDateTime.parse()` now results in an exception; whereas,
previously an entry such as `Expires=0` was allowed.

This commit fixes this issue in MockCookie by catching and ignoring any
DateTimeException thrown while attempting to parse an Expires attribute.

Closes gh-23911
2019-11-06 18:28:28 +01:00
Rossen Stoyanchev 9960ed55aa Fix condition in ServletInvocableHandlerMethod
Closes gh-23775
2019-11-06 15:39:37 +00:00
Sam Brannen 29b31cad48 Align implementations of StringToUUIDConverter and UUIDEditor
Closes gh-23940
2019-11-06 14:21:52 +01:00
Sam Brannen 92228f0fc0 Test status quo for @RequestHeader UUID conversion support
See gh-23939
2019-11-06 13:49:44 +01:00
Sam Brannen 1a13700f8b Polish contribution
See gh-23923
2019-11-06 12:57:01 +01:00
stsypanov 9da15ee23a Improve usage of String.substring()
Closes gh-23923
2019-11-06 12:57:01 +01:00
Sam Brannen f9c1f136c3 Polishing 2019-11-05 15:27:46 +01:00
Sam Brannen fc1dcddb75 Fix grammar 2019-11-05 15:20:18 +01:00
Arjen Poutsma 6e3deb86f1 Javadoc
Describe source of parameters for ServerRequest (i.e. query string or
form data)
2019-11-05 14:30:31 +01:00
Sam Brannen d6002092c4 Clean up build warnings for ApplicationContextExpressionTests 2019-11-04 15:44:53 +01:00
Sam Brannen 01fb35bd2d Remove TestGroup.CI enum constant
Prior to this commit, the TestGroup.CI enum constant was only used in a
single test method in spring-core. In order to enable that test, the
`testGroups` JVM system property was configured for the
Publication-master CI build plan; however, the `testGroups` system
property is not set when executing local builds. Consequently, there
has been a Gradle cache miss for every `test` task when building
something locally that's already been built on the CI server.

This commit addresses this issue by removing the `TestGroup.CI` enum
constant. The `-PtestGroups=ci` command line configuration for the
Publication-master CI build plan has also been removed on the CI server.

Closes gh-23918
2019-11-04 15:44:53 +01:00
wonwoo 8855056395 Polish 2019-11-04 10:10:49 +00:00
Stephane Nicoll 87d4ad39da Merge pull request #23729 from facewindu
* pr/23729:
  Fix spring-core jar task 'up-to-date'-ness

Closes gh-23729
2019-11-04 10:44:53 +01:00
François Guillot 2411b657ae Fix spring-core jar task 'up-to-date'-ness
See gh-23729
2019-11-04 10:29:58 +01:00
Sam Brannen f746e9df82 Upgrade to Gradle 5.6.4 2019-11-03 15:04:58 +01:00
Spring Buildmaster c28cc0bc74 Next Development Version 2019-11-02 08:19:35 +00:00
방성범 (Bang Seongbeom) 89fc0f2713 Fix typo in docs
Closes gh-23788
2019-11-01 11:57:03 +00:00
AlexeyAnufriev 2d208de145 Clear connection pool for OkHttpClient
Closes gh-23628
2019-11-01 11:44:16 +00:00
Arjen Poutsma 3858a69c42 Path RequestPredicate should honor servlet path
Closes gh-23841
2019-10-31 16:06:42 +01:00
Sam Brannen 95af079906 Document unidirectional @AliasFor attribute mapping support
See gh-23834
2019-10-31 15:27:27 +01:00
Rossen Stoyanchev 005d2018d4 Refine changes for PR
Closes gh-23882
2019-10-31 14:14:44 +00:00
Dekel Pilli 64f2beb9bf Fixing NPE in AbstractNamedValueMethodArgumentResolver
See gh-23882
2019-10-31 14:13:44 +00:00
Rossen Stoyanchev fd9678833f Use int for maxParts instead of long 2019-10-31 14:13:44 +00:00
Rossen Stoyanchev 3691c187ef Preserve order of onStatus handlers
Closes gh-23880
2019-10-31 14:13:44 +00:00
Sam Brannen 74b7b550f6 Make MBeanServer tests more robust
This commit refactors several tests to use SocketUtils to find an
available port, compose a custom JMX service URL using that port, and
start an MBeanServer for the particular test using that port.

This commit also makes other changes to MBeanServer related tests in an
effort to make them more robust when executed concurrently.

Closes gh-23699
2019-10-31 14:34:57 +01:00
Sam Brannen 57b4b74e7d Polish Javadoc for JMX factory beans 2019-10-31 13:55:13 +01:00
Brian Clozel 3b724c72b6 Polish
See gh-23884
2019-10-30 19:57:17 +01:00
Sam Brannen 9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Christoph Dreis 3c17178b16 Fix Mockito deprecations 2019-10-30 18:30:05 +01:00
Brian Clozel 4beb25b318 Reorder date formatting converter in registrar
Prior to this commit, the `DateFormatterRegistrar` would register the
annotation-based formatter before the pattern-based formatter. This
would create an issue when an application tries to convert a `String` to
an annotated `@DateTimeFormat Date`: since the converters are considered
in reversed order of registration in
`GenericConversionServicei#ConvertersForPair`, the pattern-based variant
would always be considered before the annotation-based variant,
overriding the developer's opinion.

This commit aligns the `DateFormatterRegistrar` with the
`DateTimeFormatterRegistrar` and registers the annotation-based variant
last.

Closes gh-23893
2019-10-30 17:15:59 +01:00
Juergen Hoeller 43a86565ca Consider target transaction manager for reactive transaction decision
Closes gh-23832
2019-10-30 16:23:37 +01:00
Sam Brannen cef4478b7b Treat InvalidPathException like an IOException in MockServletContext
Prior to this commit, if MockServletContext was configured with a
FileSystemResourceLoader, invocations of the following methods on a
Microsoft Windows operating system resulted in an InvalidPathException
if the supplied path contained a colon (such as "C:\\temp"). This is
inconsistent with the behavior on non-Windows operating systems. In
addition, for comparable errors resulting in an IOException, those
methods (except getRealPath()) return null instead of throwing the
exception.

- getResourcePaths()
- getResource()
- getResourceAsStream()
- getRealPath()

This commit makes handling of InvalidPathException and IOException
consistent for these methods: both exceptions now result in null be
returned by these methods.

Closes gh-23717
2019-10-30 15:59:44 +01:00
Stephane Nicoll 8d88e29173 Add qualified injection points for MVC and WebFlux infrastructure
Previously, the infrastructure provided by WebMvcConfigurationSupport
and WebFluxConfigurationSupport can lead to unexpected results due to
the lack of qualifier for certain dependencies. Those configuration
classes refer to very specific beans, yet their injection points do not
define such qualifiers. As a result, if a candidate exists for the
requested type, the context will inject the existing bean and will
ignore a most specific one as such constraint it not defined. This can
be easily reproduced by having a primary Validator whereas a dedicated
"mvcValidator" is expected. Note that a parameter name is in no way a
constraint as the name is only used as a fallback when a single
candidate cannot be determined.

This commit provides explicit @Qualifier metadata for such injection
points, renaming the parameter name in the process to clarify that it
isn't relevant for the proper bean to be resolved by the context.

Closes gh-23887
2019-10-30 15:07:23 +01:00
Juergen Hoeller 19ff7d84ab Polishing 2019-10-30 14:31:46 +01:00
Juergen Hoeller 19107649d2 Revise concurrent JAXBContext creation towards computeIfAbsent
Closes gh-23879
2019-10-30 14:31:34 +01:00
Juergen Hoeller 42e7ade110 Tolerate unidirectional alias declaration for annotation attribute pair
Closes gh-23834
2019-10-30 14:31:09 +01:00
Juergen Hoeller dba7bf7ec1 Avoid unnecessary setAccessible call in AttributeMethods
Closes gh-23829
2019-10-30 14:30:26 +01:00
Rossen Stoyanchev 422c26832b Minor follow-up to previous commit
See gh-23741
2019-10-30 12:38:26 +00:00
Rossen Stoyanchev 34cfbe5d26 ResponseStatusException associated headers
A ResponseStatus exception now exposes extra method to return headers
for the response. This is used in ResponseStatusExceptionHandler to
apply the headers to the response.

Closes gh-23741
2019-10-30 12:10:45 +00:00
Rossen Stoyanchev 0e08e19070 Merge pull request #23793 from alexandrumm/ws-stomp-client-add-log 2019-10-30 07:05:18 +00:00
Rossen Stoyanchev 3895d21b7d Fix failing test after previous commit
See gh-23793
2019-10-30 07:03:51 +00:00
Rossen Stoyanchev 03ac8e6b42 Logging decorator for WebSocketStompClient handler
Closes gh-23793
2019-10-30 06:55:04 +00:00
Juergen Hoeller 248ad0fa79 Expose primary flag on BeanDefinitionBuilder
Closes gh-23794
2019-10-30 01:04:41 +01:00
Juergen Hoeller dc59e50561 Avoid unnecessary use of ResolvableType within MethodParameter
Closes gh-23792
2019-10-30 01:04:26 +01:00
Juergen Hoeller d51ab24a1b Latest dependency updates (Tomcat 9.0.27, Undertow 2.0.27, RxJava 2.2.13, Gson 2.8.6, Apache Johnzon 1.2.1, Hibernate ORM 5.4.8, EclipseLink 2.7.5, H2 1.4.200, POI 4.1.1, Quartz 2.3.2, WebJars Locator 0.42, HtmlUnit 2.36, Checkstyle 8.26, Mockito 3.1, Objenesis 3.1) 2019-10-30 00:26:45 +01:00
Juergen Hoeller 046380988b Nullability refinements 2019-10-30 00:26:11 +01:00
Juergen Hoeller 773b2f06a1 Avoid Connection.isReadOnly() call in resetConnectionAfterTransaction
Closes gh-23747
2019-10-30 00:25:17 +01:00
Brian Clozel 7d02ba0694 Add missing CORS headers defined in SockJS CORS config
Prior to this commit and following changes done in d27b5d0, the CORS
response headers would not be added for SockJS-related requests, even
though a CORS configuration had been applied to SockJS/WebSocket.
This was due to a missing case in our implementation: calling
`AbstractHandlerMapping#getHandlerInternal` can return a Handler
directly, but also a `HandlerExecutionChain` in some cases, as explained
in the Javadoc.

This commit ensures that, when checking for existing CORS configuration,
the `AbstractHandlerMapping` class also considers the
`HandlerExecutionChain` case and unwraps it to get the CORS
configuration from the actual Handler.

Fixes gh-23843
2019-10-29 15:01:18 +01:00
Rossen Stoyanchev ef14d76d36 Merge limits on input in codecs 2019-10-29 12:34:04 +00:00
Rossen Stoyanchev 5abf24e7d7 Expose maxInMemorySize via CodecConfigurer
Centralized maxInMemorySize exposed via CodecConfigurer along with
ability to plug in an instance of MultipartHttpMessageWrite.

Closes gh-23884
2019-10-29 12:33:16 +00:00
Rossen Stoyanchev 00ead7a756 Refine multipart parsing limits
See gh-23884
2019-10-29 12:33:16 +00:00
Brian Clozel ea6f51e9e3 Configurable limits with Synchronoss
See gh-23884
2019-10-29 12:33:16 +00:00
Brian Clozel 69bcdfc17f Polishing 2019-10-29 12:33:16 +00:00
Rossen Stoyanchev 89d053d7f4 Limits on input stream in codecs
- Add maxInMemorySize property to Decoder and HttpMessageReader
  implementations that aggregate input to trigger
  DataBufferLimitException when reached.

- For codecs that call DataBufferUtils#join, there is now an overloaded
  variant with a maxInMemorySize extra argument. Internally, a custom
  LimitedDataBufferList is used to count and enforce the limit.

- Jackson2Tokenizer and XmlEventDecoder support those limits per
  streamed JSON object.

See gh-23884
2019-10-29 12:33:16 +00:00
Sam Brannen ce0b012f43 Polish contribution
See gh-23769
2019-10-29 13:27:39 +01:00
Vedran Pavic 9b2087618b Preserve expires attribute in MockCookie
At present, MockCookie doesn't preserve expires attribute. This has a
consequence that a cookie value set using
MockHttpServletResponse#addHeader containing an expires attribute will
not match the cookie value obtained from
MockHttpServletResponse#getHeader, since the expires attribute will get
calculated based on current time.

This commit enhances MockCookie to preserve the expires attribute.

Closes gh-23769
2019-10-29 12:56:24 +01:00
Sam Brannen 2482209437 Polish Javadoc @param order 2019-10-29 12:49:05 +01:00
Andy Wilkinson 1a54b83ae1 Add opt-in support for remote build cache and pushing to it from CI
This commit provides opt-in enablement of Gradle's remote build
cache. When the GRADLE_ENTERPRISE_URL environment variable is set, its
build cache node will be used as a source of cached output. If both
GRADLE_ENTERPRISE_CACHE_USERNAME and GRADLE_ENTERPRISE_CACHE_PASSWORD
are also set, task output produced by the build will be pushed to the
build cache node for use by subsequent builds.

Closes gh-23883
2019-10-29 12:46:33 +01:00
Stephane Nicoll 0cea49fdc0 Upgrade to Reactor Dysprosium-SR1
Closes gh-23871
2019-10-28 14:31:38 +01:00
Stephane Nicoll dd140c6ff9 Merge branch '5.1.x' 2019-10-28 14:31:08 +01:00
Sam Brannen 46329d0b97 Polish Javadoc for HeaderAssertions and StatusAssertions
See gh-23878
2019-10-28 13:33:30 +01:00
Sam Brannen d159ec89a3 Upgrade to AssertJ 3.14.0 2019-10-27 21:22:26 +01:00
Sebastien Deleuze 9f242fac66 Add RSocketRequester retrieveAndAwaitOrNull extension
Closes gh-23874
2019-10-27 20:11:08 +01:00
Mark Paluch 0d8aa854e8 Add tests for cancellation of transactional streams
See gh-23864

Closes gh-23873
2019-10-25 17:16:33 +02:00
Sam Brannen 5bd1af2a7f Away with the "manger"; time to fix that typo 2019-10-25 17:04:21 +02:00
Sam Brannen fd95646a04 Polish contribution
See gh-23869
2019-10-25 15:26:20 +02:00
Johnny Lim 46a31bc656 Extract build cache settings to a dedicated file
Closes gh-23869
2019-10-25 15:08:11 +02:00
Andreas Killaitis f838590300 Commit on cancelled subscription in TransactionalOperator::transactional
Prior to this commit, TransactionalOperator::transactional did not close
the transaction when cancelled.

Closes gh-23864
2019-10-25 14:48:46 +02:00
Andy Wilkinson cba91ab28e Stop Created-By manifest header from causing a test task cache miss
Previously, when a project's jar was an input into a test task, a
cache hit required the current build to be using the same JDK as the
one that created the cache entry. This was due to the Created-By
entry in the jar's manifest which will vary if JDKs with different
values for the java.version and java.specification.vendor version are
used.

This commit configures normalization of the runtime classpath to ignore
META-INF/MANIFEST.MF, thereby allowing a cache hit when the tests were
previously run on a different JDK than the one being used now. Typically
this is a different update release being used on a CI agent and a
developer's machine. This change will therefore improve the likelihood
of a cache hit once remote caching has been enabled.

Closes gh-23872
2019-10-25 13:52:48 +02:00
Stephane Nicoll a51334f079 Upgrade to Netty 4.1.43.Final 2019-10-25 09:24:15 +02:00
Stephane Nicoll fecb681339 Start building against Reactor Dysprosium-SR1 snapshots
See gh-23871
2019-10-25 09:23:13 +02:00
Stephane Nicoll 22192fcaab Merge branch '5.1.x' 2019-10-25 09:09:10 +02:00
Phillip Webb 013ec6abdb Support customer repeatable containers in type map
Update `AnnotationTypeMappings` so that a custom `RepeatableContainers`
instances can be used. Prior to this commit, only standard repeatables
were used when reading the annotations. This works in most situations,
but causes regressions for some `AnnotationUtils` methods.

Fixed gh-23856
2019-10-24 13:20:11 -07:00
Sam Brannen f8b875d2d8 Introduce failing @Disabled test for gh-23856 2019-10-24 16:15:59 +02:00
Sam Brannen 5b6337b6a9 Clean up warning in spring-test 2019-10-24 13:55:26 +02:00
Sam Brannen 13cdb70f64 Reinstate protected XpathRequestMatchers constructor
This commit makes the XpathRequestMatchers constructor protected again
in case users have extended this class.
2019-10-24 13:49:35 +02:00
Sam Brannen f3cad9f685 Polish XpathRequestMatchers Javadoc and implementation 2019-10-24 13:37:56 +02:00
Sam Brannen db4d51ba32 Remove unused type parameter declarations in XpathRequestMatchers
Prior to this commit, several of the methods in XpathRequestMatchers
declared unused type parameters (e.g., <T>). This was obviously the
result of copying an existing method that actually needs the type
parameter for proper casting.

For example, the following ...

public <T> RequestMatcher exists() {
    // ...
}

... should actually be declared without <T>, since T is not used in the
implementation or in the return type:

public RequestMatcher exists() {
    // ...
}

This commit removes all unused type parameter declarations in
XpathRequestMatchers.

Side Effects:

Now that we have removed the unused type parameter declarations, users
will see the following side effects if they had previously declared a
type argument when invoking such methods.

- Java: an "Unused type arguments for the non generic method ..."
  warning will be generated by the compiler, but the code will continue
  to work unmodified.

- Kotlin: a "Type inference failed: Not enough information to infer
  parameter T in fun ..." compiler error will be raised, causing the
  code to no longer compile (see
  https://youtrack.jetbrains.com/issue/KT-5464). Removal of the type
  argument declaration will allow the code to work correctly again.

Closes gh-23860
2019-10-24 13:12:02 +02:00
Sam Brannen 693101ded8 Remove unused type parameter declarations in MockMvc result matchers
Prior to this commit, several of the ResultMatcher methods used in
MockMvc declared unused type parameters (e.g., <T>). This was obviously
the result of copying an existing method that actually needs the type
parameter for proper casting.

For example, the following in RequestResultMatchers ...

public <T> ResultMatcher attribute(String name, Object expectedValue) {
    // ...
}

... should actually be declared without <T>, since T is not used in the
implementation or in the return type:

public ResultMatcher attribute(String name, Object expectedValue) {
    // ...
}

This commit removes all unused type parameter declarations in MockMvc
result matchers.

Side Effects:

Now that we have removed the unused type parameter declarations, users
will see the following side effects if they had previously declared a
type argument when invoking such methods.

- Java: an "Unused type arguments for the non generic method ..."
  warning will be generated by the compiler, but the code will continue
  to work unmodified.

- Kotlin: a "Type inference failed: Not enough information to infer
  parameter T in fun ..." compiler error will be raised, causing the
  code to no longer compile (see
  https://youtrack.jetbrains.com/issue/KT-5464). Removal of the type
  argument declaration will allow the code to work correctly again.

Closes gh-23858
2019-10-24 10:41:37 +02:00
Rossen Stoyanchev 5c0212e678 Merge pull request #23780 from izeye/polish-20191011 2019-10-23 17:32:42 +01:00
Rossen Stoyanchev 780eef8d36 Update comment in HttpWebHandlerAdapter
See gh-23780
2019-10-23 17:31:59 +01:00
Johnny Lim 33bf09d513 Polish HttpWebHandlerAdapter.handleUnresolvedError() 2019-10-23 16:57:20 +01:00
Tomasz Letachowicz 9bbf22a1c9 Typos in WebSocket section
Closes gh-23777
2019-10-23 16:55:00 +01:00
Rossen Stoyanchev b343e733df Upgrade Jetty to 9.4.21
Make use of the new getAvailableExtensionNames() method.

Closes gh-23565
2019-10-23 16:51:04 +01:00
Rossen Stoyanchev 88ec452dee Merge pull request #23764 from ask4gilles/23738 2019-10-23 16:50:42 +01:00
Rossen Stoyanchev 2733511ea2 Charset argument in RestClientResponseException
See gh-23764
2019-10-23 16:49:32 +01:00
Rossen Stoyanchev 4932196b87 RestClientResponseException defaults to UTF-8
Closes gh-23764
2019-10-23 16:26:57 +01:00
Rossen Stoyanchev 1b43b09e55 Merge pull request #23612 from KateVasovski/add-principal-method-argument-resolver 2019-10-23 14:58:48 +01:00
Rossen Stoyanchev 739d2881fa Polishing 2019-10-23 14:55:55 +01:00
KateVasovski f77d23de94 @MessgeMapping support for Optional<Principal> 2019-10-23 14:51:07 +01:00
Sam Brannen 6c4ac8f9c9 Remove unused type parameter declaration in RequestResultMatchers
The new sessionAttributeDoesNotExist() method introduced in commit
e73344fc71 declares an unused type
parameter <T>.

This commit removes that unused type parameter from the method
signature.

See gh-23756
2019-10-23 14:27:00 +02:00
Sam Brannen eabf357640 Polish MockMvc result matchers and tests 2019-10-23 14:03:50 +02:00
Sam Brannen 82f64f6a8d Polish contribution
See gh-23756
2019-10-23 12:34:51 +02:00
Drummond Dawson e73344fc71 Introduce sessionAttributeDoesNotExist in RequestResultMatchers
Analogous to the attributeDoesNotExist() method in ModelResultMatchers,
this commit introduces a new sessionAttributeDoesNotExist() method in
RequestResultMatchers which asserts that the given attributes are null
in the HttpSession.

Closes gh-23756
2019-10-23 12:28:08 +02:00
Stephane Nicoll e6f92ae2af Merge pull request #23848 from pdeneve
* pr/23848:
  Update Spring Boot references in testing documentation

Closes gh-23848
2019-10-23 09:54:08 +02:00
Philippe De Neve ca77342407 Update Spring Boot references in testing documentation
See gh-23848
2019-10-23 09:53:41 +02:00
Sam Brannen 112bbe859c Fix grammar in Javadoc 2019-10-22 18:07:41 +02:00
Sam Brannen 71400ea604 Polish MergedAnnotation internals 2019-10-22 13:58:13 +02:00
Sam Brannen 2146bc816a Fix Checkstyle violations
See gh-23767
2019-10-22 12:40:38 +02:00
Phillip Webb ad543dbee3 Use mapped annotation values when resolving mirrors
Update `TypeMappedAnnotation` mirror resolution logic so that mapped
annotation values are also considered. Prior to this commit, mirrors
in more complex meta-annotation scenarios would not resolve correctly.

Specifically, given the following:

 @interface TestAliased {

 	@AliasFor(attribute = "qualifier")
 	String value() default "";

 	@AliasFor(attribute = "value")
 	String qualifier() default "";
 }

 @TestAliased
 @interface TestMetaAliased {

 	@AliasFor(annotation = Aliased.class, attribute = "value")
 	String value() default "";
 }

 @TestMetaAliased("test")
 @interface TestComposed {
 }

A merged `@TestAliased` annotation obtained from a `@TestComposed`
root annotation would return a `value` and `qualifier` of "".

This was because the "value" and "qualifier" mirrors needed to be
resolved against the `@TestMetaAliased` meta-annotation. They cannot be
resolved against the declared `@TestComposed` annotation because it
does not have any attributes. Our previous tests only covered a single
depth scenario where `@TestMetaAliased` was used directly on the
annotated element.

Closes gh-23767
Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-10-21 21:57:30 -07:00
Sam Brannen b1a938fa24 Polishing 2019-10-21 13:51:37 -07:00
Sam Brannen 243f2890ee Upgrade to Gradle 5.6.3 2019-10-18 11:59:30 +02:00
Sam Brannen c087697fde Ensure line endings for binary files are not modified in Git
This commit is necessary in order to upgrade the Gradle wrapper, since
the recent attempt to do so ended up in a corrupted JAR file for the
Gradle wrapper.
2019-10-18 11:56:18 +02:00
Sam Brannen 9e066e5272 Revert "Upgrade to Gradle 5.6.3"
This reverts commit 8e72722d7f.
2019-10-18 10:38:40 +02:00
Sam Brannen 8e72722d7f Upgrade to Gradle 5.6.3 2019-10-18 09:52:13 +02:00
Brian Clozel a65c6f6884 Fix APPLICATION_PROBLEM_JSON_UTF8 media type value
This commit adds the missing "+json" suffix to the "application/problem"
media type for its deprecated UTF-8 variant.

Fixes gh-23825
2019-10-17 09:36:05 +02:00
Minho Hwang d1aee0e869 Fix typo in RSocket reference documentation
This commit fixes a typo in a Java code snippet of
the RSocket reference documentation.

Closes gh-23762
2019-10-06 16:34:27 +02:00
Sam Brannen 3f9359aa83 Polish docs.gradle 2019-10-05 17:44:40 +02:00
Sam Brannen 972337e8f9 Introduce common .gitattributes file
Closes gh-23376
2019-10-02 15:22:39 +02:00
Sam Brannen 6fd50d7d17 Register EventPublishingTEL in JUnit 4 & TestNG base classes
Spring Framework 5.2 introduced an EventPublishingTestExecutionListener
in the Spring TestContext Framework. This listener is automatically
registered via the spring.factories mechanism; however, this listener is
not registered in the abstract JUnit 4 and TestNG base classes.

This commit addresses this oversight by explicitly registering the
EventPublishingTestExecutionListener in the following classes.

- AbstractJUnit4SpringContextTests
- AbstractTransactionalJUnit4SpringContextTests
- AbstractTestNGSpringContextTests
- AbstractTransactionalTestNGSpringContextTests

Closes gh-23748
2019-10-02 15:04:03 +02:00
Sam Brannen fc74c43718 Polishing 2019-10-02 14:49:23 +02:00
Sam Brannen 3a59b01be8 Polish Javadoc for abstract JUnit 4 and TestNG base classes 2019-10-02 14:26:50 +02:00
Sam Brannen f16e29892e Add note regarding proxyTargetClass for Java config and web controllers
See gh-23744
2019-10-02 13:11:06 +02:00
Martin Macko 96930924b2 Fixes broken links to dev.java.net
Closes gh-23746
2019-10-02 12:48:34 +02:00
Brian Clozel a4257f84e7 Fix base directory in distribution zip
Fixes gh-23745
2019-10-02 10:00:33 +02:00
Drummond Dawson b7f819c9e1 Fix URI typo in Java code snippet of web-uris.adoc
Closes gh-23739
2019-10-01 15:10:44 +02:00
Sam Brannen d9bb9b55ee Fix Checkstyle violation
See gh-23706
2019-09-30 18:31:13 +02:00
Sam Brannen 60cd73e97c Update documentation for importing projects into Eclipse
Closes gh-23706
2019-09-30 18:21:29 +02:00
Andy Wilkinson 3b0b173353 Enable local build cache for buildSrc and main project 2019-09-30 15:04:14 +02:00
Spring Buildmaster fef09e3522 Next Development Version 2019-09-30 08:57:48 +00:00
Brian Clozel e435f642bc Temporarily disable Gradle metadata publication
See gh-23503
2019-09-30 10:23:30 +02:00
Brian Clozel a446f572a6 Fix missing project information in generated POMS
This commit ensures that the project name and description are published
with the generated POMs.
2019-09-30 10:22:44 +02:00
Stephane Nicoll 545a4faa2d Revert "Next Development Version"
This reverts commit f3ba263fcc.
2019-09-30 10:14:57 +02:00
Spring Buildmaster f3ba263fcc Next Development Version 2019-09-30 07:20:43 +00:00
Brian Clozel 77bc1b05a6 Use RSocket BOM
See gh-23698
2019-09-30 08:50:03 +02:00
Stephane Nicoll 29f0d1b25e Remove TODO in AnnotationUtils
Closes gh-23727
2019-09-30 07:57:12 +02:00
Stephane Nicoll f9424c889b Upgrade to RSocket 1.0.0-RC5
Closes gh-23698
2019-09-30 07:57:12 +02: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
康智冬 1e0bdc0337 Fix typo in DispatcherServlet Javadoc
Closes gh-23726
2019-09-29 16:22:48 +02:00
Stephane Nicoll d7711e6365 Merge branch '5.1.x' 2019-09-28 14:36:03 +02:00
Sebastien Deleuze ae2218741e Upgrade to Jackson 2.10.0
Closes gh-23662
2019-09-27 22:38:27 +02:00
Sebastien Deleuze 6080449d03 Polishing 2019-09-27 18:17:23 +02:00
Sam Brannen 06563d8b4b Add headerDoesNotExist() to MockRestRequestMatchers
Prior to this commit, one could not test for the absence of a specific
HTTP header in a request.

This commit adds a headerDoesNotExist() method in MockRestRequestMatchers.

Closes gh-23721
2019-09-27 17:38:11 +02:00
Sam Brannen 4dc966b04b Include @Inject TCK tests in the build again
Commit 979508a7f3 removed the JUnit 4
dependency from all modules except spring-test. Unfortunately, the
@Inject TCK tests (SpringAtInjectTckTests) are still based on JUnit 3.
Thus, that commit accidentally excluded those tests from the build.

This commit includes SpringAtInjectTckTests in the build again by
introducing a test runtime dependency on the JUnit Vintage TestEngine
in spring-context.

See gh-23451
2019-09-27 13:57:31 +02:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sam Brannen 6a207d0012 Polish AnnotationConfigApplicationContextTests 2019-09-26 16:45:49 +02:00
Johnny Lim 2a4dbcc623 Fix an assertion in AnnotationConfigApplicationContextTests
Closes gh-23719
2019-09-26 16:34:27 +02:00
Sam Brannen 2526553ecd Document terms and units in DataSize and DataUnit
Prior to this commit, it was not readily apparent what terms and units
such as kilobyte/KB and megabyte/MB represented numerically in DataSize
and DataUnit.

This commit clarifies that such terms and units are based on binary
prefixes for data (i.e., powers of 2 instead of powers of 10).

Closes gh-23697
2019-09-26 16:05:12 +02:00
Sam Brannen 6186239287 Remove obsolete references to specific release versions in testing docs 2019-09-26 15:02:30 +02:00
Brian Clozel fbe05f0369 Upgrade to Spring Doc Resources 0.1.3
Closes gh-23679
2019-09-26 14:27:07 +02:00
Sam Brannen 26ee9c68eb Document [Priority]Ordered support for Bean[Factory]PostProcessor
Prior to this commit, it was not clear from the Javadoc for
BeanPostProcess and BeanFactoryPostProcessor that such components can
be ordered by implementing Ordered or PriorityOrdered.

This commit improves the documentation for BPP and BFPP to make this
support explicit.

Closes gh-23636
2019-09-26 14:24:33 +02:00
Sam Brannen 77b896ca28 Polishing 2019-09-26 11:58:45 +02:00
Sam Brannen f05b4625de Merge branch '5.1.x' 2019-09-26 10:55:55 +02:00
Rossen Stoyanchev e93ac7ac75 Merge branch '5.1.x' 2019-09-26 09:07:29 +01:00
Juergen Hoeller 47a24ac378 Upgrade to Aalto 1.2.2, Protobuf 3.10, Apache Johnzon 1.2, SnakeYAML 1.25, OpenPDF 1.3.11, FreeMarker 2.3.29 2019-09-25 23:49:15 +02:00
Juergen Hoeller d00690f43f Merge branch '5.1.x'
# Conflicts:
#	build.gradle
#	spring-context/spring-context.gradle
#	spring-test/spring-test.gradle
#	spring-web/spring-web.gradle
#	spring-webflux/spring-webflux.gradle
#	spring-webmvc/spring-webmvc.gradle
2019-09-25 23:13:49 +02:00
Sebastien Deleuze 091c512f0d Upgrade to Coroutines 1.3.2
Closes gh-23663
2019-09-25 21:51:04 +02:00
Sebastien Deleuze c10dcec9ed Polishing 2019-09-25 21:48:47 +02:00
Rossen Stoyanchev 2995b6f224 Merge branch '5.1.x' 2019-09-25 17:28:24 +01:00
Sam Brannen a541aa13a5 Link build status badge to build overview page 2019-09-25 17:21:21 +02:00
Sam Brannen 8b73d76204 Link from build status badge to CI build plan 2019-09-25 17:15:55 +02:00
Sam Brannen 667636de66 Add Bamboo build status badge 2019-09-25 17:12:56 +02:00
Sebastien Deleuze f79cebd53d Add Kotlin samples to RSocket documentation
See gh-23147
2019-09-25 17:04:40 +02:00
Sebastien Deleuze a4b278a269 Polishing 2019-09-25 17:02:05 +02:00
Sebastien Deleuze 5866693ece Add MetadataExtractorRegistry.metadataToExtract Kotlin extensions
Closes gh-23705
2019-09-25 17:02:05 +02:00
Andy Wilkinson 00bad3dce0 Allow genJaxb's output to be cached when checkout locations differ
Previously, the genJaxb task's input files were compared using
absolute paths. This would result in a cache miss for two builds
with identical files contents and different root directories.

This commit updates the path sensitivity of the input to be relative
to the build's root directory, thereby allowing caching to work
irrespective of the source checkout location.

Closes gh-23704
2019-09-25 16:44:01 +02:00
Andy Wilkinson 69a0730b01 Upgrade to io.freefair.aspectj 4.1.1
Closes gh-23703
2019-09-25 16:09:51 +02:00
Andy Wilkinson 02decfd864 Improve exclusions of checkstyleNoHttp task
This commit adds the following exclusions to the source of the
checkstyleNoHttp tasks for each project in the build and for buildSrc:

- bin/ directory (created by Eclipse Buildship)
- .settings directory (created by Eclipse)
- .classpath file (created by Eclipse)
- .project file (created by Eclipse)

An exclusion for the build/ directory is also configured as the
NoHttp plugin does not exclude it by default for buildSrc.

Closes gh-23702
2019-09-25 15:29:19 +02:00
Juergen Hoeller 1aa0ea0281 Fix nullability declarations on internal ParserStrategyUtils methods 2019-09-25 13:51:20 +02:00
Andy Wilkinson 853d4c38ae Run webflux's tests in parallel to shorten long tail of builds (#23701)
When built in an environment where many Gradle build workers are
available, :spring-webflux:test is regularly the only task running at
the end of the build. Therefore, the build's overall execution time
can be reduced by running its tests in parallel, spreading the tests'
execution across the available workers. The configured number of forks
is a maximum with Gradle reducing this as necessary for environments
with low numbers of cores where multiple workers will not improve
build performance.

Closes gh-23701
2019-09-25 13:44:14 +02:00
Juergen Hoeller bf55252366 Upgrade to Hibernate ORM 5.4.5 2019-09-25 13:08:07 +02:00
Juergen Hoeller 07df1ce7d2 Update genericBeanDefinitionEquality test to AssertJ usage on master
See gh-23593
2019-09-25 13:07:27 +02:00
Juergen Hoeller bd70f10d2b Merge branch '5.1.x'
# Conflicts:
#	build.gradle
#	spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
#	spring-aspects/spring-aspects.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
#	spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java
#	spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
#	spring-orm/spring-orm.gradle
#	spring-test/spring-test.gradle
2019-09-25 12:43:24 +02:00
Brian Clozel 9034391b6c Temporarily add milestone repository for RSocket
RSocket is still in its RC phase, but those artifacts are published on
maven central. This dependency is currently still depending on a
milestone dependency for Reactor adn this is causing issues with our
build.

This commits adds back the milestone repository until the RSocket POMs
and BOMs are fixed. Once fixed, the Framework build should use the
RSocket BOM for managing RSocket dependencies.

See gh-23698
2019-09-25 12:20:07 +02:00
Stephane Nicoll 27481e4211 Upgrade to Reactor Dysprosium-RELEASE
Closes gh-23695
2019-09-25 08:50:06 +02:00
Stephane Nicoll 4a588a359d Merge branch '5.1.x' 2019-09-25 08:49:38 +02:00
Sam Brannen b9013ada9f Abort MBeanServer tests if BindException encountered
This commit builds on the previous commit but covers exceptions thrown
by @BeforeEach and @AfterEach methods as well as @Test methods.
2019-09-24 19:20:39 +02:00
Sam Brannen 435cc67026 Abort MBeanServer tests if BindException encountered 2019-09-24 18:57:30 +02:00
Andy Wilkinson d0adadf3ca Capture maxParallelForks of Test tasks in build scans
The parallel forks configuration of Test tasks can have a big impact
on their execution time. This commit updates the build can
configuration to capture each Test task's maxParallelForks
configuration as custom values in the build scan. This will make this
data available when comparing scans which will be useful as we
experiment with different parallel fork settings to reduce the
build's overall execution time.

Closes gh-23691
2019-09-24 18:25:24 +02:00
Andy Wilkinson 2570379824 Obfuscate IP addresses in build scans
Closes gh-23690
2019-09-24 18:18:52 +02:00
Sam Brannen e6678f40e8 Make DataSize constants final 2019-09-24 15:32:26 +02:00
Rossen Stoyanchev 30e1257dda Merge branch '5.1.x' 2019-09-24 13:39:42 +01:00
Sam Brannen 402046f3c7 Polish data buffer allocation tests 2019-09-24 14:24:36 +02:00
Sam Brannen 48c8d3a551 Polishing 2019-09-24 13:57:14 +02:00
Sam Brannen 38052e77b7 Fix bug in WebClientDataBufferAllocatingTests
Prior to this commit, the parameterized DataBufferFactory was never
actually used when setting up the WebClient for each test. This was due
to an oversight when migrating from JUnit 4 to JUnit Jupiter.

See: https://github.com/reactor/reactor-netty/issues/860

This commit fixes this by converting the existing @BeforeEach method to
a local setup method that is invoked from each
@ParameterizedDataBufferAllocatingTest method.

In addition, in order to avoid the 2 second "quiet period" that is
incurred when destroying the ReactorResourceFactory, this commit moves
the setup and destruction of the ReactorResourceFactory to new
@BeforeAll and @AfterAll methods.

The test instance lifecycle has also been switched to PER_CLASS to avoid
static state in the test class.
2019-09-24 13:45:50 +02:00
Sam Brannen bba3553dfb Polish SpringVersion 2019-09-24 12:43:10 +02:00
Johnny Lim d6d3a9e232 Polish ImportOrderCheck Checkstyle rule
Closes gh-23685
2019-09-24 12:36:51 +02:00
Sebastien Deleuze 840249778a Polish Kotlin reference documentation for WebMvc.fn
See gh-23657
2019-09-24 10:14:16 +02:00
Sebastien Deleuze 97026f1ec3 Fix ServerRequestExtensionsTests on Java 13
Closes gh-23677
2019-09-24 09:47:57 +02:00
Rossen Stoyanchev 2888b032a1 Polish rsocket.adoc 2019-09-24 06:08:06 +01:00
Rossen Stoyanchev 93371cc2ac Polish 2019-09-23 16:35:08 +01:00
Brian Clozel 72be38cf2c Fix API Diff Gradle task
Prior to this change, the Gradle API Diff task was failing due to a
missing class (a Guava class) during processing. This might be a
dependency that was previously brought by some other dependency.

This commit adds that dependency as a workaround, and improves the
Gradle API Diff task to only select relevant projects when running the
task (projects using the Java Plugin and the Maven Publish Plugin).
2019-09-23 17:13:49 +02:00
Brian Clozel 716f928e79 Upgrade to Spring Doc Resources 0.1.3.BUILD-SNAPSHOT
See gh-23679
2019-09-23 16:53:39 +02:00
Arjen Poutsma 9ffecc5059 Polish reference documentation for WebMvc.fn 2019-09-23 16:08:50 +02:00
Arjen Poutsma 652bbdad2a Add reference documentation for WebMvc.fn
This commit introduces reference documentation for WebMvc.fn, the
functional web framework.

Closes gh-23657
2019-09-23 15:27:49 +02:00
Rossen Stoyanchev e2baf7277b Use metadata slice
Take a slice of the metadata if not using composite metadata to allow
reading it multiple times. For composite metadata this is not an isuse
as it is ensured by the underlying RSocket Java API.
2019-09-23 13:32:28 +01:00
Rossen Stoyanchev 0ae7154518 Fix checkstyle violation 2019-09-23 13:09:06 +01:00
Rossen Stoyanchev 88bb2aabbf RSocket reference documentation
Closes: gh-23147
2019-09-23 12:18:03 +01:00
Sam Brannen 2572cd0503 Make PathPatternParserTests compatible with JDK 13
Closes gh-23669
2019-09-21 17:33:28 +02:00
Sam Brannen 4acd180fa3 Document that setting static final fields is unsupported
This commit updates the documentation for ReflectionUtils and
ReflectionTestUtils to point out that setting static final fields is
not supported.
2019-09-21 15:42:09 +02:00
Sam Brannen fccdb8cf60 Polish ReflectionUtils
This commit removes dead code in ReflectionUtils and improves the
exception message for field access errors.
2019-09-21 15:29:03 +02:00
Juergen Hoeller 4882dfcc0d Consistent relative path treatment (no accidental URL fragment symbol)
Closes gh-23532
2019-09-20 21:55:27 +02:00
Juergen Hoeller 957924ace2 Avoid early log provider initialization (and LogAccessor dependency)
Closes gh-23655
2019-09-20 21:54:53 +02:00
Juergen Hoeller e68132686d Restore lenient target type handling for FactoryBean definitions
Closes gh-23561
2019-09-20 21:54:32 +02:00
Juergen Hoeller a48c13ae73 Avoid deprecated usingWhen method in Reactor 3.3
Closes gh-23562
2019-09-20 21:54:18 +02:00
Mark Paluch 393a81d4a9 Omit cancellation of transactional Monos in TransactionOperator
TransactionOperator.as(Mono) now no longer short-cuts via a Flux.next() but provides an implementation via Mono.usingWhen(…).
The short-cut previously issued a cancellation signal to the transactional Mono causing the transaction cleanup to happen without a handle for synchronization.

Using Mono.usingWhen(…) initiates transaction cleanup when the Mono completes eliminating the need for cancellation of the transactional Publisher.

This change does not fully fix gh-23304 but it softens its impact because TransactionalOperator.transactional(Mono) avoids cancellation.
2019-09-20 20:48:39 +02:00
Sam Brannen f0e160fc67 Execute WebClientDataBufferAllocatingTests during all builds
This commit reverts b2704e1db6 and
configures the ReactorResourceFactory not to use global resources,
thereby allowing all tests in WebClientDataBufferAllocatingTests to
execute within approximately 2 seconds again on Mac OS.
2019-09-20 14:09:00 +02:00
Sam Brannen 3603e0c448 Set Spring-specific name for shutdown hook thread
Prior to this commit, the name of the Thread registered via
ConfigurableApplicationContext#registerShutdownHook() was the generic,
default thread name ("Thread-#"). That made it difficult to discern
which executing thread was the Spring ApplicationContext shutdown hook.

This commit improves diagnostics by setting the thread name of the
ApplicationContext shutdown hook to "SpringContextShutdownHook".

Closes gh-23670
2019-09-20 13:16:59 +02:00
Sam Brannen 734ceed301 Polish contribution
See gh-23658
2019-09-19 22:02:19 +02:00
i321222 fde7b1e545 Avoid ArrayIndexOutOfBoundsException in SpEL's Indexer
When index == arrayLength, the array index is also out of bounds.

For this scenario, a SpelEvaluationException should be thrown instead
of ArrayIndexOutOfBoundsException.

Closes gh-23658
2019-09-19 22:01:10 +02:00
Sam Brannen b2704e1db6 Execute WebClientDataBufferAllocatingTests only during PERFORMANCE build 2019-09-19 18:35:35 +02:00
Sam Brannen c256af4ef7 Polishing 2019-09-19 16:31:07 +02:00
Sam Brannen d611c7484f Fix Checkstyle violation 2019-09-19 16:21:44 +02:00
Sam Brannen 9811e21432 Merge branch '5.1.x' 2019-09-19 15:57:33 +02:00
Brian Clozel 809009e6c4 Rename RSocketStrategies.Builder.metadataExtractors
This commit renames the `metadataExtractors` method to something that is
closer to the actual intent: addming new metadata extractors against the
registry given as a parameter of the `Consumer`.

The method is renamed to `metadataExtractorRegistry`.
2019-09-19 14:54:36 +02:00
Stephane Nicoll e06d2a9c57 Stop using libs-release
This commit makes sure we narrow down dependencies of the Spring
Framework to only Maven central. Optional dependencies that are not
available on Maven Central are now served from a more specific
repository (`libs-spring-framework-build`).

Closes gh-23124
2019-09-19 13:27:49 +02:00
Sebastien Deleuze 02d70424ad Mention Kotlin code samples in the Kotlin refdoc 2019-09-19 10:44:50 +02:00
Brian Clozel 74897bc52a Use Reactor's new Schedulers.boundedElastic()
Prior to this commit, Spring Framework would use `Schedulers.elastic()`
in places where we needed to process blocking tasks in a reactive
environment.

With reactor/reactor-core#1804, a new `Schedulers.boundedElastic()`
scheduler is available and achieves the same goal with added security;
it guarantees that resources are bounded.

This commit uses that new scheduler in the standard websocket client,
since the underlying API is blocking for the connection phase and we
need to schedule that off a web server thread.

Closes gh-23661
See gh-23665
2019-09-18 21:39:45 +02:00
Sebastien Deleuze 90b5e6ab48 Polishing
See gh-23649
2019-09-18 19:29:15 +02:00
Sebastien Deleuze 5adc3d6666 Fix RSocketRequester API for requests without payload
This commit makes it possible to send requests without
requiring to call data(Mono.empty()). It introduces a
dedicated MetadataSpec interface and merge ResponseSpec
into RequestSpec for more flexibility.

Closes gh-23649
2019-09-18 16:00:16 +02:00
Brian Clozel ab58e29397 Remove scope information from published BOM
It seems that publishing a Gradle platform as a Maven POM writes all
dependencies with their scope information by default.

We don't want that when publishing the Spring Framework BOM, as it
forces the scope on projects depending on the BOM, unless they've
specified the scope when they added the dependency to their build.

Typically, developers could get spring-test as a compile dependency
without this change.

This commit removes the scope information from the published BOM.

Fixes gh-23660
2019-09-18 15:27:59 +02:00
Sam Brannen e1e072b75c Fix memory leak regression involving @Async methods
Spring Framework 5.2 M1 introduced a memory leak for applications using
@Async methods. Specifically, in a large test suite with multiple
ApplicationContexts that were closed (e.g., via @DirtiesContext,
@MockBean, or context cache eviction), the JVM process could run out of
memory.

Underlying cause: Due to a missing equals() implementation in Spring's
new AnnotationCandidateClassFilter, CGLIB's static cache of generated
classes indirectly retained references to BeanFactory instances for the
closed ApplicationContexts for the duration of the test suite.

This commit fixes this regression by introducing a proper equals()
implementation in AnnotationCandidateClassFilter. This commit also
introduces corresponding hashCode() and toString() implementations.

Closes gh-23571
2019-09-18 14:28:54 +02:00
Sam Brannen 2e7d344930 Polish ClassFiltersTests 2019-09-18 10:25:54 +02:00
Sam Brannen a51dc84cb1 Fix Checkstyle violation 2019-09-17 13:29:22 +02:00
Sam Brannen 9517372e5f Re-enable DLBFTests.prototypeCreationWithConstructorArgumentsIsFastEnough() 2019-09-17 13:24:53 +02:00
Sam Brannen a93f3ddfe4 Polish DefaultListableBeanFactoryTests 2019-09-17 13:17:22 +02:00
Sam Brannen c8e47f578f Merge branch '5.1.x' 2019-09-17 13:13:02 +02:00
Sebastien Deleuze 1dfe304da4 Improve parity between Java and Kotlin router DSL
This commit adds following functions to the Kotlin DSL:
add, filter, before, after and onError.

Closes gh-23524
2019-09-17 12:42:48 +02:00
Sam Brannen 7a1a8e1623 Polish DefaultListableBeanFactoryTests 2019-09-17 10:44:45 +02:00
Brian Clozel 4cfcc108fe Merge branch '5.1.x' 2019-09-17 09:49:47 +02:00
Sebastien Deleuze 5a0216d657 Improve parity between Java and Kotlin router DSL
This commit adds variants with pattern + predicate to
Kotlin router DSLs, and vararg where necessary.

Closes gh-23524
2019-09-16 22:14:55 +02:00
Brian Clozel 848804a227 Allow registration of RSocket metadata extractors
Prior to this commit, customizing the extraction of RSocket metadata
from frames would require developers to override the default
`MetadataExtractor` while configuring `RSocketStrategies`.
This touches on many infrastructure parts, whereas the goal is just to
configure an extra metadata entry extractor using already configured
codecs.

This commit adds a way to register metadata entry extractors on the
`RSocketStrategies` builder with a `Consumer`-based API.

Closes gh-23645
2019-09-16 19:01:14 +02:00
Sam Brannen a676059699 Declare CRON_DISABLED constant value only once
This commit removes the duplicated CRON_DISABLED constant value from
@Scheuled and simply refers to the ScheduledTaskRegistrar.CRON_DISABLED
constant.

This avoids a potential package cycle by ensuring that the `annotation`
package depends on the `config` package but not the other way around.

See gh-23568
2019-09-16 15:17:58 +02:00
Stephane Nicoll 37d950c5d6 Merge branch '5.1.x' 2019-09-16 14:37:15 +02:00
Andy Wilkinson 20e6ca3601 Fix race condition in sendBlockingMessage
Previously, tests in ConcurrentWebSocketSessionDecoratorTests that use
the BlockingSession would fail intermittently. This appears to have
been due to a race condition in sendBlockingMessage where the call
to getSentMessageLatch() that stores a latch in nextMessageLatch on
the main thread may happen after the call to sendMessage that counts
down the latch if it is non-null occurs on the executor's thread.

This commit updates sendBlockingMessage to call getSentMessageLatch()
(and therefore store the latch) before it sumbmits the task to the
executor. This ensures that the latch will be available when the
exeuctor's thread attempts to retrieve and decrement it.
BlockingSession's AtomicReference fields have also been made final to
eliminate the possibility of any visibility problems across threads.

Closes gh-23642
2019-09-16 14:14:06 +02:00
Kwon Young Jae 6063c00e4e Delete obsolete comment in RowMapperTests
Closes gh-23643
2019-09-16 14:10:33 +02:00
Sam Brannen e7b2c93ede Delete dead code 2019-09-16 13:56:01 +02:00
Sam Brannen 53565c825f Merge branch '5.1.x' 2019-09-16 13:48:49 +02:00
Sam Brannen 1deaedc2b9 Merge branch '5.1.x' 2019-09-16 12:49:35 +02:00
Sam Brannen 52128fe863 Polish RequestLoggingFilterTests 2019-09-16 11:35:26 +02:00
Napster 33cee066e5 Log HTTP method in logging filters and revise log message format
Closes gh-23567
2019-09-16 11:35:26 +02:00
Arjen Poutsma a65fd34801 Change raw status code range check in MockClientHttpResponse
This commit changes the raw status code check to allow for all three
digit numbers, not just those between 100 and 600.

See gh-23599
2019-09-16 09:52:03 +02:00
Sam Brannen cf5cb9484a Add additional tests for HttpHeaders.keySet() operations
See gh-22821
2019-09-15 15:48:37 +02:00
Phillip Webb 077754b8e0 Support constructor injection for @Import classes
Allow `ImportBeanDefinitionRegistrar`, `ImportSelector`,
`DeferredImportSelector.Group` and `TypeFilter` to use constructor
parameters as an alternative to `*Aware` callbacks.

In order to remain backwards compatible, injection only occurs
when there is a single constructor with one or more parameters.

The following parameter types are supported:

* `Environment`
* `BeanFactory`
* `ClassLoader`
* `ResourceLoader`

In order to keep the algorithm simple, subclass parameter types are
not supported. For example, you cannot use `ConfigurableEnvironment`
instead of `Environment`.

Closes gh-23637
2019-09-13 15:20:57 -07:00
Sam Brannen 957f0fac7a Polishing 2019-09-13 12:55:59 +02:00
Sebastien Deleuze 7b4b64b8fb Fix UTF-8 handling in ContentResultMatchers
Closes gh-23622
2019-09-13 11:44:10 +02:00
Phillip Webb 5d785390eb Add ClientHttpRequestInitializer support
Add `ClientHttpRequestInitializer` interface that can be used with any
`HttpAccessor` to initialize each `ClientHttpRequest` before it's used.

This provides a useful alternative to `ClientHttpRequestInterceptor`
when users need to configure things like `HttpHeaders`.

Closes gh-22002
2019-09-12 16:01:46 -07:00
Rossen Stoyanchev b587003d8d Merge branch '5.1.x' 2019-09-12 21:52:41 +01:00
Rossen Stoyanchev 7194261961 Merge branch '5.1.x' 2019-09-12 21:17:00 +01: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
Sam Brannen d689ef8891 Support disabling cron jobs registered via SchedulingConfigurer
Prior to this commit, support was provided for disabling cron jobs
configured with an explicit "-" cron expression. However, the "-"
expression was only supported when supplied via the @Scheduled
annotation.

This commit adds support for disabling cron jobs configured with the
"-" cron expression when a cron job is registered via the
addCronTask(Runnable, String) method in the ScheduledTaskRegistrar
supplied to a SchedulingConfigurer.

Closes gh-23568
2019-09-12 16:08:26 +02:00
Sebastien Deleuze fc6480631e Improve Coroutines transaction API
As a follow-up of gh-22915, the purpose of this commit is to improve
Coroutines programmatic transaction API to make it more consistent with
the Java one and more idiomatic.

For suspending functions, this commit changes the
TransactionalOperator.transactional extension with a suspending lambda
parameter to a TransactionalOperator.executeAndAwait one which is
conceptually closer to TransactionalOperator.execute Java API so more
consistent.

For Flow, the TransactionalOperator.transactional extension is correct
but would be more idiomatic as a Flow extension.

This commit also adds code samples to the reference documentation.

Closes gh-23627
2019-09-12 14:45:03 +02:00
Sam Brannen e62cb6bc56 Merge branch '5.1.x' 2019-09-12 14:03:12 +02:00
Sam Brannen 2b460854ce Polishing 2019-09-12 13:16:48 +02:00
Sam Brannen e124cbb310 Fix Checkstyle violation 2019-09-12 13:15:58 +02:00
OLPMO 40fcf876ce Optimize test code with lambdas where feasible
This commit optimizes test code with lambda expressions
and method references where feasible.

Closes gh-23626
2019-09-12 13:09:31 +02:00
Sam Brannen 00c07e3a50 Indent with tabs 2019-09-12 11:51:44 +02:00
Andy Wilkinson 508b6798ff Move jmx.log beneath build/ to avoid UP-TO-DATE pollution
Previously, some tests in spring-context wrote a file named jmx.log
into spring-context/. This led to the file being included in the
sources of the Checkstyle NoHTTP Gradle task, breaking that task's
UP-TO-DATE checks and causing it to execute unnecessarily.

This commit updates the tests to write the jmx.log file beneath
spring-context/build/ so that it is not included in the sources of the
Checkstyle NoHTTP task.

Closes gh-23623
2019-09-12 11:39:43 +02:00
Sam Brannen 8f38f5c17a Polishing 2019-09-12 11:35:30 +02:00
Sam Brannen 30cff46e7f Prevent improper use of testing framework APIs
Prior to this commit, a lot of work had been done to prevent improper
use of testing Framework APIs throughout the codebase; however, there
were still some loopholes.

This commit addresses these loopholes by introducing additional
Checkstyle rules (and modifying existing rules) to prevent improper use
of testing framework APIs in production code as well as in test code.

- Checkstyle rules for banned imports have been refactored into
  multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
  TestNG.
- Accidental usage of org.junit.Assume has been switched to
  org.junit.jupiter.api.Assumptions.
- All test classes now reside under org.springframework packages.
- All test classes (including abstract test classes) now conform to the
  `*Tests` naming convention.
  - As an added bonus, tests in the renamed
    ScenariosForSpringSecurityExpressionTests are now included in the
    build.
- Dead JUnit 4 parameterized code has been removed from
  DefaultServerWebExchangeCheckNotModifiedTests.

Closes gh-22962
2019-09-12 11:20:56 +02:00
Stephane Nicoll 92d3f7e7d7 Merge pull request #23620 from wilkinsona
* pr/23620:
  Enable parallel builds by default

Closes gh-23620
2019-09-12 09:48:50 +02:00
Andy Wilkinson 9de4c4aefb Enable parallel builds by default
Previously, all tasks in the build were run sequentially. This
commit updates Gradle's properties to build them in parallel where
possible. When using the daemon (recommended) its default max heap is
not sufficient for the demands on a parallel build, therefore this
commit also increases the daemon's max heap.

See gh-23620
2019-09-12 09:48:45 +02:00
Rossen Stoyanchev cfae20f97d Update advice on creating issue vs pull request
Closes gh-23427
2019-09-11 16:16:41 +01:00
Andy Wilkinson 2b4316cf24 Upgrade to com.gradle.build-scan 2.4.2
Closes gh-23619
2019-09-11 15:36:19 +02:00
Sam Brannen d759ae772b Rename Spr3896SuiteTests to Spr3896TestSuite
This commit renames Spr3896SuiteTests to comply with our naming
convention for test classes that should be executed via the Gradle
build.

The effect of this commit is that test classes included in that "suite"
are no longer executed twice in the build. Consequently, Gradle and
Bamboo will now report the same number of executed tests for the
spring-test project.
2019-09-11 13:21:19 +02:00
Arjen Poutsma 13ba7ef701 Merge branch '5.1.x' 2019-09-11 10:43:43 +02:00
Andy Wilkinson b730597c87 Disable caching of changing modules and dynamic versions
Previously, changing modules (snapshots) and dynamic versions were
cached for Gradle's default period of 24 hours and
--refresh-dependencies was used to pick up the latest artifacts. This
approach has a notable downside. --refresh-dependencies causes all
dependencies to be refreshed, irrespective of whether they are
expected to change. At a minimum, this results in a HEAD request for
every dependency in the build. Running an up-to-date build without
--refresh-dependencies takes in the region of 6 seconds:

$ ./gradlew build

BUILD SUCCESSFUL in 6s
203 actionable tasks: 203 up-to-date

The same build with --refresh-dependencies takes almost ten times as
long:

$ ./gradlew build --refresh-dependencies

BUILD SUCCESSFUL in 58s
203 actionable tasks: 203 up-to-date

This commit replaces the manual usage of --refresh-dependencies on
the command line with a 0 second caching period for changing modules
and dynamic versions. This should remove the need to use
--refresh-dependencies both locally and on CI, saving almost 1 minute
per full build.
2019-09-11 10:00:01 +02:00
Sam Brannen 333711fd36 Convert XmlValidationModeDetectorTests to JUnit Jupiter and AssertJ
See gh-23605
2019-09-09 16:29:00 +02:00
Sam Brannen 22c88d7126 Merge branch '5.1.x' 2019-09-09 16:25:20 +02:00
Sam Brannen 604eecaf67 Upgrade to JUnit 5.5.2
This commit also removes the testRuntime dependency on Hamcrest which
was a workaround for https://github.com/junit-team/junit5/issues/2004.

Closes gh-23604
2019-09-09 14:20:56 +02:00
Sebastien Deleuze 5bb8c47b14 Rename fromObject to fromValue in BodyInserters
Closes gh-23587
2019-09-09 00:08:55 +02:00
Sam Brannen 665e8aa51c Downgrade to JUnit 4.12
Since it does not appear that JUnit 4.13 will be released before Spring
Framework 5.2 GA, I am reverting back to JUnit 4.12 for the time being.

See gh-22894
2019-09-08 15:22:21 +02:00
Sam Brannen 683fe9ed70 Update comment
See gh-23604
2019-09-08 15:15:30 +02:00
康智冬 0d742cf3d0 Fix typos related to indefinite articles for SQL acronym
Closes gh-23603
2019-09-07 16:04:47 +02:00
Andy Wilkinson df7e4ad023 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.

Closes gh-23597
2019-09-06 19:18:46 +02:00
Sam Brannen d817b591e5 Revert "Tweak detection of Bamboo (#23597)"
This reverts commit 35567678ef, reversing
changes made to 807e1d3367.
2019-09-06 19:16:59 +02:00
Sam Brannen 35567678ef Tweak detection of Bamboo (#23597)
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 17:18:10 +02:00
Sam Brannen 807e1d3367 Upgrade to Gradle 5.6.2
See gh-23479
2019-09-06 16:09:01 +02:00
Sam Brannen 5d5f9aceca Avoid accidental usage of JUnit 4 assumptions
This commit also avoids starting a server if an assumption fails.
2019-09-06 16:03:36 +02:00
Sam Brannen 591995ecc8 Polish and revive disabled tests
This commit revives some previously disabled tests and converts
some usage of @Disabled to @EnabledForTestGroups(...).
2019-09-06 15:57:27 +02:00
Andy Wilkinson fcda0fb8d9 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 10:08:35 +01:00
Andy Wilkinson 35b967a801 Add opt-in build scan integration with Gradle Enterprise
This commit adds opt-in build scan integration with Gradle Enterprise.
When the GRADLE_ENTERPRISE_URL environment variable is set on a
developer's machine or on CI, a build scan will be automatically
uploaded to Gradle Enterprise at the end of the build.

This initial integration will establish a baseline for Spring
Framework builds. Once that baseline has been established we can use
the build scans to identify ways in which the build can be optimized
and updated to make use of Gradle's build caching which should reduce
build times, significantly so for changes that only affect tasks near
the leaf nodes of the task graph.
2019-09-05 15:16:59 +01:00
Sam Brannen 2b1ae4af60 Remove obsolete Checkstyle suppression entries 2019-09-05 15:54:55 +02:00
Sam Brannen 760f7bed03 Merge branch '5.1.x' 2019-09-05 15:18:43 +02:00
Sebastien Deleuze aa81fdc66f Upgrade to Kotlin Coroutines 1.3.1 2019-09-05 15:09:17 +02:00
Stephane Nicoll 9afe17a29b Fix static imports handling in IntelliJ IDEA configuration
Closes gh-23588
2019-09-05 14:35:54 +02:00
Sam Brannen 99d88ba14e Document minimum JDK 8 update version
Closes gh-23563
2019-09-05 14:04:43 +02:00
Sam Brannen ef50777535 Polishing 2019-09-05 13:45:38 +02:00
Sam Brannen d9e3b8b9a5 Introduce default constructor in TomcatHttpServer 2019-09-05 13:45:38 +02:00
Sebastien Deleuze 40a55b412d Rename BodyBuilder#bodyAndAwait to bodyValueAndAwait 2019-09-05 13:34:11 +02:00
Sam Brannen 73f5d05fd9 Avoid deprecation warning in RandomHandlerIntegrationTests 2019-09-05 13:29:01 +02:00
Sam Brannen c80705a708 Polishing 2019-09-05 13:20:20 +02:00
Sam Brannen ce178f76eb Add missing Temporal tests in BeanUtilsTests
This change will help to serve as a regression test.
2019-09-05 13:14:39 +02:00
Stephane Nicoll facdbdb7b6 Fix checkstyle violation 2019-09-05 09:18:43 +02:00
Phillip Webb 6fbd4841ec Update checkstyle import rule
Update the checkstyle rule to enforce the blank line between `java`
and `javax`.

Closes gh-23539
2019-09-04 22:06:46 -07:00
Phillip Webb deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Phillip Webb 2f106fbb32 Polishing web socket test to use BDD Mockito 2019-09-04 22:05:13 -07:00
Rossen Stoyanchev bc81fa520e Reject range starting above resource length
Closes: gh-23576
2019-09-04 18:05:59 +01:00
Sebastien Deleuze 70bbe71235 Polishing
See gh-22915
2019-09-04 18:24:35 +02:00
Sebastien Deleuze ff271894fe Detect unsupported suspending handler methods in Spring MVC
closes gh-23585
2019-09-04 18:24:35 +02:00
Sam Brannen f54395b261 Polish BeanUtilsTests 2019-09-04 16:53:29 +02:00
Sam Brannen 803643559a Merge branch '5.1.x' 2019-09-04 16:24:44 +02:00
Brian Clozel 0c7359911a Re-enable StreamingSimpleClientHttpRequestFactoryTests
Since the okhttp3 3.14 downgrade, we don't need to ignore this test
anymore.
2019-09-04 16:02:43 +02:00
Brian Clozel cccd9c8bb0 Fix okhttp3 downgrade 2019-09-04 15:07:17 +02:00
Brian Clozel e83fec4ec3 Downgrade to okhttp3 3.14.2
The upgrade to 4.x was breaking some behavior in our tests.
We need to reconsider this upgrade and check our mockrestserver usage in
our tests.
2019-09-04 14:51:52 +02:00
Sam Brannen 00983a1141 Update @Disabled for StreamingSimpleClientHttpRequestFactoryTests.interceptor() 2019-09-04 14:37:37 +02:00
Sam Brannen 4d819128db Fix Javadoc 2019-09-04 14:33:02 +02:00
Sam Brannen 07d4104f2f Polishing 2019-09-04 14:12:44 +02:00
Rossen Stoyanchev 310f0bfb6c Remove unnecessary code from prior commit 2019-09-04 12:59:19 +01:00
Rossen Stoyanchev dfc7540106 Add generic type bounds to DataBufferUtils methods
Closes gh-23459
2019-09-04 12:14:32 +01:00
Juergen Hoeller 48934cba1b Polishing 2019-09-04 12:19:08 +02:00
Juergen Hoeller 3bc27e8d14 Streamline AnnotationFilter usage with the MergedAnnotations API
MergedAnnotations provides 'from' variants with RepeatableContainers but without AnnotationFilter argument now, avoiding the need to refer to AnnotationFilter.PLAIN as a default at call sites.
2019-09-04 12:18:49 +02:00
Rossen Stoyanchev c8f430ee91 Change package used to test path matching
The org.reactivestreams has 13 instead of 4 classes in 1.0.3 with the
addition of Java 9 Flow adapters. This commit switches to using a
different package reactor.util.annotation, also with a small number of
classes, for this test.
2019-09-04 10:37:57 +01:00
Rossen Stoyanchev 57d9b92b94 Upgrade Reactor to Dysprosium RC1
Closes: gh-23579
2019-09-04 08:55:45 +01:00
Juergen Hoeller f26866e4d4 Introduce getType variant with allowFactoryBeanInit flag
Closes gh-23374
2019-09-04 00:06:23 +02:00
Juergen Hoeller eb6577755d Stackless variant of NoTransactionException for reactive flows
Closes gh-23360
2019-09-04 00:02:24 +02:00
Sebastien Deleuze d587a660fc Fix a warning in Kotlin tests 2019-09-03 23:48:39 +02:00
Sebastien Deleuze 9b33b0ad58 Rename CoroutinesUtils#invokeHandlerMethod to invokeSuspendingFunction 2019-09-03 23:41:53 +02:00
Sebastien Deleuze 2b4eb610a7 Add support for Coroutines transactions
This commit adds Coroutines extensions for
TransactionalOperator.transactional that accept suspending lambda or
Kotlin Flow parameters.

@Transactional on suspending functions is not supported yet, gh-23575
has been created for that purpose.

Closes gh-22915
2019-09-03 23:41:42 +02:00
Sam Brannen aeb857c3ba Polish ClassUtilsTests
See gh-23572
2019-09-03 17:58:54 +02:00
Sam Brannen 4575f82c72 Simplify Gradle test task configuration 2019-09-03 17:08:45 +02:00
Sam Brannen 3c4cd99237 Reintroduce Hamcrest as a global test runtime dependency
Prior to this commit, tests in spring-web and spring-webflux were no
longer executed due to the removal of the Hamcrest dependency in
commit bb03cdf5d0.
2019-09-03 17:00:26 +02:00
Sam Brannen 1c5b949df0 Fix ViewResolutionResultHandlerTests
See gh-23572
2019-09-03 16:56:50 +02:00
Sam Brannen 513ce7824f Disable StreamingSimpleClientHttpRequestFactoryTests.interceptor() test 2019-09-03 16:43:48 +02:00
Brian Clozel 1b6814402c Publish Gradle metadata
This commit enables the publishing of Gradle metadata with Spring
Framework artifacts. This feature will be enabled by default with Gradle
6.0, so Spring Framework will consistently push this information in the
5.2.x generation.

Fixes gh-23503
2019-09-03 16:17:06 +02:00
Sebastien Deleuze f8516c69bf Add Kotlin code snippets to data access refdoc
See gh-21778
2019-09-03 16:03:41 +02:00
Sam Brannen 652db21d3e Ensure Hamcrest imports are properly banned 2019-09-03 16:01:30 +02:00
Arjen Poutsma 4c863f3f83 Revise documentation on using WebClient::exchange
This commit revised the paragraph regarding the need to consume or
release the ClientResponse body when using WebClient::exchange.

Closes gh-23498
2019-09-03 15:44:02 +02:00
Arjen Poutsma 37398c669c Add toBodilessEntity to ClientResponse and WebClient.ResponseSpec
See gh-23498
2019-09-03 15:44:02 +02:00
Arjen Poutsma f5640cbfe0 Add ClientResponse::releaseBody
See gh-23498
2019-09-03 15:44:02 +02:00
Sam Brannen bc869657c8 Partially revert 670cbb9aed
... but continue to execute `Abstract*Tests` classes.
2019-09-03 15:17:34 +02:00
Sam Brannen 23d5c6e3dc Do not scan for test classes in default test task 2019-09-03 14:36:32 +02:00
Sam Brannen c78960a1ba Merge branch '5.1.x' 2019-09-03 14:21:39 +02:00
Rossen Stoyanchev 32a585d100 Merge pull request #23485 2019-09-03 12:31:36 +01:00
Rossen Stoyanchev d927d31e13 Remove reflection from ContentDispositionTests
Also minor refactoring in decoding in order to tolerate the absence of
a charset and treat as US_ASCII.

See gh-23485
2019-09-03 12:31:13 +01:00
Rossen Stoyanchev c97580035e Polish ContentDispositionTests
Closes gh-23485
2019-09-03 12:31:13 +01:00
Jonathan Bluett-Duncan f084b63286 Fix "array index out of bounds" problem reported by LGTM.com 2019-09-03 12:31:13 +01:00
Sam Brannen 670cbb9aed Simplify Gradle test task configuration
As an added bonus, AbstractViewTests is now executed in the build.
2019-09-03 12:40:59 +02:00
Sam Brannen 280a1b8880 Make AbstractWebRequestMatcherTests abstract 2019-09-03 12:13:56 +02:00
Sam Brannen 2c44eabe41 Remove unnecessary dependency declarations in spring-test 2019-09-03 12:13:56 +02:00
Sam Brannen bb03cdf5d0 Remove global test dependency on Hamcrest
Hamcrest is now only used within spring-test for MockMvc support.
2019-09-03 12:13:56 +02:00
Sam Brannen bf758eab33 Fix assertion in HandlerMethodMappingTests.unregisterMapping() 2019-09-03 12:13:56 +02:00
Sam Brannen e79bda164e Polish build.gradle 2019-09-03 12:13:10 +02:00
Sam Brannen 5fd81d2a26 Avoid deprecation warning in AbstractMockWebServerTests
MockResponse.setHeaders(Headers) is now deprecated.
2019-09-03 12:13:09 +02:00
Brian Clozel 926c385800 Upgrade to AssertJ 3.13.2 2019-09-02 20:09:14 +02:00
Brian Clozel 47f39965bf Upgrade to Tomcat 9.0.24 2019-09-02 20:09:14 +02:00
Brian Clozel 78c5c7aa9c Upgrade to Log4J 2.12.1 2019-09-02 20:09:14 +02:00
Brian Clozel 859450cf68 Upgrade to Joda time 2.10.3 2019-09-02 20:09:14 +02:00
Brian Clozel a986be3e32 Upgrade to ehcache 2.10.6 2019-09-02 20:09:14 +02:00
Brian Clozel 1b6440c2c1 Upgrade to Caffeine 2.8.0 2019-09-02 20:09:14 +02:00
Brian Clozel e60d48daae Upgrade to hessian 4.0.62 2019-09-02 20:09:14 +02:00
Brian Clozel 829e9f5d92 Upgrade to okhttp3 4.1.0 2019-09-02 20:09:14 +02:00
Brian Clozel 3ec2a222ad Upgrade to Aalto 1.2.1 2019-09-02 20:09:13 +02:00
Brian Clozel b5f933a21b Upgrade to Undertow 2.0.26.Final 2019-09-02 20:09:13 +02:00
Brian Clozel b9089d2a90 Upgrade to RxJava2 2.2.12 2019-09-02 20:09:13 +02:00
Brian Clozel d56ffd1a61 Upgrade to Netty 4.1.39.Final 2019-09-02 20:09:13 +02:00
Brian Clozel be93d37330 Fix missing findbugs dependency for Dokka task 2019-09-02 20:09:13 +02:00
Brian Clozel d4089747b8 Use dependency management in Framework build
Prior to this commit, the Spring Framework build would partially use the
dependency management plugin to import and enforce BOMs.

This commit applies the dependency management plugin to all Java
projects and regroups all version management declaration in the root
`build.gradle` file (versions and exclusions).

Some versions are overridden in specific modules for
backwards-compatibility reasons or extended support.

This commit also adds the Gradle versions plugin that checks for
dependency upgrades in artifact repositories and produces a report; you
can use the following:

    ./gradlew dependencyUpdates
2019-09-02 18:01:09 +02:00
Sebastien Deleuze c13941821a Treat Kotlin warnings as errors
Closes gh-23566
2019-09-02 16:49:31 +02:00
Sebastien Deleuze a2e740c896 Polishing 2019-09-02 16:37:42 +02:00
Sebastien Deleuze ca02cc1194 Migrate to AssertJ in Kotlin tests
Closes gh-23475
2019-09-02 15:59:26 +02:00
Arjen Poutsma 3fcf4233a2 Merge branch '5.1.x' 2019-09-02 15:19:30 +02:00
Rossen Stoyanchev 58e9266e99 Add Consumer methods to RSocketRequester
Closes gh-23513
2019-09-02 13:31:28 +01:00
Rossen Stoyanchev b144c72937 Support ByteBuf as a metadata value
This allows encoding of metadata values externally via some
existing API for encoding RSocket metadata, rather than relying on
registered Encoders.

Also remove explicit checks for DataBuffer since those are supported
through the DataBufferEncoder (registered by default).

See gh-23513
2019-09-02 13:31:28 +01:00
Rossen Stoyanchev 71f3498a26 Switch to using RoutingMetadata API
Closes gh-23137
2019-09-02 13:31:28 +01:00
Arjen Poutsma 702dad6cec Fix ConcurrentModificationException 2019-09-02 12:42:21 +02:00
Sam Brannen 0f4dcb52ca Polishing 2019-09-02 12:34:06 +02:00
Rossen Stoyanchev 2c20b2b663 Upgrade to RSocket 1.0.0-RC3
Closes gh-23543
2019-09-02 09:46:08 +01:00
康智冬 a6f4862f13 Fix typos related to indefinite articles
Closes gh-23555
2019-09-01 15:45:49 +02:00
Sam Brannen f05f993cc6 Fix formatting in Testing chapter in Reference Manual 2019-08-31 15:07:12 +02:00
Sam Brannen 794e2e328d Polish Testing chapter in Reference Manual 2019-08-31 14:47:49 +02:00
Sam Brannen 0103fec5de Convert assertions to AssertJ
See gh-23551
2019-08-31 13:13:44 +02:00
Sam Brannen 5a22eafcb4 Merge branch '5.1.x' 2019-08-31 13:10:58 +02:00
Sebastien Deleuze 57f0c2b7df Remove bodyWithType extension from WebTestClient
Since there is no more clash with the new bodyValue
method name.

See gh-23523
2019-08-31 11:40:44 +02:00
Sebastien Deleuze 3dfd0a24dc Add Kotlin code snippets to WebTestClient testing refdoc
Closes gh-21778
2019-08-31 11:36:57 +02:00
Udo Kohlmeyer b20a8c9d98 Add Kotlin code snippets to testing refdoc
See gh-21778
2019-08-31 11:31:03 +02:00
Sam Brannen ab779eb431 Preserve placeholders in @TestPropertySource locations
Prior to this commit, it was impossible to include a placeholder (i.e.,
${placeholder.name}) in a Properties file location configured via
@TestPropertySource if the placeholder was immediately followed by a
relative path (i.e., "../"). This was due to the fact that the location
was always cleaned using StringUtils.cleanPath(), which removed the
placeholder and the relative path syntax.

This commit fixes this by preserving all placeholders in
@TestPropertySource locations by simply not cleaning the locations if
they contain placeholders.

Closes gh-23544
2019-08-30 18:57:20 +02:00
Sam Brannen 9fa9a09007 Polishing 2019-08-30 18:56:03 +02:00
Sam Brannen 22494ba231 Ensure @ContextConfiguration & @TestPropertySource locations are cleaned
This commit ensures that locations to resources configured via
@ContextConfiguration & @TestPropertySource are consistently cleaned
using StringUtils.clean().

See gh-23544
2019-08-30 17:55:13 +02:00
Sam Brannen ff1f8aa5a8 Add missing parentheses in Testing chapter 2019-08-30 17:19:46 +02:00
Sam Brannen 489193dfa6 Add missing parentheses in Testing chapter 2019-08-30 17:12:23 +02:00
Sam Brannen 793f9e3d29 Ensure SpringExtensionContextCacheTests are robust
... by explicitly ordering the test methods.
2019-08-30 16:22:54 +02:00
Sam Brannen 1ea6ce72bb Test status quo for relative paths & placeholders in @TestPropertySource
This commit introduces a collection of @Nested integration tests that
verify proper support for @TestPropertySource with explicit properties
files declared with absolute paths, relative paths, and placeholders in
the classpath and in the file system.

See gh-23544
2019-08-30 15:51:45 +02:00
Sam Brannen 7738e778fa Polishing 2019-08-30 15:51:44 +02:00
Arjen Poutsma 67d48ed821 Merge branch '5.1.x' 2019-08-29 17:18:22 +02:00
Rossen Stoyanchev 8d86a861a1 Merge branch '5.1.x' 2019-08-29 15:53:17 +03:00
Rossen Stoyanchev 48233317b8 Minor polish in DispatcherServlet
See gh-23541
2019-08-29 15:38:38 +03:00
Rossen Stoyanchev 117119a88d Merge branch '5.1.x' 2019-08-29 15:13:36 +03:00
OLPMO ed64a10c38 Use Collections.addAll where feasible
Closes gh-23478
2019-08-29 13:59:14 +02:00
Sebastien Deleuze 72e92da2ad Make SpEL rootObject parameter nullable
Closes gh-23442
2019-08-29 11:02:31 +02:00
Sebastien Deleuze f65cc9a438 Remove explicit disabling of buffer recycling in Jackson codec
Since now https://github.com/FasterXML/jackson-core/issues/476
and https://github.com/FasterXML/jackson-core/issues/479 are fixed.

This commit also raises the minimum version of Jackson to 2.9.7.

Closes gh-23522
2019-08-28 18:47:21 +02:00
Sam Brannen c004ef888c Configure index in @ParameterizedTest display names
This commit prepends "[{index}] " to all custom display names
configured via @ParameterizedTest.

This provides better diagnostics between the "technical names" reported
on the CI server vs. the "display names" reported within a developer's
IDE.

See gh-23451
2019-08-28 17:06:23 +02:00
Sam Brannen b173a93e72 Verify PathMatchingResourcePatternResolver finds local files with # in name
This commit introduces a test that verifies that
PathMatchingResourcePatternResolver can find files in the filesystem
that contain hashtags (#) in their names.

See gh-23532
2019-08-28 16:21:07 +02:00
Sam Brannen 5af4d22044 Upgrade to Gradle 5.6.1
See gh-23479
2019-08-28 14:53:44 +02:00
Stephane Nicoll 5a28fdc540 Revert "Stop using libs-release"
This reverts commit e5b957167a.

See gh-23124
2019-08-28 14:52:29 +02:00
Stephane Nicoll 46b3a8335f Stop using mavenLocal()
This commit makes sure the content of the local maven repository has no
impact on the build

See gh-23124
2019-08-28 14:18:06 +02:00
Stephane Nicoll e5b957167a Stop using libs-release
This commit makes sure we narrow down dependencies of the Spring
Framework to only Maven central. Optional dependencies that are not
available on Maven Central are now served from a more specific
repository (`ext-release-local`).

Closes gh-23124
2019-08-28 14:17:57 +02:00
Sebastien Deleuze d53cbb6de4 Upgrade to Kotlin 1.3.50
Closes gh-23536
2019-08-28 13:33:50 +02:00
Sebastien Deleuze 77da40f006 Upgrade to Coroutines 1.3.0
Closes gh-23535
2019-08-28 13:30:40 +02:00
Sebastien Deleuze 52976246ac Remove bodyWithType extension from WebFlux
Since there is no more clash with the new bodyValue
method name.

Closes gh-23523
2019-08-28 13:30:16 +02:00
Sebastien Deleuze 14558844bc Add Kotlin code snippets to WebFlux refdoc
See gh-21778
2019-08-28 11:18:43 +02:00
Brian Clozel 5b4ad8bf36 Merge branch '5.1.x' 2019-08-27 22:30:07 +02:00
Rossen Stoyanchev 4e39450dbe Merge branch '5.1.x' 2019-08-27 21:49:51 +03:00
Sam Brannen 46a37b447c Fix copyright dates
See gh-23393
2019-08-27 19:30:05 +02:00
stsypanov 78d56dc61b Use Arrays.copyOf and Arrays.copyOfRange where possible
Closes gh-23393
2019-08-27 19:18:39 +02:00
Sam Brannen 216ffcfe62 Fix copyright dates 2019-08-27 18:28:31 +02:00
Сергей Цыпанов 6ef75d76cd Simplify String concatenation
Closes gh-23470
2019-08-27 18:22:44 +02:00
Sam Brannen aef67ea6bd Polishing 2019-08-27 17:42:00 +02:00
Sam Brannen b2ad16aaa7 Merge branch '5.1.x' 2019-08-27 17:37:25 +02:00
Sam Brannen 1ec9721617 Fix @since tags in ScopedProxyUtils[Tests]
See gh-23514
2019-08-27 16:01:50 +02:00
Sam Brannen 686f30a378 Merge branch '5.1.x' 2019-08-27 15:49:20 +02:00
Sam Brannen f8f3067419 Polishing 2019-08-27 12:27:18 +02:00
Sam Brannen d357ef706f Delete unused imports
See gh-23458
2019-08-27 12:24:44 +02:00
Rossen Stoyanchev 29a58ab045 Remove RSocket metadata MimeType constants
For public use, these constants aren't ideally exposed through an SPI
like MetadataExtractor, and there isn't any other obvious place either.
In practice the only public API where these can be passed in is
RSocketRequester and RSocketMessageHandler both of which already
default to composite metadata anyway, leaving only the routing MimeType
to be used potentially but much less likely.
Due to existence of similar constants in the RSocket itself, i.e.
WellKnownMimeType, we can get by internally too without declaring
MimeType constants from a central place.
2019-08-27 13:04:58 +03:00
Rossen Stoyanchev 45d0405624 Upgrade to RSocket 1.0 RC3 snapshots and...
take advantage of the symmetrical SocketAcceptor methods now available
on RSocketFactory for both client and server side.
2019-08-27 13:04:58 +03:00
lijuny a0d50a546b Polish tests in spring-aop
This commit polishes tests in spring-aop by using
OrderComparator.sort() and lambda expressions instead of anonymous
classes where feasible.

Closes gh-23458
2019-08-27 12:01:30 +02:00
Sam Brannen c6a4898ac5 Add "Participate in Reviews" section 2019-08-26 17:45:01 +02:00
Johnny Lim 6c2ef481ec Add @since tags for getCacheFilter and setCacheFilter
Closes gh-23519
2019-08-26 15:26:32 +02:00
Sam Brannen 4cd635e9c8 Avoid repeated instantiation of AutowiredArgumentMarker
Prior to this commit, the AutowiredArgumentMarker type was repeatedly
instantiated in ConstructorResolver.

This commit replaces the AutowiredArgumentMarker type with a simple
Object instance.

Closes gh-23469
2019-08-25 22:42:41 +02:00
Sam Brannen 5105b74f6e Add missing @Nullable declaration
See gh-23514
2019-08-25 15:15:48 +02:00
Sam Brannen 9be6aa64ef Introduce getOriginalBeanName(String) in ScopedProxyUtils
This commit introduces a utility method for retrieving the original
bean name for the target of a scoped proxy.

Closes gh-23514
2019-08-25 15:13:53 +02:00
Brian Clozel dda047623d Fix "missing aspectjrt.jar" warnings in spring-aspects
See gh-23506
2019-08-23 17:05:31 +02:00
Brian Clozel 84f9c150de Move Gradle plugin repos declaration to settings
See gh-23282
2019-08-23 17:05:31 +02:00
Sam Brannen bfbe84d1c6 Apply fudge factor on both ends of the spectrum in StopWatchTests
This is an attempt to solve a build issue on Microsoft Windows.

See gh-23507
2019-08-23 16:50:27 +02:00
Sam Brannen ac760c8d4b Polish Javadoc for ReflectionTestUtils
Closes gh-23504
2019-08-23 16:38:35 +02:00
Sam Brannen 5ce75f3d08 Support static methods with ReflectionTestUtils.invokeMethod()
Prior to this commit, the invokeMethod() utility method in
ReflectionTestUtils only supported instance methods.

This commit brings the invokeMethod() support on par with the getField()
support by supporting the invocation of static methods via two new
invokeMethod() variants.

Closes gh-23504
2019-08-23 16:27:27 +02:00
Sam Brannen d4360db497 Polish ReflectionTestUtilsTests 2019-08-23 15:03:41 +02:00
Brian Clozel 50decc43ce Fix aspectj dependency in spring-aspects
See gh-23506
2019-08-23 14:47:39 +02:00
Sam Brannen ad6231ad29 Add missing @Override annotations 2019-08-23 13:50:58 +02:00
Sam Brannen 0b63db26b7 Reinstate AbstractBeanFactoryTests.typeMismatch() test 2019-08-23 13:50:57 +02:00
Sam Brannen a07ce8eb82 Polishing 2019-08-23 13:50:57 +02:00
Sam Brannen 3e2b977d5d Re-enable shadowed, overridden @Test and lifecycle methods
Due to a bug (or "unintentional feature") in JUnit 4, overridden test
and lifecycle methods not annotated with @Test, @Before, @After, etc.
are still executed as test methods and lifecycle methods; however,
JUnit Jupiter does not support that. Thus, prior to this commit, some
overridden test and lifecycle methods were no longer executed after the
migration from JUnit 4 to JUnit Jupiter.

This commit addresses this issue for such known use cases, but there
are likely other such use cases within Spring's test suite.

See gh-23451
2019-08-23 13:50:57 +02:00
Sam Brannen 05c270d916 Ensure TransactionalSqlScriptsSpringRuleTests is purely JUnit 4 2019-08-23 13:50:33 +02:00
Sam Brannen 742cb90d34 Delete obsolete abstract test classes 2019-08-23 13:49:35 +02:00
Brian Clozel b96cbb4e65 Close streams in tests
This commit ensures that file streams are properly closed in tests.
This seems to cause issues on Windows as the OS cannot delete temp
folders.

This is similar to spring-io/initializr#862

See gh-23507
2019-08-23 12:56:47 +02:00
Arjen Poutsma 8e4f2c89ff Add headers(Consumer<HttpHeaders>) to RequestEntity and ResponseEntity
Closes gh-23404
2019-08-23 11:23:26 +02:00
Lars Grefer fbee3ed889 Use the 'io.freefair.aspectj' Gradle plugin
See gh-23282
See spring-projects/spring-security#7183
Closes gh-23506
2019-08-23 10:57:10 +02:00
Sebastien Deleuze 0d3fb0ee0f Add Kotlin code snippets to WebMvc refdoc
See gh-21778
2019-08-22 16:58:00 +02:00
Brian Clozel 7cfae94d70 Use resolved dependency versions for published POMs
This commit ensures that Gradle publications are using resolved
dependency versions for Maven publications (i.e. POMs). This is useful
since we're using the Spring dependency management plugin and we can't
rely on declared dependency versions only.

See gh-23282
2019-08-22 16:11:09 +02:00
Rossen Stoyanchev 1d2ebdeb8c More optimal RequestMethod condition lookup
See gh-22644
2019-08-22 13:39:20 +03:00
Brian Clozel 86c734785d Apply Artifactory Gradle plugin
Instead of relying on the CI server to apply and configure this plugin,
this commit does it directly in the Spring Framework build.
This allows us to take full control over which projects are published
and how.

See gh-23282
2019-08-21 20:15:35 +02:00
Brian Clozel 7902ae4c1f Change Gradle publication name for artifactory
This commit switches to the default publication name considered by the
artifactory plugin when it comes to publishing artifacts to the
artifactory repository.

See gh-23282
2019-08-21 18:42:17 +02:00
Sam Brannen 53f523001e Focus examples in Testing chapter on JUnit Jupiter 2019-08-21 15:56:15 +02:00
Sam Brannen 3dc4d01b53 Fix heading for Streaming Responses section of Testing chapter 2019-08-21 15:56:15 +02:00
Brian Clozel 7ce1f5e652 Configure Maven publications with Gradle
Prior to this commit, the build would use a custom task to create a BOM
and manually include/exclude/customize dependencies. It would also use
the "maven" plugin to customize the POM before publication.

This commit now uses a Gradle Java Platform for publishing the Spring
Framework BOM. We're also now using the "maven-publish" plugin to
prepare and customize publications.

This commit also tells the artifactory plugin (which is currently
applied only on the CI) not to publish internal modules.

See gh-23282
2019-08-21 15:39:51 +02:00
Brian Clozel 03701018c6 Cache "spring-doc-resources" archive between builds
This commit configures the Gradle Download plugin that's used a build
step when generating the reference documentation. Here we're making sure
that the task is caching and reusing the resource if it's been
downloaded already.

See gh-23282
2019-08-21 15:38:16 +02:00
Brian Clozel e45a3f4738 Rename non-Framework project modules
Prior to this commit, the Spring Framework build would mix proper
framework modules (spring-* modules published to maven central) and
internal modules such as:
* "spring-framework-bom" (which publishes the Framework BOM with all
modules)
* "spring-core-coroutines" which is an internal modules for Kotlin
compilation only

This commit renames these modules so that they don't start with
"spring-*"; we're also moving the "kotlin-coroutines" module under
"spring-core", since it's merged in the resulting JAR.

See gh-23282
2019-08-21 14:32:25 +02:00
Sam Brannen 6ce5f9da06 Fix unmatched parentheses in @ContextHierarchy example in reference manual
See gh-23487
2019-08-21 14:18:21 +02:00
John Lin 74de495574 Fix unmatched parentheses in @ContextHierarchy Javadoc
Closes gh-23487
2019-08-21 13:53:32 +02:00
Rossen Stoyanchev 274eab7c5d Merge branch '5.1.x' 2019-08-21 13:36:11 +03:00
Rossen Stoyanchev 78abc27432 Remove statusCode state tracking
Closes gh-23490
2019-08-21 11:45:56 +03:00
Rossen Stoyanchev e1158ad5cb Merge pull request #23493 2019-08-21 11:21:36 +03:00
Rossen Stoyanchev aa220a9a02 Polish 2019-08-21 11:20:37 +03:00
Rob Winch ca3a0b19d6 DefaultWebClientBuilder defaults using classpath
Previously DefaultWebClientBuilder always defaulted the ClientHttpConnector
with ReactorClientHttpConnector. This worked fine if reactor was used.
However, it would break if the user was trying to leverage Jetty.

This commit defaults to use Reactory Netty HttpClient if it is present. If
it is not present it then Jetty's HttpClient  is used if present.

Closes gh-23491
2019-08-21 11:04:14 +03:00
Rossen Stoyanchev 0a7fdb380f Fix checkstyle error 2019-08-21 11:02:10 +03:00
Rossen Stoyanchev ff6ccd0d04 Adapt tests changed in 5.1.x to master 2019-08-21 10:24:46 +03:00
Rossen Stoyanchev 364c7c459d Merge branch '5.1.x' 2019-08-21 10:21:32 +03:00
Brian Clozel b3aebf9e9b Download docs resources as zip file in asciidoc build
Prior to this commit, the reference documentation build with asciidoctor
would get the common "spring-docs-resources" as a dependency and then
use it when generating the docs.

As seen in #23124, this can cause problems since we'd like to
consistently resolve our dependencies. In this case, the
"spring-doc-resources" archive is not published on maven central since
it's not officially supported by the Spring team as an open source
project.

This commit updates the reference documentation build to get this
archive as a simple download task and avoid resolving it as a
dependency.

See gh-23282
2019-08-20 23:36:59 +02:00
Sam Brannen 5053df55b6 Add LICENSE.txt file
Closes gh-23492
2019-08-20 22:01:12 +02:00
Brian Clozel 4a3e2484ac Ignore spring-framework-bom project in global config
This commit ensures that the spring-framework-bom project is ignored
from the global configuration block. If not, many conventions and
dependencies are added to it and add noise to the published BOM.

See gh-23282
2019-08-20 20:33:10 +02:00
Brian Clozel e9523161f0 Revert "Revert "Refactor Gradle tasks in Spring Framework build""
This reverts commit fb0d618751.
2019-08-20 20:26:43 +02:00
Stephane Nicoll fb0d618751 Revert "Refactor Gradle tasks in Spring Framework build"
This reverts commit 1539ba8991.
2019-08-20 20:07:11 +02:00
Brian Clozel 1539ba8991 Refactor Gradle tasks in Spring Framework build
This commit reorganizes tasks and scripts in the build to only apply
them where they're needed. We're considering here 3 "types" of projects
in our build:
* the root project, handling documentation, publishing, etc
* framework modules (a project that's published as a spring artifact)
* internal modules, such as the BOM, our coroutines support and our
integration-tests

With this change, we're strealining the project configuration for all
spring modules and only applying plugins when needed (typically our
kotlin support).

See gh-23282
2019-08-20 18:17:02 +02:00
Sam Brannen aa6e762dcf Re-enable shadowed, overridden @Test methods
Due to a bug (or "unintentional feature") in JUnit 4, overridden test
methods not annotated with @Test are still executed as test methods;
however, JUnit Jupiter does not support that. Thus, prior to this
commit, some overridden test methods in spring-core were no longer
executed after the migration from JUnit 4 to JUnit Jupiter.

This commit addresses this issue for such known use cases, but there
are likely other such use cases within Spring's test suite.

See gh-23451
2019-08-20 15:30:32 +02:00
Sam Brannen fab96cad67 Use default visibility for test classes and methods in spring-core
See gh-23451
2019-08-20 15:30:24 +02:00
Sam Brannen cf1bf3d98c Polish parameterized tests 2019-08-20 12:43:31 +02:00
Sam Brannen 617863ae4b Polish WebSocket integration tests 2019-08-20 12:43:31 +02:00
Sam Brannen 91560d51ac Polish AbstractWebSocketIntegrationTests 2019-08-20 12:43:30 +02:00
Rossen Stoyanchev 26dc93d0f6 Polish body methods
WebClient, WebTestClient, and ServerResponse
2019-08-20 10:27:06 +03:00
Rossen Stoyanchev b75674f5e9 Polish method order 2019-08-20 10:27:05 +03:00
Rossen Stoyanchev 008687d5ae Rename body(Object) to bodyValue
The recently added body(Object) variant can be confused easily with
body(Publisher, Class) forgetting to provide the element type and
only running into the IllegalArgumentException at runtime.

See gh-23212
2019-08-20 10:27:05 +03:00
Rossen Stoyanchev 5cfe491602 Polish AbstractWebSocketIntegrationTests 2019-08-20 03:03:58 +03:00
Sam Brannen 4386bf05de Delete obsolete interface 2019-08-19 15:35:02 +02:00
Sam Brannen 74ccfe3533 Polish Spring's internal TestGroup support 2019-08-19 15:21:16 +02:00
Sam Brannen 3fa4d63807 Polish tests in integration-tests 2019-08-19 14:37:27 +02:00
Brian Clozel 998f6af290 Move integration tests to dedicated module
This commit moves the dependency management and test source files
related to integration tests to a dedicated module.
This allows us to focus the root project on building the Spring
Framework.

See gh-23282
2019-08-19 10:55:44 +02:00
Brian Clozel 6008c61680 Use JApiCmp Gradle plugin for API diffs
This commit removes JDiff from the Spring Framework build and instead,
adds a Gradle plugin that configure JApiCmp tasks on the framework
modules.

Fixes gh-22942
See gh-23282
2019-08-19 10:21:55 +02:00
Sebastien Deleuze 4d10249b70 Update to Coroutine 1.3.0-RC2
This updates brings full interoperability between Reactor and
Coroutines contexts.

Closes gh-22986
2019-08-19 10:03:01 +02:00
Sam Brannen 19ed439e4b Avoid Hamcrest 2.x deprecation warnings
See gh-23467
2019-08-18 09:30:50 +02:00
Stephane Nicoll dce8036757 Merge pull request #23480 from boojongmin
* pr/23480:
  Fix typo

Closes gh-23480
2019-08-18 08:10:18 +02:00
부종민 18eed79d73 Fix typo
See gh-23480
2019-08-18 08:09:56 +02:00
Sam Brannen 063233afb5 Upgrade to Gradle 5.6
Closes gh-23479
2019-08-17 19:20:36 +02:00
Sam Brannen ceaf6f46ac Remove test dependencies from spring-build-src
The spring-build-src module does not contain any tests. Thus, we do not
need any test dependencies.
2019-08-17 18:56:11 +02:00
Sam Brannen 303fc3211c Upgrade to Hamcrest 2.1
Closes gh-23467
2019-08-17 18:44:54 +02:00
Phillip Webb f8a93ee4a7 Add SpringJUnit5 checkstyle rule
Add `SpringJUnit5` checkstyle rule to ensure that JUnit 4 annotations
aren't accidentally used in new tests.

The "must not be public" rule has been suppressed since there are
quite a few tests that extend base tests from other packages.
2019-08-17 08:31:23 -07:00
Phillip Webb 0db2f8fbcf Upgrade to spring-javaformat-checkstyle v0.0.15 2019-08-17 07:27:22 -07:00
Andrey Kolchanov 6937d95e69 Remove unnecessary semicolon in AnnotatedElementUtils
Closes gh-23477
2019-08-17 15:07:39 +02:00
Sam Brannen 31cde12540 Fix off-by-one error in AbstractWebSocketIntegrationTests.arguments()
Prior to this commit, the "reactive matrix" contained a duplicate
argument set per parameterized client.
2019-08-17 14:47:25 +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 bbe33832cf Clean up warnings in Javadoc 2019-08-17 13:21:28 +02:00
Sam Brannen 504d2a41f1 Polish ScheduledAndTransactionalAnnotationIntegrationTests 2019-08-17 13:12:17 +02:00
Sam Brannen 163b97f1ff Polish MockMvcWebClientBuilderTests
Inspired by the fact that example.com is currently not reachable from
my network.
2019-08-17 12:36:45 +02:00
Sam Brannen 3877087f5a Migrate test suite from JUnit 4 to JUnit Jupiter
Closes gh-23451
2019-08-17 12:07:17 +02:00
Sam Brannen 5c1f93d9a6 Migrate spring-test test suite from JUnit 4 to JUnit Jupiter
This commit migrates the spring-test test suite from JUnit 4 to JUnit
Jupiter where applicable.

Tests specific to our JUnit 4 and TestNG support remain written using
those frameworks. In addition, some tests are still written in JUnit 4
if they extend a test class that should not be migrated to JUnit
Jupiter.

See gh-23451
2019-08-17 11:37:33 +02:00
Sam Brannen 979508a7f3 Remove JUnit 4 dependency from all modules except spring-test
This commit removes the JUnit 4 dependency from all modules except
spring-test which provides explicit JUnit 4 support.

This commit also includes the following.

- migration from JUnit 4 assertions to JUnit Jupiter assertions in all
  Kotlin tests
- migration from JUnit 4 assumptions in Spring's TestGroup support to
  JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
- introduction of a new TestGroups utility class than can be used from
  existing JUnit 4 tests in the spring-test module in order to perform
  assumptions using JUnit 4's Assume class

See gh-23451
2019-08-17 11:37:21 +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
Sam Brannen 3df85c783f Migrate parameterized tests in spring-core
This commit migrates parameterized tests in spring-core using the
"composed @ParameterizedTest" approach. This approach is reused in
follow-up commits for the migration of the remaining modules.

For a concrete example, see AbstractDataBufferAllocatingTests and its
subclasses (e.g., DataBufferTests).

Specifically, AbstractDataBufferAllocatingTests declares a custom
@ParameterizedDataBufferAllocatingTest annotation that is
meta-annotated with @ParameterizedTest and
@MethodSource("org.springframework.core.io.buffer.AbstractDataBufferAllocatingTests#dataBufferFactories()").

Individual methods in concrete subclasses are then annotated with
@ParameterizedDataBufferAllocatingTest instead of @ParameterizedTest or
@Test.

The approach makes the migration from JUnit 4 to JUnit Jupiter rather
straightforward; however, there is one major downside. The arguments
for a @ParameterizedTest test method can only be accessed by the test
method itself. It is not possible to access them in an @BeforeEach
method (see https://github.com/junit-team/junit5/issues/944).
Consequently, we are forced to declare the parameters in each such
method and delegate to a custom "setup" method. Although this is a bit
cumbersome, I feel it is currently the best way to achieve fine grained
parameterized tests within our test suite without implementing a custom
TestTemplateInvocationContextProvider for each specific use case.

Once https://github.com/junit-team/junit5/issues/878 is resolved, we
should consider migrating to parameterized test classes.

See gh-23451
2019-08-17 11:36:47 +02:00
Sam Brannen 32cc32f9a7 Migrate test suite from JUnit 4 to JUnit Jupiter
This first commit for this issue:

- allows JUnit Jupiter to be used for all tests
- adds a dependency on mockito-junit-jupiter
- migrates tests in spring-core to JUnit Jupiter, except parameterized
  tests

The following script was developed in order to semi-automate the
migration process.

https://github.com/sbrannen/junit-converters/blob/master/junit4ToJUnitJupiter.zsh

See gh-23451
2019-08-17 11:36:25 +02:00
Brian Clozel bb8fd1c6bd Fix javax.jms Gradle configuration in spring-jms
See gh-23282
2019-08-16 16:30:45 +02:00
Brian Clozel b4c0537fa5 Remove unused Gradle configuration
This commit removes unused parts of the Gradle build:
* Gradle wrapper customization which should not be needed in recent
versions of Gradle (or can be replaced with options in the
gradle.properties file)
* the branch strategy configuration

See gh-23282
2019-08-16 08:27:23 +02:00
Brian Clozel 2f61c89f09 Polish Gradle compile convention
See gh-23282
2019-08-16 08:25:52 +02:00
Brian Clozel 71ddb861bd Move compile config to a Gradle convention
This commit moves the compile configuration from the Gradle DSL to a
convention. This configuration is not changing often, and we're using
that opportunity to make the Java source compatibility a project
property so as to easily recent JDKs this on the command line.

See gh-23282
2019-08-15 13:31:06 +02:00
Sebastien Deleuze 76645644b1 Polishing
See gh-21778
2019-08-14 10:06:04 +02:00
Sebastien Deleuze db02d38c89 Restore annotated code samples
See gh-21778
2019-08-14 10:00:16 +02:00
Sebastien Deleuze ec740559ed Store refdoc preferred language
See gh-21778
2019-08-14 10:00:16 +02:00
Juergen Hoeller 9bd3a535cd Avoid UndeclaredThrowableStrategy with 1.8 bytecode level (CGLIB 3.3)
ClassLoaderAwareUndeclaredThrowableStrategy fails with a VerifyError on recent JDKs after the CGLIB 3.3 upgrade. The alternative is to replace it with a plain ClassLoaderAwareGeneratorStrategy (extracted from CglibSubclassingInstantiationStrategy) and custom UndeclaredThrowableException handling in CglibMethodInvocation.

See gh-23453
2019-08-14 00:14:14 +02:00
Brian Clozel 561af5f8f9 Replace propdeps plugin with custom plugin
Prior to this commit, the Spring Framework build would be using the
propdeps Gradle plugin to introduce two new configurations to the build:
"optional" and "provided". This would also configure related conventions
for IDEs, adding those configurations to published POMs.

This commit removes the need for this plugin and creates instead a
custom plugin for an "optional" configuration. While the Eclipse IDE
support is still supported, there is no need for specific conventions
for IntelliJ IDEA anymore.
This new plugin does not introduce the "provided" scope, as
"compileOnly" and "testCompileOnly" are here for that.

Also as of this commit, optional/provided dependencies are not published
with the Spring Framework modules POMs annymore.
Generally, these dependencies do not provide actionable information to
the developers reading / tools consuming the published POMs.

Optional/Provided dependencies are **not**:
* dependencies you can add to enable some supported feature
* dependencies versions that you can use to figure out CVEs or bugs
* dependencies that might be missing in existing Spring applications

In the context of Spring Framework, optional dependencies are just
libraries are Spring is compiling against for various technical reasons.
With that in mind, we are not publishing that information anymore.

See gh-23282
2019-08-13 18:19:37 +02:00
Sebastien Deleuze eff9cae314 Add global language switch capabilities to the refdoc
See gh-21778
2019-08-13 16:29:47 +02:00
Sebastien Deleuze 32a942fda9 Polishing 2019-08-13 16:29:47 +02:00
Sebastien Deleuze a2b8ea5173 Remove the black border from code samples
See gh-21778
2019-08-13 16:29:47 +02:00
Brian Clozel 4e5c780b99 Move TestSourcesPlugin to a Java Gradle plugin
This commit moves the existing "test sources" Gradle plugin from Groovy
to Java and updates the "buildSrc" build file to prepare for additional
plugins in the Spring Framework build.

The plugin itself looks, for a given Spring Framework module, at all the
project dependencies for the following scopes: "compile", "testCompile",
"api", "implementation" and "optional" (to be supported by a different
plugin).

See gh-23282
2019-08-13 16:23:59 +02:00
Sam Brannen e7e5cce735 Polish contribution
See gh-23457
2019-08-13 10:36:46 +02:00
Sauhard Sharma 91c0fbaadb Use valid example in Javadoc for @EnableWebFlux
This commit modifies the class-level Javadoc for the @EnableWebFlux
annotation to reference an actual method in WebFluxConfigurer.

Closes gh-23457
2019-08-13 10:27:29 +02:00
Lars Grefer c863b8994a Improve language-switch CSS
Closes gh-23454
2019-08-13 09:42:08 +02:00
Sebastien Deleuze b52a50a7e0 Use Kotlin extensions for ClassPathXmlApplicationContext refdoc
Closes gh-23456
2019-08-13 09:42:08 +02:00
Juergen Hoeller 4123910d3d Upgrade to CGLIB 3.3
Closes gh-23453
2019-08-12 19:36:06 +02:00
Sebastien Deleuze f3c7879831 Add missing css file
See gh-21778
2019-08-12 16:23:49 +02:00
Sebastien Deleuze 96658235c8 Add Kotlin code snippets to core refdoc
This commit introduces Kotlin code snippets, for now
in the core reference documentation. Other sections
will follow, as well as improvements like global
language switch.

See gh-21778
2019-08-12 15:45:18 +02:00
Sam Brannen fcbca7d569 Remove obsolete references to JUnit 4's ArrayComparisonFailure
See gh-23451
2019-08-12 12:45:14 +02:00
Michał Rowicki ee47bc3a25 Fix typo in data access reference documentation
Closes gh-23450
2019-08-12 11:21:54 +02:00
Sam Brannen 7538561a7a Polish ApplicationContextAwareProcessor
Due to recent changes, the (bean instanceof Aware) check is now
superfluous.
2019-08-10 14:24:10 +02:00
Sam Brannen 6c0e550b86 Polish contribution
See gh-23445
2019-08-10 14:07:15 +02:00
zhuzhuman978 849bbf00b5 Simplify if statements and replace try-finally with try-with-resources
Closes gh-23445
2019-08-10 14:03:18 +02:00
Sam Brannen fabdb07e53 Redeclare default methods in AbstractTestExecutionListener
This commit redeclares default methods in AbstractTestExecutionListener
in order to make them inlinable.
2019-08-09 16:39:35 +02:00
Sam Brannen 8b023b17c9 Polish contribution
See gh-23435
2019-08-09 15:04:07 +02:00
GungnirLaevatain 1dc2177a4a Avoid unnecessary processing in ApplicationContextAwareProcessor
This commit avoids unnecessary processing in the implementation of
postProcessBeforeInitialization() in ApplicationContextAwareProcessor
by immediately returning the supplied bean if it does not meet the
requirements for further processing.

Closes gh-23435
2019-08-09 14:54:05 +02:00
Sam Brannen 1925526df5 Improve reference documentation for ContextClosedEvent
Closes gh-23436
2019-08-09 13:58:31 +02:00
Daniel Le 60ec736264 Fix */* in Javadoc
This commit changes {@code &#42;&#47;&#42;} to <code>&#42;&#47;&#42;</code>
so that "*/*" is rendered correctly.

Closes gh-23439
2019-08-09 13:32:18 +02:00
Sam Brannen 0cdf992433 Fix grammar in Integration chapter regarding MDPs 2019-08-09 13:14:46 +02:00
Sam Brannen e4fec9364c Improve reference documentation for @Autowired's required attribute
Prior to this commit, the corresponding documentation was misleading.

Closes gh-23428
2019-08-09 11:37:46 +02:00
Sam Brannen 56c1e8ffd2 Polishing 2019-08-09 11:08:30 +02:00
Stephane Nicoll 977451064a Merge branch '5.1.x' 2019-08-09 09:37:36 +02:00
Sam Brannen a532afb15d Use System.nanoTime() in StopWatch
Prior to this commit, StopWatch used System.currentTimeMillis() to
track and report running time in milliseconds.

This commit updates the internals of StopWatch to use System.nanoTime()
instead of System.currentTimeMillis(). Consequently, running time is
now tracked and reported in nanoseconds; however, users still have the
option to retrieve running time in milliseconds or seconds.

Closes gh-23235
2019-08-07 17:39:42 +02:00
Sam Brannen 50e5334378 Simplify assertions within MockMvc internals 2019-08-07 17:32:19 +02:00
Sam Brannen d32cb7dac3 Avoid use of GenericTypeResolver.resolveParameterType() in tests
This commit avoids the use of the deprecated
GenericTypeResolver.resolveParameterType() method in tests in order to
avoid warnings in the Gradle build.
2019-08-07 14:23:15 +02:00
Sam Brannen 24f8d30935 Remove deprecated MergedAnnotations.SearchStrategy.EXHAUSTIVE constant
Closes gh-23391
2019-08-07 12:34:17 +02:00
Sam Brannen a43ba052e9 Remove unnecessary loop in SerializableTypeWrapper
Since arbitrary levels of proxies do not occur, this commit replaces
the `while` loop in SerializableTypeWrapper.unwrap() with a simple
`if` statement.

Closes gh-23415
2019-08-07 12:24:48 +02:00
Sam Brannen 83956f8e8b Overhaul StopWatchTests 2019-08-07 12:13:18 +02:00
Sam Brannen 03dd45fbd6 Use AssertJ in AnnotationAttributesTests 2019-08-06 18:18:16 +02:00
Sam Brannen 34767b14da Merge branch '5.1.x' 2019-08-06 18:11:47 +02:00
Sebastien Deleuze 23cd261b6b Deprecate AnnotationConfigApplicationContext { } Kotlin extension
Closes gh-23420
2019-08-06 11:28:32 +02:00
Sam Brannen 4d6e359e25 Add missing @deprecated tags for ASM-based annotation search classes 2019-08-05 15:30:06 +02:00
Sam Brannen 82f301f42f Polishing 2019-08-05 15:29:04 +02:00
Sam Brannen e6ab6c9fe9 Add missing @deprecated tag for AnnotationMetadataReadingVisitor 2019-08-05 14:39:20 +02:00
Sam Brannen c2f5dabeee Polishing 2019-08-03 00:13:30 +02:00
Rossen Stoyanchev 63bf1bff23 Merge branch '5.1.x' 2019-08-02 16:33:02 +01:00
康智冬 5bb5b2b24d Fix grammar in package-info.java
Closes gh-23401
2019-08-02 13:40:25 +02:00
Stephane Nicoll d7a6ee5962 Merge branch '5.1.x' 2019-08-02 11:21:57 +02:00
Juergen Hoeller 53d067399d Merge branch '5.1.x' 2019-08-02 01:46:26 +02:00
Sam Brannen 9be327985b Polishing 2019-08-01 23:15:40 +02:00
Sam Brannen ee2041388b Fix typo in Javadoc for MergedAnnotations 2019-08-01 23:15:39 +02:00
Juergen Hoeller 7ac665b18e Polishing 2019-08-01 22:42:33 +02:00
Rossen Stoyanchev 765d43b34f Upgrade rsocket-core to 1.0.0-RC2
Closes gh-23359
2019-08-01 20:15:16 +01:00
Juergen Hoeller 9929d75260 Adapt to Spring Framework convention for static cache field names
See gh-23345
2019-08-01 18:55:17 +02:00
Sam Brannen 5e61e33c66 Introduce SpringTestContextFrameworkTestSuite as a convenience in IDE 2019-08-01 18:49:55 +02:00
Mark Paluch 1890e04df1 Introduce interface cache for EntityManager and Query types
We now reuse interfaces for EntityManager and Query classes that
are proxied through ExtendedEntityManagerCreator and SharedEntityManagerCreator.

These caches prevent excessive object allocations through
ClassUtils.getAllInterfacesForClass(…) and
ClassUtils.getAllInterfacesForClassAsSet(…).
2019-08-01 18:48:09 +02:00
Juergen Hoeller 96ea3a8924 Upgrade to Hibernate ORM 5.4.4 2019-08-01 16:23:21 +02:00
Juergen Hoeller fd86f34057 Merge branch '5.1.x' 2019-08-01 15:27:06 +02:00
Juergen Hoeller 49593f5399 Revise DependencyDescriptor etc to avoid MethodParameter deprecations
See gh-23385
2019-08-01 14:25:33 +02:00
Juergen Hoeller b67dbe66ef Revise use of ResolvableType in MethodParameter
Includes consistent use of getContainingClass()
2019-08-01 14:25:26 +02:00
Arjen Poutsma 8b1a2a70e1 Merge pull request #22606 from fred84/22391_conditional_view_caching
* 22391_conditional_view_caching:
  Polish contribution
  Add filter to AbstractCachingViewResolver
2019-08-01 13:54:00 +02:00
Arjen Poutsma 132fa702b7 Polish contribution
See gh-22606
2019-08-01 13:37:14 +02:00
Sergey Galkin 59aee923e4 Add filter to AbstractCachingViewResolver
This commit introduces a filter that specifies whether a View should be
cached by the AbstractCachingViewResolver or not.

Closes gh-22391
2019-08-01 13:37:14 +02:00
Juergen Hoeller 4612544505 Nullability refinements and related polishing 2019-08-01 13:04:46 +02:00
Stephane Nicoll 223074295d Merge pull request #23394 from ijliym
* pr/23394:
  Polish getTypeForFactoryBean comment

Closes gh-23394
2019-08-01 10:17:27 +02:00
liym@com fde651a606 Polish getTypeForFactoryBean comment
See gh-23394
2019-08-01 10:17:11 +02:00
Phillip Webb 1e830f725c Polish firstRunOf javadoc 2019-08-01 08:29:02 +01:00
Phillip Webb 62a3e41473 Deprecate mutable methods of MethodParameter
Deprecate all mutation methods in `MethodParameter` in favor of factory
methods that return a new instance. Existing code that previously relied
on mutation has been updated to use the replacement methods.

Closes gh-23385
2019-08-01 08:05:14 +01:00
Phillip Webb 89d150d398 Resolve factoryBeanClass if necessary
Update `AbstractAutowireCapableBeanFactory.getTypeForFactoryBean` to
use fallback to `determineTargetType` if the factory bean definition
does not have a resolved class.

This is required for the case where a `@Configuration` class is picked
up via component scanning and has a bean type that has not yet been
resolved.

Closes gh-23338
2019-08-01 07:48:12 +01:00
Juergen Hoeller 6eca9e7cc9 Drop logger field in HandlerMethodArgumentResolverComposite 2019-07-31 23:58:02 +02:00
Juergen Hoeller dea9ad6cb2 Merge branch '5.1.x' 2019-07-31 23:53:32 +02:00
Sam Brannen de3c115614 Fix bug in TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Prior to this commit, the new `TYPE_HIERARCHY_AND_ENCLOSING_CLASSES`
annotation search strategy failed to find annotations on enclosing
classes if the source class was a nested class that itself had no
annotations present.

This commit fixes this by adding special logic to AnnotationsScanner's
isWithoutHierarchy() method to properly support nested classes.

Closes gh-23378
2019-07-31 22:05:46 +02:00
Sam Brannen b03dd47598 Remove duplicate assertion 2019-07-31 22:01:18 +02:00
Phillip Webb 17518ecbbe Add TYPE_HIERARCHY_AND_ENCLOSING_CLASSES strategy
Add a `TYPE_HIERARCHY_AND_ENCLOSING_CLASSES` annotation search strategy
that can be used to search the full type hierarchy as well as any
enclosing classes.

Closes gh-23378
2019-07-31 14:40:40 +01:00
Phillip Webb a6021cc968 Rename SearchStrategy.EXHAUSTIVE to TYPE_HIERARCHY
Rename `SearchStrategy.EXHAUSTIVE` from `MergedAnnotations` to
`SearchStrategy.TYPE_HIERARCHY`

See gh-23378
2019-07-31 13:52:53 +01:00
Juergen Hoeller e6f86c5c75 Nullability refinements and related polishing 2019-07-31 13:45:48 +02:00
Phillip Webb cca32a56a4 Use shared zero length array constants
Update code that's often called so that zero length array results use
a single shared static constant, rather than a new instance for each
call.

Closes gh-23340
2019-07-31 12:22:03 +02:00
Phillip Webb 71a5308c78 Support FactoryBean bean definition attributes
Update `getTypeForFactoryBean` detection so that a bean definition
attribute can be used to supply the result. This commit allows projects
such as Spring Data to provide the result that would be supplied by
`getObjectType` early so that we don't need to initialize the
`FactoryBean` unnecessarily.

Closes gh-23338
2019-07-31 12:22:03 +02:00
Phillip Webb a0e462581f Consider generics for predicting FactoryBean types
Update the `FactoryBean` type prediction logic (primarily in the
`DefaultListableBeanFactory`) so that generic type information is
considered when calling `getBeanNamesForType` on a non-frozen
configuration.

Calling `getBeanNamesForType` with `allowEagerInit` disabled will now
detect `FactoryBean` variants as long as generic type information is
available in either the class or the factory method return type.

Closes gh-23338
2019-07-31 12:22:03 +02:00
Phillip Webb 527876d9a0 Cache AbstractBeanFactory.isFactoryBean results
Add an additional cache to the `RootBeanDefinition` to save
recalculating the result of `isFactoryBean`.

Closes gh-23337
2019-07-31 12:22:03 +02:00
Phillip Webb 95edcb81b5 Retain merged bean definition caches when possible
Update the logic in `AbstractBeanFactory` so that caches from merged
bean definitions remain whenever possible.

Prior to this commit, all merged bean definitions would be completely
removed after bean post processing in case a processor changed the bean
type. It's fairly unlikely these days that the bean type will actually
change, so instead we now compare a subset of the old cached properties
against the newly created definition. Only if key properties have
changed do we now discard the older cached values.

Closes gh-23336
2019-07-31 12:22:03 +02:00
Phillip Webb 2ee1ce61c0 Add missing variants of getBeanNamesForType
Update `ListableBeanFactory` and `BeanFactoryUtils` to add the missing
`getBeanNamesForType` methods that accept a `ResolvableType` rather
than a `Class`.

This completes the work started in 778a01943b.

Closes gh-23335
2019-07-31 12:22:03 +02:00
Juergen Hoeller 30132b42c6 Consistent assertion messages in DefaultWebClient 2019-07-30 22:53:27 +02:00
Juergen Hoeller 3b235a098f Merge branch '5.1.x' 2019-07-30 22:52:20 +02:00
Arjen Poutsma ac9a11a581 Merge branch '5.1.x' 2019-07-30 18:03:01 +02:00
Juergen Hoeller 27aaad5a89 Add isTooEarly() method to StatusResultMatchers
See gh-23384
2019-07-30 17:37:26 +02:00
Juergen Hoeller 4f3b89e907 Adapt MethodParameterTests to AssertJ usage on master
See gh-23352
2019-07-30 17:36:02 +02:00
Juergen Hoeller 8ef557df2f Merge branch '5.1.x' 2019-07-30 17:34:29 +02:00
Rossen Stoyanchev 5e15bbfbf1 Change order of argument for createPayload
Expecting data first and metadata second aligns better with the single
arg variant that accepts data. This is also consistent with the
RSocket API in the create methods of ByteBufPayload and DefaultPayload.
2019-07-30 16:16:30 +01:00
Rossen Stoyanchev a1a8781279 PayloadUtils improvements and tests 2019-07-30 16:16:30 +01:00
Juergen Hoeller 22e87ac143 Polishing 2019-07-30 16:05:18 +02:00
Juergen Hoeller cc57506474 Add status code 425 ("Too Early") to HttpStatus enum
Closes gh-23384
2019-07-30 16:05:00 +02:00
Arjen Poutsma 571f6adb35 Merge branch '5.1.x' 2019-07-30 15:46:27 +02:00
Rossen Stoyanchev 9648b1c2c6 Merge branch '5.1.x' 2019-07-30 12:06:39 +01:00
Rossen Stoyanchev d972911d51 Merge branch '5.1.x' 2019-07-30 11:02:33 +01:00
Stephane Nicoll ee03a18e61 Merge branch '5.1.x' 2019-07-30 10:55:12 +02:00
Stephane Nicoll 5c860afa55 Upgrade to Reactor Dysprosium-M3 2019-07-30 09:54:20 +02:00
Stephane Nicoll c9340ecabc Merge branch '5.1.x' 2019-07-30 09:52:19 +02:00
Stephane Nicoll 535bb16c28 Merge pull request #23382 from izeye
* pr/23382:
  Remove duplicate assertion in matchWithNullPath()

Closes gh-23382
2019-07-30 09:38:04 +02:00
Johnny Lim bccc7a62f4 Remove duplicate assertion in matchWithNullPath()
See gh-23382
2019-07-30 09:37:50 +02:00
Rossen Stoyanchev 2c878e9331 Support for setupPayload in RSocketRequester
Closes gh-23368
2019-07-29 22:09:06 +01:00
Rossen Stoyanchev 55946bf319 Factor out MetadataEncoder from RSocketRequester
To be re-used also for creating metadata for the setup payload.

See: gh-23368
2019-07-29 22:09:06 +01:00
Rossen Stoyanchev c76370d7d8 Polish 2019-07-29 22:09:02 +01:00
Rossen Stoyanchev dc0c730ee8 DefaultMetadataExtractor refactoring 2019-07-29 22:08:26 +01:00
Rossen Stoyanchev 2aa3363ba2 ClientRSocketFactoryConfigurer refactoring 2019-07-29 22:08:07 +01:00
Sam Brannen 027fd78306 Further refine @TestPropertySource merged annotation calls
See gh-23320
2019-07-29 22:53:15 +02:00
Phillip Webb c9479ff20f Refine @TestPropertySource merged annotation calls
See gh-23320
2019-07-29 22:53:00 +02:00
Sam Brannen 1f8abef2ce Upgrade to AssertJ 3.13.1 2019-07-29 14:22:40 +02:00
Sam Brannen 0ac1a3754e Upgrade to AssertJ 3.13.0 2019-07-29 10:10:12 +02:00
Sam Brannen c72bf10eb9 Polish MergedSqlConfig 2019-07-28 18:41:26 +02:00
Sam Brannen f53cdb8bd2 Introduce common SimpleUrlHandlerMapping constructors
Prior to this commit, the SimpleUrlHandlerMapping classes in Spring MVC
and Spring Webflux only had default constructors. This lead to the fact
that users often had to explicitly invoke setUrlMap() and setOrder() on
the newly instantiated SimpleUrlHandlerMapping.

In order to simplify the programmatic setup of a SimpleUrlHandlerMapping
in common scenarios, this commit introduces the following constructors.

- SimpleUrlHandlerMapping()
- SimpleUrlHandlerMapping(Map<String, ?> urlMap)
- SimpleUrlHandlerMapping(Map<String, ?> urlMap, int order)

Closes gh-23362
2019-07-28 17:59:19 +02:00
Sam Brannen 0a822ddf2d Fix typo in reference manual 2019-07-28 16:36:12 +02:00
Sam Brannen bfbe8f8780 Polish MergedTestPropertySources 2019-07-28 15:40:39 +02:00
Sam Brannen a37eaf75c4 Verify meta @TestPropertySource overrides meta-meta declaration
This commit introduces tests which verify that properties configured via
@TestPropertySource used as a meta-annotation override those configured
via @TestPropertySource used as a meta-meta-annotation.

See gh-23320
2019-07-28 12:35:57 +02:00
Sam Brannen 1954861844 Update @TestPropertySource Javadoc regarding "local" semantics
See gh-23320
2019-07-28 12:12:28 +02:00
Sam Brannen 690694df33 Merge branch 'sbrannen/issues/gh-23320-repeatable-TestPropertySource' 2019-07-27 23:08:50 +02:00
Sam Brannen 1075bae280 Document repeatable @TestPropertySource support in reference manual
See gh-23320
2019-07-27 23:02:43 +02:00
Sam Brannen 136af0b164 Overhaul repeatable @TestPropertySource support
Prior to this commit, if multiple, directly present
`@TestPropertySource` annotations declared the same property, the
precedence ordering was top-down instead of bottom-up, in contrast to
the semantics for class hierarchies. In other words, a subsequent
`@TestPropertySource` annotation could not override a property in a
previous `@TestPropertySource` annotation.

This commit overhauls the internals of `TestPropertySourceUtils` in
order to provide proper support for property overrides within local,
directly present `@TestPropertySource` declarations.

Specifically, the `locations` and `properties` attributes from all
`@TestPropertySource` declarations that are directly present or
meta-present on a given class are now merged into a single instance of
`TestPropertySourceAttributes` internally, with assertions in place to
ensure that such "same level" `@TestPropertySource` declarations do not
configure different values for the `inheritLocations` and
`inheritProperties` flags. Effectively, all "same level"
`@TestPropertySource` declarations are treated internally as if there
were only one such annotation declared by the user.

See gh-23320
2019-07-27 22:30:34 +02:00
Anatoliy Korovin 2e476ca14f Support @TestPropertySource as a repeatable annotation
Prior to this commit, @TestPropertySource could not be declared as a
repeatable annotation. In addition, a local declaration of
@TestPropertySource would silently override a meta-present
@TestPropertySource.

This commit addresses this issue by introducing @TestPropertySources as
a container for @TestPropertySource. This commit also updates the
search and algorithms within TestPropertySourceUtils.

Closes gh-23320
2019-07-27 22:27:30 +02:00
Rossen Stoyanchev 8574f977a2 Mutate RSocketStrategies in RSocketMessageHandler
Use rsocketStrategies field with mutate() to ensure consistency
with internal state.

Remove transparent initialization of decoders in MetadataExtractor
and expect them to be set to avoid unintended side effects.
2019-07-26 16:12:02 +01:00
Rossen Stoyanchev fab0a5d504 MetadataExtractor refactoring
Remove RSocketStrategies argument from the contract to avoid having to
pass them every time especially by application components, like an
implementation of a Spring Security matcher.

Decouple DefaultMetadataExtractor from RSocketStrategies in favor of
a decoders property and an internal DataBufferFactory, which does not
need to be the shared one as we're only wrapping ByteBufs.
2019-07-26 16:12:02 +01:00
Johnny Lim 7c45381600 Add since tag for ClientResponse.Builder.request()
Closes gh-23364
2019-07-26 11:07:48 +02:00
Rossen Stoyanchev 1676b981e2 Upgrade to Reactor Dysprosium snapshots
Run with snapshots in preparation for next week's releases.
2019-07-25 16:40:02 +01:00
Sam Brannen 9655fc5007 Introduce ServerHttpRequest.Builder.header() variant for setting headers
Prior to this commit, the `header(String, String)` method in the
ServerHttpRequest.Builder API actually added a header value instead of
setting or overriding a header value. Since this conflicted with the
stated behavior in the Javadoc as well as the original intention of the
method, we have decided to introduce an overloaded variant
`header(String, String...)` which accepts a var-args list of header
values to set or override.

In addition, this commit deprecates the existing `header(String, String)`
method for removal in Spring Framework 5.2.

In order not to be a breaking change for custom implementations of the
builder API, this commit implements the new `header(String, String...)`
method as an interface `default` method, with the intent to remove the
default implementation in Spring Framework 5.2

closes gh-23333
2019-07-25 13:45:39 +02:00
Sam Brannen db3990d031 Merge branch '5.1.x' 2019-07-25 13:44:31 +02:00
Stephane Nicoll f95372d757 Merge branch '5.1.x' 2019-07-25 08:39:31 +02:00
Rossen Stoyanchev be4facef1b Relax check on default data MimeType
If there is more than one non-basic codec (e.g. CBOR and JSON)
RSocketRequester.Builder takes the mime type of the first one rather
than giving up. It is a valid scenario (JSON for server responding to
browser, and CBOR for client talking to server) and it is the default
situation in Boot, and after all the point here is to pick some default
as best as we can with the worst possible outcome being a server
refusing the connection if it doesn't support the mime type. Beyond
that applications can set the dataMimeType on the builder explicitly.

To match that change this commit also ensures RSocketMessageHandler
rejects proactively data mime types it does not support at the point
of accepting a connection.
2019-07-24 18:44:04 +01:00
Rossen Stoyanchev 88016d47d0 Fix issues in RSocketMessageHandler initialization
This commit ensures getRSocketStrategies() now reflects the state of
corresponding RSocketMessageHandler properties even if those change
after a call to setRSocketStrategies.

RSocketMessageHandler has default Encoder/Decoder initializations
consistent with the recent changes to RSocketStrategies.
2019-07-24 17:39:31 +01:00
Rossen Stoyanchev 2bb510588d Merge branch 'rs' 2019-07-24 11:18:15 +01:00
Rossen Stoyanchev e19e36ae4c Simplify RSocket client responder config
Now that responder RSocketStrategies also exposes responder strategies,
AnnotationClientResponderConfigurer is reduced and no longer needs to
be public. This commit folds it into RSocketMessageHandler as a nested
class and exposes it as a ClientRSocketFactoryConfigurer through a
static method that accepts the handlers to use.

Effectively a shortcut for creating RSocketMessageHandler, giving it
RSocketStrategies, calling afterPropertiesSet, and then the instance
createResponder.

See gh-23314
2019-07-24 11:17:56 +01:00
Rossen Stoyanchev c456950bc3 Add create shortcut to RSocketStrategies
Now that RSocketStrategies has default settings it makes sense to have
a create() shortcut vs builder().build().

This commit also updates tests to take advantage of improvements in this
and the previous two commits.

See gh-23314
2019-07-24 11:16:27 +01:00
Rossen Stoyanchev 91b040d0bf Add responder strategies to RSocketStrategies
RouteMatcher and MetadataExtractor can now be configured on and
accessed through RSocketStrategies. This simplifies configuration for
client and server responders.

See gh-23314
2019-07-24 11:16:27 +01:00
Rossen Stoyanchev a780cad12e Updates to RSocket[Strategies|Requester] defaults
1. RSocketStrategies hooks in the basic codecs from spring-core by
default. Now that we have support for composite metadata, it makes
sense to have multiple codecs available.

2. RSocketStrategies is pre-configured with NettyDataBufferFactory.

3. DefaultRSocketRequesterBuilder configures RSocket with a frame
decoder that matches the DataBufferFactory choice, i.e. ensuring
consistency of zero copy vs default (copy) choice.

4. DefaultRSocketRequesterBuilder now tries to find a single non-basic
decoder to select a default data MimeType (e.g. CBOR), or otherwise
fall back on the first default decoder (e.g. String).

See gh-23314
2019-07-24 11:16:27 +01:00
Sam Brannen c3c152f806 Add multi-prefix comment support for @SqlConfig
gh-23289 introduced support for multiple single-line comment prefixes
for ScriptUtils, ResourceDatabasePopulator, and EmbeddedDatabaseBuilder.

This commit adds the same support for @SqlConfig in the TestContext
Framework. Specifically, @SqlConfig has a new `commentPrefixes`
attribute for setting multiple single-line comment prefixes.

Closes gh-23331
2019-07-24 12:01:14 +02:00
Sam Brannen a3c7ae2c58 Polish contribution
See gh-23300
2019-07-24 10:13:29 +02:00
stsypanov 1d6e44ab04 Use StringJoiner where possible to simplify String joining
Closes gh-23300
2019-07-24 10:05:38 +02:00
Sam Brannen 5190eaf503 Merge branch '5.1.x' 2019-07-22 18:37:02 +02:00
Sam Brannen d633cb3ad5 Polish @Sql tests 2019-07-22 18:28:52 +02:00
Sam Brannen d1570fd05b Fix copy-n-paste error in WebTestClient Javadoc 2019-07-22 18:16:46 +02:00
Rossen Stoyanchev acb3d1cf88 Fix typo in test from previous commit
See gh-23310
2019-07-22 14:59:52 +01:00
Arjen Poutsma 7b73418418 Add rawStatusCode() to ServerResponse in both WebFlux and Servlet
Closes gh-22872
2019-07-22 15:34:42 +02:00
Rossen Stoyanchev 56c2987273 RSocketRequester support for route vars
Closes gh-23310
2019-07-22 14:02:22 +01:00
Rossen Stoyanchev 358a6d6f10 Improve separator support in PathContainer
To make the switching of separators complete, it is also important to
know whether the decoding of path segment values and the parsing of
path param should be done as those are applied transparently.

This commit replaces the recently added separator argument to
PathContainer.parsePath with an Options type with two predefined
constants. One for HTTP URLs with automatic decoding and parsing of
path params, and another for "." separated message routes without
decoding except for encoded sequences of the separator itself.

See gh-23310
2019-07-22 11:28:38 +01:00
Sam Brannen fbe697061c Remove duplicate junit-bom configuration from spring-test.gradle
The junit-bom is already configured in build.gradle via "allprojects".
2019-07-21 20:40:53 +02:00
Sam Brannen 0f773515e4 Remove unnecessary test results directory configuration
Commit eec183ef28 configured the
Artifactory Gradle task in the Default Job of the Bamboo build plan for
the Spring Framework (SPR-PUB) to use the following Gradle-friendly test
results directory pattern: `**/build/test-results/**/*.xml`.

That change made the existing custom configuration of the test results
directory in the common Gradle `test` task obsolete.
2019-07-21 20:29:40 +02:00
Sam Brannen 8ccf4a9072 Set testGroups system property for spring-test Gradle test tasks 2019-07-21 20:21:58 +02:00
Sam Brannen 69214429df Ensure aggregateTestReports task is UP-TO-DATE
Prior to this commit, the standard Gradle `test` task was configured to
execute all JUnit tests and had a dependency on the `testNG` task. In
addition, the `aggregateTestReports` task depended on the results of
the `test` and `testNG` tasks as input. Consequently, a subsequent
execution of the `aggregateTestReports` task would not be considered
UP-TO-DATE since the JUnit and TestNG results were both written to the
same "test" reports folder.

This commit introduces a new `junit` test task that allows JUnit and
TestNG test output to be completely independent. The standard `test`
task now depends on `junit` and `testNG` but does not execute any tests
itself, and the `aggregateTestReports` task now depends on the
individual `junit` and `testNG` results instead of on the mixed `test`
results.

See also: eec183ef28
2019-07-21 17:21:24 +02:00
Sam Brannen 9cb15ba602 Merge class-level and method-level @Sql declarations
Prior to these commits method-level @Sql declarations always overrode
class-level @Sql declarations, which required developers to redeclare
class-level @Sql declarations on test methods (e.g., via
copy-and-paste) in order to combine them with method-level @Sql
declarations.

These commits provide developers the ability to optionally merge
class-level and method-level @Sql declarations via a new @SqlMergeMode
annotation that can be applied at the class level or method level, with
method-level declarations of @SqlMergeMode overriding class-level
declarations. For example, @SqlMergeMode(MERGE) switches from the
default OVERRIDE behavior to merging behavior, with class-level SQL
scripts and statements executed before method-level SQL scripts and
statements.

Closes gh-1835
2019-07-21 16:20:29 +02:00
Sam Brannen ccdf04e925 Document @SqlMergeMode support in reference manual
See gh-1835
2019-07-21 15:37:51 +02:00
Sam Brannen 89571ea236 Introduce @SqlMergeMode for configuring @Sql annotation merging
Closes gh-1835
2019-07-21 14:34:35 +02:00
Sam Brannen ab8876219f Polish contribution
See gh-1835
2019-07-21 13:26:55 +02:00
asympro d77b715d38 Merge class-level and method-level @Sql declarations
See gh-1835
2019-07-21 13:26:48 +02:00
Sam Brannen b0939a8af0 Suppress deprecation warnings in Gradle build 2019-07-21 13:12:02 +02:00
Sebastien Deleuze c006a83584 Upgrade to Coroutines 1.3.0-RC
This commit upgrades Coroutines support to kotlinx.coroutines
1.3.0-RC, leverages the new Coroutines BOM and refine Coroutines
detection to avoid false positives.

Only Coroutines to Mono context interoperability is supported
for now.

CLoses gh-23326
2019-07-21 11:27:43 +02:00
Juergen Hoeller 45136aabd4 Upgrade to Protobuf 3.9 (plus consistent XMLUnit declarations) 2019-07-20 19:06:54 +02:00
Juergen Hoeller cdeb1fef5f Merge branch '5.1.x' 2019-07-20 18:23:00 +02:00
Sam Brannen 33979b2de9 Upgrade to JUnit Jupiter 5.5.1
See gh-23076
2019-07-20 17:07:14 +02:00
Juergen Hoeller 8ea3aa512f Merge branch '5.1.x' 2019-07-20 16:35:05 +02:00
Juergen Hoeller 69d3e89814 Polishing 2019-07-20 15:05:49 +02:00
Juergen Hoeller daf29118a6 Resolve ApplicationListener against BeanDefinition.getResolvableType()
This covers ApplicationListener generics in factory method return types in particular but also allows for programmatic setTargetType hints.

Closes gh-23178
2019-07-20 15:05:38 +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
Phillip Webb be65bef91b Merge branch '5.1.x' 2019-07-20 13:23:37 +01:00
Sam Brannen 9110a56e11 Merge branch '5.1.x' 2019-07-20 13:33:43 +02:00
Arjen Poutsma 090bfa63a1 Add DataBuffer::toString(Charset)
Closes gh-23317
2019-07-19 12:45:24 +02:00
Arjen Poutsma c8704ce473 Introduce DataBufferWrapper
This commit introduces the DataBufferWrapper, a wrapper for DataBuffers,
and uses it in applicable use cases.
2019-07-19 12:45:24 +02:00
Rossen Stoyanchev 24e96b6c79 Merge branch '5.1.x' 2019-07-19 10:52:30 +01:00
Sebastien Deleuze 095fd5bcb3 Use Kotlin BOM
Close gh-23316
2019-07-19 10:43:54 +02:00
Sam Brannen 8db73c80e2 Polish MockRestServiceServer internals regarding "effectively final" 2019-07-18 15:45:44 +02:00
Sam Brannen 42f033e439 Polish MockMvc internals regarding "effectively final" 2019-07-18 15:45:44 +02:00
Arjen Poutsma 8b7ed5f45e Added since tag 2019-07-18 15:37:33 +02:00
Arjen Poutsma d8838152b3 Copy ClientResponseEntity::toEntity* methods to ResponseSpec
This commit copies the toEntity and toEntityList methods from
ClientResponse to ResponseSpec, so that it is possible to retrieve
a ResponseEntity when using retrieve().

Closes gh-22368
2019-07-18 12:28:22 +02:00
Sam Brannen 38f6d270f8 Delete dead code in tests 2019-07-18 12:20:26 +02:00
Sam Brannen b774147db4 Polish Javadoc for @Autowired
See gh-23263
2019-07-18 12:07:39 +02:00
Sam Brannen 817f689584 Improve Javadoc for AutowiredAnnotationBeanPostProcessor
See gh-23263
2019-07-18 11:55:18 +02:00
Rossen Stoyanchev d2a7d9fa88 Introduce RSocketClientFactoryConfigurer
The new interface supersedes ClientResponderFactory and is more general,
for any RSocketFactory customization.

DefaultClientResponderFactory implements the new interface and is
renamed to AnnotationClientResponderConfigurer.

See gh-23170
2019-07-18 10:21:51 +01:00
Rossen Stoyanchev 1e9ccdd8b8 Pass RSocketStrategies to MetadataExtractor
Simplify the creation of MetadataExtractor by not requiring
RSocketStrategies up front. The strategies are already configured in higher
level places like RSocketMessageHandler that invoke the MetadataExtractor.
The strategies are now passed in as an argument to the extract method.
2019-07-18 10:21:51 +01:00
Rossen Stoyanchev d33e4878a0 Move MetadataExtractor to the rsocket package
The move up the hierarchy reflects the fact that MetadataExtractor
is more generally useful and not tied to annotations.
2019-07-18 10:18:28 +01:00
Juergen Hoeller aa9f840938 Merge branch '5.1.x' 2019-07-17 23:35:48 +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 2c33c11d4c Introduce TransactionOperations.execute(Runnable) convenience method
Closes gh-23250
2019-07-17 22:35:26 +02:00
Juergen Hoeller 7f33344784 Tracking ASM master
See gh-23156
2019-07-17 22:34:39 +02:00
Juergen Hoeller 94e3210ae7 Fix nullability warnings and javadoc-triggered package cycles 2019-07-17 22:34:07 +02:00
Sam Brannen 56eadff34f Merge branch '5.1.x' 2019-07-17 18:58:08 +02:00
Sam Brannen e92cbe1938 Improve failure messages for redirect/forward in MockMvc 2019-07-17 16:53:47 +02:00
Sam Brannen 7779aa3487 Polish contribution
See gh-23297
2019-07-17 16:53:47 +02:00
Scheidter,Ryan 84200f3141 Treat null path as non-matching pattern in AntPathMatcher
Prior to this commit, a null path supplied to the isPattern(), match(),
and matchStart() methods in AntPathMatcher resulted in a
NullPointerException.

This commit addresses this by treating a `null` path as a non-matching
pattern.

Closes gh-23297
2019-07-17 16:53:47 +02:00
Sebastien Deleuze 639a254e0d Polishing 2019-07-17 16:44:34 +02:00
Sebastien Deleuze 4e2b51bedb Improve Kotlin integration testing documentation
Closes gh-22875
2019-07-17 16:37:27 +02:00
Brian Clozel e7ecb83449 Add client responder configuration
Prior to this commit, the `RSocketRequester.Builder` would allow to
configure directly annotated handlers for processing server requests.
This lead to a package tangle where the `o.s.messaging.rsocket` would
use classes from `o.s.messaging.rsocket.annotation.support` package.

This commit introduces the `ClientResponderFactory` interface for
configuring a responder on the client RSocket factory. Its goal is
to be compatible with future changes with a functional variant for
RSocket handlers.

Closes gh-23170
2019-07-17 12:09:09 +02:00
Sebastien Deleuze d6e3394b81 Polishing
See gh-23219
2019-07-16 19:23:21 +02:00
Sebastien Deleuze b4a0e71ccc Polishing
See gh-23219
2019-07-16 18:46:36 +02:00
Arjen Poutsma 7fe0116599 Added since tag 2019-07-16 16:18:31 +02:00
Arjen Poutsma a9b3d95a14 Interpret empty mono from status handler as normal response
Prior to this commit, returning an empty mono from an exception handler
registered through ResponseSpec::onStatus would result in memory leaks
(since the response was not read) and in an empty response from bodyTo*
methods of the webclient.

As of this commit, that same empty mono is now interpreted to return
the body (and not an exception), offering a way to override the default
status handlers and return a normal response for 4xx and 5xx status
codes.
2019-07-16 15:53:21 +02:00
Sam Brannen b2b79ae1e6 Polish contribution
See gh-23219
2019-07-16 14:57:32 +02:00
Sebastien Deleuze adadffe0e1 Improve charset handling in MockHttpServletResponse
This commit adds a getContentAsString(Charset fallbackCharset) method
to MockHttpServletResponse in order to make it easier to get the content
in a specific charset like UTF-8 when the response charset has not been
explicitly set (by default ISO-8859-1 is used).

JsonPathResultMatchers leverages this new feature to support UTF-8
content out of the box.

Closes gh-23219
2019-07-16 11:44:16 +02:00
Sam Brannen 60a7092977 Fix dataMimeType and metadataMimeType mixup in precondition check
Closes gh-23292
2019-07-16 11:13:21 +02:00
Sam Brannen c788be30fe Polish contribution
See gh-23289
2019-07-15 19:08:20 +02:00
Phillip Webb b5e4e02337 Polish ScriptUtilsUnitTests 2019-07-15 14:43:03 +02:00
Phillip Webb 17914fc44b Add multi-prefix comment support for SQL scripts
Update `ResourceDatabasePopulator` and `ScriptUtils` so that more than
one comment prefix can be used when processing SQL scripts. This
feature is particularly useful when dealing with scripts provided by
Quartz since they often use a mix `--` and `#`.

Closes gh-23289
2019-07-15 14:43:03 +02:00
Rossen Stoyanchev 1ff29b0f6b Merge branch '5.1.x' 2019-07-15 11:34:35 +01:00
Arjen Poutsma dae4509152 Make sure built ClientResponses have HttpRequest 2019-07-15 09:40:02 +02:00
Sam Brannen 0aa5533dea Execute test suite in Gradle using JUnit Platform
Closes gh-23286
2019-07-13 19:13:33 +02:00
Sam Brannen 480b1e0a0d Run JUnit 4 tests in spring-test on the JUnit Platform
This commit simplifies the build for spring-test by running JUnit 4
tests and JUnit Jupiter tests together in the standard Gradle `test`
task.

As an added bonus, the ignored tests in SpringJUnit4ConcurrencyTests
and ClassLevelDisabledSpringRuleTests are now reported in the test
results.

See gh-23286
2019-07-13 18:24:37 +02:00
Sebastien Deleuze a3222476ad Use proxyBeanMethods in ProxyTransactionManagementConfiguration
Closes gh-23166
2019-07-13 12:19:33 +02:00
Rossen Stoyanchev 2eba010c1b Merge branch '5.1.x' 2019-07-13 11:00:57 +01:00
Rossen Stoyanchev c32299f734 Use HttpMessageNotWritableException instead of ISE
As a follow-up to the recent commit #37f9ce, this change replaces the
raised IllegalStateException with HttpMessageNotWritableException.

See gh-23205
2019-07-13 10:56:12 +01:00
Rossen Stoyanchev 68c99dafcf Rename {client|server}Acceptor to Responder
See gh-23170
2019-07-13 10:23:46 +01:00
Sam Brannen 3cf5db6317 Exclude ParallelExecutionSpringExtensionTests.TestCase from build
Prior to this commit, ParallelExecutionSpringExtensionTests.TestCase
was accidentally included in the build which skewed the number of tests
in spring-test by 1000.
2019-07-12 18:21:45 +02:00
Stephane Nicoll 9a71a8d357 Fix checkstyle violation
Closes gh-23276
2019-07-12 15:57:16 +02:00
Stephane Nicoll 4f8b347aa0 Do not trigger transactional event listener if no transaction is active
This commit fixes the behaviour of not triggering a transactional event
listener if no transaction is active. Previously, a transaction boundary
was all that was necessary to trigger the listener regardless of the fact
there was an active transaction.

This commit now prevents `Propagation.NOT_SUPPORTED` and
`Propagation.SUPPORTS` without an active transaction to trigger the
listener.

Closes gh-23276
2019-07-12 15:39:14 +02:00
Arjen Poutsma b4207823af Add ClientResponse::createException
This commit adds the createException() method to ClientResponse,
returning a delayed WebClientResponseException based on the status code,
headers, and body as well as the corresponding request.

Closes gh-22825
2019-07-12 14:51:54 +02:00
Rob Winch 5e9a22d118 Add nohttp to build
See gh-22839
2019-07-12 13:21:22 +02:00
Sam Brannen 09c10232a4 Polishing
See gh-23224
2019-07-12 13:08:33 +02:00
Sam Brannen 699d3f15e8 Simplify LocalVariableTableParameterNameDiscoverer implementation
This commit refactors the internals of
LocalVariableTableParameterNameDiscoverer to use
java.lang.reflect.Executable in order to simplify the implementation.
2019-07-12 12:02:49 +02:00
mfeng-ya 309b328719 Use computeIfAbsent in LocalVariableTableParameterNameDiscoverer
Closes gh-23281
2019-07-12 11:44:10 +02:00
Stephane Nicoll 5b341f620a Merge pull request #22839 from rwinch
* pr/22839:
  Polish "Add nohttp to build"
  Add nohttp to build
  BeanDefinitionParserDelegate uses http://www.springframework.org/schema/
  Fix http URLs

Closes gh-22839
2019-07-11 18:14:35 +02:00
Stephane Nicoll d6fdd8e874 Polish "Add nohttp to build"
See gh-22839
2019-07-11 18:14:20 +02:00
Rob Winch 4fa11a5061 Add nohttp to build
See gh-22839
2019-07-11 18:14:20 +02:00
Rob Winch 8c605dd082 BeanDefinitionParserDelegate uses http://www.springframework.org/schema/
See gh-22839
2019-07-11 18:14:20 +02:00
Rob Winch fde92793b5 Fix http URLs
See gh-22839
2019-07-11 18:14:20 +02:00
Sam Brannen b5fba14ab8 Fix Checkstyle violation
Eclipse apparently sorts static imports differently.
2019-07-11 18:13:59 +02:00
Sam Brannen fc38bb4fc6 Change @TestConstructor.autowire attribute into an enum
Prior to this commit, @TestConstructor supported a boolean `autowire`
attribute which naturally limited the configuration to two states: on
or off. Since we may need to support additional autowiring modes in the
future, the use of a boolean is limiting.

This commit address this issue by introducing a new AutowireMode enum
in @TestConstructor with ALL and ANNOTATED constants. In addition, the
attribute has been renamed to `autowireMode`, and the system property
has been renamed to `spring.test.constructor.autowire.mode` for greater
clarity of purpose.

Closes gh-23224
2019-07-11 18:00:52 +02:00
Sebastien Deleuze c8f8dfa39e Add engineSupplier property to ScriptTemplateConfigurer
This commit adds an engineSupplier property to ScriptTemplateConfigurer
and ScriptTemplateView in order to be able to customize the ScriptEngine
when sharedEngine is set to false.

This can be useful with Graal.js for example.

Closes gh-23258
2019-07-11 15:58:10 +02:00
Sam Brannen 01125a571c Upgrade to Gradle 5.5.1
See gh-23214
2019-07-11 14:11:36 +02:00
Sebastien Deleuze c08035b674 Remove unused Coroutines extension parameter 2019-07-11 10:11:34 +02:00
Stephane Nicoll 4a5063f4c0 Merge branch '5.1.x' 2019-07-11 09:55:13 +02:00
Sam Brannen af18d71bc2 Clean up warnings in Gradle build 2019-07-10 16:59:08 +02:00
Сергей Цыпанов 1728bf17fc Avoid unnecessary boxing where primitives can be used
Closes gh-23267
2019-07-10 16:51:18 +02:00
Arjen Poutsma 2909de8829 Remove ServerWebExchange::getParts and ServerRequest::parts
Revert to state before DefaultMultipartMessageReader
2019-07-10 16:20:20 +02:00
Arjen Poutsma 09572e7b60 Removed DataBufferUtils::split
DataBuffers::split (and underlying algorithm) should not be returning
a Flux<DataBuffer>, but rather a Flux<Flux<DataBuffer>>. In other words,
it should not join all data buffers that come before a delimiter.

Providing an implementation of a such a fully reactive split method
proved to be beyond the scope of this release, so this commit removes
the method altogether.
2019-07-10 16:00:11 +02:00
Arjen Poutsma fdcf09dc2f Copied buffering split from DataBufferUtils to StringDecoder
Due to the imminent removal of DataBufferUtils.split, this commit copies
over the buffering split algortihm from DataBufferUtils, as it is still
sutable for the StringDecoder
2019-07-10 16:00:11 +02:00
Arjen Poutsma ef19a6bf8e Various DataBufferUtils improvements
- Made sure that takeUntilByteCount is usable in multiple subscriptions.
- Added composite Matcher
2019-07-10 16:00:11 +02:00
Arjen Poutsma 77c24aac2f Remove DefaultMultipartMessageReader
The DefaultMultipartMessageReader has been removed for 5.2 and will be
part of a future release. This commit switches back to the
SynchronossPartHttpMessageReader.

gh-21659
2019-07-10 16:00:11 +02:00
Sam Brannen b8f77e53b5 Polish contribution
See gh-23251
2019-07-10 15:52:41 +02:00
Eric Hettiaratchi 827ec5d5a2 Add unit tests for PropertyAccessorUtils
Closes gh-23251
2019-07-10 15:40:21 +02:00
Sam Brannen 8ca834b868 Merge branch '5.1.x' 2019-07-09 18:24:03 +02:00
Sam Brannen f0d599493e Cache encoded BASIC credentials in ExchangeFilterFunctions
Prior to this commit, the Basic Authentication credentials were encoded for
each request in ExchangeFilterFunctions.basicAuthentication(String, String).

This commit addresses this minor performance issue by encoding the
credentials prior to the creation of the lambda expression returned by
ExchangeFilterFunctions.basicAuthentication(String, String).

Closes gh-23256
2019-07-09 18:01:27 +02:00
Sam Brannen 140e1e6532 Polish PropertyAccessorUtilsTests 2019-07-09 17:39:32 +02:00
Sam Brannen 39de64bafc Log at WARN level in case of contradicting PersistenceUnitManager setup
Closes gh-23257
2019-07-09 17:24:41 +02:00
Sam Brannen e8fe4493b9 Upgrade Mockito to 3.0.0 2019-07-09 12:59:00 +02:00
Sam Brannen 43447a8ee9 Polishing 2019-07-09 12:33:55 +02:00
Sebastien Deleuze ca75c2843a Upgrade to Coroutines 1.3.0-M2 2019-07-09 11:36:26 +02:00
Rossen Stoyanchev 47d60b34f8 Fix checkstyle violation 2019-07-08 21:35:00 +01:00
Rossen Stoyanchev 7b1a6eb50a Add getters to RSocketMessageHandler 2019-07-08 19:39:54 +01:00
Rossen Stoyanchev 2f77541f9c Update @MessageMapping Javadoc 2019-07-08 18:02:45 +01:00
Rossen Stoyanchev c199cb9054 @ConnectMapping for RSocket handling
The new annotation helps to differentiate the handling of connection
level frames (SETUP and METADATA_PUSH) from the 4 stream requests.

Closes gh-23177
2019-07-08 17:04:23 +01:00
Brian Clozel 507d128e1d Fix RSocket API warning 2019-07-08 14:47:41 +02:00
Sebastien Deleuze 08a5196c3a Use elementClass and elementTypeRef consistently 2019-07-08 12:08:40 +02:00
Sebastien Deleuze 88d7fede36 Avoid shadowed RSocketRequester extensions
This commit renames RSocketRequester.RequestSpec data extension to
dataWithType to avoid shadowing issues and adds Publisher<T> and Flow<T>
variants to provide automatic reified type parameter resolution for
those types. It also makes RSocketRequester consistent with the
changes introduced via 2b4d6ce354 in WebFlux.
2019-07-08 12:08:26 +02:00
slawluc 4bced4682a Make RSocketRequester extensions reified
Extension functions need to use reified types to create
ParameterizedTypeReference.

Closes gh-23185
2019-07-08 10:49:44 +02:00
Sebastien Deleuze 2b4d6ce354 Add body methods with Object parameter to WebFlux
The commit deprecates syncBody(Object) in favor of body(Object)
which has the same behavior in ServerResponse, WebClient and
WebTestClient. It also adds body(Object, Class) and
body(Object, ParameterizedTypeReference) methods in order to support
any reactive type that can be adapted to a Publisher via
ReactiveAdapterRegistry. Related BodyInserters#fromProducer
methods are provided as well.

Shadowed Kotlin body<T>() extensions are deprecated in favor of
bodyWithType<T>() ones, including dedicated Publisher<T> and
Flow<T> variants. Coroutines extensions are adapted as well, and
body(Object) can now be used with suspending functions.

Closes gh-23212
2019-07-07 22:27:57 +02:00
Sam Brannen 0fbc9bf461 Fix broken Javadoc links 2019-07-07 19:50:34 +02:00
Lonre Wang 8bfc920ac5 Fix typo in data-access.adoc
Closes gh-23247
2019-07-07 19:11:50 +02:00
Sam Brannen a3161dc533 Merge branch '5.1.x' 2019-07-07 18:43:27 +02:00
Sam Brannen 575027af24 Polishing 2019-07-07 16:34:15 +02:00
Sam Brannen fae75cb238 Polish contribution
See gh-23237
2019-07-07 16:29:03 +02:00
Johnny Lim 6dcf390fa2 Rename PathPatternRouteMatcherTest to PathPatternRouteMatcherTests
Closes gh-23239
2019-07-07 16:28:09 +02:00
Сергей Цыпанов 9f81ffa5ae Use StringJoiner where possible to simplify String joining
Closes gh-23237
2019-07-07 16:19:01 +02:00
Sam Brannen 8f5b2b2231 Merge branch '5.1.x' 2019-07-07 14:49:34 +02:00
Sam Brannen e57845a50f Polishing 2019-07-06 15:32:54 +02:00
Juergen Hoeller a5cb8799fa Merge branch '5.1.x' 2019-07-05 18:22:02 +02:00
Juergen Hoeller 944b943ea7 Upgrade to Kotlin 1.3.41, Netty 4.1.37, Log4J 2.12, HSQLDB 2.5 2019-07-05 16:26:10 +02:00
Juergen Hoeller d903b9acf5 Compatibility with RxJava 3.0
Closes gh-23208
2019-07-05 16:25:52 +02:00
Juergen Hoeller 6990504d17 Upgrade to ASM 7.2
Closes gh-23156
2019-07-05 16:24:45 +02:00
Juergen Hoeller 2abff1a5b0 Introduce withoutTransaction factory method on TransactionOperations
Closes gh-23198
2019-07-05 16:24:37 +02:00
Juergen Hoeller 7bfe01a028 Support for reactive result values from event listener methods
Closes gh-21831
2019-07-05 16:19:23 +02:00
Rossen Stoyanchev 97d020c509 Merge branch '5.1.x' 2019-07-05 10:55:49 +01:00
Rossen Stoyanchev 1f5f22213c Merge branch 'pr/23119'
Closes gh-23119
2019-07-05 09:03:15 +01:00
Rossen Stoyanchev fbb72eff2e Polish 2019-07-05 09:02:24 +01:00
Dmytro Nosan ea10ee5265 queryParam and replaceParam with List
See gh-23114
2019-07-05 09:02:24 +01:00
Rossen Stoyanchev 0d3e5db3ff Compare suffix patterns by length
Closes gh-23125
2019-07-05 07:36:35 +01:00
Rossen Stoyanchev 157df861f9 Do not warn also if cause is re-thrown
Closes gh-23233
2019-07-05 07:07:59 +01:00
Rossen Stoyanchev 37f9ce5cc9 Return 500 (not 406) if content-type was preset
If content-type is preset in the returned ResponseEntity, then any
failure to find a matching converter is a server error.

Closes gh-23205
2019-07-05 07:07:58 +01:00
Rossen Stoyanchev 3d913b8134 Merge branch '5.1.x' 2019-07-03 17:25:12 +01:00
Rossen Stoyanchev 03a342378a Merge branch '5.1.x' 2019-07-02 09:43:58 +01:00
Sam Brannen 64d13c471f Upgrade to JUnit Jupiter 5.5
Closes gh-23076
2019-07-01 00:00:09 +03:00
Phillip Webb 932f771380 Improve performance of FormContentFilter
Improve the performance of `FormContentFilter` by checking directly if
`contentType` is empty. This saves the need for an exception to thrown
then immediately caught.

Closes gh-23216
2019-06-29 22:31:11 -07:00
Phillip Webb b3d56ebf3b Restore StringUtils.hasLength check
Update `MimeTypeUtils` so that the  StringUtils.hasLength check is
performed immediately on the incoming argument, rather than in
`parseMimeTypeInternal`. This restores the `IllegalArgumentException`
rather than the `NullPointerException` which is thrown by the
`ConcurrentHashMap`.

Closes gh-23215
See gh-23211
2019-06-29 22:31:11 -07:00
Thomas Girard 87c15ba9ad Use the accepted profiles in BeanDefinitionDsl
Closes gh-22393
2019-06-29 17:25:45 +02:00
Sam Brannen ba95818b1d Upgrade to Gradle 5.5
Closes gh-23214
2019-06-29 11:54:19 +03:00
Sam Brannen 896496341a Add explicit support for multipart/mixed in FormHttpMessageConverter
Commit 5008423408 added support for
multipart/* media types in FormHttpMessageConverter, but users still had
to manually register multipart/mixed as a supported media type in order
to POST multipart data with that content type.

This commit removes the need to manually register multipart/mixed as a
supported media type by registering it automatically in
FormHttpMessageConverter. In addition, this commit introduces
MULTIPART_MIXED and MULTIPART_MIXED_VALUE constants in MediaType.

Closes gh-23209
2019-06-29 11:41:15 +03:00
Sam Brannen 75d1428e24 Polishing 2019-06-29 11:41:15 +03:00
Brian Clozel 5a308ad5bd Polish MimeTypeUtils LRU cache
This commit improves the cache implementation by skipping the ordering
of most recently used cached keys when the cache is at least half empty.

See gh-23211
2019-06-29 00:17:40 +02:00
Rossen Stoyanchev 511a430906 Polish 2019-06-28 23:13:31 +01:00
Brian Clozel 1b93ea97ac Fix concurrent reads issue in MimeTypeUtils cache
As of gh-22340, `MimeTypeUtils` has a built-in LRU cache implementation
for caching parsed MIME types and avoiding excessive garbage creation at
runtime.
This implementation, when hit with highly concurrent reads on the same
media type (the cache key), can create multiple keys for the same MIME
type string. This duplication leads to the cache filling up and evicting
entries. When the cache fetches a duplicate key, it is then not
associated with a value and the cache can return a `null` value, which
is forbidden by the API contract.

This commit adds another cache check within the write lock: this avoids
creating duplicate entries in the cache and `null` return values.

Fixes gh-23211
2019-06-28 23:43:38 +02:00
Rossen Stoyanchev 5bf070a857 More flexible RSocket metadata support
The responding side now relies on a new MetadataExtractor which decodes
metadata entries of interest, and adds them to an output map whose
values are then added as Message headers, and are hence accessible to
controller methods.

Decoded metadata entry values can be added to the output map one for
one, or translated to any number of values (e.g. JSON properties),
as long as one of the resulting pairs has a key called "route".

On the requesting side, now any metadata can be sent, and a String
route for example is not required to be provided explicitly. Instead
an application could create any metadata (e.g. JSON properties) as long
as the server can work out the route from it.

The commit contains further refinements on the requesting side so that
any mime type can be used, not only composite or routing metadata, e.g.
a route in an "text/plain" entry.

Closes gh-23157
2019-06-28 22:00:44 +01:00
Sam Brannen 3e41f5e6b6 Cache the encoded credentials in BasicAuthenticationInterceptor
Prior to this commit, the Basic Authentication credentials were encoded
for each request.

This commit addresses this minor performance issue by caching the
encoded credentials in BasicAuthenticationInterceptor.

In addition, this commit introduces new encodeBasicAuth() and
setBasicAuth(String encodedCredentials) methods in HttpHeaders to
support this feature.

Closes gh-23204
2019-06-28 18:48:59 +03:00
Sam Brannen 5008423408 Support multipart/* MediaTypes in RestTemplate
Prior to this commit, RestTemplate posted multipart with Content-Type
"multipart/form-data" even if the FormHttpMessageConverter configured
in the RestTemplate had been configured to support additional multipart
subtypes. This made it impossible to POST form data using a content
type such as "multipart/mixed" or "multipart/related".

This commit addresses this issue by updating FormHttpMessageConverter
to support custom multipart subtypes for writing form data.

For example, the following use case is now supported.

MediaType multipartMixed = new MediaType("multipart", "mixed");

restTemplate.getMessageConverters().stream()
    .filter(FormHttpMessageConverter.class::isInstance)
    .map(FormHttpMessageConverter.class::cast)
    .findFirst()
    .orElseThrow(() ->
        new IllegalStateException("Failed to find FormHttpMessageConverter"))
    .addSupportedMediaTypes(multipartMixed);

MultiValueMap<String, Object> parts = new LinkedMultiValueMap<>();
parts.add("field 1", "value 1");
parts.add("file", new ClassPathResource("myFile.jpg"));

HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(multipartMixed);
HttpEntity<MultiValueMap<String, Object>> requestEntity =
    new HttpEntity<>(parts, requestHeaders);

restTemplate.postForLocation("https://example.com/myFileUpload", requestEntity);

Closes gh-23159
2019-06-28 17:13:18 +03:00
Sam Brannen 7bc727c895 Convert addSupportedMediaType() to var-args in FormHttpMessageConverter
This commit changes the new addSupportedMediaType(MediaType) method
to addSupportedMediaTypes(MediaType...), in order to allow registration
of multiple supported media types simultaneously.

See gh-23203
2019-06-27 16:55:03 +03:00
Sam Brannen 1ef60f2d3b Polishing 2019-06-27 16:05:38 +03:00
Sam Brannen 91ae711a54 Fix Javadoc for MediaType 2019-06-27 16:05:38 +03:00
Sam Brannen 4e7d8a8873 Introduce addSupportedMediaType() in FormHttpMessageConverter
Closes gh-23203
2019-06-27 16:05:38 +03:00
Sam Brannen 8e1cb9a059 Improve diagnostics for all server failures in RestTemplateIntegrationTests 2019-06-27 14:16:19 +03:00
Sam Brannen d522e9835f Polish AbstractMockWebServerTestCase 2019-06-27 13:45:32 +03:00
Sam Brannen 0b6239cecc Improve diagnostics for failures in RestTemplateIntegrationTests 2019-06-26 15:16:54 +03:00
Sam Brannen 7d6be2e26e Polishing 2019-06-26 15:12:32 +03:00
Stephane Maldini 14afdb2bbc Remove unnecessary import 2019-06-25 17:42:01 -07:00
Stephane Maldini 339ee01233 Remove unnecessary flushOnEach (since reactor-netty 0.9) 2019-06-25 16:05:30 -07:00
Sam Brannen e947e08638 Merge branch '5.1.x' 2019-06-25 13:14:21 +03:00
Sam Brannen 33fa55e658 Update OrderComparatorTests based on clarified PriorityOrdered semantics
See gh-23187
2019-06-25 11:04:19 +03:00
Sam Brannen b2dc4debde Merge branch '5.1.x' 2019-06-25 10:42:14 +03:00
Johnny Lim 1afc2be5aa Remove duplicate assertion in AnnotatedElementUtilsTests
Closes gh-23191
2019-06-25 10:00:12 +03:00
Sam Brannen 0f1d16bb05 Fix Checkstyle violation 2019-06-24 17:54:04 +03:00
Sam Brannen d0231cb29a Presort beans in ControllerAdviceBean.findAnnotatedBeans()
Prior to this commit, all clients of
ControllerAdviceBean.findAnnotatedBeans() sorted the returned list
manually. In addition, clients within the core Spring Framework
unnecessarily used AnnotationAwareOrderComparator instead of
OrderComparator to sort the list.

This commit presorts the ControllerAdviceBean list using OrderComparator
directly within ControllerAdviceBean.findAnnotatedBeans().

Closes gh-23188
2019-06-24 16:26:11 +03:00
Brian Clozel dd15ff79d7 Register annotated handlers in RSocketRequester
Prior to this commit, there would be no easy way to register client
RSocket handlers against an `RSocketRequester` instance. The only
solution was to gather all handlers and wrap them in a
`RSocketMessageHandler` and configure it as an acceptor on the client
RSocket.

This commit adds a convenience method on the `RSocketRequester` builder
to tkae care of this part of the infrastructure.

Closes gh-23170
2019-06-24 15:11:18 +02:00
Sam Brannen d5a2bdee8d Improve Javadoc for @ControllerAdvice regarding ordering
Closes gh-23163
2019-06-24 14:36:04 +03:00
Sam Brannen 6cc6abd405 Test status quo for OrderComparator's PriorityOrdered support
See gh-23187
2019-06-24 14:13:46 +03:00
Sam Brannen 4357749a63 Document that OrderComparator honors PriorityOrdered
Prior to this commit, it was not clear that OrderComparator sorts
PriorityOrdered objects with higher priority than plain Ordered objects.
2019-06-24 13:32:54 +03:00
Sam Brannen e3b3481c19 Fix typo in Javadoc 2019-06-24 12:32:41 +03:00
Sam Brannen 9239ab1891 Support Ordered interface for @ControllerAdvice beans
Closes gh-23163
2019-06-23 19:31:35 +03:00
Sam Brannen 978adbdae7 Avoid duplicate lookups of @ControllerAdvice annotations
See gh-23163
2019-06-23 18:31:04 +03:00
Gaurav Deshpande ed6fbdddaa Fix typo in CONTRIBUTING.md
Closes gh-23180
2019-06-22 22:34:05 +03:00
Sam Brannen 7576d0d40c Polishing
See gh-23163
2019-06-22 19:06:58 +03:00
Sam Brannen 4568edf6c4 Simplify ControllerAdviceBean constructors
See gh-23163
2019-06-22 19:02:49 +03:00
Sam Brannen 8f30639a0a Test status quo for Ordered support for @ControllerAdvice beans
See gh-23163
2019-06-22 18:18:57 +03:00
Juergen Hoeller e2d01bb783 Merge branch '5.1.x' 2019-06-22 17:11:31 +02:00
Sam Brannen 21267e56b7 Cache resolved bean instance in ControllerAdviceBean
Prior to this commit, the resolveBean() method in ControllerAdviceBean
looked up the @ControllerAdvice bean instance in the ApplicationContext
by name for every web request that involved lookups for global methods
annotated with @ExceptionHandler, @InitBinder, and @ModelAttribute.

This commit avoids the need for such repeated lookups in the
ApplicationContext by caching the resolved @ControllerAdvice bean
instance within ControllerAdviceBean once it has been resolved.
2019-06-21 18:27:33 +03:00
Sam Brannen 59901592d2 Introduce regression tests for ControllerAdviceBean
This commit introduces unit tests for the status quo in
ControllerAdviceBeanTests to serve as regression tests for future
changes to ControllerAdviceBean.
2019-06-21 17:21:50 +03:00
Sam Brannen 52f1a3aef9 Polish ControllerAdviceBean 2019-06-21 17:11:12 +03:00
Sam Brannen beb454a299 Use HTTPS links in documentation where possible 2019-06-21 16:51:44 +03:00
Sebastien Deleuze eaecf0c006 Improve RSocketRequester.ResponseSpec Kotlin extensions
This commit adds retrieveMono and retrieveFlux reified variants, and
turns dataFlow(flow: Flow) extension into a general purpose reified
data(producer: Any) one.

Closes gh-23164
2019-06-21 15:26:12 +02:00
Rossen Stoyanchev 003247dc40 Equalize copy of ChannelSendOperator
See gh-23175
2019-06-21 14:16:44 +01:00
Rossen Stoyanchev 030caea9cf Merge branch '5.1.x' 2019-06-21 14:15:26 +01:00
Sam Brannen 0e5a38591f Cache beanType in ControllerAdviceBean 2019-06-21 14:09:05 +03:00
Sam Brannen 2759b4b909 Avoid use of Stream API in ControllerAdviceBean 2019-06-21 13:49:49 +03:00
Sam Brannen d5554d5d8d Polish @ControllerAdvice and @RestControllerAdvice 2019-06-21 13:26:30 +03:00
Sam Brannen 2f4c97cbdb Merge branch '5.1.x' 2019-06-21 12:46:21 +03:00
Sam Brannen 1d2f8e5cc2 Merge branch '5.1.x' 2019-06-21 12:41:59 +03:00
Arjen Poutsma 92981ac9de Add Flux<Part> ServerRequest.parts()
This commit introduces Flux<Part> ServerRequest.parts() that delegates
to ServerWebExchange.getParts() and offers an alternative,
streaming way of accessing multipart data.

Closes gh-23131
2019-06-21 10:59:13 +02:00
Arjen Poutsma 11c7907a59 Add Flux<Part> ServerWebExchange.getParts()
This commit introduces ServerWebExchange.getParts(), as an alternative,
streaming way of accessing multipart data.
2019-06-21 10:59:12 +02:00
Arjen Poutsma edd86e5dd5 Move RouterFunction WebHandler to inner class 2019-06-21 10:59:12 +02:00
Rossen Stoyanchev 7f1d5d790e Polish 2019-06-21 06:51:59 +01:00
Rossen Stoyanchev c6a2c89408 Package refactoring in rsocket support
Create annotation.support sub-package and move handler code there. This
prepares for a future, functional handler (responder) variant and is
consistent with the package structure under simp.
2019-06-21 06:49:59 +01:00
Brian Clozel cc05608ae9 PathPattern does not use custom separator
Prior to this commit, `PathPattern::extractPathWithinMapping`
would always use the default path pattern separator `/` when extracting
the path within the pattern of a matched route.

This commit ensures that `PathPattern` uses the configured separator
when extracting the path within the matched mapping.

Fixes gh-23168
2019-06-20 20:27:22 +02:00
Brian Clozel 5787fc16fb PathPatternRouteMatcher should use custom separator
Prior to this commit, the `PathPatternRouteMatcher` would always use the
default path pattern separator when parsing incoming route strings to
`RouteMatcher.Route` instances.
When the `PathPatternRouteMatcher` is configured with a
`PathPatternParser` that has a custom separator (e.g., `.`), then the
matching algorithm can't match routes against parsed patterns.

This commit ensures that the route matcher uses the configured separator
at all times.

Fixes gh-23167
2019-06-20 20:23:04 +02:00
Sam Brannen f56c54dfc8 Polishing 2019-06-20 18:09:22 +03:00
Sebastien Deleuze da582dad7c Add documentation for Coroutines dependencies 2019-06-20 16:11:20 +02:00
Rossen Stoyanchev 772087fe18 Refactor RSocket handler selection
1. Consolidate config options for handler detection in the base class
AbstractMethodMessageHandler with sub-classes like RSocketMessageHandler
now only setting the handler predicate by default (e.g. @Controller).

2. Remove autoDetection flag in favor of just having the mutually
exclusive handler Predicate<Object> vs manually registered List<Object>.
Or if both are desired for some reason, then manually register first,
and set the predicate second.
2019-06-20 12:16:08 +01:00
Rossen Stoyanchev 7d68a65dc0 Replace deprecated methods in RSocket tests 2019-06-20 12:16:08 +01:00
Rossen Stoyanchev d6b5c20058 Generalize RSocketRequester data methods
Replace the Publisher argument in RequestSpec's
data(Publisher, Class<T>) and
data(Publisher, ParameterizedTypeReference<T>) methods with Object thus
allowing any reactive type known to the ReactiveAdapterRegistry to be
passed in directly rather than adapted to Publisher first.
2019-06-20 12:16:08 +01:00
Sam Brannen b3d40b3fac Upgrade to JUnit Jupiter 5.5 RC2
See gh-23076
2019-06-20 13:20:25 +03:00
Sam Brannen d2e6d0269b Preliminary tests for multipart/related & multipart/mixed in RestTemplate
See gh-23159
2019-06-20 11:35:18 +03:00
Sebastien Deleuze e86b937f8c Leverage new Kotlin script templating support
As of 1.3.40, Kotlin now provides a kotlin-scripting-jsr223-embeddable
dependency which:
 - Fixes classloading related issues
 - Provides out of the box JSR 223 support
 - Is compatible with Spring Boot Fat Jar mechanism

This commit updates Spring Framework tests and documentation accordingly.

Closes gh-23165
2019-06-20 10:17:02 +02:00
Sebastien Deleuze cfb4148982 Upgrade to Kotlin 1.3.40 2019-06-20 09:44:14 +02:00
Stephane Nicoll 521539b68e Merge pull request #23162 from izeye
* pr/23162:
  Polish FormattingConversionServiceTests

Closes gh-23162
2019-06-20 08:46:56 +02:00
Johnny Lim ef704aa531 Polish FormattingConversionServiceTests
See gh-23162
2019-06-20 08:40:47 +02:00
Stephane Nicoll 8e1612c68a Merge pull request #23158 from izeye
* pr/23158:
  Polish YamlProcessorTests.flattenedMapIsSameAsPropertiesButOrdered()

Closes gh-23158
2019-06-20 08:35:42 +02:00
Johnny Lim 77aa17fe75 Polish YamlProcessorTests.flattenedMapIsSameAsPropertiesButOrdered()
See gh-23158
2019-06-20 08:34:44 +02:00
Rossen Stoyanchev 22fd521e0a Remove MessageHandlerAcceptor sub-class
This commit removes the MessageHandlerAcceptor sub-class of
RSocketMessageHandler, and rather than implementing directly the
contracts for RSocket client and server acceptors, RSocketMessageHandler
now exposes clientAcceptor() and serverAcceptor() methods that return
the required adapter instances.

This provides better separation between the RSocketMessageHandler and
the RSocket adapter code, and also avoids implementing generic
interfaces like the BiFunction required for the client acceptor.
2019-06-19 22:19:19 +01:00
Sebastien Deleuze 341385acfc Merge branch '5.1.x' 2019-06-19 13:59:59 +02:00
Rossen Stoyanchev 73c2eb1b77 Fix minor Assert-related issues 2019-06-18 21:31:44 +01:00
Sam Brannen ef6471fcbf Polish contribution
See gh-23141
2019-06-18 18:59:18 +03:00
RustyTheClone 72adc3d37e Support target type in MockMvcResultMatchers.jsonPath()
This commit introduces an overloaded jsonPath() method to specify a
target type to coerce into for MockMvcResultMatchers.

 - jsonPath(String, Matcher<T>, Class<T>)

Closes gh-23141
2019-06-18 18:57:27 +03:00
Sam Brannen 89ebdc766c Polishing 2019-06-18 18:53:47 +03:00
Sebastien Deleuze ea97fefa98 Merge branch '5.1.x' 2019-06-18 16:52:29 +02:00
Sam Brannen 4000b244ff Forbid null converters in RestTemplate & HttpMessageConverterExtractor
Prior to this commit, RestTemplate and HttpMessageConverterExtractor did
not validate that the supplied HttpMessageConverter list contained no
null elements, which can lead to a NullPointerException when the
converters are accessed.

This commit improves the user experience by failing immediately if the
supplied HttpMessageConverter list contains a null element. This applies
to constructors for RestTemplate and HttpMessageConverterExtractor as
well as to RestTemplate#setMessageConverters().

Note, however, that RestTemplate#getMessageConverters() returns a mutable
list. Thus, if a user modifies that list so that it contains null values,
that will still lead to a NullPointerException when the converters are
accessed.

This commit also introduces noNullElements() variants for collections in
org.springframework.util.Assert.

Closes gh-23151
2019-06-18 16:13:20 +03:00
Sam Brannen 8ceac9c015 Document supported @Transactional attributes in the TCF
This commit documents which attributes in @Transactional are supported
for test-managed transactions in the Spring TestContext Framework (TCF).

Closes gh-23149
2019-06-18 14:34:28 +03:00
Sam Brannen da903904c9 Fix Javadoc reference to MediaType#APPLICATION_CBOR_VALUE
{@value ...} cannot be used outside of the current type.
2019-06-18 13:00:00 +03:00
Sam Brannen aa0a8d66a8 Polishing 2019-06-18 10:19:03 +03:00
Johnny Lim 7f67cecd10 Polish MappingMediaTypeFileExtensionResolver.addFileExtension()
Closes gh-23145
2019-06-18 10:10:30 +03:00
Sam Brannen f6a4595cef Polishing 2019-06-17 17:06:37 +03:00
Stephane Nicoll 80c7f7f6ba Merge pull request #23142 from ielatif
* pr/23142:
  Fix typo

Closes gh-23142
2019-06-17 11:41:01 +02:00
Issam El-atif 57fa09b80d Fix typo
See gh-23142
2019-06-17 11:40:45 +02:00
Arjen Poutsma 30af01fd4e Use DataBufferUtils.write in DefaultFilePart.transferTo
This commit makes sure that in DefaultMultipartMessageReader's
DefaultFilePart, the file is not closed before all bytes are written,
by using DataBufferUtils.write (see c1b6885191d6a50347aeaa14da994f0db88f26fe).

The commit also improves on the logging of the
DefaultMultipartMessageReader.

Closes gh-23130
2019-06-14 14:13:18 +02:00
Arjen Poutsma f08656c6cb Add methods to read/write from Path to DataBufferUtils
This commit adds two methods to DataBufferUtils:
- one that reads a Flux<DataBuffer> from a Path
- one that writes a Flux<DataBuffer> to a Path
2019-06-14 14:13:18 +02:00
Sam Brannen 99d10a671c Merge branch '5.1.x' 2019-06-14 14:51:08 +03:00
Johnny Lim 293506013d Add since declarations for JettyClientHttpConnector constructor change
Closes gh-23128
2019-06-14 14:31:37 +03:00
Stephane Nicoll 296220f374 Merge branch '5.1.x' 2019-06-13 16:47:50 +02:00
Sam Brannen 451cce4fe8 Do not override requestContextAttribute with null in UrlBasedViewResolvers
Prior to this commit, if a subclass of
org.springframework.web.servlet.view.AbstractView or
org.springframework.web.reactive.result.view.AbstractUrlBasedView
configured a custom value for the requestContextAttribute, that value
was overwritten with null whenever the View was dynamically
instantiated by a UrlBasedViewResolver, and this could lead to
confusing behavior for users of the View.

This commit addresses this issue by ensuring that the
UrlBasedViewResolvers in spring-webmvc and spring-webflux do not
override the requestContextAttribute in a View if the
UrlBasedViewResolver has not been explicitly configured with a custom
requestContextAttribute value.

Closes gh-23129
2019-06-13 17:42:14 +03:00
Sam Brannen c4075cf216 Document WebFlux FreeMarker macro support in Reference Manual
Closes gh-23133
2019-06-13 17:40:18 +03:00
Sam Brannen eef9bc899f Avoid NPE in FreeMarkerView.getModelAttributes() in spring-webflux
This commit declares the model method parameter as @Nullable and adds
defensive guards against a null model argument.

Closes gh-23105
2019-06-13 01:40:22 +03:00
Rossen Stoyanchev 4690f745ce Upgrade to RSocket 0.2.12-RC4 2019-06-12 17:19:17 -04:00
Rossen Stoyanchev 14e2c6803e Support for RSocket composite metadata
Closes gh-22798
2019-06-12 17:11:30 -04:00
Sam Brannen 9fb973d4f3 Polish JavaDoc for FreeMarkerView in spring-webflux
See gh-23105
2019-06-12 22:42:29 +03:00
Sam Brannen a4f4ef9011 Update documentation for spring.ftl in spring-webflux
See gh-23105
2019-06-12 22:40:13 +03:00
Juergen Hoeller 0a77477d32 Merge branch '5.1.x' 2019-06-12 18:16:30 +02:00
stsypanov 49873a30c5 Simplify String concatenation 2019-06-12 17:32:35 +02:00
Sam Brannen cc4593fda8 Improve FreeMarker macro support in spring-webflux
This commit improves the FreeMarker macro support in spring-webflux by
automatically exposing a RequestContext under the name
"springMacroRequestContext" for use with Spring's FreeMarker macros in
spring.ftl.

This aligns with the user experience for FreeMarkerView in spring-webmvc.

Closes gh-23105
2019-06-12 17:00:21 +03:00
Sam Brannen c99b7c1c90 Polishing 2019-06-12 16:33:39 +03:00
Sam Brannen 8b68400bbe Remove use of @Nullable from copy of SortedProperties
Rationale: @Nullable is not visible in the spring-context-indexer
project.
2019-06-12 15:31:54 +03:00
Juergen Hoeller 42c0d8ec7f Merge branch '5.1.x' 2019-06-12 14:14:40 +02:00
Sam Brannen 259dd3d731 Polishing 2019-06-12 14:43:23 +03:00
Juergen Hoeller 918ffacdf8 Polishing 2019-06-12 13:29:35 +02:00
Juergen Hoeller 98a49b46b7 NamedParameterJdbcTemplate only treats Iterables like Collections
Closes gh-22981
2019-06-12 13:29:07 +02:00
Sam Brannen bee4fb0615 Polishing 2019-06-12 14:07:04 +03:00
Sam Brannen 049437e111 Log exception when closing InputStream in AbstractResource
Prior to this commit, exceptions thrown while closing an InputStream in
AbstractResource were silently ignored.

This commit improves diagnostics for such failure scenarios by logging
the exception at DEBUG level.

Closes gh-23116
2019-06-12 14:07:04 +03:00
Sam Brannen 5cbc0cd8a3 Merge branch '5.1.x' 2019-06-12 09:32:22 +03:00
Juergen Hoeller bd76a160bb Merge branch '5.1.x' 2019-06-12 00:58:51 +02:00
Juergen Hoeller 707c720441 Polishing 2019-06-12 00:05:37 +02:00
Juergen Hoeller 7e02358166 Merge branch '5.1.x' 2019-06-12 00:05:01 +02:00
Phillip Webb 5e505ce3a9 Add FormatterRegistry addPrinter/addParser methods
Update `FormatterRegistry` with `addPrinter` and `addParser` methods
that can be used to register Printer or Parser implementations in a
similar way to the existing `addFormatter` method.

Closes gh-23110
2019-06-11 14:47:42 -07:00
Juergen Hoeller a89bfffd8c Merge branch '5.1.x' 2019-06-11 23:16:03 +02:00
Sam Brannen 74d520fbfa Polish @Value documentation in the Reference Manual
See gh-23052
2019-06-11 23:07:23 +03:00
Phillip Webb 6ac68391c1 Polishing 2019-06-11 12:03:05 -07:00
Phillip Webb b21b27c5ac Add MultiValueMap.addIfAbsent method
Closes gh-23111
2019-06-11 12:03:05 -07:00
Rossen Stoyanchev 0757eaee9d Clear ProducesRequestCondition attribute
Closes gh-23091
2019-06-11 13:55:20 -04:00
Juergen Hoeller 859923b732 Support for fine-grained by-type references and autowired properties
Closes gh-23032
2019-06-11 18:27:46 +02:00
Juergen Hoeller eeb79c8dde NamedParameterJdbcTemplate treats arrays/Iterables like Collections
Closes gh-22981
2019-06-11 18:26:40 +02:00
Juergen Hoeller 9f92b42d69 Upgrade to Tomcat 9.0.21, Undertow 2.0.21, RxJava 2.2.9, Checkstyle 8.21, Mockito 2.28.2, Hibernate ORM 5.4.3
Centralizes rsocketVersion declaration in build.gradle; also includes upgrade to Reactor Dysprosium M2 proper.
2019-06-11 18:26:13 +02:00
Sebastien Deleuze 1af43d7164 Rework @Value documentation
See gh-23052
2019-06-11 17:54:43 +02:00
Sam Brannen 44a00b58c8 Polish contribution
See gh-22383
2019-06-11 17:46:29 +03:00
Vedran Pavic b51e553f55 Ensure indexer output is deterministic and repeatable
Closes gh-22383
2019-06-11 17:46:12 +03:00
Sam Brannen a5828ca14e Polish JavaDoc for AbstractView in spring-webflux 2019-06-11 16:28:25 +03:00
Sam Brannen dfbf742547 Polishing 2019-06-11 13:54:11 +03:00
Sylvain Lemoine 74fcb0c5e8 Add proper @Value documentation
Closes gh-23052
2019-06-11 12:06:42 +02:00
Sam Brannen 59d070e12a Test JUnit Jupiter 5.5 @Timeout support with Spring transactions
See gh-23076
2019-06-10 17:57:56 +03:00
Sam Brannen 809fc50036 Upgrade to JUnit Jupiter 5.5 RC1
See gh-23076
2019-06-10 16:51:47 +03:00
Sam Brannen 7a87d86b80 Fix documentation for FreeMarker bind macro in spring-webflux
See gh-23002
2019-06-10 16:39:54 +03:00
Sam Brannen 2f640fe205 Polish FreeMarker macro support in spring-webflux
See gh-23002
2019-06-10 16:13:20 +03:00
Sam Brannen ac28de0dc1 Polish Javadoc for FreeMarker support 2019-06-10 16:03:16 +03:00
Issam EL-ATIF b58f34d802 Add FreeMarker macro support in spring-webflux
Closes gh-23002
2019-06-09 16:30:05 +03: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
Juergen Hoeller 662541a48e Fix formatting
See gh-23068
2019-06-08 14:26:39 +02:00
陈其苗 ab8e388412 Fix duplicate invoke method of transformedBeanName 2019-06-07 22:48:19 +02:00
Rossen Stoyanchev b296545af8 Handler StreamingHttpOutputMessage in XHR transport
Closes gh-23030
2019-06-07 16:40:58 -04:00
Rossen Stoyanchev 331463739d Merge branch '5.1.x' 2019-06-07 16:26:00 -04:00
Rossen Stoyanchev 1f05bd4ef3 Merge branch '5.1.x' 2019-06-07 16:08:29 -04:00
Sam Brannen 08afe5d22b Polishing 2019-06-07 19:45:51 +03:00
Сергей Цыпанов e352e9ddaa Simplify comparison of primitives
Closes gh-23098
2019-06-07 18:14:04 +02:00
Sam Brannen e903bf440b Polishing 2019-06-06 17:57:14 +03:00
Sam Brannen 61bf45c86f Merge branch '5.1.x' 2019-06-06 17:40:51 +03:00
Sebastien Deleuze 098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Brian Clozel 33becd8258 Allow separator configuration in PathPatternParser
This commit allows to configure a custom path separator when parsing and
matching path patterns with `PathPatternParser`, but also when parsing
incoming paths as `PathContainer` instances.

Closes gh-23092
2019-06-06 11:39:53 +02:00
Rossen Stoyanchev ec91934730 Use correct file options for transferTo
Similar to fix applied to Synchronoss implementation in #cef98e.
2019-06-05 10:54:56 -04:00
Sam Brannen 1259b7cb49 Polishing 2019-06-05 14:41:14 +03:00
Sam Brannen 2ed9a61ba0 Rename TransactionSynchronizationManager#currentTransaction()
This commit renames currentTransaction() to forCurrentTransaction() for
greater clarity.

Closes gh-23086
2019-06-05 14:15:07 +03:00
Sebastien Deleuze 044ea17bf9 Polishing 2019-06-05 12:13:36 +02:00
Sebastien Deleuze 23e617160f Use a timeout != 0 in InvocableHandlerMethodTests 2019-06-05 11:52:08 +02:00
Sebastien Deleuze 2a19b8f7a5 Refine Coroutines adapter registration activation
Closes gh-23087
2019-06-05 11:52:00 +02:00
Sam Brannen 3b37989774 Apply De Morgan's law for greater clarity of purpose 2019-06-05 10:29:24 +03:00
Rossen Stoyanchev 1f35bb609b Fix checkstyle warning 2019-06-04 17:38:30 -04:00
Rossen Stoyanchev 69eba32284 Improved Part support in MultipartBodyBuilder
1. Add contentType and filename options to PartBuilder.

2. Revert recently committed #44659f since asyncPart can't properly
support Publisher of Part (only Mono, can't support filename), and
replace that with support for Part in the regular part method.

Closes gh-23083
2019-06-04 17:21:39 -04:00
Rossen Stoyanchev 8781c01edf Merge branch '5.1.x' 2019-06-04 16:42:13 -04:00
Sam Brannen 2074afc87f Polish Javadoc
See gh-23075
2019-06-04 16:55:51 +03:00
Arjen Poutsma 145610129b Javadoc
Closes gh-23075
2019-06-04 15:31:27 +02:00
Sam Brannen e92ace7301 Merge branch '5.1.x' 2019-06-04 16:22:08 +03:00
Sam Brannen 410f204168 Support consistent ordering of string adapting properties
This commit introduces support for consistent ordering of Properties
created by CollectionFactory.createStringAdaptingProperties().

Specifically, the created Properties instance sorts properties
alphanumerically based on their keys.

Closes gh-23081
2019-06-04 14:47:43 +03:00
Sam Brannen 3a8388ec8d Merge branch '5.1.x' 2019-06-04 12:01:58 +03:00
Rossen Stoyanchev e89fd5c3be Merge branch '5.1.x' 2019-06-03 16:34:58 -04:00
Stephane Nicoll cb97a1b371 Merge pull request #23071 from ielatif
* pr/23071:
  Polish "Replace with 'Integer.compare()'"
  Replace with 'Integer.compare()'

Closes gh-23071
2019-06-03 08:34:43 +02:00
Stephane Nicoll 0ef4349c4d Polish "Replace with 'Integer.compare()'"
See gh-23071
2019-06-03 08:31:57 +02:00
Issam El-atif 7ce3792672 Replace with 'Integer.compare()'
See gh-23071
2019-06-03 08:31:19 +02:00
Sebastien Deleuze e0bb712bfc Update Kotlin documentation 2019-05-31 14:15:44 +02:00
Sam Brannen 3794a57651 Improve AnnotationProcessorPerformanceTests with Awaitility 2019-05-30 12:07:30 +02:00
Sam Brannen f66eef1f88 Fix SortedPropertiesTests on JDK 9+ 2019-05-30 10:41:49 +02:00
Rossen Stoyanchev eacc531cf7 Add dataMimeType to RSocketRequestBuilder
Closes gh-23012
2019-05-29 17:08:46 -04:00
Rossen Stoyanchev 64f3dbbee8 Polish in rsocket package 2019-05-29 17:08:46 -04:00
Сергей Цыпанов aaeabc3c85 Simplify iteration over maps
Closes gh-23053
2019-05-29 18:00:34 +02:00
Sebastien Deleuze 5b04b04b69 Merge branch '5.1.x' 2019-05-29 11:54:40 +02:00
Brian Clozel 4b8ce04bdc Mark Spring web config classes as proxyBeanMethods=false
Closes gh-23004
2019-05-28 19:11:35 +02:00
Johnny Lim 83078eb6fd Add constants for application/cbor to MediaType
Closes gh-23042
2019-05-28 18:51:25 +02:00
Sam Brannen 53597f90e9 Remove dependency on StringUtils in SortedProperties
See gh-23018, gh-22383
2019-05-28 18:31:54 +02:00
Brian Clozel 1cfedb20b8 Add new constructor to JettyClientHttpConnector
This commit adds a new constructor to `JettyClientHttpConnector` and
deprecates another one. Jetty is not creating `HttpClient` instances
using a builder API, but rather setting immutable configuration at
constructor time and using setters for the rest.

This commit addresses that by deprecating the constructor variant
accepting a `Consumer` and just delegating to Spring's implementation
for setting the client resources as needed.

Closes gh-22977
2019-05-28 16:59:51 +02:00
Сергей Цыпанов 7ef8cc9faf Tiny improvements regarding ArrayList creation
Closes gh-23047
2019-05-28 16:08:58 +02:00
zyan f492e37370 Fix typo
provices -> provides

See gh-23046
2019-05-28 16:00:35 +02:00
Sam Brannen 7c9c8220d8 Polish YAML tests 2019-05-28 15:27:11 +02:00
Sam Brannen c6818fe15b Polishing
See gh-23018
2019-05-28 14:53:24 +02:00
Sam Brannen 141ef9082f Clean up Mockito usage
This commit migrates to the MockitoJUnitRunner where sensible, which
will later allow for an easier migration to Mockito's extension for
JUnit Jupiter.

In addition, this commit deletes unnecessary stubbing for various mocks
and polishes test fixture setup in various test classes.
2019-05-28 13:59:43 +02:00
Sam Brannen d495902a9c Polish Javadoc 2019-05-28 12:37:50 +02:00
Sam Brannen c39c4211df Introduce support for sorted Properties
This commit introduces an internal SortedProperties class that is a
specialization of java.util.Properties which sorts properties
alphanumerically based on their keys.

This can be useful when storing a java.util.Properties instance in a
properties file, since it allows such files to be generated in a
repeatable manner with consistent ordering of properties.

Comments in generated properties files can also be optionally omitted.

An instance of SortedProperties can be created via two new
createSortedProperties() factory methods in
org.springframework.core.CollectionFactory.

Closes gh-23018
2019-05-28 12:23:56 +02:00
Brian Clozel 98079a364d Revert asciidoctorj-pdf upgrade
See gh-23006
2019-05-28 11:47:30 +02:00
Sebastien Deleuze 9905200f69 Merge branch '5.1.x' 2019-05-28 08:01:23 +02:00
Christoph Dreis 4e4145ac27 Avoid unnecessary call to get message type
Closes gh-23040
2019-05-28 07:21:08 +02:00
Sebastien Deleuze bc205e0dbf Remove charset parameter from Spring MVC JSON content type
This change is a follow-up to the ones done as part of gh-22788.

Closes gh-22954
2019-05-27 18:14:19 +02:00
Sam Brannen 30944ed2e2 Attempt to make AbstractSchedulingTaskExecutorTests more robust 2019-05-27 13:02:30 +02:00
Sam Brannen bdf3960283 Suppress warnings in Gradle build 2019-05-27 12:15:50 +02:00
Sam Brannen 32277b74db Attempt to make AbstractSchedulingTaskExecutorTests more robust 2019-05-27 12:01:34 +02:00
Sam Brannen 4b9f5a35a6 Polish contribution 2019-05-27 11:22:11 +02:00
Сергей Цыпанов 6964ed33bf Allocate objects only when it's necessary
Closes gh-23036
2019-05-27 11:14:25 +02:00
Phillip Webb 6f2f5bb8c1 Fix annotation exceptions in tight memory
Update `AnnotationTypeMapping` so that instance comparisons are no
longer used when checking attribute methods. Prior to this commit,
in an environment with tightly constrained memory, the method cache
could be cleared and different method instances would be returned.

Closes gh-23010
2019-05-26 14:59:33 -07:00
Phillip Webb e386e53f92 Use less confusing MergedAnnotation method names
Rename some `MergedAnnotation` methods to prevent using parent/child
terminology, specifically:

	`getDepth()` has been renamed `getDistance()`
	`getParent()` has been renamed `getMetaSource()`
	`getTypeHierarchy()` has been renamed `getMetaTypes()`

The parent child naming was particularly confusing given that the
parent/child relationships were inverted from the way that a lot of
users think about meta-annotations. For example, a `@RequestMapping`
having a parent of `@GetMapping` feels odd given that `@GetMapping`
is the thing declaring the meta-annotation relationship.

The new method names are designed to align more closely with existing
terms. For example, `getMetaSource` hints at the relationship with
`isMetaAnnotated` and `getSource`.

Closes gh-22946
2019-05-26 13:15:59 -07:00
Sam Brannen 4f4427f550 Migrate TestNG assertions to AssertJ
Migrate all existing TestNG based assertions to AssertJ and add
Checkstyle rules to ensure they don't return.

See gh-23022
2019-05-26 18:29:39 +02:00
Sam Brannen 50cc23ca55 Use the JUnit Platform Test Kit in spring-test 2019-05-26 14:28:09 +02:00
Sam Brannen 43119deb08 Polishing 2019-05-26 14:28:09 +02:00
Sam Brannen 09db8881bb Fix Checkstyle violation 2019-05-26 14:28:09 +02:00
stsypanov 4cc7b9b9fc tiny simplifications regarding usage of Iterator 2019-05-25 20:32:43 +02:00
Juergen Hoeller 8f972a5a60 Merge branch '5.1.x' 2019-05-24 23:46:25 +02:00
Juergen Hoeller 3c3d828e6c Actually test LiteConfiguration arrangement
Closes gh-23013
2019-05-24 23:18:10 +02:00
Phillip Webb 6b9160b3ae Restore transaction specific assertions
Revert 82d0e49d and instead create a `TransactionAssert` class.

Closes gh-23022
2019-05-24 11:09:44 -07:00
Sam Brannen 5a1217cafe Migrate JUnit Jupiter assertions to AssertJ
Migrate all existing JUnit Jupiter based assertions to AssertJ and add
Checkstyle rules to ensure they don't return.

See gh-23022
2019-05-24 18:50:01 +02:00
Sam Brannen f47481749b Fix Checkstyle violation 2019-05-24 18:33:29 +02:00
Sam Brannen ecf45edfb6 Upgrade to reactor Dysprosium snapshots 2019-05-24 18:19:35 +02:00
Sam Brannen 0aaf5785dd Merge branch '5.1.x' 2019-05-24 18:18:21 +02:00
Stephane Nicoll d106ae0d80 Upgrade to reactor Dysprosium snapshots 2019-05-24 14:22:55 +02:00
Stephane Nicoll 40c82d8871 Merge branch '5.1.x' 2019-05-24 14:22:19 +02:00
Sam Brannen a4cd547b7e Fix ScriptUtilsUnitTests 2019-05-24 10:46:50 +02:00
Sam Brannen 303216f4eb Merge branch '5.1.x' 2019-05-24 10:18:25 +02:00
Diego Castro 2f8aa368fe Fix code example for validation on functional endpoints
Closes gh-23020
2019-05-24 09:41:17 +02:00
Phillip Webb 82d0e49de9 Inline methods from TransactionTestUtils
Delete `TransactionTestUtils` and inline AssertJ assertions
instead.

Closes gh-23022
2019-05-23 16:38:39 -07: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
Rossen Stoyanchev 2294625cf0 Exposes STOMP frame stats
Closes gh-23015
2019-05-23 18:32:11 -04:00
Rossen Stoyanchev e09c5fd9e5 Use TaskExecutor instead of ThreadPoolTaskExecutor
Closes gh-22943
2019-05-23 14:26:51 -04:00
Rossen Stoyanchev 0b2fcbfe8a Use TaskScheduler instead of ThreadPoolTaskScheduler
Closes gh-22943
2019-05-23 14:01:05 -04:00
Rossen Stoyanchev d30778458a Create SECURITY.md 2019-05-23 11:36:52 -04:00
Rossen Stoyanchev 31135cc2c4 Merge branch '5.1.x' 2019-05-23 10:41:33 -04:00
Rossen Stoyanchev 3a5fb1fdf3 Fix test failing after #99302f 2019-05-23 10:38:08 -04:00
Rossen Stoyanchev 71396121a7 Merge branch '5.1.x' 2019-05-23 09:57:29 -04:00
D瓜哥 f39fde7460 Upgrade to asciidoctorj-pdf version 1.5.0-alpha.17
Closes gh-23006
2019-05-23 15:22:11 +02:00
Sam Brannen f806594e60 Introduce getOrEmpty(String) convenience method in HttpHeaders
This commit introduces a getOrEmpty(String) method in HttpHeaders that
returns an immutable, empty list if no values are present for the
specified header name. This is provided as a convenience over the
existing get(String) method which returns null in such cases.

Closes gh-22949
2019-05-22 15:26:45 +02:00
Sam Brannen 9ca7354146 Polishing 2019-05-22 15:22:29 +02:00
Sam Brannen 819097a07a Clean up warning in Gradle build 2019-05-22 14:48:40 +02:00
Juergen Hoeller 8a33ef2d14 Merge branch '5.1.x' 2019-05-21 21:06:38 +02:00
Rossen Stoyanchev 438d3710d3 Detect MimeType via ConnectionSetupPayload
Closes gh-23012
2019-05-21 14:07:59 -04:00
Juergen Hoeller 3645281c35 Polishing 2019-05-21 19:26:39 +02:00
Juergen Hoeller ff838fd011 Consistently support CompletionStage in ReactiveAdapterRegistry
Aligns ReactiveAdapterRegistry with MVC/messaging handler methods in terms of recognizing CompletionStage as well as CompletableFuture. Includes consistent use of ReactiveAdapter for reactive transactions.

Closes gh-23011
2019-05-21 19:26:12 +02:00
Arjen Poutsma 9b3c92e8d2 Add leading slash for path predicate if not present
This commit adds a leading slash for path predicates in both
WebFlux.fn and WebMvc.fn.

Closes gh-22795
2019-05-21 12:09:36 +02:00
Juergen Hoeller c329bad42a Merge branch '5.1.x' 2019-05-21 00:16:35 +02:00
Juergen Hoeller 171e8f56a3 Merge branch '5.1.x' 2019-05-20 22:27:37 +02:00
stsypanov 6f07a504b8 A couple of trivial simplifications 2019-05-20 21:41:15 +02: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
Phillip Webb fb26fc3f94 Polishing 2019-05-20 10:46:20 -07:00
Juergen Hoeller a363fed209 Merge branch '5.1.x' 2019-05-20 17:21:07 +02:00
Johnny Lim 21e163e5da Fix typo 2019-05-20 16:41:05 +02:00
Rossen Stoyanchev bd910fc62b Fix checkstyle errors 2019-05-16 20:49:49 -04:00
Rossen Stoyanchev 60e4649ff3 Merge branch '5.1.x' 2019-05-16 20:42:09 -04:00
Rossen Stoyanchev ed2a3bd451 Take advantage of Encoder#encodeValue
EncoderHttpMessageWriter takes advantage of the Encoder#encodeValue
that's new in 5.2 in order to produce a Mono<DataBuffer> instead of
producing a Flux<DataBuffer> and then using flux.singleOrEmpty().

Closes gh-22952
2019-05-15 17:31:59 -04:00
Rossen Stoyanchev 013249757a Merge branch '5.1.x' 2019-05-15 16:44:05 -04:00
Arjen Poutsma a30a134c23 Make StringDecoder use DataBufferUtils.split
* Added DataBufferUtils.split variant that takes multiple delimiters
  as argument (instead of 1).
* Use this new split() variant from within StringDecoder, replacing
  its inefficient algorithm with the Knuth-Morris-Pratt algorithm.
2019-05-15 16:07:28 +02:00
Rossen Stoyanchev b1912f6acc Fix checkstyle error 2019-05-15 08:29:41 -04:00
Rossen Stoyanchev 97c2de915a Add RouteMatcher
Closes gh-22642
2019-05-14 21:44:39 -04:00
Rossen Stoyanchev afc0ae3752 Add hasPatternSyntax method to PathPattern 2019-05-14 15:36:47 -04:00
Rossen Stoyanchev ac6c96a391 Polish 2019-05-13 13:45:25 -04:00
Juergen Hoeller e0654a5b3d Merge branch '5.1.x' 2019-05-13 19:22:07 +02:00
Juergen Hoeller 9755b59197 Merge branch '5.1.x' 2019-05-13 18:05:07 +02:00
stsypanov 9ca8681f79 Iteration over a map using EntrySet 2019-05-13 15:38:13 +02:00
Sam Brannen 785e8d8116 Polish MergedAnnotation support 2019-05-13 14:11:29 +02:00
Juergen Hoeller cfc4a59135 Merge branch '5.1.x' 2019-05-13 13:40:07 +02:00
Johnny Lim 9a6ce66bd9 Add a missing single quote in assertion message 2019-05-13 12:04:22 +02:00
Sam Brannen 73dbd06361 Enforces static imports for JUnit 4 assertions and assumptions
This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
2019-05-12 15:13:07 +02:00
Sam Brannen deecab6311 Use assertThat from Hamcrest instead of JUnit 4
org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
2019-05-12 14:46:55 +02:00
Sam Brannen 724c805211 Discontinue use of JUnit 3 APIs
This commit also ensures that the JSR-330 TCK is executed with the
normal build by adhering to naming conventions for test classes.

See gh-22894
2019-05-12 14:46:55 +02:00
Sam Brannen 5685e9dfa3 Add Checkstyle rules for deprecated JUnit APIs
This commit adds Checkstyle rules to disallow imports of the following.

- junit.framework.*
- org.junit.Assert.assertThat
- org.junit.Assume.assumeThat

See gh-22894
2019-05-12 14:46:55 +02:00
Sam Brannen 9e1ed6c771 Fix build on JDK 9+ 2019-05-12 13:46:14 +02:00
Sam Brannen da1b004254 Merge branch '5.1.x' 2019-05-11 18:21:44 +02:00
Sam Brannen 33fcde4c3e Merge branch '5.1.x' 2019-05-11 18:04:48 +02:00
Sam Brannen 6ef7d7124e Clean up warnings 2019-05-11 15:51:06 +02:00
Sam Brannen 64819bbc1d Clean up warnings 2019-05-10 18:00:29 +02:00
Sam Brannen 0cff7eb32c Fix Javadoc links 2019-05-10 17:40:03 +02:00
Sam Brannen 9b61316c2e Clean up warnings in spring-web 2019-05-10 17:31:23 +02:00
Stephane Nicoll f188aab5f2 Merge branch '5.1.x' 2019-05-10 10:49:59 +02:00
Stephane Nicoll 6d69a4e03a Merge branch '5.1.x' 2019-05-10 09:57:25 +02:00
Stephane Nicoll 4606209ad4 Merge branch '5.1.x' 2019-05-09 17:09:54 +02:00
Sam Brannen d8f1d56100 Fix broken test 2019-05-09 16:21:54 +02:00
Sam Brannen 1be29d5933 Document automatic constructor injection in JUnit Jupiter
Closes gh-22928
2019-05-09 16:16:32 +02:00
Sebastien Deleuze c601ecf169 Merge branch '5.1.x' 2019-05-09 15:00:53 +02:00
Juergen Hoeller 0b50d1eff3 Merge branch '5.1.x' 2019-05-09 14:29:37 +02:00
Denis Zavedeev c80028b71e Fix trivial errors in integration.adoc 2019-05-09 13:50:26 +02:00
Sam Brannen 8e29eca1eb Merge branch '5.1.x' 2019-05-09 13:25:21 +02:00
Sam Brannen e465f51d56 Suppress deprecation warnings 2019-05-09 13:21:42 +02:00
Sam Brannen dc1c110288 Delete dead code 2019-05-09 13:21:27 +02:00
Rossen Stoyanchev fd48bf1dbe Merge branch '5.1.x' 2019-05-08 21:05:42 -04:00
Rossen Stoyanchev ed61f44545 Upgrade to Disprosium-M1
Closes gh-22930
2019-05-08 20:55:31 -04:00
Rossen Stoyanchev 06c3a058f4 Use most recent RSocket RC for M2 release 2019-05-08 20:34:22 -04:00
Juergen Hoeller 8b08b6812a Merge branch '5.1.x' 2019-05-09 02:26:23 +02:00
Phillip Webb 798b51f4a3 Migrate to BDD Mockito
Migrate all tests to consistently use BDD Mockito. Also add
checksyle rule to enforce going forwards.
2019-05-08 13:46:13 -07: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
Phillip Webb 1b985fb3da Update static import limit in eclipse prefs
Update eclipse preferences so that static imports no longer use
`.*`.
2019-05-08 09:53:01 -07:00
Phillip Webb 66eb86f055 Delete unused Matchers class
Delete the `Matches` class since it's no longer being used.
2019-05-08 09:52:39 -07:00
Juergen Hoeller d3b713d5f0 Upgrade to Protobuf 3.7.1 and HtmlUnit 2.35 2019-05-08 17:52:56 +02:00
Juergen Hoeller fb29088670 Revise LinkedCaseInsensitiveMap's lazy key/value/entry collections
Closes gh-22926
2019-05-08 17:52:28 +02:00
Juergen Hoeller 82d32f0875 Remove unused import 2019-05-08 17:51:54 +02:00
Sam Brannen 4038d590a1 Suppress deprecation warning in Gradle build 2019-05-08 17:18:41 +02:00
Rossen Stoyanchev 44659f4945 Unwrap Part content in asyncPart builder method
Closes gh-22876
2019-05-08 10:59:58 -04:00
Sam Brannen 6a05b97df3 Log identity hash for ApplicationContext for context cache hits/misses
DefaultCacheAwareContextLoaderDelegate now logs the identity hash code
for an application context instance that was stored in or retrieved from
the context cache in the Spring TestContext Framework.

Closes gh-22925
2019-05-08 16:39:23 +02:00
Sam Brannen 4d1637a9b7 Avoid warnings in RequestMappingHandlerMappingTests 2019-05-08 16:29:31 +02: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
Rossen Stoyanchev 7e6e3d7027 Switch writeAcceptCharset to false by default
Closes gh-22506
2019-05-08 09:56:52 -04:00
Rossen Stoyanchev a9f0eae4ab Merge branch '5.1.x' 2019-05-08 09:41:10 -04:00
Sam Brannen 77eef47483 Support automatic constructor injection in JUnit Jupiter
Prior to this commit, dependency injection of all arguments in a test
class constructor invoked by JUnit Jupiter was only possible if the
constructor was explicitly annotated with @Autowired.

This commit introduces support for a configurable "test constructor
autowire" mode which defaults to false in order to remain backwards
compatible.

Specifically, this mode can be configured globally for an entire test
suite via a new "spring.test.constructor.autowire" JVM system property
that can alternatively be configured via the SpringProperties
mechanism. In addition, the global "test constructor autowire" mode can
be overridden locally on a per-class basis via the new @TestConstructor
annotation.

Closes gh-22286
2019-05-08 14:51:43 +02:00
Juergen Hoeller eb16e853b1 Fix JDK 9+ generics compilation problem in TransactionAspectSupport
Includes consistent mentioning of ReactiveTransactionManager in javadoc.

Closes gh-22923
2019-05-08 14:01:12 +02:00
Arjen Poutsma dc01917dae Javadoc 2019-05-08 12:21:00 +02:00
Arjen Poutsma 2352688ccb MultipartIntegrationTests should not bind to same part multiple times
DefaultMultipartMessageReader does not cache the part contents, so
binding to the same part multiple times does not work.
Rewrote this test to use separate HTTP request instead.
2019-05-08 12:10:20 +02:00
Arjen Poutsma e7cca7792d Add way to override default multipartReader
This commit introduces a way to override the default multipart reader,
for instance to the SynchronossPartHttpMessageReader.
2019-05-08 12:10:20 +02:00
Arjen Poutsma 32915d8bf5 Add logging to DefaultMultipartMessageReader 2019-05-08 12:10:20 +02:00
Arjen Poutsma e625ace8c8 Add reference counting for UndertowDataBuffer
This commit adds proper reference counting to the UndertowDataBuffer.
2019-05-08 12:09:16 +02:00
Rossen Stoyanchev 45147c23c1 Empty body checks in ConsumesRequestCondition
Normally consumes matches the "Content-Type" header but what should be done if
there is no content? This commit adds checks for method parameters with
@RequestBody(required=false) and if "false" then also match requests with no content.

Closes gh-22010
2019-05-07 22:03:36 -04:00
Juergen Hoeller cdf51c3d51 Nullability refinements and related polishing 2019-05-08 00:27:56 +02:00
Juergen Hoeller c5b3848357 Nullability refinements and related polishing
Includes fix for typo in visitor class names.

See gh-22909
2019-05-08 00:27:47 +02:00
Phillip Webb 7031964e49 Deprecate StandardMetadata constructors
Deprecate the public `StandardMetadata` constructors to make it clearer
that these classes should not be instantiated directly. A new
`AnnotationMetadata.introspect` factory method has been added which
can now be used to obtain instances.

This change will allow use to make the constructors package private
and drop the `nestedAnnotationsAsMap` parameter in a future release.

Closes gh-22906
2019-05-07 23:12:42 +02:00
Phillip Webb 7fbf3f97cd Add SimpleAnnotationMeta classes and readers
Replace the existing ASM based readers with new implementations that
also support MergedAnnotations. The meta-data classes themselves are
now immutable, and constructed via separate reader classes.

The `SimpleMetadataReader` class has been updated to return the new
classes, however the old ones remain since some of them are public
and might be being used directly.

Closes gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb 8c2ccfe6a3 Add MergedAnnotations support to meta-data classes
Add `AnnotatedTypeMetaData.getAnnotations()` that can be used to access
annotation details using the `MergedAnnotations` interface.

Where possible, the existing annotation methods have been migrated to
call `getAnnotation()`, rather than needing their own implementation.

The existing ASM based meta-data implementations have not been updated
since they will be deprecated and replaced in a subsequent commit.

See gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb 30ba80a3c3 Reduce meta-data code duplicate with default methods
Extract and pull-up some common method implementations and make them
default methods of the interface.

See gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb f592c1f211 Add additional class/method meta-data tests
Add some additional tests to provide more coverage of class and method
meta-data support.

See gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb 9738e4886c Use ReflectionUtils to get declared methods
Update `StandardAnnotationMetadata` to use `ReflectionUtils` when
obtaining declared methods. This update is primarily so that the common
method cache can be used.

Closes gh-22907
2019-05-07 23:12:42 +02:00
Phillip Webb 1fa5937834 Skip java.lang.annotations when reading metadata
Update `StandardAnnotationMetadata` and `AnnotationMetadataReadingVisitor`
so that `java.lang.annotation` annotations are consistently skipped.

Closes gh-22885
2019-05-07 23:12:42 +02:00
Phillip Webb 8a293f51a4 Don't expose RetentionPolicy.CLASS annotations
Update ASM based metadata readers so that only RetentionPolicy.RUNTIME
annotations are exposed. This aligned behavior with the reflection based
implementation.

Closes gh-22886
2019-05-07 23:12:42 +02:00
Phillip Webb 9d6cf57cb7 Add MergedAnnotations.of method
Add a factory method to `MergedAnnotation` that allows an instance to
be created for an explicit collection of root annotations. This method
will allow ASM based readers to expose a `MergedAnnotation` instance
that has root annotations loaded from bytecode, and meta-annotations
loaded using reflection.

See gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb daec3531b3 Support String->Class adaptation in MergedAnnotation
Update TypeMappedAnnotation so that Strings can be used to represent
Class attribute values. This will allow ASM annotation readers to
present a `MergedAnnotation` instance without necessarily having the
actual class values on the classpath.

When the underlying value is a String, any calls to
`getValue(name, String.class)` or `asMap(Adapt.CLASS_TO_STRING)` will
simply return the original String. Calls that need the actual Class
result (such as `getClass`) will use `Class.forName` and may throw
a `ClassNotFoundException` at that point.

This commit also allows an empty Object[] to be used to represent
any empty primitive array.

See gh-22884
2019-05-07 23:12:42 +02:00
Phillip Webb e11990e63d Polishing MergedAnnotation code 2019-05-07 23:12:42 +02:00
Phillip Webb d4a761abea Rename some MergedAnnotation from methods to of
Rename `from` to `of` for the `MergedAnnotation` factory methods that
work with Maps. The previous name was a little confusing, especially
when an annotation source parameter was specified. The new method name
helps to make it clearer when the user is explicitly defining the
attributes of the annotation, as opposed to picking them up from the
source.
2019-05-07 23:12:42 +02:00
Phillip Webb 3b145a5a73 Add MergedAnnotation.getTypeHierarchy method
Add a `getTypeHierarchy()` method to `MergedAnnotation` that can be used
to return the full type hierarchy information. This method is
specifically designed to be used in combination with
`MergedAnnotationPredicates.unique`.

This update also allows us to delete the `parentAndType` method
from `AnnotatedElementUtils`.

Closes gh-22908
2019-05-07 23:12:42 +02:00
Phillip Webb f86affe404 Extract integration test classes from package-info
Extract the inner classes from package-info into their own files to
prevent local build problems and to make them easier to find.
2019-05-07 23:12:42 +02:00
Juergen Hoeller fff3813d75 Properly detect importing class metadata for lite configuration class
Closes gh-22920
2019-05-07 21:23:47 +02:00
Arjen Poutsma 00a5106bfa Add route(RequestPredicate, HandlerFunction) to RouterFunctions builder
Closes gh-22701
2019-05-07 16:49:02 +02:00
Mark Paluch bb002af8af Fix suspend/resume in AbstractReactiveTransactionManager
We now correctly unwrap suspended resources instead capturing
the Mono emitting suspended resources.

We also properly continue resume by chaining resume Mono's
instead of terminating eagerly.
2019-05-07 15:51:27 +02:00
Arjen Poutsma 55b56b8c5c Javadoc
Closes gh-22893
2019-05-07 15:24:33 +02:00
Arjen Poutsma 59f6044c09 Add route(RequestPredicate, HandlerFunction) to RouterFunctions builder
Closes gh-22701
2019-05-07 15:06:59 +02:00
Johnny Lim 49570ae2f3 Fix typo 2019-05-07 14:25:22 +02:00
Juergen Hoeller e3fa4e1350 Merge branch '5.1.x' 2019-05-07 14:24:28 +02:00
Nicofisi 0e980324e6 Add a space in the documentation index file 2019-05-07 13:29:59 +02:00
Juergen Hoeller ba1c7192c9 Merge branch '5.1.x' 2019-05-07 13:09:44 +02:00
Sam Brannen ccb01e663a Merge branch '5.1.x' 2019-05-07 13:03:45 +02:00
Juergen Hoeller 7e5aacf8a2 Merge pull request #22421 from olszewskimichal/LinkedMultiValueMap-OutOfBoundException-When-EmptyList
LinkedMultiValueMap.getFirst - check that values is not empty
2019-05-07 12:44:05 +02:00
Juergen Hoeller 8eb9782ca2 Polishing 2019-05-07 12:43:36 +02:00
Arjen Poutsma fb642ce723 Introduce DefaultMultipartMessageReader
This commit introduces the DefaultMultipartMessageReader, a fully
reactive multipart parser that does have any third party dependencies.

Closes gh-21659
2019-05-07 12:14:45 +02:00
Arjen Poutsma f747ba282a Add DataBufferUtils.matcher and split
Added two methods to DataBufferUtils:

* matcher(byte[]), which returns a Matcher object that can be used to
  find a delimiter in a data buffer.
* split(Publisher<DataBuffer>, byte[] delimiter), which splits a given
  stream of data buffers around a given delimiter.
2019-05-07 12:14:45 +02:00
Arjen Poutsma b74c09d12e Add DataBuffer.retainedSlice
Add method retainedSlice to the DataBuffer, defaulting to using
DataBufferUtils for retain, but allowing for ByteBuf specific override.
2019-05-07 12:14:45 +02:00
Mark Paluch 1d80cbea35 Replace signal materialization in TransactionAspectSupport with usingWhen
We now use Flux.usingWhen() instead materialize/dematerialize operators
to reuse Reactor's resource closure.

Until usingWhen() accepts a BiFunction to consume error signals,
we need to map error signals outside of usingWhen which requires
re-wrapping of the ReactiveTransaction object.

Also, reuse the current TransactionContext to leave Transaction
creation/propagation entirely to ReactiveTransactionManager instead
of creating new TransactionContexts.
2019-05-07 11:23:20 +02:00
Juergen Hoeller 28c5d7b586 Merge branch '5.1.x' 2019-05-07 02:12:11 +02:00
Stephane Maldini d45f7c4828 Use explicit onErrorMap(class.java) instead of reactor kotlin extension 2019-05-06 16:45:01 -07:00
Juergen Hoeller 85cecb66e5 Consistent parameter retrieval across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:33:07 +02:00
Juergen Hoeller f56c70d2f0 Merge branch '5.1.x' 2019-05-07 01:23:16 +02:00
Stephane Maldini fd36d1efe6 Use explicit expectError(class.java) instead of reactor kotlin extension 2019-05-06 16:22:25 -07:00
Stephane Maldini 3f8be3416e Use explicit cast to avoid dependency on reactor-core kotlin extension 2019-05-06 16:13:05 -07:00
Juergen Hoeller 30a1f6fed5 Consistent exception naming across InvocableHandlerMethod variants
See gh-22900
2019-05-07 01:00:45 +02:00
Juergen Hoeller 4b06d8e511 Merge branch '5.1.x' 2019-05-07 00:59:56 +02:00
Ippei Nawate 47ff92873b Add null check 2019-05-07 00:23:48 +02:00
Sebastien Deleuze 2b3df1fa30 Merge branch '5.1.x' 2019-05-06 22:11:11 +02:00
Rossen Stoyanchev 53cadf15e7 Deferred handling of Flux error in Spring MVC
This commit defers flushing of the response until the first item is
emitted that needs to be written (and flushed) to the response.

This makes Spring MVC consistent with WebFlux in this regard.

Closes gh-21972
2019-05-06 12:26:25 -04:00
Rossen Stoyanchev 15e1af2281 Protected methods to determine payload target type
Closes gh-22035
2019-05-06 09:34:21 -04:00
Sebastien Deleuze e16a134075 Refine WebFlux Kotlin extensions
ServerRequest:
 - awaitPrincipalOrNull is renamed to awaitPrincipal since
 there is no non-nullable variant

ServerResponse:
 - new BodyBuilder.sse() extension
 - BodyBuilder.bodyToServerSentEvents is deprecated in favor
   of sse().body()
 - BodyBuilder.bodyAndAwait(flow: Flow<T>) is renamed to
   bodyFlowAndAwait to avoid shadowing of
   BodyBuilder.bodyAndAwait(body: Any)
 - BodyBuilder.bodyToServerSentEventsAndAwait is removed,
   sse().bodyAndAwait() should be used instead

Closes gh-22899
2019-05-06 11:00:58 +02:00
Sam Brannen d616e10dca 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 19:26:04 +02:00
Sam Brannen 47c39304af 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:27:38 +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
Sam Brannen d4379630e2 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 17:31:31 +02:00
Sam Brannen 0aeb7d1e02 Delete dead code in TransactionSynchronizationManager 2019-05-05 17:29:54 +02:00
Sam Brannen 1928167d5d Delete dead code in ReactiveTransactionInterceptorTests 2019-05-05 17:21:15 +02:00
Sam Brannen 772ef40920 Upgrade to JUnit 4.13-beta-3
See gh-22894
2019-05-05 16:56:48 +02:00
Sam Brannen 7ed4df20a8 Ensure AbstractReactiveTransactionManager compiles in Eclipse IDE 2019-05-05 16:46:11 +02:00
Sam Brannen 3dc38a08c8 Add missing return in AbstractReactiveTransactionManager.processCommit() 2019-05-05 16:30:26 +02:00
Sam Brannen 21864c80d7 Suppress warning 2019-05-05 16:28:45 +02:00
Stephane Nicoll 0b97cc9ebd Polish 2019-05-05 09:13:09 +02:00
Stephane Nicoll 7d0a49474e Merge pull request #22891 from rewolf
* pr/22891:
  Polish contribution
  Polish CONTRIBUTING.md
2019-05-05 09:08:58 +02:00
Stephane Nicoll 1542d97dab Polish contribution
Closes gh-22891
2019-05-05 09:08:21 +02:00
Andrew Flower 6eb4ac60ab Polish CONTRIBUTING.md
See gh-22891
2019-05-05 09:08:06 +02:00
Juergen Hoeller 28039057fd Consistent naming of HandlerMethodArgumentResolver implementations
Includes combined imports of assertion methods and related polishing.

Closes #22889
2019-05-04 18:30:56 +02:00
Juergen Hoeller 30bbf91dba Rename PayloadArgumentResolver to PayloadMethodArgumentResolver
Closes gh-22888
2019-05-04 17:35:34 +02:00
Juergen Hoeller 57984c5705 Move package annotation.support.reactive to annotation.reactive
Aligned with invocation.reactive and transaction.reactive packages.

Closes gh-22887
2019-05-04 17:34:32 +02:00
Juergen Hoeller 9eb095d921 Merge branch '5.1.x' 2019-05-04 12:04:48 +02:00
Johnny Lim d489227874 Use HttpHeaders constants where possible 2019-05-04 11:14:08 +02:00
Juergen Hoeller ffbecf1427 Fix Checkstyle violation 2019-05-03 18:24:30 +02:00
Juergen Hoeller f0f6af2926 Merge branch '5.1.x' 2019-05-03 18:13:12 +02:00
Mark Paluch 83046531da Replace signal materialization in TransactionalOperator with usingWhen
We now use Flux.usingWhen() instead materialize/dematerialize operators
to reuse Reactor's resource closure.

Until usingWhen() accepts a BiFunction to consume error signals,
we need to map error signals outside of usingWhen which requires
re-wrapping of the ReactiveTransaction object.
2019-05-03 16:13:37 +02:00
Mark Paluch 9cff07ce35 Fix doCleanupAfterCompletion invocation
doCleanupAfterCompletion gets now subscribed to when processing
cleanup after a new transaction.
2019-05-03 16:13:37 +02:00
Juergen Hoeller ec8689d1fc Merge branch '5.1.x' 2019-05-03 14:23:59 +02:00
Sebastien Deleuze fc8d5c068c Support final @Configuration(proxyBeanMethods = false) classes
Closes gh-22869
2019-05-03 13:45:14 +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
Juergen Hoeller eaa9a78d5d Merge branch '5.1.x' 2019-05-03 00:23:57 +02:00
Juergen Hoeller ce9162065c Merge branch '5.1.x' 2019-05-02 17:52:12 +02:00
Juergen Hoeller 8a57997d21 Avoid use of Objects.requireNonNull plus related polishing 2019-05-02 16:32:47 +02:00
Juergen Hoeller 0be610b0ee Support for reactive transactions in TransactionInterceptor
Introduces TransactionManager marker interface for PlatformTransactionManager as well as ReactiveTransactionManager, allowing for a common configuration type in TransactionAspectSupport and TransactionManagementConfigurer.

Closes gh-22590
2019-05-02 16:23:48 +02:00
Juergen Hoeller 8dabb3e626 Shorter class names for common reactive transaction API types
Introduces TransactionExecution base interface for TransactionStatus as well as ReactiveTransaction. Renames getTransaction method to getReactiveTransaction, allowing for combined implementations of PlatformTransactionManager and ReactiveTransactionManager.

See gh-22646
2019-05-02 16:23:37 +02:00
Juergen Hoeller b5e5e33078 Remove legacy config options from AbstractReactiveTransactionManager
Includes general revision of reactive transaction sources.

See gh-22646
2019-05-02 12:04:25 +02:00
Mark Paluch beea83b9d2 Add reactive transaction support SPI
This commit adds SPI interfaces to support reactive transactions
through spring-tx with optional dependencies to Project Reactor and
supportive implementations for TransactionalOperator and
AbstractReactiveTransactionManager.
2019-05-02 11:59:09 +02:00
Juergen Hoeller cee7d09e40 Add is*Enabled methods for log level checks to LogAccessor
Closes gh-22862
2019-05-02 11:57:48 +02:00
Andy Clement 0f553661a6 Allow null operands in compiled SpEL numeric operator expressions
Prior to this when SpEL compiled an expression using the numeric
operators <, >, <= or >= then it would not create code that handled
nulls. Nulls can occur if a boxed numeric operand is used prior
to compilation, then it is nulled out. SpEL now creates null
handling bytecode.

Closes gh-22358
2019-05-01 15:36:19 -07:00
Rossen Stoyanchev bd8d71be0e canWrite uses actual return value type if known
Closes gh-22803
2019-05-01 16:52:23 -04:00
Rossen Stoyanchev 07c9a0e1f5 Merge branch '5.1.x' 2019-05-01 04:03:21 -04:00
Juergen Hoeller 52657b68ea Merge branch '5.1.x' 2019-04-30 18:55:34 +02:00
Sebastien Deleuze 2259ab7ff3 Polishing 2019-04-30 16:21:32 +02:00
Sebastien Deleuze 89454e69c3 Deprecate MediaType.APPLICATION_JSON_UTF8
This commit deprecates MediaType.APPLICATION_JSON_UTF8 and
MediaType.APPLICATION_PROBLEM_JSON_UTF8 in favor of
MediaType.APPLICATION_JSON and MediaType.APPLICATION_PROBLEM_JSON since
UTF-8 encoding is now handled correctly by most browsers
(related bug has been fixed in Chrome since September 2017).

MediaType.APPLICATION_JSON is now used as the default JSON content type.

Closes gh-22788
2019-04-30 16:11:50 +02:00
Sebastien Deleuze 2e6059f6b0 Add coroutines support to RSocket @MessageMapping
Closes gh-22780
2019-04-30 15:48:18 +02:00
Sebastien Deleuze 842e7e5ef7 Add RSocketRequester coroutines extensions
See gh-22780
2019-04-30 09:36:35 +02:00
Rossen Stoyanchev 089fb5737d Replace create with wrap in RSocketRequester 2019-04-29 17:12:28 -04:00
Rossen Stoyanchev a1ad0285ca Default MimeType selection for RSocketRequester
Remove the dataMimeType argument on connect methods. Applications can
still configure it through the ClientRSocketFactory but it shouldn't
be necessary as we now choose a default MimeType from the supported
encoders and decoders.

Add an option to provide the RSocketStrategies instance (vs customizing
it) which is expected in Spring config where an RSocketStrategies
instance may be shared between client and server setups.
2019-04-29 15:22:01 -04:00
Rossen Stoyanchev 8888a65079 Polish RSocketRequester 2019-04-29 12:03:49 -04:00
Sebastien Deleuze 5cd6763193 Add CBOR codec (single value only)
This commit adds CBOR reactive support for single value only in
order to allow CBOR usage in RSocket. Notice that no CBOR support
is configured on WebFlux, this will require gh-20513 to be resolved.

Closes gh-22767
2019-04-29 13:13:37 +02:00
Juergen Hoeller 3d502d90e2 Add missing nullable declarations
See gh-22821
2019-04-26 23:10:18 +02:00
Juergen Hoeller f8dc8523da Merge branch '5.1.x' 2019-04-26 23:00:40 +02:00
Phillip Webb 87dba5a4df Fix MergedAnnotations javadoc 2019-04-26 13:59:16 -07:00
Phillip Webb 55ac110f7b Fix LinkedCaseInsensitiveMap collection methods
Ensure that results returned from keySet, entrySet & values are tracked
to remove case insensitive keys from the source map.

Closes gh-22821
2019-04-26 11:17:51 -07:00
Juergen Hoeller c4bd5abc3b Nullability refinements and related polishing 2019-04-26 17:41:43 +02:00
Juergen Hoeller 55418b256d Merge branch '5.1.x' 2019-04-26 16:56:04 +02:00
Sebastien Deleuze 0016f58a80 Upgrade dependency management plugin to 1.0.7 2019-04-26 13:34:47 +02:00
Sebastien Deleuze f5816c9219 Upgrade Gradle to 5.4.1 2019-04-26 13:33:51 +02:00
Sebastien Deleuze c59acde34e Upgrade Kotlin plugin to 1.3.31 2019-04-26 13:32:25 +02:00
Sebastien Deleuze 5221c3000e Upgrade to Coroutines 1.2.1 2019-04-26 11:44:57 +02:00
Sebastien Deleuze 92c190fabf Upgrade to Kotlin 1.3.31 2019-04-26 11:44:39 +02:00
Phillip Webb 83cb51aec6 Add MergedAnnotation.getRoot() method
Update `MergedAnnotation` with a `getRoot()` method that allows the
root direct annotation to be retrieved easily.

Closes gh-22818
2019-04-25 14:14:03 -07:00
Stephane Nicoll 7cc132b2a9 Merge pull request #22836 from izeye
* pr/22836:
  Add missing fail() calls in MockRestServiceServerTests
2019-04-25 17:35:19 +03:00
Johnny Lim 33ac14f099 Add missing fail() calls in MockRestServiceServerTests
Closes gh-22836
2019-04-25 17:34:50 +03:00
Juergen Hoeller ad497c259a Merge branch '5.1.x' 2019-04-25 14:55:04 +02:00
Christoph Dreis 29d021ae3c Avoid possible memory leak in ResolvableType 2019-04-23 21:07:35 +02:00
Sebastien Deleuze cd5dc84832 Improve WebFlux suspending handler method support
This commit leverages Flux instead of Flow to support suspending
handler methods returning Flow in order to avoid multiple invocations
of the suspending function on every collect().

See gh-22820
2019-04-23 17:20:40 +02:00
Brian Clozel b33d2f4634 Fix checkstyle errors 2019-04-23 15:10:11 +02:00
Brian Clozel 02904121a3 Add RSocketRequest.Builder in Spring Messaging
Prior to this commit, `RSocketRequester` would have a single
`RSocketRequester.create` static method taking a fully built
`RSocket` as an argument. Developers need to build an `RSocket`
instance using the `RSocketFactory` and then use it to create
a requester.

To help developers set up a requester, this commit adds a new
`RSocketRequester.Builder` interface and implementation. The
`RSocket` building phase and codecs configuration are part of a
single call chain. Subscribing to the returned
`Mono<RSocketRequester>` will configure and connect to the remote
RSocket server.

This design should be improved in gh-22798, since we will need to
support metadata in a broader fashion.

Closes gh-22806
2019-04-23 14:06:15 +02:00
Yanming Zhou 900abfce47 Temporal should be simple value type like Date 2019-04-23 12:55:18 +02:00
水木今山 574dffb60b Some trivial optimization in method populateBean() (#22792)
Optimize the number of getResolvedAutowireMode() method calls
2019-04-23 12:48:21 +02:00
Sebastien Deleuze aee2df8919 Improve WebFlux suspending handler method support
Support for suspending handler methods introduced in Spring
Framework 5.2 M1 does not detect types correctly and does not
support suspending handler methods returning Flow which is a
common use case with WebClient.

This commit fixes these issues and adds Coroutines integration
tests.

Closes gh-22820
Closes gh-22827
2019-04-23 11:32:32 +02:00
Sam Brannen dab90cb7cc Test status quo for MergedAnnotation.getParent()
See gh-22818
2019-04-21 16:32:09 +02:00
Sam Brannen e5d64e6680 Remove dead code in HttpHeadersTests 2019-04-21 15:33:53 +02:00
Sam Brannen 4a090922d7 Polish Javadoc 2019-04-21 15:33:53 +02:00
Sam Brannen e187a42bfc Introduce failing tests for HttpHeaders
See gh-22821
2019-04-21 15:20:24 +02:00
Rossen Stoyanchev fe92486cca Expose status in SubProtocolWebSocketHandler
Closes gh-22807
2019-04-18 23:11:08 -04:00
Rossen Stoyanchev 87dd62a4a3 Merge branch '5.1.x' 2019-04-18 22:49:35 -04:00
Rossen Stoyanchev c09e711eb2 Unwrap Optional for @RequestParam reverse resolution
Closes gh-22656
2019-04-18 22:40:12 -04:00
Rossen Stoyanchev 4e63153886 Upgrade RSocket snapshot version 2019-04-18 12:49:36 -04:00
Rossen Stoyanchev dbc45319b3 Merge branch '5.1.x' 2019-04-18 11:51:34 -04:00
Rossen Stoyanchev 86835e8e5a Merge branch '5.1.x' 2019-04-17 14:23:44 -04:00
Rossen Stoyanchev 60d6b5a922 Add mutate method to RSocketStrategies
Closes gh-22799
2019-04-17 13:11:34 -04:00
Сергей Цыпанов 18af3892dd Make inner classes static where possible
Closes gh-22804
2019-04-17 19:05:24 +02:00
Rossen Stoyanchev 261dcab8ce Merge branch '5.1.x' 2019-04-17 12:34:22 -04:00
Rossen Stoyanchev 30dbff340a Upgrade to Reactor Dysprosium snapshots 2019-04-17 12:30:02 -04:00
Stephane Nicoll 2cfd2a33c8 Merge branch '5.1.x' 2019-04-17 11:49:51 +02:00
Rossen Stoyanchev de3238dbea Merge branch '5.1.x' 2019-04-16 21:08:54 -04:00
Rossen Stoyanchev ed650891ca Add filter to add exchange to Reactor Context
Closes gh-21746
2019-04-16 10:08:20 -04:00
Sam Brannen c99d904665 Upgrade to Gradle 5.4
Closes gh-22805
2019-04-16 14:46:02 +02:00
Rossen Stoyanchev e4da7cb47f Merge branch '5.1.x' 2019-04-15 08:41:27 -04:00
Sebastien Deleuze e131815bab Upgrade to Coroutines 1.2.0 2019-04-13 13:15:51 +02:00
Juergen Hoeller 44df98c82d Merge branch '5.1.x' 2019-04-12 11:37:07 +02:00
Sebastien Deleuze e84347554e Ignore Kotlin script templating tests
Ignore these tests for the time being since they trigger
a NoClassDefFoundError exception with Kotlin 1.3.30.
2019-04-12 11:17:19 +02:00
Juergen Hoeller f9903bbf69 Upgrade to Kotlin 1.3.30, Mockito 2.27, MockK 1.9.3, AssertJ 3.12.2
This commit removes quartzVersion since it is only used once.
2019-04-12 10:28:15 +02:00
Juergen Hoeller 07738b9529 Recent fine-tuning from ASM master
See gh-22503
2019-04-12 10:26:42 +02:00
Rossen Stoyanchev e27e54317f Merge messaging related codec updates 2019-04-11 19:02:48 -04:00
Rossen Stoyanchev 5fc18064f2 Use encode with an Object value where feasible
Closes gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev 181482fa15 Add option to encode with an Object value
See gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev f89d2ac148 Use decode from a DataBuffer where feasible
See gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev a912d8de1e Add option to decode from a DataBuffer
See gh-22782
2019-04-11 19:00:28 -04:00
Rossen Stoyanchev 2aae81ef0c Join buffers in decodeToMono for Jackson and Jaxb2
Closes gh-22783
2019-04-11 19:00:28 -04:00
Sam Brannen 3d0ec509ab Document mock JNDI support deprecation in the Reference Manual
See gh-22779
2019-04-11 16:46:50 +02:00
Sam Brannen 7f58e395d3 Remove @Deprecated from org.springframework.mock.jndi package
This commit removes the @Deprecated declaration on the
org.springframework.mock.jndi package, since such usage results in a
compiler warning on JDK 9+ which breaks Spring's JDK 9 and JDK 11 CI
builds.

https://bugs.openjdk.java.net/browse/JDK-6481080

See gh-22779
2019-04-11 16:17:58 +02:00
Rossen Stoyanchev 6e7da62085 Switch to Reactor snapshots and remove workaround
Following the 5.2 M1 release we can switch back to Reactor snapshots
and remove the workaround for a fix coming in Reactor Core 3.2.9.
2019-04-10 16:09:28 -04:00
Rossen Stoyanchev bb28477587 Merge branch '5.1.x' 2019-04-10 15:37:02 -04:00
Sam Brannen 88e3b84164 Deprecate mock JNDI support in the spring-test module
Closes gh-22779
2019-04-10 16:00:05 +02:00
Sam Brannen 6d7bf8050f Polishing 2019-04-10 13:15:16 +02:00
Brian Clozel 0f76acc945 Update project page URL 2019-04-10 10:04:29 +02:00
Rossen Stoyanchev d707d382b4 Merge branch '5.1.x' 2019-04-09 22:38:15 -04:00
Sebastien Deleuze 849a848f23 Polishing 2019-04-10 00:32:20 +02:00
Sebastien Deleuze 66c95dc241 Clear spring-core-coroutines artifacts 2019-04-09 23:54:22 +02:00
Sebastien Deleuze ff1f368751 Improve Kotlin documentation 2019-04-09 23:54:22 +02:00
Brian Clozel cd69a4a03b Support DestinationVariable on RSocket handlers
Prior to this commit, the pattern destination variables were not set in
the message headers prior to calling the handler. In this case, the
`DestinationVariableMethodArgumentResolver` could not get the
destination variables from the message headers and resolve those as
handler arguments.

This commit mutates the message headers if the message destination
contains patterns.

Fixes gh-22776
2019-04-09 22:56:08 +02:00
Rossen Stoyanchev a0826a20c3 CorsInterceptor at the front of the chain
Closes gh-22459
2019-04-09 15:43:43 -04:00
Rossen Stoyanchev d1f888a7a9 Empty path mapping behaves consistently
An empty path mapping in an @RequestMapping now consistently matches to
empty paths regardless of whether there are both type and method level,
annotations, or method-level only.

Closes gh-22543
2019-04-09 15:03:43 -04:00
Rossen Stoyanchev f839c1f9cd Remove warning about empty @RequestMapping path
See gh-22543
2019-04-09 15:03:43 -04:00
Sam Brannen 5b17bb2e14 Polish Javadoc for @Scheduled 2019-04-09 19:12:06 +02:00
P. Ottlinger 85597f29f2 Improve @Scheduled Javadoc regarding cron element order
Closes gh-22777
2019-04-09 19:03:30 +02:00
Juergen Hoeller eb971690d2 Merge branch '5.1.x' 2019-04-09 18:09:20 +02:00
stsypanov 604361ee1f Use concatenation instead of torn StringBuilder::append chain 2019-04-09 13:23:22 +02:00
Sebastien Deleuze cd0b517abf Improve Kotlin documentation 2019-04-09 12:28:00 +02:00
Sam Brannen 80ad60e91b Fix Javadoc for @Value 2019-04-09 11:30:59 +02:00
Sam Brannen 85f05023c6 Pull WebFlux getMappingPathPatterns() implementation up in the hierarchy
This commit moves the WebFlux getMappingPathPatterns() implementation
from RequestMappingHandlerMapping to
RequestMappingInfoHandlerMapping so that subclasses of the latter no
longer need to re-implement the method.

See gh-22543
2019-04-09 10:58:04 +02:00
Juergen Hoeller dc14ea86eb Fix regression for nested AnnotationAttributes.annotationType() result
See gh-22738
2019-04-09 09:40:53 +02:00
Rossen Stoyanchev 0a03d8e248 Upgrade to RSocket 0.12.1-RC3 and update tests
1) Tests use a timeout to avoid hanging issues
2) Some tests adjusted to work around potential rsocket-java issue
https://github.com/rsocket/rsocket-java/issues/613
2019-04-08 23:52:04 -04:00
Juergen Hoeller c8609b83b6 Merge branch '5.1.x' 2019-04-08 20:19:03 +02:00
ladislav-bozek 4d17eb4f0e Fix typo in JavaDoc for UrlPathHelper.setUrlDecode()
Closes gh22768
2019-04-08 17:37:59 +02:00
Sam Brannen b115789fd3 Polishing 2019-04-08 17:28:44 +02:00
Sam Brannen 9a93615ec4 Configure Kotlin plugin support for Eclipse in Gradle build
This commit configures the Kotlin plugin for Eclipse in the
spring-core-coroutines Gradle project so that users no longer have to
manually "Configure Kotlin / Add Kotlin Nature" within the Eclipse IDE
after importing projects.

This change is currently limited to the spring-core-coroutines project
since it is the only project in which Java code depends on compiled
Kotlin code; however, this change may later be applied to additional
projects if desirable.
2019-04-08 17:20:24 +02:00
Sam Brannen bd414df944 Remove JMXMP from TestGroup
Due to the changes in a7425c81c0, we no
longer need to execute tests using the JMXMP protocol in PERFORMANCE
builds.

This commit removes the JMXMP constant from the TestGroup enum and
updates affected tests, thereby effectively including such tests in
the standard build from now on.

See gh-22757
2019-04-08 17:05:16 +02:00
Juergen Hoeller fd8fa301a6 Consistent non-exposure of inherited annotations in AnnotationMetadata
Closes gh-22766
2019-04-08 15:59:06 +02:00
Sebastien Deleuze 2e7ed915cd Merge branch '5.1.x' 2019-04-08 15:46:47 +02:00
Sam Brannen cf5d0e6aa9 Introduce publishEvent() convenience method in TestContext
This commit introduces a publishEvent() method in the TestContext API
as a convenience for publishing an ApplicationEvent to the test's
ApplicationContext but only if the ApplicationContext is currently
available and with lazy creation of the ApplicationEvent.

For example, the beforeTestClass() method in
EventPublishingTestExecutionListener is now implemented as follows.

  public void beforeTestClass(TestContext testContext) {
      testContext.publishEvent(BeforeTestClassEvent::new);
  }

Closes gh-22765
2019-04-08 15:14:39 +02:00
Sam Brannen a7425c81c0 Add dependency on opendmk_jmxremote_optional_jar for performance builds
Although the jmxremote_optional JAR has been added to the build agents
on the Bamboo CI server for the latest JDK 8 installation, that
solution is brittle since it has to be manually installed in every new
JDK installation. In addition, this approach will not work with JDK 9+
since the "Extension Mechanism" has been removed beginning with JDK 9.

https://docs.oracle.com/javase/10/migrate/toc.htm#JSMIG-GUID-2C896CA8-927C-4381-A737-B1D81D964B7B

This commit addresses this issue by adding the following dependency to
spring-context.

// Substitute for "javax.management:jmxremote_optional:1.0.1_04" which
// is not available on Maven Central
testRuntime("org.glassfish.external:opendmk_jmxremote_optional_jar:1.0-b01-ea")

With this change, the Spring PERFORMANCE builds now execute on JDK 8,
9, and 11.

See gh-22757
2019-04-08 13:22:30 +02:00
Sam Brannen 8f5d2d65a1 Upgrade to JUnit Jupiter 5.4.2
See gh-22308
2019-04-07 22:05:33 +02:00
Sam Brannen 353e092bf6 Register EventPublishingTestExecutionListener by default (round 2)
This commit registers the EventPublishingTestExecutionListener as a
default TestExecutionListener with an order of 10,000. This registers
the EventPublishingTestExecutionListener as the last listener provided
by the Spring Framework.

With EventPublishingTestExecutionListener registered with an order of
10,000, it is effectively wrapped by all other Spring listeners,
including support for @DirtiesContext and test-managed transactions.

Furthermore, this commit revises the implementation of
EventPublishingTestExecutionListener to take advantage of the new
TestContext#hasApplicationContext() support which allows the
EventPublishingTestExecutionListener to publish events only if the
test's ApplicationContext is currently available. This avoids
undesirable side-effects such as eager loading of the
ApplicationContext before it is needed or re-loading of the
ApplicationContext after it has been intentionally closed.

Closes gh-18490
2019-04-06 16:39:26 +02:00
Sam Brannen c3d0459a4e Add support to query if ApplicationContext is available in the TCF
This commit introduces support in the Spring TestContext Framework
(TCF) to query whether the test's ApplicationContext is available.

Specifically, this commit introduces the following two `default`
methods along with corresponding implementations in DefaultTestContext
and DefaultCacheAwareContextLoaderDelegate.

- `boolean hasApplicationContext()` in the TestContext API

- `boolean isContextLoaded(MergedContextConfiguration)` in the
  CacheAwareContextLoaderDelegate API

Closes gh-22756
2019-04-06 16:00:33 +02:00
Sam Brannen ab1b8dee58 Ensure XmlEventDecoder compiles on JDK 9 and 11 2019-04-06 16:00:33 +02:00
Sam Brannen 55b764bac3 Remove unused import
See gh-22543
2019-04-06 12:14:46 +02:00
Sam Brannen 164ee2a4e1 Polishing
See gh-22543
2019-04-06 11:25:44 +02:00
Sam Brannen 021909dac2 Merge branch '5.1.x' 2019-04-06 11:22:15 +02:00
Sam Brannen 510c0c5ef7 Return Set<PathPattern> from AbstractHandlerMethodMapping.getMappingPathPatterns
This commit revises the signature of getMappingPathPatterns() in
AbstractHandlerMethodMapping to return a set of PathPatterns instead of
a set of Strings.

See gh-22543
2019-04-06 11:18:25 +02:00
Tadaya Tsuyukubo dacda5859a Fix broken asciidoc heading 2019-04-06 11:02:45 +02:00
Rossen Stoyanchev 02da8486a3 Merge branch '5.1.x' 2019-04-05 21:53:55 -04:00
Phillip Webb e905f1712e Refine MergedAnnotation.asMap
Add a convenience method that allows a `MergedAnnotation` to be
converted into an `AnnotationAttributes` instance. Also rename
the `MapValues` enum to `Adapt` which generally seems to read
better.

Closes gh-22738
2019-04-05 13:22:18 -07:00
Phillip Webb ef151f578d Polishing 2019-04-05 13:22:18 -07:00
Phillip Webb 1221b0650b Add MissingMergedAnnotation Tests
Add tests for `MissingMergedAnnotation`

See gh-21697
2019-04-05 13:21:46 -07:00
Phillip Webb 8bc74ad18d Delete AnnotationAttributeExtractor
Delete `AnnotationAttributeExtractor` which is package private and
no longer used.

Closes gh-22753
2019-04-05 13:20:47 -07:00
Sam Brannen 72027b1746 Log warning if @RequestMapping method has no explicit mapping
Commit c0b52d09f5 introduced support for
throwing an exception if a @RequestMapping handler method in a Spring
MVC controller was mapped to an empty path. This had negative side
effects for applications that intentionally mapped to an empty path,
potentially alongside a mapping to an explicit path for the same
handler method.

This commit addresses this by logging a warning (instead of throwing an
exception) if a @RequestMapping method is mapped only to empty paths.

This commit also introduces the same support for WebFlux-based
@RequestMapping handler methods.

Closes gh-22543
2019-04-05 19:55:22 +02:00
Sam Brannen e4525cf4c1 Modify ByteArrayEncoder so that it works in Eclipse IDE 2019-04-05 19:55:22 +02:00
Sam Brannen 898494a538 Polish AbstractHandlerMethodMapping
See gh-22543
2019-04-05 14:03:10 +02:00
Sam Brannen d04a640baf Polish Javadoc for @RequestMapping 2019-04-05 14:03:10 +02:00
Juergen Hoeller 9de83674cd Complete set of registerBean methods on AnnotatedBeanDefinitionReader
Includes bringing registerBean constructor-vararg variants up to GenericApplicationContext, making AnnotationConfigApplicationContext a straightforward subclass with a single template method to override.

See gh-22457
2019-04-05 13:56:33 +02:00
Juergen Hoeller b90e6ef8a0 Merge branch '5.1.x' 2019-04-05 12:48:34 +02:00
Rossen Stoyanchev 279508a0f0 Merge pull request #22705 from jhaeyaert/22371 2019-04-04 17:15:18 -04:00
Rossen Stoyanchev e0c2a1c59d Polish
Closes gh-22705
2019-04-04 17:13:57 -04:00
Jeoffrey Haeyaert 9976783639 WebClient uri method with uriTemplate and UriBuilder
See gh-22705
2019-04-04 17:13:57 -04:00
Rossen Stoyanchev ed70978071 verify() fails if there are failed requests
Normally failed requests fail the test but they're suppressed for some
reason (e.g. in async callback) then verify should still correctly
report the failures.

Closes gh-21799
2019-04-04 16:49:46 -04:00
Sam Brannen 4be605eb1e Revert "Fix tests"
This reverts commit 07e9f802f2.
2019-04-04 19:10:58 +02:00
Sam Brannen d6ba5259d8 Revert "Register EventPublishingTestExecutionListener by default"
This reverts commit 86fb7362b1.
2019-04-04 19:10:58 +02:00
Sam Brannen a66e6d3231 Revert "Fix tests"
This reverts commit 65365d91c8.
2019-04-04 19:10:58 +02:00
Sam Brannen f7a5b3013e Revert "Register EventPublishingTestExecutionListener by default"
This reverts commit 13543f5e0f.
2019-04-04 19:10:58 +02:00
Sebastien Deleuze a8d6ba9965 Add support for Coroutines Flow
Flow is a Kotlin Coroutines related cold asynchronous
stream of the data, that emits from zero to N (where N
can be unbounded) values and completes normally or with
an exception.

It is conceptually the Coroutines equivalent of Flux with
an extension oriented API design, easy custom operator
capabilities and some suspending methods.

This commit leverages Flow <-> Flux interoperability
to support Flow on controller handler method parameters
or return values, and also adds Flow based extensions to
WebFlux.fn. It allows to reach a point when we can consider
Spring Framework officially supports Coroutines even if some
additional work remains to be done like adding
interoperability between Reactor and Coroutines contexts.

Flow is currently an experimental API that is expected to
become final before Spring Framework 5.2 GA.

Close gh-19975
2019-04-04 19:06:32 +02:00
Sam Brannen a5e297a161 Polishing 2019-04-04 18:41:57 +02:00
Sam Brannen df15b64e86 Document @Autowired support on parameters
Closes gh-21118
2019-04-04 18:31:04 +02:00
Sam Brannen e1080f8b5f Polish Javadoc for @Autowired 2019-04-04 18:18:35 +02:00
Sam Brannen 3a9262ca1e Fix Javadoc warnings in Gradle build 2019-04-04 17:49:33 +02:00
Sam Brannen c0b52d09f5 Require explicit path mappings for @RequestMapping methods
Prior to this commit, handler methods in Spring MVC controllers were
not required to provide explicit path mappings via @RequestMapping (or
any of its specializations such as @GetMapping). Such handler methods
were effectively mapped to all paths. Consequently, developers may have
unwittingly mapped all requests to a single handler method.

This commit addresses this by enforcing that @RequestMapping methods
are mapped to an explicit path. Note, however, that this is enforced
after type-level and method-level @RequestMapping information has been
merged.

Developers wishing to map to all paths should now add an explicit path
mapping to "/**" or "**".

Closes gh-22543
2019-04-04 17:33:59 +02:00
Sam Brannen de69871354 Removed unused import 2019-04-04 17:13:08 +02:00
Sam Brannen 1a2e372186 Removed unused import 2019-04-04 16:56:03 +02:00
Juergen Hoeller 23b8f471dc Upgrade to Quartz 2.3.1 2019-04-04 16:43:40 +02:00
Juergen Hoeller 1741b6dcd9 Merge branch '5.1.x' 2019-04-04 16:12:07 +02:00
stsypanov 383f18e214 Use StringJoiner where possible to simplify String joining 2019-04-04 16:11:32 +02:00
Sam Brannen 07e9f802f2 Fix tests
See gh-18490
2019-04-04 12:55:55 +02:00
Sam Brannen 86fb7362b1 Register EventPublishingTestExecutionListener by default
See gh-18490
2019-04-04 12:55:06 +02:00
Sebastien Deleuze 40e4c8068d Polishing 2019-04-04 12:16:18 +02:00
Sebastien Deleuze 9217f0b63e Convert CoRouterFunctionDsl indents to tabs 2019-04-04 12:14:27 +02:00
Sebastien Deleuze 2eb631aaad Avoid exposing (Co)RouterFunctionDsl#invoke
WebFlux.fn RouterFunctionDsl#invoke and CoRouterFunctionDsl#invoke
were wrongly exposed on public API and have never been designed to
be used by end users, but rather only invoked from router { } or
coRouter { } builders.

To fix that, avoiding this method being accessible from the DSL and
for the sake of consistency with WebMvc.fn RouterFunctionDsl,
Spring Framework 5.2 turns public fun invoke() method to
an internal fun build() one.

As a consequence RouterFunctionDsl and CoRouterFunctionDsl are not
open anymore, they are expected to be extended via Kotlin
extensions if needed.

Closes gh-22736
2019-04-04 12:14:27 +02:00
Sebastien Deleuze e6171fb47d Add Kotlin router DSL and extensions for WebMvc.fn
Closes gh-22697
2019-04-04 12:14:27 +02:00
Sebastien Deleuze 92d5f6395e Rename awaitPrincipal to awaitPrincipalOrNull
See gh-19975
2019-04-04 12:14:27 +02:00
Arjen Poutsma b3d3778269 Do not resolve DTDs in Stax Tests 2019-04-04 12:10:10 +02:00
Brian Clozel 65365d91c8 Fix tests
See gh-18490
2019-04-04 11:19:31 +02:00
Juergen Hoeller 52f90c303e Rename LogMessage.lazy(Supplier) to LogMessage.of(Supplier)
See gh-22726
2019-04-04 10:39:42 +02:00
Juergen Hoeller 9080ae24f9 First-class support for printf-style format strings in LogMessage
LogMessage is an abstract class now: with internal subclasses for Supplier bindings as well as printf-style format strings with a variable number of arguments (some fixed for efficiency, varargs array as fallback), created through corresponding static factory methods.

Closes gh-22726
2019-04-04 01:52:51 +02:00
Rossen Stoyanchev 5616eb2e8e Merge branch '5.1.x' 2019-04-03 19:38:21 -04:00
Rossen Stoyanchev 88a7a68a71 Revert to Californium-SR6 for M1 release 2019-04-03 19:25:34 -04:00
Rossen Stoyanchev 2c28e4e972 Merge branch '5.1.x' 2019-04-03 16:29:28 -04:00
Rossen Stoyanchev 1c5aa6a8d3 Merge changes for 22644 2019-04-03 14:56:39 -04:00
Rossen Stoyanchev 72119ac076 ProducesRequestCondition caches accepted media types
Closes gh-22644
2019-04-03 14:56:30 -04:00
Rossen Stoyanchev 254f06e1a1 Request attribute cache for resolved lookupPath
See gh-22644
2019-04-03 14:56:30 -04:00
Rossen Stoyanchev bb9fcad58a RequestCondition implementations minor refactoring
Reduce object creation by pre-computing instances that can be re-used,
and eliminating collection copying and sorting where not needed.

See gh-22644
2019-04-03 14:56:30 -04:00
Juergen Hoeller 8f967129b9 Merge branch '5.1.x' 2019-04-03 19:05:42 +02:00
Sam Brannen 13543f5e0f Register EventPublishingTestExecutionListener by default
Closes gh-18490
2019-04-03 18:31:16 +02:00
Sam Brannen d6173512fe Document test execution event support in the Reference Manual
Closes gh-18490
2019-04-03 18:18:39 +02:00
Sebastien Deleuze a63d23492a Optimize Jackson2Tokenizer
See gh-22727
2019-04-03 18:02:27 +02:00
Sam Brannen 807828b2b7 Polish Javadoc for MergedAnnotation support
See gh-21697
2019-04-03 16:55:34 +02:00
Sam Brannen a4279c5d00 Rename MergedAnnotations.SearchStrategy.SUPER_CLASS to SUPERCLASS
For consistency within the framework, this commit renames the SUPER_CLASS enum constant
to SUPERCLASS.

See gh-21697
2019-04-03 16:44:36 +02:00
Juergen Hoeller d39e3cc0ba Merge branch '5.1.x' 2019-04-03 14:43:22 +02:00
Juergen Hoeller e0fe32af05 Detect factory method annotations in getBeanNamesForAnnotation and co
As of 5.2, ListableBeanFactory.findAnnotationOnBean and its retrieval companions getBeanNamesForAnnotation and getBeansWithAnnotation detect annotations on @Bean methods as well.

Closes gh-22541
2019-04-03 13:07:47 +02:00
Juergen Hoeller dee88d931a Common constant for DefaultBeanNameGenerator as well
Closes gh-22591
2019-04-03 12:58:13 +02:00
Brian Clozel 47c8d1de7b Avoid calling other bean methods in web config
This commit changes the main configuration classes for Spring MVC and
Spring WebFlux to not call other bean methods when setting up the web
infrastructure. This allows configuration classes extending
`DelegatingWebFluxConfiguration` and `DelegatingWebMvcConfiguration`
to opt-in the lite-mode, as introduced in gh-22461.
2019-04-03 10:16:41 +02:00
Brian Clozel 83ce8ad79a Fix checkstyle 2019-04-03 10:16:11 +02:00
Juergen Hoeller e2e91e2196 Switch LogAccessor argument order to have message supplier last
Closes gh-22726
2019-04-02 21:01:56 +02:00
Sam Brannen 5922642333 Document exception handling and async support for test events
This commit updates the class-level Javadoc for
EventPublishingTestExecutionListener in order to provide explicit
documentation for exception handling and async support.

See gh-18490
2019-04-02 20:31:58 +02:00
Juergen Hoeller 2e63c66b0d Merge branch '5.1.x' 2019-04-02 20:13:29 +02:00
Juergen Hoeller 3ac88bed23 Introduce LogAccessor and LogMessage as convenient logging utilities
Closes gh-22726
2019-04-02 19:13:05 +02:00
Rossen Stoyanchev 208a1ae0ea Sync ChannelSendOperator copy in spring-messaging
See gh-22720
2019-04-02 11:06:11 -04:00
Rossen Stoyanchev 89a29598d5 Merge branch '5.1.x' 2019-04-02 11:05:30 -04:00
Juergen Hoeller c366e205e5 Common constants for default AnnotationBeanNameGenerator instances
Closes gh-22591
2019-04-02 16:52:36 +02:00
Sebastien Deleuze b2dbefcfc5 Prevent spring-core-coroutines deployment
See gh-19975
2019-04-02 16:05:18 +02:00
Sebastien Deleuze d2fa5536db Use more efficient Reactor operators
Use handle/flatMapIterable instead of flatMap/flatMapMany
when possible.

Closes gh-22727
2019-04-02 15:49:59 +02:00
Juergen Hoeller b1231de062 Fix formatting
See gh-21855
2019-04-02 15:17:34 +02:00
Matthias Kurz 6899624155 Correctly parse property name in path "map[key[foo]]" 2019-04-02 15:09:13 +02:00
liguoxiong 7b11c3b599 Transform the beanName in method isPrimary
Transform the beanName in method DefaultListableBeanFactory.isPrimary.
Add the corresponding test cases.
Fixes #22675.
2019-04-02 15:06:12 +02:00
Juergen Hoeller a11a592734 AbstractSqlParameterSource enumerates parameter values in toString()
Closes gh-2080
2019-04-02 14:56:38 +02:00
Juergen Hoeller 4a5b9d39d4 Consistent java.time setters on HttpHeaders and CorsConfiguration
Closes gh-22546
2019-04-02 14:56:20 +02:00
Juergen Hoeller d6c1a65737 JtaTransactionManagerFactoryBean fully initializes its JTM instance
Closes gh-22605
2019-04-02 14:55:56 +02:00
Juergen Hoeller 271445b89e Public createMarshaller/Unmarshaller methods on Jaxb2Marshaller
Closes gh-22708
2019-04-02 14:55:39 +02:00
Juergen Hoeller c1a74de48d Boolean getLazyInit accessor indicating no explicit flag set
Closes gh-22694
2019-04-02 14:55:27 +02:00
Juergen Hoeller 03bda29032 Revert "AnnotationConfigRegistry exposes registerBean with supplier/qualifiers"
This reverts commit 18f2e6a1
2019-04-02 14:55:13 +02:00
Rossen Stoyanchev a94868158e Sync ChannelSendOperator copy in spring-messaging
See gh-22720
2019-04-01 17:22:54 -04:00
Rossen Stoyanchev 20742c74dc Merge branch '5.1.x' 2019-04-01 17:16:17 -04:00
Sebastien Deleuze eb75367934 Remove deprecated AbstractHandlerMapping#getCorsConfigurations
Closes gh-22719
2019-04-01 17:43:20 +02:00
Sebastien Deleuze d27b5d0ab6 Improve CORS handling
This commit improves CORS support by:
 - Using CORS processing only for CORS-enabled endpoints
 - Skipping CORS processing for same-origin requests
 - Adding Vary headers for non-CORS requests

It introduces an AbstractHandlerMapping#hasCorsConfigurationSource
method in order to be able to check CORS endpoints efficiently.

Closes gh-22273
Closes gh-22496
2019-04-01 17:42:51 +02:00
Stephane Nicoll 8714710170 Merge branch '5.1.x' 2019-04-01 14:02:23 +02:00
Stephane Nicoll 4b5c370701 Merge branch '5.1.x' 2019-04-01 13:55:44 +02:00
Sam Brannen 085cb1dd92 Clean up warnings 2019-03-31 14:36:35 +02:00
Sam Brannen e8cfc4df45 Disable verbose JiBX logging in Gradle build 2019-03-31 13:26:38 +02:00
Stephane Nicoll 7625fc0262 Merge branch '5.1.x' 2019-03-31 10:59:30 +02:00
Sebastien Deleuze beb491b840 Use Dispatchers.Unconfined for Coroutines
As of Coroutines 1.2.0-alpha, Dispatchers.Unconfined
is a stable API so we can leverage it in order to get
better performances in our Reactive to Coroutines
bridge.

See gh-19975
2019-03-31 10:56:05 +02:00
Sebastien Deleuze 3387d3ec89 Upgrade to Coroutines 1.2.0-alpha
This commit also switches on kotlin-compiler-embeddable to
improve isolation of its dependencies

See gh-19975
2019-03-31 10:55:13 +02:00
Juergen Hoeller 76e5a2a53b Remove superfluous empty lines 2019-03-30 00:26:58 +01:00
Juergen Hoeller 2e832c03ae Merge branch '5.1.x' 2019-03-30 00:25:10 +01:00
Stephane Nicoll 43004328c8 Merge pull request #22709 from armansimonyan13
* pr/22709:
  Polish contribution
  Polish
2019-03-29 22:42:05 +01:00
Stephane Nicoll 2156a1bbd5 Polish contribution
Closes gh-22709
2019-03-29 22:40:40 +01:00
arman simonyan 257772c61e Polish
See gh-22709
2019-03-29 22:40:04 +01:00
Rossen Stoyanchev 8dc535c15c Match declared parameters on produces condition
Closes gh-21670
2019-03-29 17:03:40 -04:00
Rossen Stoyanchev c0be1c5100 Polish 2019-03-29 16:01:22 -04:00
Rossen Stoyanchev 6c33af0a1c Merge branch '5.1.x' 2019-03-29 15:56:07 -04:00
Juergen Hoeller 57de2e0900 Deprecate ClassUtils.isCglibProxy methods in favor of AOP-level checks
Closes gh-22706
2019-03-29 11:12:49 +01:00
Phillip Webb f273fa990c Use RepeatableContainers.none() in AnnotationUtils
Update `AnnotationUtils` so that `RepeatableContainers.none()` is used
when performing an exhaustive search for merged annotations. These
parameters were accidentally removed in commit 210b1789 and weren't
caught earlier because we were missing a test.

Closes gh-22702
2019-03-28 14:39:29 -07:00
Phillip Webb 800cbf2524 Ignore 'value' attribute in AnnotationTypeMapping
Update `addConventionAnnotationValues` so that `value` attributes
do not override existing annotation values. The aligns the new
`MergedAnnotations` API with the previous `AnnotatedElementUtils`
logic.

Closes gh-22703
2019-03-28 14:39:29 -07:00
Rossen Stoyanchev 45e42214b2 Merge branch '5.1.x' 2019-03-28 17:37:21 -04:00
Rossen Stoyanchev 52b109ae68 Merge branch '5.1.x' 2019-03-28 17:19:51 -04:00
Sam Brannen 3f85530efd URL Cleanup - polishing 2019-03-28 17:23:13 +01:00
Sam Brannen faa3bde991 Merge branch '5.1.x' 2019-03-28 17:05:35 +01:00
Arjen Poutsma e09d6e2efd Javadoc 2019-03-28 16:47:25 +01:00
Arjen Poutsma 2950958f35 Fix ConcurrentModificationException on Undertow
This commit fixes a ConcurrentModificationException that occurs when
requesting a nonexistant route.

Closes gh-22698
2019-03-28 16:19:57 +01:00
Juergen Hoeller 49fccfb158 Consistent retrieval of javax annotation types (e.g. JSR-305)
Closes gh-22696
2019-03-28 14:38:55 +01:00
Sam Brannen f9d59570de URL Cleanup - polishing 2019-03-28 14:05:21 +01:00
Sam Brannen eec183ef28 Ensure spring-test test tasks are UP-TO-DATE
Prior to this commit, the three `test` tasks in the spring-test module
shared the same output directory for test reports. This had the
negative side effect of causing Gradle to believe that the tasks were
not UP-TO-DATE. Consequently, all three `test` tasks in the spring-test
module were executed for every build even if there were zero changes in
the spring-test module.

This commit fixes this issue by allowing Gradle to use the default test
results output directory for each `test` task. Thanks to @marcphilipp
for providing the tip.

In addition, the Artifactory Gradle task in the Default Job of the
Bamboo build plan for the Spring Framework (SPR-PUB) has been updated
to use the following custom test results directory pattern:
`**/build/test-results/**/*.xml`.

See: https://guides.gradle.org/using-build-cache/#concepts_overlapping_outputs
2019-03-28 13:47:33 +01:00
Sam Brannen 7e6a5f5875 URL Cleanup - license.txt 2019-03-28 13:04:33 +01:00
Sam Brannen 025eaf688f Clean up warnings in Gradle build output 2019-03-28 12:32:58 +01:00
Sam Brannen 09690f2750 Upgrade to Gradle 5.3.1
See gh-22347
2019-03-28 12:02:35 +01:00
Sebastien Deleuze c5c4ac164b Refine WebFlux Coroutines API
This commit provides both nullable and non-nullable variants for
awaitBody, makes awaitPrincipal return type nullable and rename
awaitResponse to awaitExchange for better consistency with Java API.

See gh-19975
2019-03-28 10:22:50 +01:00
Sebastien Deleuze 811f315440 Refine PropertyResolver extensions null-safety
See gh-22687
2019-03-28 09:01:20 +01:00
Phillip Webb bf9dea4254 Defensively copy array returned from TypeDescriptor
Update the internal proxy used in `TypeDescriptor` so that it returns a
cloned array for calls to `getDeclaredAnnotations` or `getAnnotations`.

Closes gh-22695
2019-03-27 13:50:30 -07:00
Rossen Stoyanchev 0589989eb4 Merge branch '5.1.x' 2019-03-27 16:19:31 -04:00
Juergen Hoeller ac0ffda311 Merge branch '5.1.x' 2019-03-27 19:39:28 +01:00
Sebastien Deleuze 864dddee7a Merge branch '5.1.x' 2019-03-27 17:13:06 +01:00
Juergen Hoeller 673be7fb0d Merge branch '5.1.x' 2019-03-27 16:02:07 +01:00
Sebastien Deleuze 8003aa4f26 Deprecate GenericApplicationContext { } Kotlin extension
Closes gh-22692
2019-03-27 15:12:16 +01:00
Sebastien Deleuze fb1da01410 Support creating beans from Kotlin callable references
This commit updates Kotlin beans DSL in order to support
creating beans using callable references with autowired
parameters. Type resolution is implemented using Kotlin
reified type parameters without requiring reflection.

Closes gh-21845
2019-03-27 14:47:42 +01:00
Juergen Hoeller c9857702e4 Refined retrieval of plain annotations through direct presence checks
Shortcut checks apply for hasPlainJavaAnnotationsOnly types as well now.

Closes gh-22685
2019-03-27 12:56:11 +01:00
Juergen Hoeller cb84c56f19 Revert "Migrate CommonAnnotationBeanPostProcessor to MergedAnnotations"
This reverts commit 75b52309
2019-03-27 12:54:34 +01:00
Sebastien Deleuze cbb5a78aa0 Infer Kotlin null-safety from type variables
This commit removes the constraint from type variables in
PropertyResolver, JdbcOperations and RestOperations
Kotlin extensions in order to get null-safety inferred
from the type declared by the user.

Closes gh-22687
2019-03-27 09:03:32 +01:00
Rossen Stoyanchev 68a529b915 Merge branch '5.1.x' 2019-03-26 21:14:51 -04:00
Juergen Hoeller b646943350 Upgrade to Hibernate ORM 5.4.2 2019-03-26 23:59:16 +01:00
Juergen Hoeller ea51270895 Merge branch '5.1.x' 2019-03-26 23:48:09 +01:00
Sam Brannen 49b6c5800a Merge branch '5.1.x' 2019-03-26 18:29:17 +01:00
Juergen Hoeller e3b6174b6d Merge branch '5.1.x' 2019-03-26 18:02:20 +01:00
Arjen Poutsma 4ca27db0cc Copy cookies to ServerResponse builders
See gh-22351
2019-03-26 16:32:54 +01:00
Arjen Poutsma 771d436680 Merge branch '5.1.x' 2019-03-26 16:19:57 +01:00
Juergen Hoeller 635305647c Polishing 2019-03-26 16:13:51 +01:00
Juergen Hoeller 210b178922 Restore retrieval of plain annotations through direct presence checks
Includes deprecation of several AnnotationUtils methods and nullability refinements for passed-in function arguments at the MergedAnnotation API level... also, MergedAnnotation.getType() returns a Class now.

Closes gh-22663
Closes gh-22685
2019-03-26 16:13:41 +01:00
Juergen Hoeller f7a4850675 AnnotationJmxAttributeSource uses MergedAnnotation API directly
Includes deprecation of AnnotationBeanUtils class (now unused).

Closes gh-22657
2019-03-26 16:13:23 +01:00
Arjen Poutsma 0db317575b Copy cookies in built ServerResponse
Closes gh-22481
2019-03-26 15:47:58 +01:00
Arjen Poutsma dba04a7338 Merge branch '5.1.x' 2019-03-26 15:34:48 +01:00
Arjen Poutsma d8215e7c79 Copy cookies and hints in built ServerResponse
Closes gh-22481
2019-03-26 15:31:15 +01:00
Sebastien Deleuze 6bf52ff8b9 Merge branch '5.1.x' 2019-03-26 14:30:49 +01:00
Sam Brannen 2a94cb2fe9 Merge branch '5.1.x' 2019-03-26 14:06:28 +01:00
Phillip Webb 0ace0be29b Fix annotation value mapping regression
Refine `TypeMappedAnnotation.getValueFromMetaAnnotation` to correctly
account for aliases when finding values from meta-annotations. Prior
to this commit, only convention based mappings were considered when
searching for values on meta-annotations. This meant that declared
meta-annotations that used aliases could return the "default value"
rather than the merged value.

Closes gh-22654
2019-03-25 17:19:12 -07:00
Sebastien Deleuze 88a2729fba Introduce spring-core-coroutines module
This commit introduces the spring-core-coroutines module
in order to avoid referencing Kotlin code from Java one,
which is currently not supported by Eclipse.

During the build, spring-core-coroutines is merged into
spring-core, so this change is expected to have no impact
for end users.

This module contains functions accessible from Java via
the CoroutinesUtils class to adapt Coroutines and Deferred
instances to and from Mono.

See gh-19975
2019-03-25 21:57:53 +01:00
Sam Brannen 837be3eaa0 Merge branch '5.1.x' 2019-03-25 18:17:23 +01:00
Arjen Poutsma 94c14c469e Fix checkstyle issue 2019-03-25 17:18:47 +01:00
Arjen Poutsma 1c46a9a6ff Remove direct Reactive Streams dependencies in Servlet.fn
Isolated direct dependencies to Reactive Streams types.
2019-03-25 16:16:20 +01:00
Phillip Webb cb7f997962 Defensively copy array returned from forAnnotations
Update the proxy used in `AnnotatedElementUtils.forAnnotations` so
that it returns a cloned array for calls to `getDeclaredAnnotations`
or `getAnnotations`. This matches the behavior of standard JDK
`AnnotatedElement` implementations.

Closes gh-22655
2019-03-25 07:53:42 -07:00
Juergen Hoeller 78fd882141 Remove superfluous empty lines after code blocks 2019-03-25 14:21:49 +01:00
Juergen Hoeller 3c02331983 Merge branch '5.1.x' 2019-03-25 13:59:24 +01:00
Sebastien Deleuze 8494c7a75a Add missing KDoc comments 2019-03-25 09:34:55 +01:00
Sebastien Deleuze 67c8d3753b Upgrade to Dokka 0.9.18 2019-03-25 09:34:55 +01:00
www 4517f40f57 Remove redundant 'String.substring()' call 2019-03-25 09:34:29 +01:00
Stephane Nicoll 80c48648d7 Merge pull request #22649 from ttddyy
* pr/22649:
  Fix typo on MergedAnnotations
2019-03-25 09:25:32 +01:00
Tadaya Tsuyukubo 860ec44c50 Fix typo on MergedAnnotations
Closes gh-22649
2019-03-25 09:25:16 +01:00
Sam Brannen 3a0f309e2c Update readme.txt in distributed artifacts 2019-03-23 19:43:34 +01:00
Sam Brannen d41c4522da Remove italics from XML examples in Reference Manual 2019-03-23 19:32:01 +01:00
Sam Brannen 4f619787ad Revert change from URL Cleanup 2019-03-23 19:20:40 +01:00
Sam Brannen 57ab877f0d Upgrade to Gradle 5.3
Closes gh-22347
2019-03-23 18:04:44 +01:00
Sam Brannen cd19170ffb Polish BeanUtilsTests 2019-03-23 16:19:42 +01:00
Min-soo 670aa4b7ef Use JUnit 4's expected exception support in BeanUtilsTests
This commit uses JUnit 4's built-in expected exception support in
BeanUtilsTests,

Closes gh-22354
2019-03-23 16:15:07 +01:00
Sam Brannen 9ac2e034e7 Polishing 2019-03-23 16:09:47 +01:00
Johnny Lim 14b1a6fdcb Polish docs (#22645) 2019-03-23 15:48:47 +01:00
Sam Brannen 7bb66c4f49 Replace bit.ly links with real links 2019-03-23 13:54:40 +01:00
Sam Brannen 0c8b473cac Wikipedia -> Wiki 2019-03-23 13:44:59 +01:00
Sam Brannen 9b7215e640 URL Cleanup - update remaining license headers
See gh-22617 gh-22622 gh-22635
2019-03-23 13:11:10 +01:00
Sam Brannen 20764685ec Merge URL Cleanup PRs
This merges the URL Cleanup PRs along with fixes.

Closes gh-22617 gh-22622 gh-22635
2019-03-23 13:01:57 +01:00
Sam Brannen 8a61c56154 URL Cleanup - upgrade to more modern Xalan namespace
See gh-22617 gh-22622 gh-22635
2019-03-23 12:21:21 +01:00
Juergen Hoeller bddba68549 Polishing 2019-03-23 12:14:35 +01:00
Juergen Hoeller 32b46866c7 Make MultipartResolutionDelegate final (aligned with other delegates) 2019-03-23 12:14:21 +01:00
Juergen Hoeller 62e5585c2e Avoid package cycle between beans.factory.annotation and b.f.support
See gh-2060
2019-03-23 12:14:03 +01:00
Juergen Hoeller 5e15338a09 Nullability refinements (no IntelliJ warnings, fewer null checks)
Includes consistent ignoring of all java.lang (meta-)annotations.

Closes gh-22586
2019-03-23 12:13:38 +01:00
Sam Brannen 68837ebb57 URL Cleanup - fix undesirable code change
Namespace handlers are mapped based on the canonical names for XML
namespaces which in Spring do not use "https" as the scheme.

See gh-22617 gh-22622 gh-22635
2019-03-23 11:56:31 +01:00
Sam Brannen 307a74835d URL Cleanup - remove obsolete ATOM schema location
See gh-22617 gh-22622 gh-22635
2019-03-23 11:54:49 +01:00
Sam Brannen 2db36c00e7 URL Cleanup - use HTTPS where possible in links in Testing Chapter
See gh-22617 gh-22622 gh-22635
2019-03-23 11:54:11 +01:00
Sam Brannen 6164664f65 URL Cleanup - fix XSD imports
See gh-22617 gh-22622 gh-22635
2019-03-23 11:53:24 +01:00
Sam Brannen cedcd2fddd URL Cleanup - fix links
See gh-22617 gh-22622 gh-22635
2019-03-23 11:52:49 +01:00
Phillip Webb 75b52309a7 Migrate CommonAnnotationBeanPostProcessor to MergedAnnotations
Closes gh-22585
2019-03-22 20:40:05 +01:00
Phillip Webb 50c257794f Migrate DefaultListableBeanFactory to MergedAnnotations
Closes gh-22584
2019-03-22 20:40:05 +01:00
Phillip Webb 857371ba67 Migrate AutowiredAnnotationBeanPostProcessor to MergedAnnotations
Closes gh-22582
2019-03-22 20:40:05 +01:00
Phillip Webb f065abac93 Migrate AnnotationAwareOrderComparator to MergedAnnotations
Closes gh-22581
2019-03-22 20:40:05 +01:00
Phillip Webb 7244c9aea1 Add more aggressive annotation element filtering
Refine the element filtering performed by `AnnotationsScanner` to also
cover `org.springframework.util` and most `com.sun` classes which turn
out to be referenced quite frequently and which we know contain no
useful annotations.

See gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb db8eaec131 Cache BridgeMethodResolver results
Add a cache to `BridgeMethodResolver` to help with repeated calls to
resolve the same methods. Since bridge method resolution can be somewhat
expensive (especially when resolving generics), and the number of bridge
methods is quite small, a cache generally helps.

This commit also simplifies the code a little by calling `doWithMethods`
directly rather than relying on `ReflectionUtils.getAllDeclaredMethods`
to do so. The methods list is now always created, but we save the list
creation that `getAllDeclaredMethods` used to do.

Closes gh-22579
2019-03-22 20:40:05 +01:00
Phillip Webb a57d6ba5f3 Optimize StringUtils.cleanPath
Add an early exit to `StringUtils.cleanPath` to save array creating and
string concatenation. With a typical Spring application, the `cleanPath`
method can be called over 600 times, often with a path constructed by
a `ClassPathResource` that is likely to already be clean.

Closes gh-22568
2019-03-22 20:40:05 +01:00
Phillip Webb 19fb697d03 Add more empty array constants in ReflectionUtils
Add some additional empty array constants to `ReflectionUtils` to save
us creating new arrays for zero length results.

See gh-22567
2019-03-22 20:40:05 +01:00
Phillip Webb e3a86be122 Make ConcurrentReferenceHashMap more JIT friendly
Update `ConcurrentReferenceHashMap` to make some methods more inline
friendly, and to manually inline a few others. These minor optimizations
don't make a great deal of difference for most applications, but seem
worthwhile since we use `ConcurrentReferenceHashMap` for many internal
caches.

Closes gh-22566
2019-03-22 20:40:05 +01:00
Phillip Webb aa4e56b251 Optimize @Configuration class parsing a little
Update `ConfigurationClassParser` to skip `java.lang.annotation` types
which were often processed but would never provide useful results. Also
use a single shared immutable `SourceClass` instance to represent
`Object.class`.

Closes gh-22563
2019-03-22 20:40:05 +01:00
Phillip Webb 37255afca4 Complete migration of annotation utility methods
Delete `InternalAnnotationUtils` and `InternalAnnotatedElementUtils` and
migrate exclusively to the new `MergedAnnotations` API.

Closes gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb a14bfe9a21 Migrate and verify annotation utility methods
Migrate all possible `AnnotationUtils` and `AnnotatedElementUtils`
method to the `MergedAnnotation` API, verify results against the old
implementations.

All migrated methods now call both the new API and the old version and
ensure that the same results or exceptions are raised. A full build of
both Spring Framework and Spring Boot has been executed to ensure, as
much as possible, that the migration does not cause unexpected
regressions.

See gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb b91ccf038f Start migration annotation utility methods
Create internal variants of the existing `AnnotationUtils` and
`AnnotatedElementUtils` classes and migrate the existing classes to
use them.

The internal variants will be used to check that the same results are
given as we migrate the utils methods to use the new `MergedAnnotations`
API.

See gh-22562
2019-03-22 20:40:05 +01:00
Phillip Webb 4972d85ae0 Create a new API for handling merged annotations
Add new `MergedAnnotations` and `MergedAnnotation` interfaces that
attempt to provide a uniform way for dealing with merged annotations.

Specifically, the new API provides alternatives for the static methods
in `AnnotationUtils` and `AnnotatedElementUtils` and supports Spring's
comprehensive annotation attribute `@AliasFor` features. The interfaces
also open the possibility of the same API being exposed from the
`AnnotationMetadata` interface.

Additional utility classes for collecting, filtering and selecting
annotations have also been added.

Typical usage for the new API would be something like:

	MergedAnnotations.from(Example.class)
		.stream(MyAnnotation.class)
		.map(a -> a.getString("value"))
		.forEach(System.out::println);

Closes gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb fdacda8b01 Add AnnotationIntrospectionFailureTests
Add a new test class to help cover annotation introspection failure
handling. These tests were previously missing and are important to
ensure that annotation util code changes don't introduce regressions.

See gh-21697
2019-03-22 20:40:05 +01:00
Phillip Webb 8ef609a1b7 Add public variant getDeclaredMethods method
Add a public variant of `getDeclaredMethods` that defensively copies the
cached methods array. This is often more faster and more convenient
for users than calling `doWithLocalMethods`. We still retain most of the
benefits of the cache, namely fewer security manager calls and not as
many `Method` instances being created.

Closes gh-22580
2019-03-22 20:40:05 +01:00
Phillip Webb 5044ee8fe6 Add AssertJ dependency for tests usage
Add AssertJ as a test scope dependency for all sub-projects.

Closes gh-22561
2019-03-22 20:40:05 +01:00
Phillip Webb ecbad874bf Refine eclipse settings 2019-03-22 20:40:05 +01:00
Phillip Webb 9c92b21af8 Polishing 2019-03-22 20:40:05 +01:00
Rossen Stoyanchev f8121515bf Merge branch '5.1.x' 2019-03-22 14:50:51 -04:00
Sam Brannen 7fe12cc23e URL Cleanup
This merges the URL Cleanup PRs along with fixes.

Closes gh-22617 gh-22622 gh-22635
2019-03-22 16:37:36 +01:00
Sam Brannen 14902e1744 Polish Javadoc 2019-03-22 13:32:24 +01:00
arman simonyan 517812d30a Fix grammar issue 2019-03-22 09:25:21 +01:00
Rob Winch bff3d2f2be Update to spring-javaformat-checkstyle 0.0.7
Remove unnecessary lambdas to fix updated checkstyle
2019-03-22 00:35:32 -05:00
Rob Winch 62ea7382d7 Polish URL Cleanup
Update Apache Headers
2019-03-22 00:24:06 -05:00
Spring Operator dc6f63f610 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 6625 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 23:49:28 -05:00
Rob Winch 263868f018 Polish URL Cleanup 2019-03-21 23:47:38 -05:00
Rossen Stoyanchev 2f95859715 Upgrade to RSocket 0.12.1-RC3-SNAPSHOT
Closes gh-22629
2019-03-21 19:31:06 -04:00
Spring Operator d99edd154f URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* [ ] http://aopalliance.sourceforge.net (200) with 1 occurrences could not be migrated:
   ([https](https://aopalliance.sourceforge.net) result AnnotatedConnectException).
* [ ] http://cglib.sourceforge.net (200) with 2 occurrences could not be migrated:
   ([https](https://cglib.sourceforge.net) result AnnotatedConnectException).
* [ ] http://classdoc.sourceforge.net (200) with 1 occurrences could not be migrated:
   ([https](https://classdoc.sourceforge.net) result AnnotatedConnectException).
* [ ] http://code.jquery.com:80/jquery.js (200) with 1 occurrences could not be migrated:
   ([https](https://code.jquery.com:80/jquery.js) result ClosedChannelException).
* [ ] http://dbunit.sourceforge.net/ (200) with 1 occurrences could not be migrated:
   ([https](https://dbunit.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html (200) with 1 occurrences could not be migrated:
   ([https](https://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html) result SSLProtocolException).
* [ ] http://domain3.com (200) with 6 occurrences could not be migrated:
   ([https](https://domain3.com) result ConnectTimeoutException).
* [ ] http://forum.thymeleaf.org/Thymeleaf-3-0-8-JUST-PUBLISHED-td4030687.html (200) with 1 occurrences could not be migrated:
   ([https](https://forum.thymeleaf.org/Thymeleaf-3-0-8-JUST-PUBLISHED-td4030687.html) result SSLHandshakeException).
* [ ] http://grinder.sourceforge.net/ (200) with 1 occurrences could not be migrated:
   ([https](https://grinder.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://groovy-lang.org/templating.html (200) with 3 occurrences could not be migrated:
   ([https](https://groovy-lang.org/templating.html) result SSLProtocolException).
* [ ] http://hsqldb.org (200) with 1 occurrences could not be migrated:
   ([https](https://hsqldb.org) result SSLHandshakeException).
* [ ] http://htmlunit.sourceforge.net/ (200) with 3 occurrences could not be migrated:
   ([https](https://htmlunit.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://htmlunit.sourceforge.net/gettingStarted.html (200) with 1 occurrences could not be migrated:
   ([https](https://htmlunit.sourceforge.net/gettingStarted.html) result AnnotatedConnectException).
* [ ] http://htmlunit.sourceforge.net/javascript.html (200) with 1 occurrences could not be migrated:
   ([https](https://htmlunit.sourceforge.net/javascript.html) result AnnotatedConnectException).
* [ ] http://javadiff.cvs.sourceforge.net/ (200) with 3 occurrences could not be migrated:
   ([https](https://javadiff.cvs.sourceforge.net/) result SSLHandshakeException).
* [ ] http://jibx.sourceforge.net/ (200) with 2 occurrences could not be migrated:
   ([https](https://jibx.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://joda-time.sourceforge.net (200) with 1 occurrences could not be migrated:
   ([https](https://joda-time.sourceforge.net) result AnnotatedConnectException).
* [ ] http://jotm.objectweb.org/ (200) with 1 occurrences could not be migrated:
   ([https](https://jotm.objectweb.org/) result NotSslRecordException).
* [ ] http://json-b.net/ (200) with 1 occurrences could not be migrated:
   ([https](https://json-b.net/) result SSLHandshakeException).
* [ ] http://mx4j.sourceforge.net (200) with 1 occurrences could not be migrated:
   ([https](https://mx4j.sourceforge.net) result AnnotatedConnectException).
* [ ] http://mx4j.sourceforge.net/ (200) with 1 occurrences could not be migrated:
   ([https](https://mx4j.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://mydomain3.com (200) with 9 occurrences could not be migrated:
   ([https](https://mydomain3.com) result ConnectTimeoutException).
* [ ] http://objenesis.org (200) with 1 occurrences could not be migrated:
   ([https](https://objenesis.org) result SSLHandshakeException).
* [ ] http://objenesis.org/tutorial.html (200) with 1 occurrences could not be migrated:
   ([https](https://objenesis.org/tutorial.html) result SSLHandshakeException).
* [ ] http://other.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://other.com/) result SSLHandshakeException).
* [ ] http://reactivex.io/ (200) with 1 occurrences could not be migrated:
   ([https](https://reactivex.io/) result SSLHandshakeException).
* [ ] http://reactivex.io/documentation/operators.html (200) with 1 occurrences could not be migrated:
   ([https](https://reactivex.io/documentation/operators.html) result SSLHandshakeException).
* [ ] http://url.somewhereelse.com (200) with 4 occurrences could not be migrated:
   ([https](https://url.somewhereelse.com) result SSLHandshakeException).
* [ ] http://www.beanshell.org (200) with 1 occurrences could not be migrated:
   ([https](https://www.beanshell.org) result SSLHandshakeException).
* [ ] http://www.beanshell.org/ (200) with 1 occurrences could not be migrated:
   ([https](https://www.beanshell.org/) result SSLHandshakeException).
* [ ] http://www.doclet.com (200) with 1 occurrences could not be migrated:
   ([https](https://www.doclet.com) result AnnotatedConnectException).
* [ ] http://www.gebish.org/ (200) with 1 occurrences could not be migrated:
   ([https](https://www.gebish.org/) result SSLHandshakeException).
* [ ] http://www.gebish.org/manual/current/ (200) with 3 occurrences could not be migrated:
   ([https](https://www.gebish.org/manual/current/) result SSLHandshakeException).
* [ ] http://www.groovy-lang.org/ (200) with 2 occurrences could not be migrated:
   ([https](https://www.groovy-lang.org/) result SSLProtocolException).
* [ ] http://www.groovy-lang.org/operators.html (200) with 2 occurrences could not be migrated:
   ([https](https://www.groovy-lang.org/operators.html) result SSLProtocolException).
* [ ] http://www.hsqldb.org (200) with 1 occurrences could not be migrated:
   ([https](https://www.hsqldb.org) result SSLHandshakeException).
* [ ] http://www.jensgulden.de (200) with 1 occurrences could not be migrated:
   ([https](https://www.jensgulden.de) result AnnotatedConnectException).
* [ ] http://www.mockobjects.com (200) with 1 occurrences could not be migrated:
   ([https](https://www.mockobjects.com) result ClosedChannelException).
* [ ] http://www.mockobjects.com/ (200) with 1 occurrences could not be migrated:
   ([https](https://www.mockobjects.com/) result ClosedChannelException).
* [ ] http://www.w3.org/TR/cors/ (200) with 19 occurrences could not be migrated:
   ([https](https://www.w3.org/TR/cors/) result SSLException).
* [ ] http://xmlunit.sourceforge.net/ (200) with 2 occurrences could not be migrated:
   ([https](https://xmlunit.sourceforge.net/) result AnnotatedConnectException).
* [ ] http://www.easymock.org (301) with 1 occurrences could not be migrated:
   ([https](https://www.easymock.org) result SSLHandshakeException).
* [ ] http://www.easymock.org/ (301) with 1 occurrences could not be migrated:
   ([https](https://www.easymock.org/) result SSLHandshakeException).
* [ ] http://www.jmock.org/ (301) with 1 occurrences could not be migrated:
   ([https](https://www.jmock.org/) result SSLHandshakeException).
* [ ] http://foo.com (301) with 4 occurrences could not be migrated:
   ([https](https://foo.com) result SSLHandshakeException).
* [ ] http://foo.com/ (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/) result SSLHandshakeException).
* [ ] http://foo.com/a (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/a) result SSLHandshakeException).
* [ ] http://foo.com/a?foo=bar&foo=baz (301) with 4 occurrences could not be migrated:
   ([https](https://foo.com/a?foo=bar&foo=baz) result SSLHandshakeException).
* [ ] http://foo.com/bar (301) with 5 occurrences could not be migrated:
   ([https](https://foo.com/bar) result SSLHandshakeException).
* [ ] http://foo.com/baz (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/baz) result SSLHandshakeException).
* [ ] http://foo.com/rest/books/6.json (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/rest/books/6.json) result SSLHandshakeException).
* [ ] http://foo.com/rest/books/6/pages/1.json (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/rest/books/6/pages/1.json) result SSLHandshakeException).
* [ ] http://foo.com/v1 (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/v1) result SSLHandshakeException).
* [ ] http://foo.com/v1/123 (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/v1/123) result SSLHandshakeException).
* [ ] http://foo.com/v1/bar (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/v1/bar) result SSLHandshakeException).
* [ ] http://foo.com/v1?id=123 (301) with 2 occurrences could not be migrated:
   ([https](https://foo.com/v1?id=123) result SSLHandshakeException).
* [ ] http://foo.com/wrong (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com/wrong) result SSLHandshakeException).
* [ ] http://mydomain4.com (301) with 3 occurrences could not be migrated:
   ([https](https://mydomain4.com) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/ (301) with 4 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/external-general-entities (301) with 10 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/external-general-entities) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/is-standalone (301) with 1 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/is-standalone) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/namespace-prefixes (301) with 13 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/namespace-prefixes) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/namespaces (301) with 12 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/namespaces) result SSLHandshakeException).
* [ ] http://xml.org/sax/features/namespaces-prefixes (301) with 1 occurrences could not be migrated:
   ([https](https://xml.org/sax/features/namespaces-prefixes) result SSLHandshakeException).
* [ ] http://xml.org/sax/properties/lexical-handler (301) with 12 occurrences could not be migrated:
   ([https](https://xml.org/sax/properties/lexical-handler) result SSLHandshakeException).
* [ ] http://www.caucho.com/hessian (302) with 6 occurrences could not be migrated:
   ([https](https://www.caucho.com/hessian) result SSLHandshakeException).
* [ ] http://example.com:80/test/this/here (404) with 3 occurrences could not be migrated:
   ([https](https://example.com:80/test/this/here) result NotSslRecordException).
* [ ] http://www.foo.com/schema/component/component.xsd (404) with 1 occurrences could not be migrated:
   ([https](https://www.foo.com/schema/component/component.xsd) result SSLHandshakeException).
* [ ] http://www.foo.com/schema/jcache (404) with 2 occurrences could not be migrated:
   ([https](https://www.foo.com/schema/jcache) result SSLHandshakeException).
* [ ] http://www.mycompany.com/schema/myns/myns.xsd (404) with 1 occurrences could not be migrated:
   ([https](https://www.mycompany.com/schema/myns/myns.xsd) result ConnectTimeoutException).
* [ ] http://xunitpatterns.com/Test%20Spy.html (404) with 1 occurrences could not be migrated:
   ([https](https://xunitpatterns.com/Test%20Spy.html) result AnnotatedConnectException).

These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://mydomain2.com (302) with 22 occurrences migrated to:
  /QTifZ/ ([https](https://mydomain2.com) result IllegalArgumentException).
* [ ] http://www.jdiff.org (302) with 1 occurrences migrated to:
  /VQYNZ/ ([https](https://www.jdiff.org) result IllegalArgumentException).
* [ ] http://192.168.0.1/mvc-showcase (301) with 1 occurrences migrated to:
  /admin/ ([https](https://192.168.0.1/mvc-showcase) result IllegalArgumentException).
* [ ] http://bugs.sun.com/view_bug.do?bug_id=6342411 (302) with 1 occurrences migrated to:
  https://bugs.java.com/view_bug.do?bug_id=6342411 ([https](https://bugs.sun.com/view_bug.do?bug_id=6342411) result SSLHandshakeException).
* [ ] http://bugs.sun.com/view_bug.do?bug_id=7023180 (302) with 2 occurrences migrated to:
  https://bugs.java.com/view_bug.do?bug_id=7023180 ([https](https://bugs.sun.com/view_bug.do?bug_id=7023180) result SSLHandshakeException).
* [ ] http://www.freemarker.org (301) with 5 occurrences migrated to:
  https://freemarker.apache.org/ ([https](https://www.freemarker.org) result ConnectTimeoutException).
* [ ] http://sockjs.org (303) with 2 occurrences migrated to:
  https://github.com/sockjs/sockjs-client ([https](https://sockjs.org) result AnnotatedConnectException).
* [ ] http://projects.eclipse.org/projects/tools.buildship (301) with 1 occurrences migrated to:
  https://projects.eclipse.org/projects/tools.buildship ([https](https://projects.eclipse.org/projects/tools.buildship) result SSLException).
* [ ] http://tools.ietf.org/html/rfc6202 (301) with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc6202 ([https](https://tools.ietf.org/html/rfc6202) result ReadTimeoutException).
* [ ] http://tools.ietf.org/html/rfc7239 (301) with 7 occurrences migrated to:
  https://tools.ietf.org/html/rfc7239 ([https](https://tools.ietf.org/html/rfc7239) result ReadTimeoutException).
* [ ] http://aaa.org:8080/a (301) with 1 occurrences migrated to:
  https://www.aaa.org/articles/ ([https](https://aaa.org:8080/a) result NotSslRecordException).
* [ ] http://www.caucho.com (302) with 1 occurrences migrated to:
  https://www.caucho.com/ ([https](https://www.caucho.com) result SSLHandshakeException).
* [ ] http://jruby.org (301) with 4 occurrences migrated to:
  https://www.jruby.org ([https](https://jruby.org) result SSLHandshakeException).
* [ ] http://jruby.org/ (301) with 1 occurrences migrated to:
  https://www.jruby.org ([https](https://jruby.org/) result SSLHandshakeException).
* [ ] http://bbb.org:9090/b (AnnotatedConnectException) with 2 occurrences migrated to:
  https://bbb.org:9090/b ([https](https://bbb.org:9090/b) result AnnotatedConnectException).
* [ ] http://192.168.28.42/1.jsp (ConnectTimeoutException) with 3 occurrences migrated to:
  https://192.168.28.42/1.jsp ([https](https://192.168.28.42/1.jsp) result ConnectTimeoutException).
* [ ] http://abc.com/v2/accounts?q=12 (ConnectTimeoutException) with 1 occurrences migrated to:
  https://abc.com/v2/accounts?q=12 ([https](https://abc.com/v2/accounts?q=12) result ConnectTimeoutException).
* [ ] http://example.com:8080/ (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.com:8080/ ([https](https://example.com:8080/) result ConnectTimeoutException).
* [ ] http://example.com:8080/bar (ConnectTimeoutException) with 5 occurrences migrated to:
  https://example.com:8080/bar ([https](https://example.com:8080/bar) result ConnectTimeoutException).
* [ ] http://example.org:9090 (ConnectTimeoutException) with 2 occurrences migrated to:
  https://example.org:9090 ([https](https://example.org:9090) result ConnectTimeoutException).
* [ ] http://example.org:9090/base (ConnectTimeoutException) with 12 occurrences migrated to:
  https://example.org:9090/base ([https](https://example.org:9090/base) result ConnectTimeoutException).
* [ ] http://example.org:9090/base/people (ConnectTimeoutException) with 2 occurrences migrated to:
  https://example.org:9090/base/people ([https](https://example.org:9090/base/people) result ConnectTimeoutException).
* [ ] http://example.org:9090/base/something/1/foo (ConnectTimeoutException) with 2 occurrences migrated to:
  https://example.org:9090/base/something/1/foo ([https](https://example.org:9090/base/something/1/foo) result ConnectTimeoutException).
* [ ] http://example.org:9090/base/something/else (ConnectTimeoutException) with 2 occurrences migrated to:
  https://example.org:9090/base/something/else ([https](https://example.org:9090/base/something/else) result ConnectTimeoutException).
* [ ] http://example.org:9999/base (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/base ([https](https://example.org:9999/base) result ConnectTimeoutException).
* [ ] http://example.org:9999/base/api/people/123/addresses (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/base/api/people/123/addresses ([https](https://example.org:9999/base/api/people/123/addresses) result ConnectTimeoutException).
* [ ] http://example.org:9999/base/api/people/123/addresses/DE (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/base/api/people/123/addresses/DE ([https](https://example.org:9999/base/api/people/123/addresses/DE) result ConnectTimeoutException).
* [ ] http://example.org:9999/base/people/123/addresses/DE (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/base/people/123/addresses/DE ([https](https://example.org:9999/base/people/123/addresses/DE) result ConnectTimeoutException).
* [ ] http://example.org:9999/next (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/next ([https](https://example.org:9999/next) result ConnectTimeoutException).
* [ ] http://example.org:9999/path?q=foo (ConnectTimeoutException) with 1 occurrences migrated to:
  https://example.org:9999/path?q=foo ([https](https://example.org:9999/path?q=foo) result ConnectTimeoutException).
* [ ] http://foo.com:8080/v1/bar?id=123 (ConnectTimeoutException) with 1 occurrences migrated to:
  https://foo.com:8080/v1/bar?id=123 ([https](https://foo.com:8080/v1/bar?id=123) result ConnectTimeoutException).
* [ ] http://mydomain1.com:123 (ConnectTimeoutException) with 1 occurrences migrated to:
  https://mydomain1.com:123 ([https](https://mydomain1.com:123) result ConnectTimeoutException).
* [ ] http://site1.com (ConnectTimeoutException) with 13 occurrences migrated to:
  https://site1.com ([https](https://site1.com) result ConnectTimeoutException).
* [ ] http://wwws.sun.com/software/xml/developers/diffmk/ (ConnectTimeoutException) with 1 occurrences migrated to:
  https://wwws.sun.com/software/xml/developers/diffmk/ ([https](https://wwws.sun.com/software/xml/developers/diffmk/) result ConnectTimeoutException).
* [ ] http://aaa.org:8080/app/b/c/d (ReadTimeoutException) with 1 occurrences migrated to:
  https://aaa.org:8080/app/b/c/d ([https](https://aaa.org:8080/app/b/c/d) result NotSslRecordException).
* [ ] http://aaa.org:8080/b/c/d (ReadTimeoutException) with 1 occurrences migrated to:
  https://aaa.org:8080/b/c/d ([https](https://aaa.org:8080/b/c/d) result NotSslRecordException).
* [ ] http://www.w3.org/2000/xmlns/ (ReadTimeoutException) with 5 occurrences migrated to:
  https://www.w3.org/2000/xmlns/ ([https](https://www.w3.org/2000/xmlns/) result SSLException).
* [ ] http://www.w3.org/2004/08/xop/include (ReadTimeoutException) with 2 occurrences migrated to:
  https://www.w3.org/2004/08/xop/include ([https](https://www.w3.org/2004/08/xop/include) result SSLException).
* [ ] http://www.w3.org/DesignIssues/MatrixURIs.html (ReadTimeoutException) with 2 occurrences migrated to:
  https://www.w3.org/DesignIssues/MatrixURIs.html ([https](https://www.w3.org/DesignIssues/MatrixURIs.html) result SSLException).
* [ ] http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/ (ReadTimeoutException) with 2 occurrences migrated to:
  https://www.w3.org/TR/2004/WD-soap12-mtom-20040608/ ([https](https://www.w3.org/TR/2004/WD-soap12-mtom-20040608/) result SSLException).
* [ ] http://www.w3.org/TR/2005/REC-xop10-20050125/ (ReadTimeoutException) with 6 occurrences migrated to:
  https://www.w3.org/TR/2005/REC-xop10-20050125/ ([https](https://www.w3.org/TR/2005/REC-xop10-20050125/) result SSLException).
* [ ] http://www.w3.org/TR/eventsource/ (ReadTimeoutException) with 2 occurrences migrated to:
  https://www.w3.org/TR/eventsource/ ([https](https://www.w3.org/TR/eventsource/) result SSLException).
* [ ] http://www.w3.org/TR/html4/loose.dtd (ReadTimeoutException) with 5 occurrences migrated to:
  https://www.w3.org/TR/html4/loose.dtd ([https](https://www.w3.org/TR/html4/loose.dtd) result SSLException).
* [ ] http://www.w3.org/TR/xhtml1/ (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/TR/xhtml1/ ([https](https://www.w3.org/TR/xhtml1/) result SSLException).
* [ ] http://www.w3.org/TR/xhtml1/diffs.html (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/TR/xhtml1/diffs.html ([https](https://www.w3.org/TR/xhtml1/diffs.html) result SSLException).
* [ ] http://www.w3.org/TR/xhtml1/dtds.html (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/TR/xhtml1/dtds.html ([https](https://www.w3.org/TR/xhtml1/dtds.html) result SSLException).
* [ ] http://www.w3.org/XML/1998/namespace (ReadTimeoutException) with 5 occurrences migrated to:
  https://www.w3.org/XML/1998/namespace ([https](https://www.w3.org/XML/1998/namespace) result SSLException).
* [ ] http://Additional-namespace-name-URI (UnknownHostException) with 1 occurrences migrated to:
  https://Additional-namespace-name-URI ([https](https://Additional-namespace-name-URI) result UnknownHostException).
* [ ] http://DOMAIN2.com (UnknownHostException) with 2 occurrences migrated to:
  https://DOMAIN2.com ([https](https://DOMAIN2.com) result UnknownHostException).
* [ ] http://Default-namespace-name-URI (UnknownHostException) with 1 occurrences migrated to:
  https://Default-namespace-name-URI ([https](https://Default-namespace-name-URI) result UnknownHostException).
* [ ] http://HOST:8080/remoting/AccountService (UnknownHostException) with 1 occurrences migrated to:
  https://HOST:8080/remoting/AccountService ([https](https://HOST:8080/remoting/AccountService) result UnknownHostException).
* [ ] http://Namespace-name-URI (UnknownHostException) with 1 occurrences migrated to:
  https://Namespace-name-URI ([https](https://Namespace-name-URI) result UnknownHostException).
* [ ] http://Unbound-namespace-name-URI (UnknownHostException) with 1 occurrences migrated to:
  https://Unbound-namespace-name-URI ([https](https://Unbound-namespace-name-URI) result UnknownHostException).
* [ ] http://a.example.org/mvc-showcase (UnknownHostException) with 1 occurrences migrated to:
  https://a.example.org/mvc-showcase ([https](https://a.example.org/mvc-showcase) result UnknownHostException).
* [ ] http://anotherHost/mvc-showcase (UnknownHostException) with 1 occurrences migrated to:
  https://anotherHost/mvc-showcase ([https](https://anotherHost/mvc-showcase) result UnknownHostException).
* [ ] http://arjen:foobar@java.sun.com:80 (UnknownHostException) with 1 occurrences migrated to:
  https://arjen:foobar@java.sun.com:80 ([https](https://arjen:foobar@java.sun.com:80) result UnknownHostException).
* [ ] http://barfoo:8888 (UnknownHostException) with 1 occurrences migrated to:
  https://barfoo:8888 ([https](https://barfoo:8888) result UnknownHostException).
* [ ] http://dev.bar.com (UnknownHostException) with 3 occurrences migrated to:
  https://dev.bar.com ([https](https://dev.bar.com) result UnknownHostException).
* [ ] http://domain1.com (UnknownHostException) with 25 occurrences migrated to:
  https://domain1.com ([https](https://domain1.com) result UnknownHostException).
* [ ] http://domain1.com/test.html (UnknownHostException) with 4 occurrences migrated to:
  https://domain1.com/test.html ([https](https://domain1.com/test.html) result UnknownHostException).
* [ ] http://domain2.com (UnknownHostException) with 98 occurrences migrated to:
  https://domain2.com ([https](https://domain2.com) result UnknownHostException).
* [ ] http://example.com&quot;,HttpMethod.GET (UnknownHostException) with 6 occurrences migrated to:
  https://example.com&quot;,HttpMethod.GET ([https](https://example.com&quot;,HttpMethod.GET) result UnknownHostException).
* [ ] http://example/ (UnknownHostException) with 1 occurrences migrated to:
  https://example/ ([https](https://example/) result UnknownHostException).
* [ ] http://fake-service (UnknownHostException) with 7 occurrences migrated to:
  https://fake-service ([https](https://fake-service) result UnknownHostException).
* [ ] http://foo (UnknownHostException) with 3 occurrences migrated to:
  https://foo ([https](https://foo) result UnknownHostException).
* [ ] http://foo.bar.com (UnknownHostException) with 4 occurrences migrated to:
  https://foo.bar.com ([https](https://foo.bar.com) result UnknownHostException).
* [ ] http://foobar:8088 (UnknownHostException) with 1 occurrences migrated to:
  https://foobar:8088 ([https](https://foobar:8088) result UnknownHostException).
* [ ] http://host:port/myApp/myEndpoint/ (UnknownHostException) with 1 occurrences migrated to:
  https://host:port/myApp/myEndpoint/ ([https](https://host:port/myApp/myEndpoint/) result UnknownHostException).
* [ ] http://jaxws.remoting.springframework.org/ (UnknownHostException) with 4 occurrences migrated to:
  https://jaxws.remoting.springframework.org/ ([https](https://jaxws.remoting.springframework.org/) result UnknownHostException).
* [ ] http://joe.openid.example.org/ (UnknownHostException) with 2 occurrences migrated to:
  https://joe.openid.example.org/ ([https](https://joe.openid.example.org/) result UnknownHostException).
* [ ] http://myserver (UnknownHostException) with 1 occurrences migrated to:
  https://myserver ([https](https://myserver) result UnknownHostException).
* [ ] http://myserver/logo.png (UnknownHostException) with 1 occurrences migrated to:
  https://myserver/logo.png ([https](https://myserver/logo.png) result UnknownHostException).
* [ ] http://myurl (UnknownHostException) with 12 occurrences migrated to:
  https://myurl ([https](https://myurl) result UnknownHostException).
* [ ] http://remotehost:8080/remoting/AccountService (UnknownHostException) with 2 occurrences migrated to:
  https://remotehost:8080/remoting/AccountService ([https](https://remotehost:8080/remoting/AccountService) result UnknownHostException).
* [ ] http://samples.springframework.org/order (UnknownHostException) with 2 occurrences migrated to:
  https://samples.springframework.org/order ([https](https://samples.springframework.org/order) result UnknownHostException).
* [ ] http://somethingDifferent (UnknownHostException) with 1 occurrences migrated to:
  https://somethingDifferent ([https](https://somethingDifferent) result UnknownHostException).
* [ ] http://url.somewhere.com (UnknownHostException) with 25 occurrences migrated to:
  https://url.somewhere.com ([https](https://url.somewhere.com) result UnknownHostException).
* [ ] http://url.somewhere.com/path (UnknownHostException) with 1 occurrences migrated to:
  https://url.somewhere.com/path ([https](https://url.somewhere.com/path) result UnknownHostException).
* [ ] http://url.somewhere.com/path?id=1 (UnknownHostException) with 1 occurrences migrated to:
  https://url.somewhere.com/path?id=1 ([https](https://url.somewhere.com/path?id=1) result UnknownHostException).
* [ ] http://url.somewhere.com/test.htm (UnknownHostException) with 2 occurrences migrated to:
  https://url.somewhere.com/test.htm ([https](https://url.somewhere.com/test.htm) result UnknownHostException).
* [ ] http://url.somewhere.com?a=b&c=d (UnknownHostException) with 1 occurrences migrated to:
  https://url.somewhere.com?a=b&c=d ([https](https://url.somewhere.com?a=b&c=d) result UnknownHostException).
* [ ] http://url.somewhere.com?foo= (UnknownHostException) with 2 occurrences migrated to:
  https://url.somewhere.com?foo= ([https](https://url.somewhere.com?foo=) result UnknownHostException).
* [ ] http://url.somewhere.com?foo=bar (UnknownHostException) with 4 occurrences migrated to:
  https://url.somewhere.com?foo=bar ([https](https://url.somewhere.com?foo=bar) result UnknownHostException).
* [ ] http://url.somewhere.com?foo=bar&a=b&c=d (UnknownHostException) with 2 occurrences migrated to:
  https://url.somewhere.com?foo=bar&a=b&c=d ([https](https://url.somewhere.com?foo=bar&a=b&c=d) result UnknownHostException).
* [ ] http://wiki.fasterxml.com/JacksonHome (UnknownHostException) with 3 occurrences migrated to:
  https://wiki.fasterxml.com/JacksonHome ([https](https://wiki.fasterxml.com/JacksonHome) result UnknownHostException).
* [ ] http://wiki.fasterxml.com/JacksonJsonViews (UnknownHostException) with 4 occurrences migrated to:
  https://wiki.fasterxml.com/JacksonJsonViews ([https](https://wiki.fasterxml.com/JacksonJsonViews) result UnknownHostException).
* [ ] http://www (UnknownHostException) with 1 occurrences migrated to:
  https://www ([https](https://www) result UnknownHostException).
* [ ] http://x.y.z (UnknownHostException) with 2 occurrences migrated to:
  https://x.y.z ([https](https://x.y.z) result UnknownHostException).
* [ ] http://abc.com/v1 (301) with 1 occurrences migrated to:
  https://abc.go.com/v1 ([https](https://abc.com/v1) result 404).
* [ ] http://abc.com/v1/accounts/43 (301) with 1 occurrences migrated to:
  https://abc.go.com/v1/accounts/43 ([https](https://abc.com/v1/accounts/43) result 404).
* [ ] http://abc.com/v1/accounts?q=12 (301) with 1 occurrences migrated to:
  https://abc.go.com/v1/accounts?q=12 ([https](https://abc.com/v1/accounts?q=12) result 404).
* [ ] http://apache.org/xml/features/disallow-doctype-decl (404) with 10 occurrences migrated to:
  https://apache.org/xml/features/disallow-doctype-decl ([https](https://apache.org/xml/features/disallow-doctype-decl) result 404).
* [ ] http://docs.spring.io/v1/bar (301) with 1 occurrences migrated to:
  https://docs.spring.io/v1/bar ([https](https://docs.spring.io/v1/bar) result 404).
* [ ] http://example.com/-foo (404) with 2 occurrences migrated to:
  https://example.com/-foo ([https](https://example.com/-foo) result 404).
* [ ] http://example.com/1 (404) with 1 occurrences migrated to:
  https://example.com/1 ([https](https://example.com/1) result 404).
* [ ] http://example.com/1/2 (404) with 2 occurrences migrated to:
  https://example.com/1/2 ([https](https://example.com/1/2) result 404).
* [ ] http://example.com/2 (404) with 1 occurrences migrated to:
  https://example.com/2 ([https](https://example.com/2) result 404).
* [ ] http://example.com/a%20b?q=a%2Bb (404) with 1 occurrences migrated to:
  https://example.com/a%20b?q=a%2Bb ([https](https://example.com/a%20b?q=a%2Bb) result 404).
* [ ] http://example.com/abc/ (404) with 1 occurrences migrated to:
  https://example.com/abc/ ([https](https://example.com/abc/) result 404).
* [ ] http://example.com/abc/x/y (404) with 1 occurrences migrated to:
  https://example.com/abc/x/y ([https](https://example.com/abc/x/y) result 404).
* [ ] http://example.com/abc/x/y/z (404) with 3 occurrences migrated to:
  https://example.com/abc/x/y/z ([https](https://example.com/abc/x/y/z) result 404).
* [ ] http://example.com/app/login/authenticate (404) with 1 occurrences migrated to:
  https://example.com/app/login/authenticate ([https](https://example.com/app/login/authenticate) result 404).
* [ ] http://example.com/arbitrary/path (404) with 1 occurrences migrated to:
  https://example.com/arbitrary/path ([https](https://example.com/arbitrary/path) result 404).
* [ ] http://example.com/bar (404) with 6 occurrences migrated to:
  https://example.com/bar ([https](https://example.com/bar) result 404).
* [ ] http://example.com/context.xml (404) with 4 occurrences migrated to:
  https://example.com/context.xml ([https](https://example.com/context.xml) result 404).
* [ ] http://example.com/example (404) with 6 occurrences migrated to:
  https://example.com/example ([https](https://example.com/example) result 404).
* [ ] http://example.com/example/?name (404) with 1 occurrences migrated to:
  https://example.com/example/?name ([https](https://example.com/example/?name) result 404).
* [ ] http://example.com/example/?name= (404) with 1 occurrences migrated to:
  https://example.com/example/?name= ([https](https://example.com/example/?name=) result 404).
* [ ] http://example.com/example/?name=%20 (404) with 1 occurrences migrated to:
  https://example.com/example/?name=%20 ([https](https://example.com/example/?name=%20) result 404).
* [ ] http://example.com/example/?name=row%5B0%5D (404) with 1 occurrences migrated to:
  https://example.com/example/?name=row%5B0%5D ([https](https://example.com/example/?name=row%5B0%5D) result 404).
* [ ] http://example.com/example/?name=value (404) with 1 occurrences migrated to:
  https://example.com/example/?name=value ([https](https://example.com/example/?name=value) result 404).
* [ ] http://example.com/example/?name=value&param2=value+2 (404) with 1 occurrences migrated to:
  https://example.com/example/?name=value&param2=value+2 ([https](https://example.com/example/?name=value&param2=value+2) result 404).
* [ ] http://example.com/example/?row%5B0%5D=value (404) with 1 occurrences migrated to:
  https://example.com/example/?row%5B0%5D=value ([https](https://example.com/example/?row%5B0%5D=value) result 404).
* [ ] http://example.com/foo (404) with 7 occurrences migrated to:
  https://example.com/foo ([https](https://example.com/foo) result 404).
* [ ] http://example.com/foo/../bar (404) with 1 occurrences migrated to:
  https://example.com/foo/../bar ([https](https://example.com/foo/../bar) result 404).
* [ ] http://example.com/foo/foo2?bar (404) with 1 occurrences migrated to:
  https://example.com/foo/foo2?bar ([https](https://example.com/foo/foo2?bar) result 404).
* [ ] http://example.com/foo?bar (404) with 4 occurrences migrated to:
  https://example.com/foo?bar ([https](https://example.com/foo?bar) result 404).
* [ ] http://example.com/foo?bar= (404) with 2 occurrences migrated to:
  https://example.com/foo?bar= ([https](https://example.com/foo?bar=) result 404).
* [ ] http://example.com/foo?bar=baz (404) with 2 occurrences migrated to:
  https://example.com/foo?bar=baz ([https](https://example.com/foo?bar=baz) result 404).
* [ ] http://example.com/foo?baz=42 (404) with 1 occurrences migrated to:
  https://example.com/foo?baz=42 ([https](https://example.com/foo?baz=42) result 404).
* [ ] http://example.com/foo?foo=bar&baz=qux (404) with 2 occurrences migrated to:
  https://example.com/foo?foo=bar&baz=qux ([https](https://example.com/foo?foo=bar&baz=qux) result 404).
* [ ] http://example.com/hotel (404) with 3 occurrences migrated to:
  https://example.com/hotel ([https](https://example.com/hotel) result 404).
* [ ] http://example.com/hotel%20list (404) with 1 occurrences migrated to:
  https://example.com/hotel%20list ([https](https://example.com/hotel%20list) result 404).
* [ ] http://example.com/hotel%20list/Z (404) with 1 occurrences migrated to:
  https://example.com/hotel%20list/Z ([https](https://example.com/hotel%20list/Z) result 404).
* [ ] http://example.com/hotel%20list/Z%C3%BCrich (404) with 3 occurrences migrated to:
  https://example.com/hotel%20list/Z%C3%BCrich ([https](https://example.com/hotel%20list/Z%C3%BCrich) result 404).
* [ ] http://example.com/hotels (404) with 3 occurrences migrated to:
  https://example.com/hotels ([https](https://example.com/hotels) result 404).
* [ ] http://example.com/hotels/ (404) with 15 occurrences migrated to:
  https://example.com/hotels/ ([https](https://example.com/hotels/) result 404).
* [ ] http://example.com/hotels/1/bookings/42 (404) with 1 occurrences migrated to:
  https://example.com/hotels/1/bookings/42 ([https](https://example.com/hotels/1/bookings/42) result 404).
* [ ] http://example.com/hotels/1/pic/pics%2Flogo.png/size/150x150 (404) with 2 occurrences migrated to:
  https://example.com/hotels/1/pic/pics%2Flogo.png/size/150x150 ([https](https://example.com/hotels/1/pic/pics%2Flogo.png/size/150x150) result 404).
* [ ] http://example.com/hotels/1/pic/pics/logo.png (404) with 1 occurrences migrated to:
  https://example.com/hotels/1/pic/pics/logo.png ([https](https://example.com/hotels/1/pic/pics/logo.png) result 404).
* [ ] http://example.com/hotels/42/bookings/21 (404) with 1 occurrences migrated to:
  https://example.com/hotels/42/bookings/21 ([https](https://example.com/hotels/42/bookings/21) result 404).
* [ ] http://example.com/hotels/42/bookings/42 (404) with 1 occurrences migrated to:
  https://example.com/hotels/42/bookings/42 ([https](https://example.com/hotels/42/bookings/42) result 404).
* [ ] http://example.com/hotels/Rest%20%26%20Relax/bookings/42 (404) with 2 occurrences migrated to:
  https://example.com/hotels/Rest%20%26%20Relax/bookings/42 ([https](https://example.com/hotels/Rest%20%26%20Relax/bookings/42) result 404).
* [ ] http://example.com/info (404) with 2 occurrences migrated to:
  https://example.com/info ([https](https://example.com/info) result 404).
* [ ] http://example.com/invalid (404) with 1 occurrences migrated to:
  https://example.com/invalid ([https](https://example.com/invalid) result 404).
* [ ] http://example.com/jquery-1.11.0.min.js (404) with 2 occurrences migrated to:
  https://example.com/jquery-1.11.0.min.js ([https](https://example.com/jquery-1.11.0.min.js) result 404).
* [ ] http://example.com/match (404) with 1 occurrences migrated to:
  https://example.com/match ([https](https://example.com/match) result 404).
* [ ] http://example.com/myFileUpload (404) with 1 occurrences migrated to:
  https://example.com/myFileUpload ([https](https://example.com/myFileUpload) result 404).
* [ ] http://example.com/myForm (404) with 1 occurrences migrated to:
  https://example.com/myForm ([https](https://example.com/myForm) result 404).
* [ ] http://example.com/path (404) with 4 occurrences migrated to:
  https://example.com/path ([https](https://example.com/path) result 404).
* [ ] http://example.com/path?query (404) with 2 occurrences migrated to:
  https://example.com/path?query ([https](https://example.com/path?query) result 404).
* [ ] http://example.com/path?query=foo (404) with 1 occurrences migrated to:
  https://example.com/path?query=foo ([https](https://example.com/path?query=foo) result 404).
* [ ] http://example.com/people (404) with 1 occurrences migrated to:
  https://example.com/people ([https](https://example.com/people) result 404).
* [ ] http://example.com/people/ (404) with 1 occurrences migrated to:
  https://example.com/people/ ([https](https://example.com/people/) result 404).
* [ ] http://example.com/prefix/path (404) with 2 occurrences migrated to:
  https://example.com/prefix/path ([https](https://example.com/prefix/path) result 404).
* [ ] http://example.com/resource (404) with 5 occurrences migrated to:
  https://example.com/resource ([https](https://example.com/resource) result 404).
* [ ] http://example.com/resource?access_token=123 (404) with 1 occurrences migrated to:
  https://example.com/resource?access_token=123 ([https](https://example.com/resource?access_token=123) result 404).
* [ ] http://example.com/spaces (404) with 1 occurrences migrated to:
  https://example.com/spaces ([https](https://example.com/spaces) result 404).
* [ ] http://example.com/spaces%20and%20%E2%82%AC (404) with 3 occurrences migrated to:
  https://example.com/spaces%20and%20%E2%82%AC ([https](https://example.com/spaces%20and%20%E2%82%AC) result 404).
* [ ] http://example.com/spring/ (404) with 1 occurrences migrated to:
  https://example.com/spring/ ([https](https://example.com/spring/) result 404).
* [ ] http://example.com/test/this/here (404) with 1 occurrences migrated to:
  https://example.com/test/this/here ([https](https://example.com/test/this/here) result 404).
* [ ] http://example.com/upload (404) with 1 occurrences migrated to:
  https://example.com/upload ([https](https://example.com/upload) result 404).
* [ ] http://example.com/user (404) with 1 occurrences migrated to:
  https://example.com/user ([https](https://example.com/user) result 404).
* [ ] http://example.org/fonts/css (404) with 6 occurrences migrated to:
  https://example.org/fonts/css ([https](https://example.org/fonts/css) result 404).
* [ ] http://example.org/foo/page.html (404) with 1 occurrences migrated to:
  https://example.org/foo/page.html ([https](https://example.org/foo/page.html) result 404).
* [ ] http://example.org/image.png (404) with 4 occurrences migrated to:
  https://example.org/image.png ([https](https://example.org/image.png) result 404).
* [ ] http://example.org/music/people (404) with 4 occurrences migrated to:
  https://example.org/music/people ([https](https://example.org/music/people) result 404).
* [ ] http://example.org/page.cache.html (404) with 1 occurrences migrated to:
  https://example.org/page.cache.html ([https](https://example.org/page.cache.html) result 404).
* [ ] http://example.org/path (404) with 3 occurrences migrated to:
  https://example.org/path ([https](https://example.org/path) result 404).
* [ ] http://springframework.org/oxm-test (404) with 2 occurrences migrated to:
  https://springframework.org/oxm-test ([https](https://springframework.org/oxm-test) result 404).
* [ ] http://www.example.com/favicon.ico (404) with 2 occurrences migrated to:
  https://www.example.com/favicon.ico ([https](https://www.example.com/favicon.ico) result 404).
* [ ] http://www.example.com/foo/bar (404) with 1 occurrences migrated to:
  https://www.example.com/foo/bar ([https](https://www.example.com/foo/bar) result 404).
* [ ] http://www.example.com/hotels (404) with 2 occurrences migrated to:
  https://www.example.com/hotels ([https](https://www.example.com/hotels) result 404).
* [ ] http://www.example.com/user/ (404) with 4 occurrences migrated to:
  https://www.example.com/user/ ([https](https://www.example.com/user/) result 404).
* [ ] http://www.example.com/user/john%3Bdoe/dashboard (404) with 4 occurrences migrated to:
  https://www.example.com/user/john%3Bdoe/dashboard ([https](https://www.example.com/user/john%3Bdoe/dashboard) result 404).
* [ ] http://www.example.com/user/john;doe/dashboard (404) with 2 occurrences migrated to:
  https://www.example.com/user/john;doe/dashboard ([https](https://www.example.com/user/john;doe/dashboard) result 404).
* [ ] http://www.ibm.com/developerworks/websphere/library/techarticles/0404_tang/0404_tang.html (301) with 1 occurrences migrated to:
  https://www.ibm.com/developerworks/websphere/library/techarticles/0404_tang/0404_tang.html ([https](https://www.ibm.com/developerworks/websphere/library/techarticles/0404_tang/0404_tang.html) result 404).
* [ ] http://mydomain1.com:80/path (301) with 2 occurrences migrated to:
  https://www.mydomain1.com/path ([https](https://mydomain1.com:80/path) result 404).
* [ ] http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/tutorial-lesson-03 (404) with 1 occurrences migrated to:
  https://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/tutorial-lesson-03 ([https](https://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/tutorial-lesson-03) result 404).
* [ ] http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html (301) with 1 occurrences migrated to:
  https://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html ([https](https://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html) result 404).
* [ ] http://xml.apache.org/xslt (404) with 3 occurrences migrated to:
  https://xml.apache.org/xslt ([https](https://xml.apache.org/xslt) result 404).
* [ ] http://myhost.com/resource/path/myTemplate.txt (500) with 1 occurrences migrated to:
  https://myhost.com/resource/path/myTemplate.txt ([https](https://myhost.com/resource/path/myTemplate.txt) result 500).
* [ ] http://myhost.com/some/arbitrary/path (500) with 1 occurrences migrated to:
  https://myhost.com/some/arbitrary/path ([https](https://myhost.com/some/arbitrary/path) result 500).

These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://activemq.apache.org/delete-inactive-destinations.html with 1 occurrences migrated to:
  https://activemq.apache.org/delete-inactive-destinations.html ([https](https://activemq.apache.org/delete-inactive-destinations.html) result 200).
* [ ] http://activemq.apache.org/stomp.html with 1 occurrences migrated to:
  https://activemq.apache.org/stomp.html ([https](https://activemq.apache.org/stomp.html) result 200).
* [ ] http://ant.apache.org with 1 occurrences migrated to:
  https://ant.apache.org ([https](https://ant.apache.org) result 200).
* [ ] http://asciidoctor.org/ with 1 occurrences migrated to:
  https://asciidoctor.org/ ([https](https://asciidoctor.org/) result 200).
* [ ] http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/ with 2 occurrences migrated to:
  https://asciidoctor.org/docs/editing-asciidoc-with-live-preview/ ([https](https://asciidoctor.org/docs/editing-asciidoc-with-live-preview/) result 200).
* [ ] http://beanvalidation.org/ with 1 occurrences migrated to:
  https://beanvalidation.org/ ([https](https://beanvalidation.org/) result 200).
* [ ] http://caniuse.com/ with 2 occurrences migrated to:
  https://caniuse.com/ ([https](https://caniuse.com/) result 200).
* [ ] http://cbor.io/ with 1 occurrences migrated to:
  https://cbor.io/ ([https](https://cbor.io/) result 200).
* [ ] http://code.jquery.com/jquery-1.11.0.min.js with 2 occurrences migrated to:
  https://code.jquery.com/jquery-1.11.0.min.js ([https](https://code.jquery.com/jquery-1.11.0.min.js) result 200).
* [ ] http://code.jquery.com/jquery.js with 1 occurrences migrated to:
  https://code.jquery.com/jquery.js ([https](https://code.jquery.com/jquery.js) result 200).
* [ ] http://commons.apache.org/proper/commons-lang/ with 2 occurrences migrated to:
  https://commons.apache.org/proper/commons-lang/ ([https](https://commons.apache.org/proper/commons-lang/) result 200).
* [ ] http://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html ([https](https://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html) result 200).
* [ ] http://docs.oracle.com/javase/8/docs/api/java/beans/package-summary.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/8/docs/api/java/beans/package-summary.html ([https](https://docs.oracle.com/javase/8/docs/api/java/beans/package-summary.html) result 200).
* [ ] http://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html ([https](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) result 200).
* [ ] http://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html ([https](https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html) result 200).
* [ ] http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html with 2 occurrences migrated to:
  https://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html ([https](https://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html) result 200).
* [ ] http://docs.oracle.com/javase/tutorial/javabeans/advanced/customization.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/tutorial/javabeans/advanced/customization.html ([https](https://docs.oracle.com/javase/tutorial/javabeans/advanced/customization.html) result 200).
* [ ] http://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html with 1 occurrences migrated to:
  https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html ([https](https://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html) result 200).
* [ ] http://docs.seleniumhq.org/ with 1 occurrences migrated to:
  https://docs.seleniumhq.org/ ([https](https://docs.seleniumhq.org/) result 200).
* [ ] http://docs.seleniumhq.org/projects/webdriver/ with 1 occurrences migrated to:
  https://docs.seleniumhq.org/projects/webdriver/ ([https](https://docs.seleniumhq.org/projects/webdriver/) result 200).
* [ ] http://docs.spring.io/spring-framework/docs/current/javadoc-api/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-framework/docs/current/javadoc-api/ ([https](https://docs.spring.io/spring-framework/docs/current/javadoc-api/) result 200).
* [ ] http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/view/script/ScriptTemplateView.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/view/script/ScriptTemplateView.html ([https](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/view/script/ScriptTemplateView.html) result 200).
* [ ] http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/ ([https](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/) result 200).
* [ ] http://docs.spring.io/spring-session/docs/current/reference/html5/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-session/docs/current/reference/html5/ ([https](https://docs.spring.io/spring-session/docs/current/reference/html5/) result 200).
* [ ] http://en.wikipedia.org/wiki/Adapter_pattern with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/Adapter_pattern ([https](https://en.wikipedia.org/wiki/Adapter_pattern) result 200).
* [ ] http://en.wikipedia.org/wiki/Halting_Problem with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/Halting_Problem ([https](https://en.wikipedia.org/wiki/Halting_Problem) result 200).
* [ ] http://en.wikipedia.org/wiki/List_of_HTTP_status_codes with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/List_of_HTTP_status_codes ([https](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) result 200).
* [ ] http://en.wikipedia.org/wiki/MIME with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/MIME ([https](https://en.wikipedia.org/wiki/MIME) result 200).
* [ ] http://en.wikipedia.org/wiki/Mock_Object with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/Mock_Object ([https](https://en.wikipedia.org/wiki/Mock_Object) result 200).
* [ ] http://en.wikipedia.org/wiki/Polyfill with 2 occurrences migrated to:
  https://en.wikipedia.org/wiki/Polyfill ([https](https://en.wikipedia.org/wiki/Polyfill) result 200).
* [ ] http://example.com with 150 occurrences migrated to:
  https://example.com ([https](https://example.com) result 200).
* [ ] http://example.com/ with 16 occurrences migrated to:
  https://example.com/ ([https](https://example.com/) result 200).
* [ ] http://example.com?foo with 2 occurrences migrated to:
  https://example.com?foo ([https](https://example.com?foo) result 200).
* [ ] http://example.com?foo=bar with 8 occurrences migrated to:
  https://example.com?foo=bar ([https](https://example.com?foo=bar) result 200).
* [ ] http://example.com?foo=bar@baz with 1 occurrences migrated to:
  https://example.com?foo=bar@baz ([https](https://example.com?foo=bar@baz) result 200).
* [ ] http://example.org with 18 occurrences migrated to:
  https://example.org ([https](https://example.org) result 200).
* [ ] http://example.org/ with 1 occurrences migrated to:
  https://example.org/ ([https](https://example.org/) result 200).
* [ ] http://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/DeserializationFeature.html with 2 occurrences migrated to:
  https://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/DeserializationFeature.html ([https](https://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/DeserializationFeature.html) result 200).
* [ ] http://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/MapperFeature.html with 2 occurrences migrated to:
  https://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/MapperFeature.html ([https](https://fasterxml.github.io/jackson-databind/javadoc/2.6/com/fasterxml/jackson/databind/MapperFeature.html) result 200).
* [ ] http://h2database.com with 1 occurrences migrated to:
  https://h2database.com ([https](https://h2database.com) result 200).
* [ ] http://handlebarsjs.com with 2 occurrences migrated to:
  https://handlebarsjs.com ([https](https://handlebarsjs.com) result 200).
* [ ] http://handlebarsjs.com/ with 2 occurrences migrated to:
  https://handlebarsjs.com/ ([https](https://handlebarsjs.com/) result 200).
* [ ] http://hc.apache.org/httpcomponents-asyncclient-dev/ with 1 occurrences migrated to:
  https://hc.apache.org/httpcomponents-asyncclient-dev/ ([https](https://hc.apache.org/httpcomponents-asyncclient-dev/) result 200).
* [ ] http://hc.apache.org/httpcomponents-client-ga/ with 2 occurrences migrated to:
  https://hc.apache.org/httpcomponents-client-ga/ ([https](https://hc.apache.org/httpcomponents-client-ga/) result 200).
* [ ] http://hc.apache.org/httpcomponents-client-ga/httpclient/ with 1 occurrences migrated to:
  https://hc.apache.org/httpcomponents-client-ga/httpclient/ ([https](https://hc.apache.org/httpcomponents-client-ga/httpclient/) result 200).
* [ ] http://www.hibernate.org/ (301) with 1 occurrences migrated to:
  https://hibernate.org/ ([https](https://www.hibernate.org/) result 200).
* [ ] http://www.hibernate.org (301) with 1 occurrences migrated to:
  https://hibernate.org/ ([https](https://www.hibernate.org) result 200).
* [ ] http://jcp.org/aboutJava/communityprocess/final/jsr003/index3.html with 1 occurrences migrated to:
  https://jcp.org/aboutJava/communityprocess/final/jsr003/index3.html ([https](https://jcp.org/aboutJava/communityprocess/final/jsr003/index3.html) result 200).
* [ ] http://jcp.org/aboutJava/communityprocess/final/jsr160/index.html with 1 occurrences migrated to:
  https://jcp.org/aboutJava/communityprocess/final/jsr160/index.html ([https](https://jcp.org/aboutJava/communityprocess/final/jsr160/index.html) result 200).
* [ ] http://jcp.org/en/jsr/detail?id=107 with 1 occurrences migrated to:
  https://jcp.org/en/jsr/detail?id=107 ([https](https://jcp.org/en/jsr/detail?id=107) result 200).
* [ ] http://joel-costigliola.github.io/assertj/ with 3 occurrences migrated to:
  https://joel-costigliola.github.io/assertj/ ([https](https://joel-costigliola.github.io/assertj/) result 200).
* [ ] http://jsonassert.skyscreamer.org with 1 occurrences migrated to:
  https://jsonassert.skyscreamer.org ([https](https://jsonassert.skyscreamer.org) result 200).
* [ ] http://jsonassert.skyscreamer.org/ with 5 occurrences migrated to:
  https://jsonassert.skyscreamer.org/ ([https](https://jsonassert.skyscreamer.org/) result 200).
* [ ] http://junit.org/junit5/docs/current/user-guide/ with 2 occurrences migrated to:
  https://junit.org/junit5/docs/current/user-guide/ ([https](https://junit.org/junit5/docs/current/user-guide/) result 200).
* [ ] http://kotlinlang.org/ with 2 occurrences migrated to:
  https://kotlinlang.org/ ([https](https://kotlinlang.org/) result 200).
* [ ] http://kotlinlang.org/docs/reference/ with 1 occurrences migrated to:
  https://kotlinlang.org/docs/reference/ ([https](https://kotlinlang.org/docs/reference/) result 200).
* [ ] http://kotlinlang.org/docs/reference/classes.html with 3 occurrences migrated to:
  https://kotlinlang.org/docs/reference/classes.html ([https](https://kotlinlang.org/docs/reference/classes.html) result 200).
* [ ] http://mydomain.com with 5 occurrences migrated to:
  https://mydomain.com ([https](https://mydomain.com) result 200).
* [ ] http://netty.io/ with 1 occurrences migrated to:
  https://netty.io/ ([https](https://netty.io/) result 200).
* [ ] http://openjdk.java.net/jeps/290 with 1 occurrences migrated to:
  https://openjdk.java.net/jeps/290 ([https](https://openjdk.java.net/jeps/290) result 200).
* [ ] http://openjdk.java.net/projects/nashorn/ with 10 occurrences migrated to:
  https://openjdk.java.net/projects/nashorn/ ([https](https://openjdk.java.net/projects/nashorn/) result 200).
* [ ] http://pivotal.io/security/cve-2015-5211 with 1 occurrences migrated to:
  https://pivotal.io/security/cve-2015-5211 ([https](https://pivotal.io/security/cve-2015-5211) result 200).
* [ ] http://poi.apache.org with 3 occurrences migrated to:
  https://poi.apache.org ([https](https://poi.apache.org) result 200).
* [ ] http://projects.spring.io/spring-boot/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-boot/ ([https](https://projects.spring.io/spring-boot/) result 200).
* [ ] http://projects.spring.io/spring-data/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-data/ ([https](https://projects.spring.io/spring-data/) result 200).
* [ ] http://projects.spring.io/spring-framework/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-framework/ ([https](https://projects.spring.io/spring-framework/) result 200).
* [ ] http://projects.spring.io/spring-integration/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-integration/ ([https](https://projects.spring.io/spring-integration/) result 200).
* [ ] http://projects.spring.io/spring-security/ with 3 occurrences migrated to:
  https://projects.spring.io/spring-security/ ([https](https://projects.spring.io/spring-security/) result 200).
* [ ] http://repo1.maven.org/maven2/javax/inject/javax.inject/1/ with 2 occurrences migrated to:
  https://repo1.maven.org/maven2/javax/inject/javax.inject/1/ ([https](https://repo1.maven.org/maven2/javax/inject/javax.inject/1/) result 200).
* [ ] http://schema.spring.io/mvc/spring-mvc.xsd with 1 occurrences migrated to:
  https://schema.spring.io/mvc/spring-mvc.xsd ([https](https://schema.spring.io/mvc/spring-mvc.xsd) result 200).
* [ ] http://search.maven.org/ with 2 occurrences migrated to:
  https://search.maven.org/ ([https](https://search.maven.org/) result 200).
* [ ] http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html with 3 occurrences migrated to:
  https://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html ([https](https://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html) result 200).
* [ ] http://sourceforge.net with 1 occurrences migrated to:
  https://sourceforge.net ([https](https://sourceforge.net) result 200).
* [ ] http://sourceforge.net/projects/javadiff/ with 1 occurrences migrated to:
  https://sourceforge.net/projects/javadiff/ ([https](https://sourceforge.net/projects/javadiff/) result 200).
* [ ] http://sourceforge.net/sflogo.php?group_id=37160 with 1 occurrences migrated to:
  https://sourceforge.net/sflogo.php?group_id=37160 ([https](https://sourceforge.net/sflogo.php?group_id=37160) result 200).
* [ ] http://spring.io/blog/ with 1 occurrences migrated to:
  https://spring.io/blog/ ([https](https://spring.io/blog/) result 200).
* [ ] http://spring.io/blog/category/news with 1 occurrences migrated to:
  https://spring.io/blog/category/news ([https](https://spring.io/blog/category/news) result 200).
* [ ] http://square.github.io/okhttp/ with 1 occurrences migrated to:
  https://square.github.io/okhttp/ ([https](https://square.github.io/okhttp/) result 200).
* [ ] http://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do with 1 occurrences migrated to:
  https://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do ([https](https://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do) result 200).
* [ ] http://stackoverflow.com/questions/19394570/java-jre-7u45-breaks-classloader-getresources with 2 occurrences migrated to:
  https://stackoverflow.com/questions/19394570/java-jre-7u45-breaks-classloader-getresources ([https](https://stackoverflow.com/questions/19394570/java-jre-7u45-breaks-classloader-getresources) result 200).
* [ ] http://stackoverflow.com/questions/22986109/testing-spring-managed-servlet with 1 occurrences migrated to:
  https://stackoverflow.com/questions/22986109/testing-spring-managed-servlet ([https](https://stackoverflow.com/questions/22986109/testing-spring-managed-servlet) result 200).
* [ ] http://stackoverflow.com/questions/24725438/what-could-cause-a-class-implementing-applicationlistenercontextrefreshedevent with 1 occurrences migrated to:
  https://stackoverflow.com/questions/24725438/what-could-cause-a-class-implementing-applicationlistenercontextrefreshedevent ([https](https://stackoverflow.com/questions/24725438/what-could-cause-a-class-implementing-applicationlistenercontextrefreshedevent) result 200).
* [ ] http://stackoverflow.com/questions/35733344/can-contextconfiguration-in-a-custom-annotation-be-merged with 1 occurrences migrated to:
  https://stackoverflow.com/questions/35733344/can-contextconfiguration-in-a-custom-annotation-be-merged ([https](https://stackoverflow.com/questions/35733344/can-contextconfiguration-in-a-custom-annotation-be-merged) result 200).
* [ ] http://start.spring.io/ with 2 occurrences migrated to:
  https://start.spring.io/ ([https](https://start.spring.io/) result 200).
* [ ] http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html with 1 occurrences migrated to:
  https://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html ([https](https://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html) result 200).
* [ ] http://stomp.github.io/stomp-specification-1.2.html with 9 occurrences migrated to:
  https://stomp.github.io/stomp-specification-1.2.html ([https](https://stomp.github.io/stomp-specification-1.2.html) result 200).
* [ ] http://struts.apache.org with 1 occurrences migrated to:
  https://struts.apache.org ([https](https://struts.apache.org) result 200).
* [ ] http://struts.apache.org/ with 1 occurrences migrated to:
  https://struts.apache.org/ ([https](https://struts.apache.org/) result 200).
* [ ] http://tapestry.apache.org/ with 2 occurrences migrated to:
  https://tapestry.apache.org/ ([https](https://tapestry.apache.org/) result 200).
* [ ] http://tiles.apache.org with 4 occurrences migrated to:
  https://tiles.apache.org ([https](https://tiles.apache.org) result 200).
* [ ] http://tiles.apache.org/framework/dependency-management.html with 1 occurrences migrated to:
  https://tiles.apache.org/framework/dependency-management.html ([https](https://tiles.apache.org/framework/dependency-management.html) result 200).
* [ ] http://tomcat.apache.org/ with 1 occurrences migrated to:
  https://tomcat.apache.org/ ([https](https://tomcat.apache.org/) result 200).
* [ ] http://tools.ietf.org/html/rfc1945 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc1945 ([https](https://tools.ietf.org/html/rfc1945) result 200).
* [ ] http://tools.ietf.org/html/rfc2109 with 2 occurrences migrated to:
  https://tools.ietf.org/html/rfc2109 ([https](https://tools.ietf.org/html/rfc2109) result 200).
* [ ] http://tools.ietf.org/html/rfc2295 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2295 ([https](https://tools.ietf.org/html/rfc2295) result 200).
* [ ] http://tools.ietf.org/html/rfc2324 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2324 ([https](https://tools.ietf.org/html/rfc2324) result 200).
* [ ] http://tools.ietf.org/html/rfc2518 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2518 ([https](https://tools.ietf.org/html/rfc2518) result 200).
* [ ] http://tools.ietf.org/html/rfc2616 with 3 occurrences migrated to:
  https://tools.ietf.org/html/rfc2616 ([https](https://tools.ietf.org/html/rfc2616) result 200).
* [ ] http://tools.ietf.org/html/rfc2774 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2774 ([https](https://tools.ietf.org/html/rfc2774) result 200).
* [ ] http://tools.ietf.org/html/rfc2817 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2817 ([https](https://tools.ietf.org/html/rfc2817) result 200).
* [ ] http://tools.ietf.org/html/rfc2965 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc2965 ([https](https://tools.ietf.org/html/rfc2965) result 200).
* [ ] http://tools.ietf.org/html/rfc3229 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc3229 ([https](https://tools.ietf.org/html/rfc3229) result 200).
* [ ] http://tools.ietf.org/html/rfc3986 with 4 occurrences migrated to:
  https://tools.ietf.org/html/rfc3986 ([https](https://tools.ietf.org/html/rfc3986) result 200).
* [ ] http://tools.ietf.org/html/rfc4918 with 5 occurrences migrated to:
  https://tools.ietf.org/html/rfc4918 ([https](https://tools.ietf.org/html/rfc4918) result 200).
* [ ] http://tools.ietf.org/html/rfc5842 with 2 occurrences migrated to:
  https://tools.ietf.org/html/rfc5842 ([https](https://tools.ietf.org/html/rfc5842) result 200).
* [ ] http://tools.ietf.org/html/rfc5988 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc5988 ([https](https://tools.ietf.org/html/rfc5988) result 200).
* [ ] http://tools.ietf.org/html/rfc6266 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc6266 ([https](https://tools.ietf.org/html/rfc6266) result 200).
* [ ] http://tools.ietf.org/html/rfc6454 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc6454 ([https](https://tools.ietf.org/html/rfc6454) result 200).
* [ ] http://tools.ietf.org/html/rfc6455 with 2 occurrences migrated to:
  https://tools.ietf.org/html/rfc6455 ([https](https://tools.ietf.org/html/rfc6455) result 200).
* [ ] http://tools.ietf.org/html/rfc6585 with 4 occurrences migrated to:
  https://tools.ietf.org/html/rfc6585 ([https](https://tools.ietf.org/html/rfc6585) result 200).
* [ ] http://tools.ietf.org/html/rfc7230 with 10 occurrences migrated to:
  https://tools.ietf.org/html/rfc7230 ([https](https://tools.ietf.org/html/rfc7230) result 200).
* [ ] http://tools.ietf.org/html/rfc7231 with 56 occurrences migrated to:
  https://tools.ietf.org/html/rfc7231 ([https](https://tools.ietf.org/html/rfc7231) result 200).
* [ ] http://tools.ietf.org/html/rfc7232 with 8 occurrences migrated to:
  https://tools.ietf.org/html/rfc7232 ([https](https://tools.ietf.org/html/rfc7232) result 200).
* [ ] http://tools.ietf.org/html/rfc7233 with 12 occurrences migrated to:
  https://tools.ietf.org/html/rfc7233 ([https](https://tools.ietf.org/html/rfc7233) result 200).
* [ ] http://tools.ietf.org/html/rfc7234 with 5 occurrences migrated to:
  https://tools.ietf.org/html/rfc7234 ([https](https://tools.ietf.org/html/rfc7234) result 200).
* [ ] http://tools.ietf.org/html/rfc7235 with 6 occurrences migrated to:
  https://tools.ietf.org/html/rfc7235 ([https](https://tools.ietf.org/html/rfc7235) result 200).
* [ ] http://tools.ietf.org/html/rfc7238 with 1 occurrences migrated to:
  https://tools.ietf.org/html/rfc7238 ([https](https://tools.ietf.org/html/rfc7238) result 200).
* [ ] http://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt with 3 occurrences migrated to:
  https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt ([https](https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt) result 200).
* [ ] http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/ with 10 occurrences migrated to:
  https://www.amazon.com/exec/obidos/tg/detail/-/0764543857/ ([https](https://www.amazon.com/exec/obidos/tg/detail/-/0764543857/) result 200).
* [ ] http://www.apache.org with 1 occurrences migrated to:
  https://www.apache.org ([https](https://www.apache.org) result 200).
* [ ] http://www.apple.com/DTDs/PropertyList-1.0.dtd with 6 occurrences migrated to:
  https://www.apple.com/DTDs/PropertyList-1.0.dtd ([https](https://www.apple.com/DTDs/PropertyList-1.0.dtd) result 200).
* [ ] http://www.atomikos.com/ with 1 occurrences migrated to:
  https://www.atomikos.com/ ([https](https://www.atomikos.com/) result 200).
* [ ] http://www.baeldung.com/kotlin-null-safety with 1 occurrences migrated to:
  https://www.baeldung.com/kotlin-null-safety ([https](https://www.baeldung.com/kotlin-null-safety) result 200).
* [ ] http://www.eclipse.org/ajdt/ with 1 occurrences migrated to:
  https://www.eclipse.org/ajdt/ ([https](https://www.eclipse.org/ajdt/) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/next/progguide/index.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/next/progguide/index.html ([https](https://www.eclipse.org/aspectj/doc/next/progguide/index.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/next/progguide/semantics-joinPoints.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/next/progguide/semantics-joinPoints.html ([https](https://www.eclipse.org/aspectj/doc/next/progguide/semantics-joinPoints.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/adk15notebook/index.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/adk15notebook/index.html ([https](https://www.eclipse.org/aspectj/doc/released/adk15notebook/index.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/devguide/antTasks.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/devguide/antTasks.html ([https](https://www.eclipse.org/aspectj/doc/released/devguide/antTasks.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/devguide/index.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/devguide/index.html ([https](https://www.eclipse.org/aspectj/doc/released/devguide/index.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html ([https](https://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/devguide/ltw.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/devguide/ltw.html ([https](https://www.eclipse.org/aspectj/doc/released/devguide/ltw.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/progguide/index.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/progguide/index.html ([https](https://www.eclipse.org/aspectj/doc/released/progguide/index.html) result 200).
* [ ] http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html ([https](https://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html) result 200).
* [ ] http://www.eclipse.org/aspectj/dtd/aspectj.dtd with 1 occurrences migrated to:
  https://www.eclipse.org/aspectj/dtd/aspectj.dtd ([https](https://www.eclipse.org/aspectj/dtd/aspectj.dtd) result 200).
* [ ] http://ehcache.sourceforge.net (301) with 1 occurrences migrated to:
  https://www.ehcache.org/ ([https](https://ehcache.sourceforge.net) result 200).
* [ ] http://ehcache.org/ (301) with 1 occurrences migrated to:
  https://www.ehcache.org/ ([https](https://ehcache.org/) result 200).
* [ ] http://www.embeddedjs.com/ with 2 occurrences migrated to:
  https://www.embeddedjs.com/ ([https](https://www.embeddedjs.com/) result 200).
* [ ] http://www.enterpriseintegrationpatterns.com with 1 occurrences migrated to:
  https://www.enterpriseintegrationpatterns.com ([https](https://www.enterpriseintegrationpatterns.com) result 200).
* [ ] http://www.example.org/?param=aGVsbG9Xb3JsZA%3D%3D with 1 occurrences migrated to:
  https://www.example.org/?param=aGVsbG9Xb3JsZA%3D%3D ([https](https://www.example.org/?param=aGVsbG9Xb3JsZA%3D%3D) result 200).
* [ ] http://www.google.com with 2 occurrences migrated to:
  https://www.google.com ([https](https://www.google.com) result 200).
* [ ] http://www.h2database.com with 1 occurrences migrated to:
  https://www.h2database.com ([https](https://www.h2database.com) result 200).
* [ ] http://www.h2database.com/html/grammar.html with 1 occurrences migrated to:
  https://www.h2database.com/html/grammar.html ([https](https://www.h2database.com/html/grammar.html) result 200).
* [ ] http://www.ietf.org with 1 occurrences migrated to:
  https://www.ietf.org ([https](https://www.ietf.org) result 200).
* [ ] http://www.ietf.org/rfc/rfc1867.txt with 1 occurrences migrated to:
  https://www.ietf.org/rfc/rfc1867.txt ([https](https://www.ietf.org/rfc/rfc1867.txt) result 200).
* [ ] http://www.ietf.org/rfc/rfc2396.txt with 2 occurrences migrated to:
  https://www.ietf.org/rfc/rfc2396.txt ([https](https://www.ietf.org/rfc/rfc2396.txt) result 200).
* [ ] http://www.ietf.org/rfc/rfc3986.txt with 11 occurrences migrated to:
  https://www.ietf.org/rfc/rfc3986.txt ([https](https://www.ietf.org/rfc/rfc3986.txt) result 200).
* [ ] http://www.infoq.com/ with 1 occurrences migrated to:
  https://www.infoq.com/ ([https](https://www.infoq.com/) result 200).
* [ ] http://www.infoq.com/minibooks/JTDS with 1 occurrences migrated to:
  https://www.infoq.com/minibooks/JTDS ([https](https://www.infoq.com/minibooks/JTDS) result 200).
* [ ] http://www.jetbrains.com/idea/ with 1 occurrences migrated to:
  https://www.jetbrains.com/idea/ ([https](https://www.jetbrains.com/idea/) result 200).
* [ ] http://www.json.org/ with 1 occurrences migrated to:
  https://www.json.org/ ([https](https://www.json.org/) result 200).
* [ ] http://www.jython.org with 2 occurrences migrated to:
  https://www.jython.org ([https](https://www.jython.org) result 200).
* [ ] http://www.jython.org/ with 2 occurrences migrated to:
  https://www.jython.org/ ([https](https://www.jython.org/) result 200).
* [ ] http://www.lowagie.com/iText with 2 occurrences migrated to:
  https://www.lowagie.com/iText ([https](https://www.lowagie.com/iText) result 200).
* [ ] http://www.manpagez.com/man/5/crontab/ with 1 occurrences migrated to:
  https://www.manpagez.com/man/5/crontab/ ([https](https://www.manpagez.com/man/5/crontab/) result 200).
* [ ] http://mydomain1.com:80/ (301) with 2 occurrences migrated to:
  https://www.mydomain1.com/ ([https](https://mydomain1.com:80/) result 200).
* [ ] http://mydomain1.com:80 (301) with 1 occurrences migrated to:
  https://www.mydomain1.com/ ([https](https://mydomain1.com:80) result 200).
* [ ] http://www.oracle.com/technetwork/articles/javaee/jpa-137156.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/articles/javaee/jpa-137156.html ([https](https://www.oracle.com/technetwork/articles/javaee/jpa-137156.html) result 200).
* [ ] http://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html ([https](https://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html) result 200).
* [ ] http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html ([https](https://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html) result 200).
* [ ] http://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html ([https](https://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html) result 200).
* [ ] http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html ([https](https://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html) result 200).
* [ ] http://www.oracle.com/technetwork/middleware/weblogic/overview/index-085209.html with 1 occurrences migrated to:
  https://www.oracle.com/technetwork/middleware/weblogic/overview/index-085209.html ([https](https://www.oracle.com/technetwork/middleware/weblogic/overview/index-085209.html) result 200).
* [ ] http://www.ow2.org/ with 1 occurrences migrated to:
  https://www.ow2.org/ ([https](https://www.ow2.org/) result 200).
* [ ] http://www.owasp.org/index.php/HTTPOnly with 4 occurrences migrated to:
  https://www.owasp.org/index.php/HTTPOnly ([https](https://www.owasp.org/index.php/HTTPOnly) result 200).
* [ ] http://quartz-scheduler.org (301) with 3 occurrences migrated to:
  https://www.quartz-scheduler.org/ ([https](https://quartz-scheduler.org) result 200).
* [ ] http://www.rabbitmq.com/stomp.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/stomp.html ([https](https://www.rabbitmq.com/stomp.html) result 200).
* [ ] http://www.reactive-streams.org with 1 occurrences migrated to:
  https://www.reactive-streams.org ([https](https://www.reactive-streams.org) result 200).
* [ ] http://www.reactive-streams.org/ with 2 occurrences migrated to:
  https://www.reactive-streams.org/ ([https](https://www.reactive-streams.org/) result 200).
* [ ] http://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Publisher.html with 1 occurrences migrated to:
  https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Publisher.html ([https](https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Publisher.html) result 200).
* [ ] http://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Subscriber.html with 1 occurrences migrated to:
  https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Subscriber.html ([https](https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/org/reactivestreams/Subscriber.html) result 200).
* [ ] http://seleniumhq.org/projects/webdriver/ (301) with 1 occurrences migrated to:
  https://www.seleniumhq.org ([https](https://seleniumhq.org/projects/webdriver/) result 200).
* [ ] http://www.springbyexample.org/examples/custom-thread-scope-module.html with 1 occurrences migrated to:
  https://www.springbyexample.org/examples/custom-thread-scope-module.html ([https](https://www.springbyexample.org/examples/custom-thread-scope-module.html) result 200).
* [ ] http://www.springframework.org/dtd/spring-beans-2.0.dtd with 3 occurrences migrated to:
  https://www.springframework.org/dtd/spring-beans-2.0.dtd ([https](https://www.springframework.org/dtd/spring-beans-2.0.dtd) result 200).
* [ ] http://www.springframework.org/schema/aop/spring-aop.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200).
* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 80 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/cache/spring-cache.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/cache/spring-cache.xsd ([https](https://www.springframework.org/schema/cache/spring-cache.xsd) result 200).
* [ ] http://www.springframework.org/schema/context/spring-context.xsd with 13 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* [ ] http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200).
* [ ] http://www.springframework.org/schema/jee/spring-jee.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/jee/spring-jee.xsd ([https](https://www.springframework.org/schema/jee/spring-jee.xsd) result 200).
* [ ] http://www.springframework.org/schema/jms/spring-jms.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms.xsd ([https](https://www.springframework.org/schema/jms/spring-jms.xsd) result 200).
* [ ] http://www.springframework.org/schema/lang/spring-lang.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang.xsd ([https](https://www.springframework.org/schema/lang/spring-lang.xsd) result 200).
* [ ] http://www.springframework.org/schema/mvc/spring-mvc.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200).
* [ ] http://www.springframework.org/schema/oxm/spring-oxm.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/oxm/spring-oxm.xsd ([https](https://www.springframework.org/schema/oxm/spring-oxm.xsd) result 200).
* [ ] http://www.springframework.org/schema/tool/spring-tool.xsd with 13 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool.xsd ([https](https://www.springframework.org/schema/tool/spring-tool.xsd) result 200).
* [ ] http://www.springframework.org/schema/tx/spring-tx.xsd with 8 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200).
* [ ] http://www.springframework.org/schema/util/spring-util.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200).
* [ ] http://www.springframework.org/schema/websocket/spring-websocket.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/websocket/spring-websocket.xsd ([https](https://www.springframework.org/schema/websocket/spring-websocket.xsd) result 200).
* [ ] http://www.stuartellis.eu/articles/erb/ (301) with 2 occurrences migrated to:
  https://www.stuartellis.name/articles/erb/ ([https](https://www.stuartellis.eu/articles/erb/) result 200).
* [ ] http://www.thymeleaf.org/ with 2 occurrences migrated to:
  https://www.thymeleaf.org/ ([https](https://www.thymeleaf.org/) result 200).
* [ ] http://www.thymeleaf.org/documentation.html with 2 occurrences migrated to:
  https://www.thymeleaf.org/documentation.html ([https](https://www.thymeleaf.org/documentation.html) result 200).
* [ ] http://www.webjars.org with 4 occurrences migrated to:
  https://www.webjars.org ([https](https://www.webjars.org) result 200).
* [ ] http://www.webjars.org/ with 2 occurrences migrated to:
  https://www.webjars.org/ ([https](https://www.webjars.org/) result 200).
* [ ] http://www.webjars.org/documentation with 2 occurrences migrated to:
  https://www.webjars.org/documentation ([https](https://www.webjars.org/documentation) result 200).
* [ ] http://www.wildfly.org/ with 1 occurrences migrated to:
  https://www.wildfly.org/ ([https](https://www.wildfly.org/) result 200).
* [ ] http://x-stream.github.io/ with 2 occurrences migrated to:
  https://x-stream.github.io/ ([https](https://x-stream.github.io/) result 200).
* [ ] http://youtrack.jetbrains.com/issue/IDEA-53476 with 1 occurrences migrated to:
  https://youtrack.jetbrains.com/issue/IDEA-53476 ([https](https://youtrack.jetbrains.com/issue/IDEA-53476) result 200).
* [ ] http://youtrack.jetbrains.com/issue/IDEA-64446 with 1 occurrences migrated to:
  https://youtrack.jetbrains.com/issue/IDEA-64446 ([https](https://youtrack.jetbrains.com/issue/IDEA-64446) result 200).
* [ ] http://bit.ly/TRlX2r with 1 occurrences migrated to:
  https://bit.ly/TRlX2r ([https](https://bit.ly/TRlX2r) result 301).
* [ ] http://bit.ly/UzccDt with 1 occurrences migrated to:
  https://bit.ly/UzccDt ([https](https://bit.ly/UzccDt) result 301).
* [ ] http://bit.ly/p9rIvx with 1 occurrences migrated to:
  https://bit.ly/p9rIvx ([https](https://bit.ly/p9rIvx) result 301).
* [ ] http://bit.ly/qUwvwz with 1 occurrences migrated to:
  https://bit.ly/qUwvwz ([https](https://bit.ly/qUwvwz) result 301).
* [ ] http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx with 1 occurrences migrated to:
  https://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx ([https](https://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx) result 301).
* [ ] http://code.google.com/p/beanshell2/ with 1 occurrences migrated to:
  https://code.google.com/p/beanshell2/ ([https](https://code.google.com/p/beanshell2/) result 301).
* [ ] http://code.google.com/p/browsersec/wiki/Part2 with 1 occurrences migrated to:
  https://code.google.com/p/browsersec/wiki/Part2 ([https](https://code.google.com/p/browsersec/wiki/Part2) result 301).
* [ ] http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal with 1 occurrences migrated to:
  https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal ([https](https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal) result 301).
* [ ] http://code.google.com/p/xml-matchers/ with 3 occurrences migrated to:
  https://code.google.com/p/xml-matchers/ ([https](https://code.google.com/p/xml-matchers/) result 301).
* [ ] http://commons.apache.org/proper/commons-dbcp with 2 occurrences migrated to:
  https://commons.apache.org/proper/commons-dbcp ([https](https://commons.apache.org/proper/commons-dbcp) result 301).
* [ ] http://commons.apache.org/proper/commons-fileupload with 2 occurrences migrated to:
  https://commons.apache.org/proper/commons-fileupload ([https](https://commons.apache.org/proper/commons-fileupload) result 301).
* [ ] http://confluence.jetbrains.net/display/IDEADEV/Gradle+integration with 1 occurrences migrated to:
  https://confluence.jetbrains.net/display/IDEADEV/Gradle+integration ([https](https://confluence.jetbrains.net/display/IDEADEV/Gradle+integration) result 301).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://db.apache.org/derby with 2 occurrences migrated to:
  https://db.apache.org/derby ([https](https://db.apache.org/derby) result 301).
* [ ] http://dev.w3.org/html5/eventsource/ with 2 occurrences migrated to:
  https://dev.w3.org/html5/eventsource/ ([https](https://dev.w3.org/html5/eventsource/) result 301).
* [ ] http://domain.com with 24 occurrences migrated to:
  https://domain.com ([https](https://domain.com) result 301).
* [ ] http://domain.com/ with 1 occurrences migrated to:
  https://domain.com/ ([https](https://domain.com/) result 301).
* [ ] http://en.wikipedia.org/wiki/Cache_ with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/Cache_ ([https](https://en.wikipedia.org/wiki/Cache_) result 301).
* [ ] http://facebook.github.io/react/ with 2 occurrences migrated to:
  https://facebook.github.io/react/ ([https](https://facebook.github.io/react/) result 301).
* [ ] http://forum.springframework.org/showthread.php?t=41350 with 1 occurrences migrated to:
  https://forum.springframework.org/showthread.php?t=41350 ([https](https://forum.springframework.org/showthread.php?t=41350) result 301).
* [ ] http://github.com/SpringSource/spring-framework with 1 occurrences migrated to:
  https://github.com/SpringSource/spring-framework ([https](https://github.com/SpringSource/spring-framework) result 301).
* [ ] http://hdiv.org/ with 1 occurrences migrated to:
  https://hdiv.org/ ([https](https://hdiv.org/) result 301).
* [ ] http://jakarta.apache.org/commons/fileupload with 1 occurrences migrated to:
  https://jakarta.apache.org/commons/fileupload ([https](https://jakarta.apache.org/commons/fileupload) result 301).
* [ ] http://jira.springframework.org/browse/SPR-5708 with 1 occurrences migrated to:
  https://jira.springframework.org/browse/SPR-5708 ([https](https://jira.springframework.org/browse/SPR-5708) result 301).
* [ ] http://jira.springframework.org/browse/SPR-6124 with 1 occurrences migrated to:
  https://jira.springframework.org/browse/SPR-6124 ([https](https://jira.springframework.org/browse/SPR-6124) result 301).
* [ ] http://jira.springframework.org/browse/SPR-6128 with 1 occurrences migrated to:
  https://jira.springframework.org/browse/SPR-6128 ([https](https://jira.springframework.org/browse/SPR-6128) result 301).
* [ ] http://jira.springframework.org/browse/SPR-7064 with 1 occurrences migrated to:
  https://jira.springframework.org/browse/SPR-7064 ([https](https://jira.springframework.org/browse/SPR-7064) result 301).
* [ ] http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html with 1 occurrences migrated to:
  https://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html ([https](https://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html) result 301).
* [ ] http://mockito.org/ (301) with 1 occurrences migrated to:
  https://mockito.github.io ([https](https://mockito.org/) result 301).
* [ ] http://mydomain1.com with 37 occurrences migrated to:
  https://mydomain1.com ([https](https://mydomain1.com) result 301).
* [ ] http://mydomain1.com/ with 2 occurrences migrated to:
  https://mydomain1.com/ ([https](https://mydomain1.com/) result 301).
* [ ] http://mydomain1.com/path with 2 occurrences migrated to:
  https://mydomain1.com/path ([https](https://mydomain1.com/path) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-2660 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-2660 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-2660) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-2754 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-2754 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-2754) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-2789 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-2789 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-2789) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-3127 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-3127 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-3127) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-3775 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-3775 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-3775) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-3880 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-3880 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-3880) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-3896 with 7 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-3896 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-3896) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-3949 with 1 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-3949 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-3949) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-4008 with 2 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-4008 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-4008) result 301).
* [ ] http://opensource.atlassian.com/projects/spring/browse/SPR-4040 with 2 occurrences migrated to:
  https://opensource.atlassian.com/projects/spring/browse/SPR-4040 ([https](https://opensource.atlassian.com/projects/spring/browse/SPR-4040) result 301).
* [ ] http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//topic/com.ibm.websphere.base.doc/info/aes/ae/rdat_extiapi.html with 1 occurrences migrated to:
  https://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//topic/com.ibm.websphere.base.doc/info/aes/ae/rdat_extiapi.html ([https](https://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//topic/com.ibm.websphere.base.doc/info/aes/ae/rdat_extiapi.html) result 301).
* [ ] http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/rsadapter/JDBCConnectionSpec.html with 1 occurrences migrated to:
  https://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/rsadapter/JDBCConnectionSpec.html ([https](https://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/rsadapter/JDBCConnectionSpec.html) result 301).
* [ ] http://site2.com with 3 occurrences migrated to:
  https://site2.com ([https](https://site2.com) result 301).
* [ ] http://slack.kotlinlang.org/ with 2 occurrences migrated to:
  https://slack.kotlinlang.org/ ([https](https://slack.kotlinlang.org/) result 301).
* [ ] http://sourceforge.net/projects/c3p0 with 2 occurrences migrated to:
  https://sourceforge.net/projects/c3p0 ([https](https://sourceforge.net/projects/c3p0) result 301).
* [ ] http://sourceforge.net/projects/javadiff with 1 occurrences migrated to:
  https://sourceforge.net/projects/javadiff ([https](https://sourceforge.net/projects/javadiff) result 301).
* [ ] http://springframework.org with 2 occurrences migrated to:
  https://springframework.org ([https](https://springframework.org) result 301).
* [ ] http://www-01.ibm.com/software/webservers/appserv/was/ with 1 occurrences migrated to:
  https://www-01.ibm.com/software/webservers/appserv/was/ ([https](https://www-01.ibm.com/software/webservers/appserv/was/) result 301).
* [ ] http://www.atomenabled.org/developers/syndication/ with 1 occurrences migrated to:
  https://www.atomenabled.org/developers/syndication/ ([https](https://www.atomenabled.org/developers/syndication/) result 301).
* [ ] http://www.eclipse.org/aspectj with 2 occurrences migrated to:
  https://www.eclipse.org/aspectj ([https](https://www.eclipse.org/aspectj) result 301).
* [ ] http://www.google.com/ig/calculator?q=1USD=?EUR with 1 occurrences migrated to:
  https://www.google.com/ig/calculator?q=1USD=?EUR ([https](https://www.google.com/ig/calculator?q=1USD=?EUR) result 301).
* [ ] http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html with 1 occurrences migrated to:
  https://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html ([https](https://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html) result 301).
* [ ] http://www.jboss.org/jbossas/ with 1 occurrences migrated to:
  https://www.jboss.org/jbossas/ ([https](https://www.jboss.org/jbossas/) result 301).
* [ ] http://www.junit.org/ with 1 occurrences migrated to:
  https://www.junit.org/ ([https](https://www.junit.org/) result 301).
* [ ] http://www.mnot.net/cache_docs with 1 occurrences migrated to:
  https://www.mnot.net/cache_docs ([https](https://www.mnot.net/cache_docs) result 301).
* [ ] http://www.sf.net/home.view?siteLanguage=nl with 1 occurrences migrated to:
  https://www.sf.net/home.view?siteLanguage=nl ([https](https://www.sf.net/home.view?siteLanguage=nl) result 301).
* [ ] http://www.springframework.org with 7 occurrences migrated to:
  https://www.springframework.org ([https](https://www.springframework.org) result 301).
* [ ] http://www.springframework.org/ with 3 occurrences migrated to:
  https://www.springframework.org/ ([https](https://www.springframework.org/) result 301).
* [ ] http://xyz.com/path with 2 occurrences migrated to:
  https://xyz.com/path ([https](https://xyz.com/path) result 301).
* [ ] http://commons.apache.org/codec/ with 1 occurrences migrated to:
  https://commons.apache.org/codec/ ([https](https://commons.apache.org/codec/) result 302).
* [ ] http://commons.apache.org/logging with 2 occurrences migrated to:
  https://commons.apache.org/logging ([https](https://commons.apache.org/logging) result 302).
* [ ] http://download.oracle.com/javaee/6/api/javax/inject/Scope.html with 1 occurrences migrated to:
  https://download.oracle.com/javaee/6/api/javax/inject/Scope.html ([https](https://download.oracle.com/javaee/6/api/javax/inject/Scope.html) result 302).
* [ ] http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html with 4 occurrences migrated to:
  https://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html ([https](https://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html) result 302).
* [ ] http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html with 1 occurrences migrated to:
  https://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html ([https](https://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html) result 302).
* [ ] http://download.oracle.com/javase/8/docs/api/java/beans/ConstructorProperties.html with 1 occurrences migrated to:
  https://download.oracle.com/javase/8/docs/api/java/beans/ConstructorProperties.html ([https](https://download.oracle.com/javase/8/docs/api/java/beans/ConstructorProperties.html) result 302).
* [ ] http://download.oracle.com/javase/jndi/tutorial/beyond/misc/policy.html with 1 occurrences migrated to:
  https://download.oracle.com/javase/jndi/tutorial/beyond/misc/policy.html ([https](https://download.oracle.com/javase/jndi/tutorial/beyond/misc/policy.html) result 302).
* [ ] http://gafter.blogspot.nl/2006/12/super-type-tokens.html with 1 occurrences migrated to:
  https://gafter.blogspot.nl/2006/12/super-type-tokens.html ([https](https://gafter.blogspot.nl/2006/12/super-type-tokens.html) result 302).
* [ ] http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project with 1 occurrences migrated to:
  https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project ([https](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project) result 302).
* [ ] http://git-scm.com/book/en/Git-Tools-Rewriting-History with 1 occurrences migrated to:
  https://git-scm.com/book/en/Git-Tools-Rewriting-History ([https](https://git-scm.com/book/en/Git-Tools-Rewriting-History) result 302).
* [ ] http://glassfish.dev.java.net/ with 1 occurrences migrated to:
  https://glassfish.dev.java.net/ ([https](https://glassfish.dev.java.net/) result 302).
* [ ] http://java.sun.com/docs/books/jls/third_edition/html/conversions.html with 1 occurrences migrated to:
  https://java.sun.com/docs/books/jls/third_edition/html/conversions.html ([https](https://java.sun.com/docs/books/jls/third_edition/html/conversions.html) result 302).
* [ ] http://java.sun.com/docs/books/jls/third_edition/html/expressions.html with 1 occurrences migrated to:
  https://java.sun.com/docs/books/jls/third_edition/html/expressions.html ([https](https://java.sun.com/docs/books/jls/third_edition/html/expressions.html) result 302).
* [ ] http://java.sun.com/j2se/ with 2 occurrences migrated to:
  https://java.sun.com/j2se/ ([https](https://java.sun.com/j2se/) result 302).
* [ ] http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/javadoc.html with 1 occurrences migrated to:
  https://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/javadoc.html ([https](https://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/javadoc.html) result 302).
* [ ] http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html with 1 occurrences migrated to:
  https://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html ([https](https://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html) result 302).
* [ ] http://java.sun.com/j2se/javadoc with 1 occurrences migrated to:
  https://java.sun.com/j2se/javadoc ([https](https://java.sun.com/j2se/javadoc) result 302).
* [ ] http://java.sun.com/j2se/javadoc/ with 1 occurrences migrated to:
  https://java.sun.com/j2se/javadoc/ ([https](https://java.sun.com/j2se/javadoc/) result 302).
* [ ] http://java.sun.com/j2se/javadoc/faq.html with 1 occurrences migrated to:
  https://java.sun.com/j2se/javadoc/faq.html ([https](https://java.sun.com/j2se/javadoc/faq.html) result 302).
* [ ] http://java.sun.com/webservices/jaxb/ with 1 occurrences migrated to:
  https://java.sun.com/webservices/jaxb/ ([https](https://java.sun.com/webservices/jaxb/) result 302).
* [ ] http://java.sun.com/xml/jaxp/properties/schemaLanguage with 1 occurrences migrated to:
  https://java.sun.com/xml/jaxp/properties/schemaLanguage ([https](https://java.sun.com/xml/jaxp/properties/schemaLanguage) result 302).
* [ ] http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/j2ee/connector_1_5.xsd ([https](https://java.sun.com/xml/ns/j2ee/connector_1_5.xsd) result 302).
* [ ] http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd with 2 occurrences migrated to:
  https://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd ([https](https://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd) result 302).
* [ ] http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd with 2 occurrences migrated to:
  https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ([https](https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd) result 302).
* [ ] http://java.sun.com/xml/stream/properties/report-cdata-event with 1 occurrences migrated to:
  https://java.sun.com/xml/stream/properties/report-cdata-event ([https](https://java.sun.com/xml/stream/properties/report-cdata-event) result 302).
* [ ] http://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download with 1 occurrences migrated to:
  https://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download ([https](https://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download) result 302).
* [ ] http://other.info/foo/bar (301) with 1 occurrences migrated to:
  https://weibo.com/otherinfo/foo/bar ([https](https://other.info/foo/bar) result 302).
* [ ] http://www.iana.org/assignments/http-status-codes with 1 occurrences migrated to:
  https://www.iana.org/assignments/http-status-codes ([https](https://www.iana.org/assignments/http-status-codes) result 302).
* [ ] http://www.iana.org/assignments/media-types/ with 1 occurrences migrated to:
  https://www.iana.org/assignments/media-types/ ([https](https://www.iana.org/assignments/media-types/) result 302).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).
* [ ] http://www.sys-con.com/java with 1 occurrences migrated to:
  https://www.sys-con.com/java ([https](https://www.sys-con.com/java) result 302).

These URLs were intentionally ignored.

* http://java.sun.com/jsp/jstl/core with 1 occurrences
* http://java.sun.com/xml/ns/j2ee with 6 occurrences
* http://java.sun.com/xml/ns/javaee with 4 occurrences
* http://java.sun.com/xml/ns/persistence with 1 occurrences
* http://localhost with 86 occurrences
* http://localhost/ with 16 occurrences
* http://localhost/42 with 1 occurrences
* http://localhost/?cookie=foo with 1 occurrences
* http://localhost/FILE.TXT with 1 occurrences
* http://localhost/abc with 1 occurrences
* http://localhost/abc/def with 1 occurrences
* http://localhost/app%20/path/ with 1 occurrences
* http://localhost/app/path%20with%20spaces/ with 1 occurrences
* http://localhost/bar with 2 occurrences
* http://localhost/context/a with 3 occurrences
* http://localhost/contextPath/main/path with 2 occurrences
* http://localhost/file.foo with 1 occurrences
* http://localhost/file.txt with 1 occurrences
* http://localhost/foo with 2 occurrences
* http://localhost/foo%20bar with 1 occurrences
* http://localhost/foo/bar with 1 occurrences
* http://localhost/foo/bar/baz with 1 occurrences
* http://localhost/forward with 1 occurrences
* http://localhost/hotels/42/bookings/21 with 4 occurrences
* http://localhost/input with 1 occurrences
* http://localhost/jquery-1.11.0.min.js with 5 occurrences
* http://localhost/messages/form with 1 occurrences
* http://localhost/mvc-showcase with 2 occurrences
* http://localhost/mvc-showcase/app with 1 occurrences
* http://localhost/mvc-showcase/data/foo%20bar with 1 occurrences
* http://localhost/mvc-showcase/data/param with 1 occurrences
* http://localhost/mvc-showcase/data/param?foo=123 with 2 occurrences
* http://localhost/myapp/main with 1 occurrences
* http://localhost/myapp/people/1/addresses/DE with 1 occurrences
* http://localhost/path with 3 occurrences
* http://localhost/path;a=b/with/semicolon with 1 occurrences
* http://localhost/persons with 1 occurrences
* http://localhost/prefix with 1 occurrences
* http://localhost/prefix/app with 1 occurrences
* http://localhost/prefix/bar with 1 occurrences
* http://localhost/prefix/mvc-showcase with 3 occurrences
* http://localhost/query= with 1 occurrences
* http://localhost/query=foo@bar with 1 occurrences
* http://localhost/resources/child/response.txt with 1 occurrences
* http://localhost/resources/foo with 2 occurrences
* http://localhost/resources/foo.txt with 1 occurrences
* http://localhost/resources/response.txt with 2 occurrences
* http://localhost/rest/books/6/pages/1.json with 1 occurrences
* http://localhost/something/1/foo with 1 occurrences
* http://localhost/something/optional-param with 1 occurrences
* http://localhost/test with 4 occurrences
* http://localhost/test.html with 1 occurrences
* http://localhost/test/this with 2 occurrences
* http://localhost:7070/example/adminhandle.vm with 1 occurrences
* http://localhost:7070/example/bingo.html with 1 occurrences
* http://localhost:80/jquery-1.11.0.min.js with 1 occurrences
* http://localhost:8080 with 34 occurrences
* http://localhost:8080/ with 4 occurrences
* http://localhost:8080/OrderService with 3 occurrences
* http://localhost:8080/aA/bB/cC with 1 occurrences
* http://localhost:8080/context with 1 occurrences
* http://localhost:8080/context/myapiresource with 1 occurrences
* http://localhost:8080/gamecast/admin/index.html with 1 occurrences
* http://localhost:8080/gamecast/display.html with 1 occurrences
* http://localhost:8080/gamecast/displayShoppingCart.html with 1 occurrences
* http://localhost:8080/jquery-1.11.0.min.js with 1 occurrences
* http://localhost:8080/mvc-showcase with 1 occurrences
* http://localhost:8080/myapiresource with 1 occurrences
* http://localhost:8080/myapp/js/sockjs-client.js with 1 occurrences
* http://localhost:8080/path with 3 occurrences
* http://localhost:8080/people with 2 occurrences
* http://localhost:8080/portfolio with 1 occurrences
* http://localhost:8080/spring/ with 2 occurrences
* http://localhost:8080/test/ with 2 occurrences
* http://localhost:8080/test/print?value=%EA%B0%80+%EB%82%98 with 1 occurrences
* http://localhost:8081 with 1 occurrences
* http://localhost:8081/ with 1 occurrences
* http://localhost:8181 with 1 occurrences
* http://localhost:8888/AccountServiceEndpoint?WSDL with 1 occurrences
* http://localhost:9000 with 7 occurrences
* http://localhost:9090 with 18 occurrences
* http://localhost:9090/jquery-1.11.0.min.js with 2 occurrences
* http://localhost:9990/mail/messages/form with 1 occurrences
* http://localhost:9999/ with 1 occurrences
* http://localhost:9999/OrderService?wsdl with 4 occurrences
* http://localhosta/testbean with 3 occurrences
* http://samples.springframework.org/flight with 27 occurrences
* http://springframework.org/spring-ws with 17 occurrences
* http://test.com with 1 occurrences
* http://test.com/ with 1 occurrences
* http://testng.org/ with 1 occurrences
* http://tiles.apache.org/tags-tiles with 1 occurrences
* http://www.foo.com/schema/component with 6 occurrences
* http://www.mycompany.com/schema/myns with 4 occurrences
* http://www.springframework.org/schema/aop with 30 occurrences
* http://www.springframework.org/schema/beans with 169 occurrences
* http://www.springframework.org/schema/beans/test with 2 occurrences
* http://www.springframework.org/schema/c with 1 occurrences
* http://www.springframework.org/schema/cache with 5 occurrences
* http://www.springframework.org/schema/context with 28 occurrences
* http://www.springframework.org/schema/jdbc with 8 occurrences
* http://www.springframework.org/schema/jee with 9 occurrences
* http://www.springframework.org/schema/jms with 5 occurrences
* http://www.springframework.org/schema/lang with 10 occurrences
* http://www.springframework.org/schema/mvc with 8 occurrences
* http://www.springframework.org/schema/oxm with 4 occurrences
* http://www.springframework.org/schema/p with 4 occurrences
* http://www.springframework.org/schema/task with 2 occurrences
* http://www.springframework.org/schema/tool with 27 occurrences
* http://www.springframework.org/schema/tx with 18 occurrences
* http://www.springframework.org/schema/util with 8 occurrences
* http://www.springframework.org/schema/websocket with 26 occurrences
* http://www.springframework.org/spring-ws with 1 occurrences
* http://www.springframework.org/tags with 4 occurrences
* http://www.springframework.org/tags/form with 2 occurrences
* http://www.w3.org/1999/XSL/Transform with 8 occurrences
* http://www.w3.org/2001/XMLSchema with 24 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 79 occurrences
* http://www.w3.org/2005/Atom with 4 occurrences
* http://www.w3.org/TR/html4/charset.html with 5 occurrences
* http://www.w3.org/TR/html4/sgml/entities.html with 14 occurrences
2019-03-21 15:08:55 -05:00
Rob Winch c8732d0258 Polish URL Cleanup
Closes gh-22617
2019-03-21 15:07:40 -05:00
Spring Operator 6a0ef1aa64 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://www.foo.com/schema/component/component.xsd (404) with 1 occurrences could not be migrated:
   ([https](https://www.foo.com/schema/component/component.xsd) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://www.kbcafe.com/rss/atom.xsd.xml (ConnectTimeoutException) with 1 occurrences migrated to:
  https://www.kbcafe.com/rss/atom.xsd.xml ([https](https://www.kbcafe.com/rss/atom.xsd.xml) result ConnectTimeoutException).
* http://domain1.com (UnknownHostException) with 2 occurrences migrated to:
  https://domain1.com ([https](https://domain1.com) result UnknownHostException).
* http://domain2.com (UnknownHostException) with 1 occurrences migrated to:
  https://domain2.com ([https](https://domain2.com) result UnknownHostException).
* http://mydomain1.com,http://mydomain2.com (UnknownHostException) with 1 occurrences migrated to:
  https://mydomain1.com,http://mydomain2.com ([https](https://mydomain1.com,https://mydomain2.com) result UnknownHostException).
* http://mydomain2.com (UnknownHostException) with 2 occurrences migrated to:
  https://mydomain2.com ([https](https://mydomain2.com) result UnknownHostException).
* http://mydomain3.com,http://mydomain4.com (UnknownHostException) with 1 occurrences migrated to:
  https://mydomain3.com,http://mydomain4.com ([https](https://mydomain3.com,https://mydomain4.com) result UnknownHostException).
* http://www.springframework.org/schema/beans/factory/xml/support/CustomNamespaceHandlerTests.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/beans/factory/xml/support/CustomNamespaceHandlerTests.xsd ([https](https://www.springframework.org/schema/beans/factory/xml/support/CustomNamespaceHandlerTests.xsd) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://example.com with 1 occurrences migrated to:
  https://example.com ([https](https://example.com) result 200).
* http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd (301) with 2 occurrences migrated to:
  https://hibernate.org/dtd/hibernate-mapping-3.0.dtd ([https](https://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd) result 200).
* http://testng.org/testng-1.0.dtd with 3 occurrences migrated to:
  https://testng.org/testng-1.0.dtd ([https](https://testng.org/testng-1.0.dtd) result 200).
* http://tiles.apache.org/dtds/tiles-config_2_0.dtd with 2 occurrences migrated to:
  https://tiles.apache.org/dtds/tiles-config_2_0.dtd ([https](https://tiles.apache.org/dtds/tiles-config_2_0.dtd) result 200).
* http://tiles.apache.org/dtds/tiles-config_2_1.dtd with 2 occurrences migrated to:
  https://tiles.apache.org/dtds/tiles-config_2_1.dtd ([https](https://tiles.apache.org/dtds/tiles-config_2_1.dtd) result 200).
* http://tiles.apache.org/dtds/tiles-config_3_0.dtd with 4 occurrences migrated to:
  https://tiles.apache.org/dtds/tiles-config_3_0.dtd ([https](https://tiles.apache.org/dtds/tiles-config_3_0.dtd) result 200).
* http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd with 1 occurrences migrated to:
  https://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd ([https](https://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd) result 200).
* http://www.springframework.org/dtd/spring-beans-2.0.dtd with 168 occurrences migrated to:
  https://www.springframework.org/dtd/spring-beans-2.0.dtd ([https](https://www.springframework.org/dtd/spring-beans-2.0.dtd) result 200).
* http://www.springframework.org/schema/aop/spring-aop-2.0.xsd with 68 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop-2.0.xsd ([https](https://www.springframework.org/schema/aop/spring-aop-2.0.xsd) result 200).
* http://www.springframework.org/schema/aop/spring-aop-2.5.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop-2.5.xsd ([https](https://www.springframework.org/schema/aop/spring-aop-2.5.xsd) result 200).
* http://www.springframework.org/schema/aop/spring-aop-3.0.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop-3.0.xsd ([https](https://www.springframework.org/schema/aop/spring-aop-3.0.xsd) result 200).
* http://www.springframework.org/schema/aop/spring-aop.xsd with 7 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-2.0.xsd with 112 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-2.0.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-2.0.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-2.5.xsd with 46 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-2.5.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-2.5.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-3.0.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.0.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.0.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 33 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-3.2.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.2.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.2.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-4.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-4.0.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-4.0.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-4.1.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-4.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-4.1.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-4.2.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-4.2.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-4.2.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-4.3.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-4.3.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-4.3.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 142 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/cache/spring-cache.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/cache/spring-cache.xsd ([https](https://www.springframework.org/schema/cache/spring-cache.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-2.5.xsd with 41 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-2.5.xsd ([https](https://www.springframework.org/schema/context/spring-context-2.5.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-3.0.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-3.0.xsd ([https](https://www.springframework.org/schema/context/spring-context-3.0.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-3.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-3.1.xsd ([https](https://www.springframework.org/schema/context/spring-context-3.1.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-3.2.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-3.2.xsd ([https](https://www.springframework.org/schema/context/spring-context-3.2.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-4.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-4.0.xsd ([https](https://www.springframework.org/schema/context/spring-context-4.0.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-4.2.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-4.2.xsd ([https](https://www.springframework.org/schema/context/spring-context-4.2.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context-4.3.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context-4.3.xsd ([https](https://www.springframework.org/schema/context/spring-context-4.3.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd with 5 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 8 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200).
* http://www.springframework.org/schema/jee/spring-jee-3.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/jee/spring-jee-3.1.xsd ([https](https://www.springframework.org/schema/jee/spring-jee-3.1.xsd) result 200).
* http://www.springframework.org/schema/jms/spring-jms-4.1.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms-4.1.xsd ([https](https://www.springframework.org/schema/jms/spring-jms-4.1.xsd) result 200).
* http://www.springframework.org/schema/jms/spring-jms-4.2.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms-4.2.xsd ([https](https://www.springframework.org/schema/jms/spring-jms-4.2.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang-2.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang-2.0.xsd ([https](https://www.springframework.org/schema/lang/spring-lang-2.0.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang-2.5.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang-2.5.xsd ([https](https://www.springframework.org/schema/lang/spring-lang-2.5.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang-3.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang-3.0.xsd ([https](https://www.springframework.org/schema/lang/spring-lang-3.0.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang-3.1.xsd with 5 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang-3.1.xsd ([https](https://www.springframework.org/schema/lang/spring-lang-3.1.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang-4.2.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang-4.2.xsd ([https](https://www.springframework.org/schema/lang/spring-lang-4.2.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang.xsd ([https](https://www.springframework.org/schema/lang/spring-lang.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc.xsd with 26 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200).
* http://www.springframework.org/schema/oxm/spring-oxm.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/oxm/spring-oxm.xsd ([https](https://www.springframework.org/schema/oxm/spring-oxm.xsd) result 200).
* http://www.springframework.org/schema/task/spring-task-4.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/task/spring-task-4.1.xsd ([https](https://www.springframework.org/schema/task/spring-task-4.1.xsd) result 200).
* http://www.springframework.org/schema/task/spring-task.xsd with 6 occurrences migrated to:
  https://www.springframework.org/schema/task/spring-task.xsd ([https](https://www.springframework.org/schema/task/spring-task.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx-2.5.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx-2.5.xsd ([https](https://www.springframework.org/schema/tx/spring-tx-2.5.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx-4.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx-4.0.xsd ([https](https://www.springframework.org/schema/tx/spring-tx-4.0.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-2.0.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-2.0.xsd ([https](https://www.springframework.org/schema/util/spring-util-2.0.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-2.5.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-2.5.xsd ([https](https://www.springframework.org/schema/util/spring-util-2.5.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-3.0.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-3.0.xsd ([https](https://www.springframework.org/schema/util/spring-util-3.0.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-3.1.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-3.1.xsd ([https](https://www.springframework.org/schema/util/spring-util-3.1.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-4.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-4.1.xsd ([https](https://www.springframework.org/schema/util/spring-util-4.1.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util-4.2.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util-4.2.xsd ([https](https://www.springframework.org/schema/util/spring-util-4.2.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200).
* http://www.springframework.org/schema/websocket/spring-websocket.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/websocket/spring-websocket.xsd ([https](https://www.springframework.org/schema/websocket/spring-websocket.xsd) result 200).
* http://mydomain1.com with 2 occurrences migrated to:
  https://mydomain1.com ([https](https://mydomain1.com) result 301).
* http://www.springframework.org with 1 occurrences migrated to:
  https://www.springframework.org ([https](https://www.springframework.org) result 301).
* http://help.sap.com/saphelp_hanaplatform/helpdata/en/20/a78d3275191014b41bae7c4a46d835/content.htm with 1 occurrences migrated to:
  https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/a78d3275191014b41bae7c4a46d835/content.htm ([https](https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/a78d3275191014b41bae7c4a46d835/content.htm) result 302).
* http://java.sun.com/dtd/properties.dtd with 4 occurrences migrated to:
  https://java.sun.com/dtd/properties.dtd ([https](https://java.sun.com/dtd/properties.dtd) result 302).
* http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/j2ee/connector_1_5.xsd ([https](https://java.sun.com/xml/ns/j2ee/connector_1_5.xsd) result 302).
* http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd ([https](https://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd) result 302).
* http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd with 12 occurrences migrated to:
  https://java.sun.com/xml/ns/persistence/persistence_1_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_1_0.xsd) result 302).
* http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/j2ee with 2 occurrences
* http://java.sun.com/xml/ns/javaee with 2 occurrences
* http://java.sun.com/xml/ns/persistence with 27 occurrences
* http://localhost:8080 with 3 occurrences
* http://samples.springframework.org/flight with 3 occurrences
* http://www.foo.com/schema/component with 2 occurrences
* http://www.greeting.com/goodbye/ with 1 occurrences
* http://www.greeting.com/hello/ with 1 occurrences
* http://www.quartz-scheduler.org/xml/JobSchedulingData with 2 occurrences
* http://www.springframework.org/schema/aop with 176 occurrences
* http://www.springframework.org/schema/beans with 715 occurrences
* http://www.springframework.org/schema/beans/test with 2 occurrences
* http://www.springframework.org/schema/c with 9 occurrences
* http://www.springframework.org/schema/cache with 20 occurrences
* http://www.springframework.org/schema/context with 126 occurrences
* http://www.springframework.org/schema/jdbc with 66 occurrences
* http://www.springframework.org/schema/jee with 2 occurrences
* http://www.springframework.org/schema/jms with 20 occurrences
* http://www.springframework.org/schema/lang with 27 occurrences
* http://www.springframework.org/schema/mvc with 58 occurrences
* http://www.springframework.org/schema/oxm with 2 occurrences
* http://www.springframework.org/schema/p with 16 occurrences
* http://www.springframework.org/schema/task with 14 occurrences
* http://www.springframework.org/schema/tx with 12 occurrences
* http://www.springframework.org/schema/util with 28 occurrences
* http://www.springframework.org/schema/websocket with 22 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 375 occurrences
* http://www.w3.org/2005/Atom with 2 occurrences
2019-03-21 15:07:40 -05:00
armansimonyan13 3e4f8905a7 Fix grammar issue (#22628) 2019-03-21 19:32:10 +01:00
Sebastien Deleuze 5a0ac42b85 Merge branch '5.1.x' 2019-03-21 19:17:22 +01:00
Sebastien Deleuze 0d8fbb4c65 Merge branch '5.1.x' 2019-03-21 11:34:10 +01:00
arman simonyan b7f5d1f031 Fix grammar issues 2019-03-21 10:05:31 +01:00
Rossen Stoyanchev 4938831575 Register custom before default codecs
Closes gh-22612
2019-03-20 20:52:57 -04:00
Rossen Stoyanchev e9819b7535 Raise ISE if @RequestBody is used for form data
Closes gh-22486
2019-03-20 20:30:36 -04:00
Arjen Poutsma b67039d19a Fix checkstyle issue 2019-03-20 20:29:43 +01:00
Rossen Stoyanchev 2e7f98d7f6 Merge branch '5.1.x' 2019-03-20 14:47:02 -04:00
Rossen Stoyanchev c6a655275d Allow overriding of FormHttpMessageWriter#getMediaType
Closes gh-22588
2019-03-20 14:46:38 -04:00
Arjen Poutsma 0e9ea2c94d Fix review remarks on Servlet.fn
This commit incoporates the remarks made during the Servlet.fn review.

See gh-21490
2019-03-20 16:47:50 +01:00
Arjen Poutsma 2f682e1035 Polishing 2019-03-20 16:47:27 +01:00
Arjen Poutsma e638fef508 Add Servlet.fn integration with DispatcherServlet
This commit adds support for HandlerFunctions and RouterFunctions to
DispatcherServlet, in the form of a HandlerAdapter and HandlerMapping.

See gh-21490
2019-03-20 16:47:27 +01:00
Arjen Poutsma 85082fc10c Add Tests for Servlet.fn
This commit adds tests for Servlet.fn, the servlet-based version of
HandlerFunctions and RouterFunctions.

See gh-21490
2019-03-20 16:47:27 +01:00
Arjen Poutsma 5d2fd75cf9 Introduce Servlet.fn
This commit introduces Servlet.fn, a servlet-based version of
WebFlux.fn, i.e. HandlerFunctions and RouterFunctions.

This commit contains the web framework only, further commits provide
tests and DispatcherServlet integration.

See gh-21490
2019-03-20 16:47:27 +01:00
Sam Brannen 7d498ba681 Fix Checkstyle error and polish Javadoc for ResourceHttpMessageReader 2019-03-20 11:03:54 +01:00
Rossen Stoyanchev 4a397f108a ResourceDecoder supports filename hint
Closes gh-22267
2019-03-19 17:50:06 -04:00
Rossen Stoyanchev 5a3ff35215 Map arg resolver backs out if annotations present
Closes gh-21874
2019-03-19 16:41:26 -04:00
Rossen Stoyanchev a2fcf0a821 ReactorNettyWebSocketSession uses correct frame size
See gh-22367
2019-03-19 15:42:06 -04:00
Rossen Stoyanchev 48ec875a7f Merge branch '5.1.x' 2019-03-19 14:41:00 -04:00
Rossen Stoyanchev 581e77c0fb Merge branch '5.1.x' 2019-03-19 14:18:52 -04:00
Sam Brannen 3e2dbd03b9 Merge branch '5.1.x' 2019-03-19 19:00:12 +01:00
Sam Brannen 2bbd52c9f3 Polishing 2019-03-19 18:46:05 +01:00
Arjen Poutsma 228cae216e Merge branch '5.1.x' 2019-03-19 11:30:43 +01:00
Sam Brannen 0fc0849c0a Upgrade to JUnit Jupiter 5.4.1
Closes gh-22308
2019-03-17 23:01:44 +01:00
Sam Brannen 2b88c47477 Polish Javadoc for application event infrastructure 2019-03-17 20:21:47 +01:00
Rossen Stoyanchev e6d206b45a Extra information in WebFlux stacktraces
Use the checkpoint operator at various places in WebFlux to insert
information that Reactor then uses to enrich exceptions, via suppressed
exceptions, when error signals flow through the operator.

Closes gh-22105
2019-03-15 16:25:43 -04:00
Sebastien Deleuze 495ba2f58c Remove static import from InvocableHandlerMethod
See gh-19975
2019-03-15 19:38:14 +01:00
Sebastien Deleuze 9a81d0276e Fix checkstyle issue 2019-03-15 19:02:33 +01:00
Sebastien Deleuze 1382220021 Add support for Deferred to ReactiveAdapterRegistry
See gh-19975
2019-03-15 18:22:19 +01:00
Sebastien Deleuze 1c9cbaf399 Introduce coroutinesVersion
See gh-19975
2019-03-15 18:22:06 +01:00
Sebastien Deleuze 22cf83edba Add support for suspending handler methods in WebFlux
This commit turns Coroutines suspending methods to `Mono` which can be
handled natively by WebFlux.

See gh-19975
2019-03-15 18:21:50 +01:00
Sam Brannen 3cce85b402 Upgrade to latest Checkstyle Suppressions DTD
See https://github.com/checkstyle/checkstyle/blob/master/config/suppressions.xml
2019-03-15 16:49:41 +01:00
Sam Brannen 3967082c77 Upgrade to latest Checkstyle DTD
See http://checkstyle.sourceforge.net/config.html#Configuration_XML_Structure
2019-03-15 16:32:20 +01:00
Stephane Nicoll a46a6e843b Merge branch '5.1.x' 2019-03-15 10:51:59 +01:00
Sam Brannen fef43048b2 Polish annotation-driven event listener support 2019-03-14 23:13:41 +01:00
Juergen Hoeller 0b53dbf38f Allow usage of BeanNameGenerator in ImportBeanDefinitionRegistrars
Closes gh-22591
2019-03-14 17:35:04 +01:00
stsypanov e94af52510 Use Arrays::fill instead of hand-written loop 2019-03-14 17:24:51 +01:00
stsypanov 29f382b04e Simplify String concatenation 2019-03-14 17:24:33 +01:00
Sam Brannen 9d2e7ced89 Favor Math.[min|max]() over handcrafted code
In line with the general trend toward favoring core JDK APIs for common
tasks in Spring Framework 5.2, this commit replaces handcrafted
statements with Math.min() and Math.max() were applicable.
2019-03-14 16:48:44 +01:00
valery1707 9cf9d0fa21 Fix copy-n-paste error in Javadoc in ResponseEntityExceptionHandler
Closes gh-22589
2019-03-13 17:22:33 +01:00
Juergen Hoeller 840d80b994 Merge branch '5.1.x' 2019-03-13 16:24:01 +01:00
Sam Brannen 1e417146c9 Merge branch '5.1.x' 2019-03-13 15:28:58 +01:00
Sam Brannen f9e22a0f02 Merge branch '5.1.x' 2019-03-13 15:16:24 +01:00
Juergen Hoeller 4bee5073a0 Proper exception for non-matching argument on unique factory method
See gh-22420
2019-03-13 14:04:17 +01:00
Arjen Poutsma 88ca255c95 Fix checkstyle issue 2019-03-13 11:00:07 +01:00
Juergen Hoeller c0ddaae5c0 Shared empty InjectionMetadata/LifecycleMetadata instance
Closes gh-22570
2019-03-12 22:45:24 +01:00
Juergen Hoeller 62c923711d Consistent use of empty array constants in ReflectionUtils
Closes gh-22567
2019-03-12 22:44:15 +01:00
Juergen Hoeller a7adafdb6a Larger initial size for ASM type descriptor StringBuilder
Closes gh-22565
2019-03-12 22:44:00 +01:00
Rossen Stoyanchev 57a67a3c06 Header predicate option in AbstractRequestLoggingFilter
Closes gh-22244
2019-03-12 17:05:40 -04:00
Rossen Stoyanchev 19c024f91f Improved logging for @MessageMapping methods
Closes gh-20564
2019-03-12 16:39:26 -04:00
Rossen Stoyanchev b88aad6b39 Avoid payload conversion if unnecessary
Closes gh-22386
2019-03-12 16:17:39 -04:00
Rossen Stoyanchev baa7e2e228 Merge pull request #22367 from envious/adding-maxframebuffersize 2019-03-12 15:59:19 -04:00
Rossen Stoyanchev 2d4247b2da Polish 2019-03-12 15:58:25 -04:00
Usman 9f617be909 maxFramePayloadLength property in ReactorNettyWebSocketClient
Closes gh-22367
2019-03-12 15:41:45 -04:00
Rossen Stoyanchev 2b4cd5cf56 Fragment should be expanded last
Closes gh-22447
2019-03-12 15:10:35 -04:00
Sam Brannen 7dc522f0d6 Clean up warnings in Gradle build 2019-03-12 19:36:14 +01:00
Sam Brannen 79f416ddb8 Manual URL Cleanup
See gh-22515
2019-03-12 18:39:27 +01:00
Juergen Hoeller 40c62139ae Early resolution of unique factory methods in configuration classes
Includes consistent bean class resolution in the enhancement step as well as general reflection optimizations for user-declared methods.

Closes gh-22420
2019-03-12 17:17:24 +01:00
Сергей Цыпанов a35adc6ea6 Add missing break statements to stop looping when result is known
Closes gh-22573
2019-03-12 13:15:59 +01:00
Stephane Nicoll 96cd4411e5 Merge branch '5.1.x' 2019-03-12 09:10:49 +01:00
Juergen Hoeller e3a9826e56 Bypass method traversal for annotation introspection if possible
The isCandidateClass mechanism is consistently used for a bypass check before method traversal attempts. While by default this is only bypassing standard java types, the same mechanism can be used with index metadata which indicates non-presence of certain annotations.

See gh-22420
2019-03-12 00:12:22 +01:00
Sebastien Deleuze 6266370a7a Polishing 2019-03-11 15:34:46 +01:00
Sebastien Deleuze aabfc5f0a1 Support primitive types in BeanUtils.instantiateClass args
This commit adds support for primitive default values for
BeanUtils.instantiateClass arguments in Java in order to provide
a consistent behavior in both Java and Kotlin languages.

Closes gh-22531
2019-03-11 15:34:46 +01:00
Rossen Stoyanchev 256f8549d0 Merge branch '5.1.x' 2019-03-11 09:23:23 -04:00
Sam Brannen b09e6c8aaf Polishing 2019-03-09 16:53:09 +01:00
Tomasz Linkowski 8ddb1e7201 Fix a typo in @NonNullFields
Prior to this commit, `@NonNullFields` had a redundant `@see NonNullFields`
declaration instead of `@see NonNullApi` in its JavaDoc.

Closes gh-22553
2019-03-09 16:46:15 +01:00
Sam Brannen b109f140a7 Improve documentation for annotation filters with component scanning
Prior to this commit the documentation for annotation-based include and
exclude filters used with component scanning did not explicitly mention
the fact that annotations are considered a match if they are either
present or meta-present on candidate classes.

This commit improves the documentation in this regard.

See gh-22551
2019-03-09 16:30:30 +01:00
Juergen Hoeller c04eaf6b84 Merge branch '5.1.x' 2019-03-08 23:06:37 +01:00
Juergen Hoeller 1a8b3fba94 Configuration classes can opt into lite mode (proxyBeanMethods=false)
Closes gh-22461
2019-03-08 15:59:11 +01:00
Juergen Hoeller f5248ff13f Upgrade to ASM 7.1
Closes gh-22503
2019-03-08 09:58:16 +01:00
Juergen Hoeller a06ab6d0ad Polishing 2019-03-08 09:54:44 +01:00
Lars Grefer a98e3f0481 Migrate CacheControl to use java.time.Duration for durations 2019-03-08 09:12:19 +01:00
Sam Brannen 238286caaf Update @since tag in Eclipse code template 2019-03-07 19:25:44 +01:00
Sam Brannen 45ae47d5cb Polishing 2019-03-07 18:13:17 +01:00
Juergen Hoeller ac4c37d8e2 Merge branch '5.1.x' 2019-03-07 18:05:46 +01:00
Juergen Hoeller 17930d6c27 Consistent formatting and related polishing 2019-03-07 17:25:48 +01:00
stsypanov 60b72d721d Polish: do simple clean-up 2019-03-07 16:51:44 +01:00
stsypanov cb4d6f097c Use StringJoiner where possible to simplify String joining 2019-03-07 16:51:18 +01:00
Sam Brannen f087fd5a93 Report offending class in SpringFactoriesLoader in exception message
Prior to this commit, the exception message generated by
instantiateFactory() in SpringFactoriesLoader did not report the
offending class in the top-level exception message. The offending class
was in fact included in the message of the nested exception, but the
top-level exception message on its own was a bit misleading.

This commit improves the diagnostics for such failures by including the
offending class and the target factory type in the top-level exception
message.

Closes gh-22453
2019-03-06 16:44:41 +01:00
Juergen Hoeller 0b8733747c Upgrade to SnakeYAML 1.24 and HtmlUnit 2.34.1 2019-03-06 16:40:06 +01:00
Juergen Hoeller 5c1776ae8f Merge branch '5.1.x' 2019-03-06 16:26:00 +01:00
Sam Brannen 7abe9c6a08 Polishing 2019-03-06 14:22:16 +01:00
Juergen Hoeller 777b4c809d Merge branch '5.1.x' 2019-03-06 14:06:06 +01:00
www fd5a7c2dcc Fix Javadoc for AbstractApplicationContext.registerBeanPostProcessors()
Closes gh-22513
2019-03-06 12:12:17 +01:00
Konrad Kamiński 9302cb2f85 Support Kotlin suspending functions in MethodParameter
Before this commit, the return type for Kotlin suspending functions
(as returned by MethodParameter#getParameterType and
MethodParameter#getGenericReturnType methods) was incorrect.

This change leverages Kotlin reflection instead of Java one
to return the correct type.

Closes gh-21058
2019-03-06 10:14:34 +01:00
Spring Operator 5938742afd URL Cleanup (#22515)
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were fixed successfully.

* http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/ migrated to:
  https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/ ([https](https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/) result 200).
* http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/ migrated to:
  https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/ ([https](https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/) result 200).
* http://docs.oracle.com/javaee/7/api/ migrated to:
  https://docs.oracle.com/javaee/7/api/ ([https](https://docs.oracle.com/javaee/7/api/) result 200).
* http://docs.oracle.com/javase/8/docs/api/ migrated to:
  https://docs.oracle.com/javase/8/docs/api/ ([https](https://docs.oracle.com/javase/8/docs/api/) result 200).
* http://fasterxml.github.io/jackson-core/javadoc/2.9/ migrated to:
  https://fasterxml.github.io/jackson-core/javadoc/2.9/ ([https](https://fasterxml.github.io/jackson-core/javadoc/2.9/) result 200).
* http://fasterxml.github.io/jackson-databind/javadoc/2.9/ migrated to:
  https://fasterxml.github.io/jackson-databind/javadoc/2.9/ ([https](https://fasterxml.github.io/jackson-databind/javadoc/2.9/) result 200).
* http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/ migrated to:
  https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/ ([https](https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/) result 200).
* http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/ migrated to:
  https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/ ([https](https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/) result 200).
* http://issues.gradle.org/browse/GRADLE-1116 migrated to:
  https://issues.gradle.org/browse/GRADLE-1116 ([https](https://issues.gradle.org/browse/GRADLE-1116) result 200).
* http://projectreactor.io/docs/core/release/api/ migrated to:
  https://projectreactor.io/docs/core/release/api/ ([https](https://projectreactor.io/docs/core/release/api/) result 200).
* http://tiles.apache.org/framework/apidocs/ migrated to:
  https://tiles.apache.org/framework/apidocs/ ([https](https://tiles.apache.org/framework/apidocs/) result 200).
* http://tiles.apache.org/tiles-request/apidocs/ migrated to:
  https://tiles.apache.org/tiles-request/apidocs/ ([https](https://tiles.apache.org/tiles-request/apidocs/) result 200).
* http://www.apache.org/licenses/LICENSE-2.0 migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/ migrated to:
  https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/ ([https](https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/) result 200).
* http://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/ migrated to:
  https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/ ([https](https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/) result 200).
* http://docs.spring.io/spring-framework/docs migrated to:
  https://docs.spring.io/spring-framework/docs ([https](https://docs.spring.io/spring-framework/docs) result 301).
* http://glassfish.java.net/nonav/docs/v3/api/ migrated to:
  https://glassfish.java.net/nonav/docs/v3/api/ ([https](https://glassfish.java.net/nonav/docs/v3/api/) result 301).
* http://projects.spring.io/spring-framework migrated to:
  https://projects.spring.io/spring-framework ([https](https://projects.spring.io/spring-framework) result 301).
* http://springframework.org/schema migrated to:
  https://springframework.org/schema ([https](https://springframework.org/schema) result 301).
* http://ehcache.org/apidocs/2.10.4 (301) migrated to:
  https://www.ehcache.org/apidocs/2.10.4 ([https](https://ehcache.org/apidocs/2.10.4) result 301).
2019-03-05 23:21:36 +01:00
Juergen Hoeller 18f2e6a12d AnnotationConfigRegistry exposes registerBean with supplier/qualifiers
Closes gh-22457
2019-03-05 18:26:04 +01:00
Juergen Hoeller eeed20d8d9 Polishing 2019-03-05 18:25:36 +01:00
Sam Brannen c0b6488ed5 Fix typo 2019-03-05 16:47:26 +01:00
www ef91313342 Use String::isEmpty instead of "".equals(arg) when arg is not null 2019-03-05 14:32:56 +01:00
Juergen Hoeller b2b0df893a Merge branch '5.1.x' 2019-03-05 14:20:02 +01:00
Sebastien Deleuze 412c673db2 Add missing MockMvc.head Kotlin extension
See gh-1951
2019-03-05 09:35:39 +01:00
Rossen Stoyanchev 1ec3261062 Initial support for RSocket in spring-messaging 2019-03-04 23:36:27 -05:00
Rossen Stoyanchev 9e7f557b4a Updates for buffer management in RSocket
- Integration tests run with zero copy configuration.
- RSocketBufferLeakTests has been added.
- Updates in MessagingRSocket to ensure proper release

See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 23b39ad27b Explicit handling of void return values
Do give HandlerMethodReturnValueHandler's a chance to handle return
values so the RSocket reply header is always set.

See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev fa95b010cb Direct delegation to RSocketMessageHandler
Simplify handling by eliminating the use of a message channel. Instead
MessageHandlerAcceptor now extends from RSocketMessageHandler and
delegates directly to it.

See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 555dca9aff Refactoring in AbstractMethodMessageHandler
Split out the mechanics of invoking a HandlerMethod and handling the
result into a separate helper class.

See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 4e1c0c6826 @MessageExceptionHandler supports error signal
Before this change if a controller method returned a Publisher whose
first signal was an error, the error signal would not be delegated to
a @MessageExceptionHandler method as expected.

To make this work for now we use a package private local copy of the
ChannelSendOperator from spring-web.

See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev d6f4ec8c33 MessagingAcceptor/RSocket refinements + upgrade to 0.11.17
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 8bdd709683 RSocketRequester, RSocketStrategies, PayloadUtils
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 4e78b5df2f RSocket @MessageMapping handling
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev f2bb95ba7b Payload encoding/decoding and handling refinements
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 33682d74c2 ReactiveMessageChannel and ReactiveSubscribableChannel
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev ceccd9fbee Polish
Updates to synchronize with newly created reactive equivalents.
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 5b3b0b1a7b Polish
The package o.s.messaging.handler.annotation.support was missing
@NonnullApi and @NonNullFields. This commit corrects that and also
adds @Nullable to methods and arguments as needed to address
warnings.
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 567c559da8 Resolvers for destination vars and headers
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev dda40c1516 Reactive @MessageMapping
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev 421090ca35 Reactive AbstractMessageMethodHandler
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev e3e1ffc986 Encoder/Decoder based payload serialization
See gh-21987
2019-03-04 23:35:43 -05:00
Rossen Stoyanchev bcf4f3911b Reactive InvocableHandlerMethod in spring-messaging
See gh-21987
2019-03-04 23:35:43 -05:00
Sebastien Deleuze 9e873af6ab Remove infix qualifier from ResultActionsDsl methods
The infix form limits the extensibility of the API and
prevents calling `andReturn()`.

See gh-1951
2019-03-04 19:17:21 +01:00
Sebastien Deleuze 0c332286f1 Add MockMvc Kotlin DSL
This commit introduces a `MockMvc` Kotlin DSL via a set of
extensions like `MockMvc.get` or `MockMvc.request`
that provide a Kotlin idiomatic and easily discoverable
API while staying close to the original Java API design.

Closes gh-1951
2019-03-04 18:00:49 +01:00
Sam Brannen b7d60b9b89 Improve @EventListener documentation 2019-03-04 14:44:44 +01:00
Sam Brannen 70cf597484 Remove obsolete overview.html files 2019-03-04 14:07:48 +01:00
Brian Clozel 3ac1dddb9d Merge branch '5.1.x' 2019-03-04 13:58:41 +01:00
Stephane Nicoll 45b6c0fcb5 Merge branch '5.1.x' 2019-03-04 09:42:10 +01:00
Sam Brannen 0ca5afd8e4 Fix broken test 2019-03-03 23:08:44 +01:00
Sam Brannen e7bd305e87 Suppress warnings in tests 2019-03-03 22:17:52 +01:00
Sam Brannen 4112ca7da8 Separate async/sync TestContext event listeners in tests
See gh-18490
2019-03-03 21:30:49 +01:00
Sam Brannen 6daf33deff Document that @Async is not supported in @Configuration classes 2019-03-03 18:29:45 +01:00
Sam Brannen a9f251db42 Fix broken Javadoc links 2019-03-03 17:18:18 +01:00
Sam Brannen 8e2b14a2b6 Fix Javadoc links to Quartz
See https://github.com/quartz-scheduler/quartz-scheduler.org-site/issues/42
2019-03-03 17:04:34 +01:00
Sam Brannen b5fb7437c9 Test exception handling for TestContext event annotations
This commit introduces tests for both synchronous and asynchronous
exception handling for TestContext event annotations.

See gh-18490
2019-03-03 16:36:00 +01:00
Sam Brannen 6853d50ddb Polishing 2019-03-03 16:29:49 +01:00
Sam Brannen e272e2e151 Support conditional processing in TestContext event annotations
This commit introduces support for SpEL expressions for conditional
event processing in annotations such as @BeforeTestClass,
@BeforeTestMethod, etc.

This commit also introduces a new getTestContext() method in
TestContextEvent in order to improve the readability of such SpEL
expressions.

See gh-18490
2019-03-02 17:26:57 +01:00
Sam Brannen f6d62eda8b Add missing @Nullable declarations to TestContext return values 2019-03-02 16:36:23 +01:00
Sam Brannen 8649061acc Polish Javadoc for TestContext 2019-03-02 16:25:23 +01:00
Sam Brannen abda6a6c66 Polishing 2019-03-02 16:17:58 +01:00
Sam Brannen d4f544d42f Add missing precondition check to AutowireUtils.resolveDependency
See gh-2060
2019-03-02 14:39:43 +01:00
Sam Brannen 02be21d0dc Polishing 2019-03-02 14:22:28 +01:00
Sam Brannen 7d926a847d Polish tests for TestContext lifecycle events
See gh-18490
2019-03-01 21:26:37 +01:00
Sam Brannen a16dd95ab7 Polishing 2019-03-01 20:39:25 +01:00
Sam Brannen 74e9825a65 Fix CheckStyle violation 2019-03-01 20:18:04 +01:00
Sam Brannen 416346200f Polishing 2019-03-01 20:07:09 +01:00
Sam Brannen 297fd7629a Polishing 2019-03-01 19:34:13 +01:00
Sam Brannen dd1330d05e Fix CheckStyle violations
See gh-18490
2019-03-01 17:40:32 +01:00
Sam Brannen 2d6624de71 Polish support for publishing TestContext lifecycle events
See gh-18490
2019-03-01 15:25:35 +01:00
Frank Scheffler 34fee867d2 Provide support for publishing TestContext lifecycle events
This commit introduces a new EventPublishingTestExecutionListener for
publishing events to the test ApplicationContext. These may be consumed
by @EventListener annotated methods to react to the TestContext
lifecycle. The listener is not registered by default.

Closes gh-18490
2019-03-01 15:22:54 +01:00
Juergen Hoeller a7db395d9b Merge branch '5.1.x' 2019-02-28 19:29:04 +01:00
Juergen Hoeller c41616e82d Merge branch '5.1.x' 2019-02-28 11:14:49 +01:00
Juergen Hoeller fc7948c96b Merge branch '5.1.x' 2019-02-27 17:34:46 +01:00
pelladigabor a07245caf8 Exclude jdk package in ShadowingClassLoader
Many Java 11 internal classes are located in the jdk package. ShadowingClassLoader should not load them, because it can cause errors, e.g. java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.springframework.instrument.classloading.ShadowingClassLoader @2bea5ab4 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
2019-02-27 16:57:08 +01:00
Sam Brannen f2a5415111 Fix CheckStyle violations
See gh-2060
2019-02-27 16:41:00 +01:00
Sam Brannen 40da78e9df Polishing 2019-02-27 16:30:05 +01:00
Sam Brannen 6f6be27aae Polish AutowireUtils[Tests]
See gh-2060
2019-02-27 16:25:34 +01:00
Loïc Ledoyen d77b36bf3b Open parameter autowiring utility for external use (#2060)
* Make AutowireUtils public and protect its current API
* Move ParameterAutowireUtils features to AutowireUtils

Closes gh-2060
2019-02-27 15:15:45 +01:00
Sam Brannen 3a42f1154d Polishing 2019-02-27 14:03:11 +01:00
Stephane Nicoll 846ec31dfe Merge branch '5.1.x' 2019-02-27 13:57:40 +01:00
Juergen Hoeller 3a641d9297 Merge branch '5.1.x' 2019-02-26 17:50:35 +01:00
Sam Brannen a7770e7448 Remove ApplicationContext dependency from ParameterAutowireUtils
This commit is a prerequisite for gh-2060.
2019-02-26 15:22:25 +01:00
Stephane Nicoll 49bbbb060d Merge pull request #22472 from izeye
* pr/22472:
  Polish
2019-02-26 08:57:16 +01:00
Johnny Lim e21d94f91b Polish
Closes gh-22472
2019-02-26 08:57:03 +01:00
Juergen Hoeller 7158acb8df Merge branch '5.1.x' 2019-02-25 23:20:42 +01:00
Juergen Hoeller 6a7a4a2145 Upgrade to Caffeine 2.7 2019-02-25 23:15:01 +01:00
Juergen Hoeller 5c2f3079fd Sync between MockHttpServletResponse copies
See gh-22466
2019-02-25 23:14:37 +01:00
www c31613dc74 Instantiate ArrayList class with a exact initial capacity 2019-02-25 23:13:35 +01:00
Juergen Hoeller bc0317af3b Merge branch '5.1.x' 2019-02-25 17:57:49 +01:00
Sam Brannen d61c3d429c Improve Javadoc and exception message for LTW classes 2019-02-25 14:21:23 +01:00
Sam Brannen 8dc82b9689 Re-enable @Ignore'd TxMgt integration test
See: gh-12857
2019-02-25 14:21:23 +01:00
Johnny Lim 625e210676 Polish 2019-02-25 12:17:53 +01:00
stsypanov 1c24dc1f27 Simplify String concatenation 2019-02-25 12:13:35 +01:00
Sebastien Deleuze dc8fb8bc5e Use StringJoiner where possible to simplify String joining 2019-02-25 12:11:57 +01:00
Stephane Nicoll 766a23bd93 Merge pull request #22463 from rupertw
* pr/22463:
  Polish
2019-02-25 08:42:56 +01:00
www f2aa374b73 Polish
Closes gh-22463
2019-02-25 08:41:00 +01:00
Sam Brannen 9093b870dd Move mavenLocal() to bottom of repositories list
This commit moves mavenLocal() to the bottom of the repositories list
so that Gradle's Eclipse IDE support will properly link binary JARs to
their source JARS in generated Eclipse .classpath files.

According to Gradle experts, "`mavenLocal` should basically never be
the first repo in the list."

https://github.com/eclipse/buildship/issues/655#issuecomment-366227296
2019-02-23 00:50:57 +01:00
Sam Brannen 9f751ef914 Polish contribution
See: gh-456
2019-02-22 19:19:59 +01:00
Adib Saikali b4fc7b410b Document that @Transactional is not supported on test lifecycle methods
This commit adds a tip clarifying that TestNG's @BeforeClass and
@BeforeSuite methods can not be annotated with Spring's @Transactional
annotation.

Closes: gh-456
2019-02-22 17:56:19 +01:00
Juergen Hoeller 0652e4b485 Merge branch '5.1.x' 2019-02-22 14:51:00 +01:00
Sebastien Deleuze e5a595e77d Merge branch '5.1.x' 2019-02-22 09:50:28 +01:00
Brian Clozel fb66619187 Merge branch '5.1.x' 2019-02-21 17:52:17 +01:00
Sebastien Deleuze 25d7f09f8d Polishing 2019-02-18 14:50:27 +01:00
Sebastien Deleuze caa1730169 Polishing 2019-02-18 14:13:51 +01:00
Sebastien Deleuze 19f792db66 Add Coroutines support for WebClient and WebFlux.fn
This commit is the first part of a more complete Coroutines
support coming in Spring Framework 5.2. It introduces suspendable
Kotlin extensions for Mono based methods in WebFlux classes like
WebClient, ServerRequest, ServerResponse as well as a Coroutines
router usable via `coRouter { }`.

Coroutines extensions use `await` prefix or `AndAwait` suffix,
and most are using names close to their Reactive counterparts,
except `exchange` in `WebClient.RequestHeadersSpec`
which translates to `awaitResponse`.

Upcoming expected changes are:
 - Leverage `Dispatchers.Unconfined` (Kotlin/kotlinx.coroutines#972)
 - Expose extensions for `Flux` based API (Kotlin/kotlinx.coroutines#254)
 - Introduce interop with `CoroutineContext` (Kotlin/kotlinx.coroutines#284)
 - Support Coroutines in `ReactiveAdapterRegistry`
 - Support Coroutines for WebFlux annotated controllers
 - Fix return type of Kotlin suspending functions (gh-21058)

See gh-19975
2019-02-18 09:23:31 +01:00
Sebastien Deleuze 04bb114f05 Set Kotlin minimum version to 1.3 for Coroutines
See gh-20945
2019-02-18 09:11:52 +01:00
Sam Brannen c95ffe3db2 Merge branch '5.1.x' 2019-02-17 17:25:47 +01:00
Sebastien Deleuze 1d866053ed Leverage RouterFunctions.Builder in RouterFunctionDsl
Closes gh-22423
2019-02-17 17:20:11 +01:00
Sebastien Deleuze 175c27657e Merge branch '5.1.x' 2019-02-17 10:39:15 +01:00
olszewskimichal 60a7909fca getFirst - check that values is not empty 2019-02-16 11:55:23 +01:00
Juergen Hoeller c515de138a Correct import order 2019-02-15 17:19:21 +01:00
Juergen Hoeller 6db75956b9 Merge branch '5.1.x' 2019-02-15 17:16:28 +01:00
stsypanov 5e29ea30a3 Use StringJoiner where possible to simplify String joining 2019-02-15 14:55:35 +01:00
stsypanov e44d3dabc4 use Method in fixedInterceptorMap instead of String returned from Method::toString 2019-02-15 14:53:26 +01:00
stsypanov e7dc439f90 Simplify ConcurrentReferenceHashMap 2019-02-15 14:27:43 +01:00
stsypanov d2bfca7900 Extract duplicated code into a separate method 2019-02-15 14:26:44 +01:00
stsypanov 92053bb84e Some very simple improvements regarding ArrayList 2019-02-15 14:25:13 +01:00
Juergen Hoeller 5e0cd9fb60 Merge branch '5.1.x' 2019-02-14 13:39:58 +01:00
Stephane Nicoll 9967ece49c Merge branch '5.1.x' 2019-02-14 10:18:46 +01:00
Stephane Nicoll 77e815135b Merge branch '5.1.x' 2019-02-12 21:30:32 +01:00
Brian Clozel d463598c09 Defer ExchangeFilterFunction to subscription time
Prior to this commit, the `ExchangeFilterFunction` instances configured
on a `WebClient` instance would be executed as soon as the `exchange`
method would be called. This behavior is not consistent with the server
side and can confuse filter developers as they'd need to manually
`Mono.defer()` their implementations if they want to record metrics.

This commit defers all `ExchangeFilterFunction` processing at
subscription time.

Fixes gh-22375
2019-02-12 10:52:49 +01:00
Juergen Hoeller 4e47006a17 Merge branch '5.1.x' 2019-02-12 09:09:19 +01:00
Sebastien Deleuze 0bdacddc53 Remove SqlXmlObjectMappingHandler
This class is only known to be used in spring-data-jdbc-ext project
which was never upgraded to Spring Framework 5.x and is no longer
actively developed.

Closes gh-22402
2019-02-11 14:20:51 +01:00
Sebastien Deleuze 9d0f97fa00 Merge branch '5.1.x' 2019-02-11 13:09:35 +01:00
Juergen Hoeller 4ca376ef31 Merge branch '5.1.x' 2019-02-11 11:55:59 +01:00
Juergen Hoeller b5e9fa5f1e TransactionActionSupport evaluates Vavr Try failure as rollback-only
Closes gh-20361
2019-02-11 11:45:43 +01:00
Brian Clozel afbe7b31bb Polish
See gh-22341
2019-02-11 10:46:27 +01:00
Brian Clozel fb4a28f904 Polish
See gh-22340
2019-02-11 10:45:50 +01:00
Sam Brannen f7e53a071b Polishing 2019-02-08 19:41:10 +01:00
Juergen Hoeller 783a7ca46b Merge branch '5.1.x' 2019-02-08 18:16:27 +01:00
Sam Brannen 4f57d717ba Upgrade to JUnit Jupiter 5.4
Closes gh-22308
2019-02-08 13:22:34 +01:00
Stephane Nicoll f5ae288990 Merge branch '5.1.x' 2019-02-08 08:54:18 +01:00
Stephane Nicoll aff9e37b8d Merge pull request #22373 from izeye
* pr/22373:
  Fix casing for GitHub in the contributing guide
2019-02-08 08:41:21 +01:00
Johnny Lim 64c86623ee Fix casing for GitHub in the contributing guide
Closes gh-22373
2019-02-08 08:41:03 +01:00
Juergen Hoeller 7cde283066 Merge branch '5.1.x' 2019-02-07 23:07:22 +01:00
Rossen Stoyanchev b4de3845c0 Merge branch '5.1.x' 2019-02-07 14:35:53 -05:00
Rossen Stoyanchev cb9db70857 Merge branch '5.1.x' 2019-02-07 12:00:44 -05:00
Juergen Hoeller 0b617a8c93 Deprecate PreferencesPlaceholderConfigurer along with its base class
Also removing common PropertyPlaceholderConfigurer doc references.

See gh-22181
2019-02-07 16:53:05 +01:00
Juergen Hoeller d25783329a Merge branch '5.1.x' 2019-02-07 16:01:14 +01:00
Juergen Hoeller bb05ee7bff Upgrade to Kotlin 1.3.21
See #20945
2019-02-07 15:28:43 +01:00
Brian Clozel 05d7ab4328 Merge branch '5.1.x' 2019-02-06 20:00:02 +01:00
Sebastien Deleuze 72ed274c6f Merge branch '5.1.x' 2019-02-06 19:35:20 +01:00
Sam Brannen 9bc2c99ce5 Suppress deprecation warning in Gradle build
See gh-22181
2019-02-06 16:37:23 +01:00
Sebastien Deleuze 3787b23a98 Deprecate PropertyPlaceholderConfigurer
This commit deprecates PropertyPlaceholderConfigurer in favor of
PropertySourcesPlaceholderConfigurer.

Closes gh-22181
2019-02-06 16:00:24 +01:00
Sebastien Deleuze 0ad9349d84 Limit ref() and provider() visibility in Kotlin DSL
This commit makes ref() and provider() only available from
inside the bean lambda and not from the root level of the beans DSL.

Closes gh-22177
2019-02-05 16:59:56 +01:00
Juergen Hoeller 34ddb1e3cd Merge branch '5.1.x' 2019-02-05 16:32:58 +01:00
Sebastien Deleuze 0b9522c84e Migrate Kotlin Mockito tests to Mockk
Closes gh-22345
2019-02-05 15:47:08 +01:00
Yoann Rodière 00855c4f5f Add tests for SpringBeanContainer (Hibernate ORM integration) and fix the behavior when requesting named beans (#22260)
* Add integration tests for SpringBeanContainer (Hibernate ORM integration)
* Autowire bean properties of beans retrieved by name in SpringBeanContainer
* Add integration tests for fallback cases in SpringBeanContainer (Hibernate ORM integration)
* Fix SpringBeanContainer incorrectly losing the bean name when calling the fallback producer
2019-02-05 15:39:46 +01:00
Juergen Hoeller 4c9ae6494f Concurrency/nullability fine-tuning in MimeType(Utils)
See gh-22340
2019-02-05 15:38:41 +01:00
Brian Clozel 1bf3b36ce8 Polish
See gh-22340
2019-02-05 15:06:33 +01:00
Brian Clozel ba8849dda3 Avoid MimeType garbage creation
Prior to this commit, calls to `MimeType` and `MediaType` would create a
significant amount of garbage:

* during startup time, in the static sections of `MimeType` and
`MediaType` when creating well-known types
* at runtime, when parsing media types for content negotiation or
writing known media types as strings in HTTP response headers

This commit does the following:

* Avoid parsing the well-known types and use regular constructors
instead
* Cache types in a simple LRU cache once they've been parsed, since an
application is likely to deal with a limited set of types
* Avoid using `java.util.stream.Stream` in hot code paths

Benchmarks show that a complete revision of the `MimeTypeUtils` parser
is not required, since the LRU cache is enough there.

Closes gh-22340
2019-02-05 14:33:43 +01:00
Brian Clozel 862fa557bd Avoid java.util.stream.Stream usage in hot paths
Prior to this commit, profiling sessions would show that using
`java.util.stream.Stream` in some hot code paths creates significant
garbage.

Where streams aren't really required, this commit turns those snippets
into imperative logic  because those are likely to be called once or
multiple times per request.

Closes gh-22341
2019-02-05 12:14:51 +01:00
Juergen Hoeller 4ec2f3cd17 Merge branch '5.1.x' 2019-02-05 00:55:20 +01:00
Juergen Hoeller c700ccbc00 Upgrade to Apache HttpClient 4.5.7
Includes Hibernate ORM 5.4.1 for integration tests.
2019-02-05 00:10:40 +01:00
Juergen Hoeller a27a6470f7 Polishing 2019-02-05 00:10:22 +01:00
kudrevatykh 85474297be Load-time weaving support for WildFly 13+ (#22297)
Load-time weaving support for WildFly 13+ (JBoss Modules 1.8+)
2019-02-04 23:31:21 +01:00
stsypanov 248d3f8e8b Use AtomicInteger instead of unsafe increment on volatile fields 2019-02-04 23:22:20 +01:00
Stephane Nicoll e402a93e41 Merge branch '5.1.x' 2019-02-04 10:34:40 +01:00
Sam Brannen 0742986e0e Suppress warnings from tests in Gradle build 2019-02-01 11:13:53 +01:00
Sam Brannen 5e7065d829 Upgrade to JUnit Jupiter 5.4 RC2
Issue: #22308
2019-02-01 10:59:20 +01:00
stsypanov af13580fd5 Remove unnecessary array initialization 2019-01-31 09:00:22 -05:00
Juergen Hoeller 7a77e83e10 SpelNodeImpl manages start/end position in separate integer values
Fixes gh-22157
2019-01-28 22:50:56 +01:00
Juergen Hoeller 5aed117b68 Model interface exposes getAttribute method (next to add/contains)
Fixes gh-22145
2019-01-28 22:50:29 +01:00
Juergen Hoeller 80385ced4c Remove java.sql dependency from ReflectionUtils/TransactionDefinition
Fixes gh-21996
2019-01-28 22:50:11 +01:00
Arjen Poutsma d3b5ba7a36 Add test case for HttpRequest with relative URIs
Test case for #19890
2019-01-28 16:43:46 +01:00
Rossen Stoyanchev b8f7c37cc4 Merge branch '5.1.x' 2019-01-25 17:01:51 -05:00
Sam Brannen 439bc65b0e Upgrade to JUnit Jupiter 5.4 RC1
Issue: #22308
2019-01-25 15:56:16 +01:00
Juergen Hoeller 05f1ea8515 Merge branch '5.1.x' 2019-01-25 15:46:01 +01:00
Marten Deinum 6bdf2c2685 Upgrade to Commons-Fileupload 1.4 2019-01-24 17:53:22 +01:00
Arjen Poutsma 6004be9d31 Merge branch '5.1.x' 2019-01-24 15:55:46 +01:00
Juergen Hoeller 160ecdf956 Merge branch '5.1.x' 2019-01-24 15:35:28 +01:00
Juergen Hoeller 8bed7d9bb0 Upgrade to Hibernate ORM 5.4.1
Includes EclipseLink 2.7.4.

Fixes #22049
2019-01-24 15:02:30 +01:00
Juergen Hoeller b07b10de8c Upgrade to Kotlin 1.3.20
Includes RxJava 2.2.6, Netty 4.1.33, Undertow 2.0.17.

Fixes #20945
2019-01-24 15:02:13 +01:00
Sam Brannen 83d06b8f4e Merge branch '5.1.x' 2019-01-23 16:45:10 +01:00
Arjen Poutsma a5cef3845c Improve message for HttpStatusCodeException with empty status text
This commit improves the message for HttpStatusCodeException so that it
defaults to the HttpStatus reason phrase if a status text is not
provided.

This commit also fixes SimpleClientHttpResponse so that it does not
return null for getStatusText().

Fixed #22162
2019-01-23 11:44:00 +01:00
Rossen Stoyanchev 155ef5fd77 Merge branch '5.1.x' 2019-01-22 12:04:09 -05:00
Brian Clozel 46c0366594 Merge branch '5.1.x' 2019-01-22 14:56:02 +01:00
Sebastien Deleuze 81ec1d8284 Merge branch '5.1.x' 2019-01-22 10:55:06 +01:00
Rossen Stoyanchev f6c16815b4 Merge branch '5.1.x' 2019-01-21 10:00:15 -05:00
Stephane Nicoll bd3d7dbc0c Merge pull request #22283 from izeye
* pr/22283:
  Polish AutowireUtils.EXECUTABLE_COMPARATOR
2019-01-20 17:38:06 +01:00
Johnny Lim 963cc09c2e Polish AutowireUtils.EXECUTABLE_COMPARATOR
Closes gh-22283
2019-01-20 17:37:46 +01:00
Rossen Stoyanchev b0a3a6f79f Merge branch '5.1.x' 2019-01-18 18:29:39 -05:00
Rossen Stoyanchev f9ba069b9d Add "Affects" field to issue template 2019-01-18 15:27:43 -05:00
Rossen Stoyanchev 4fdfa4246f Merge branch '5.1.x' 2019-01-17 18:01:41 -05:00
Rossen Stoyanchev 2a57b40515 Merge branch '5.1.x' 2019-01-17 17:13:30 -05:00
Rossen Stoyanchev ffe888ca18 Merge branch '5.1.x' 2019-01-17 12:56:46 -05:00
Rossen Stoyanchev 2043793899 Merge branch '5.1.x' 2019-01-17 12:31:46 -05:00
Brian Clozel 0450b07c21 Merge branch '5.1.x' 2019-01-17 11:26:35 -05:00
Stephane Nicoll 0db4c22656 Merge pull request #22256 from KyleRogers
* pr/22256:
  Fix typo in cache abstraction chapter
2019-01-15 06:24:59 -05:00
Stefan Penndorf 04ce61968d Fix typo in cache abstraction chapter
Closes gh-22256
2019-01-15 06:23:34 -05:00
Rossen Stoyanchev 7a9e2f5edc Update issue template
Closes #22253
2019-01-14 19:26:23 -05:00
Rossen Stoyanchev f557f313c2 Update issue template 2019-01-14 13:48:59 -05:00
Rossen Stoyanchev 2b530bac39 Update issue template 2019-01-14 12:26:38 -05:00
Rossen Stoyanchev 66359e2e9e Update issue templates 2019-01-14 09:40:51 -05:00
Arjen Poutsma 5938ca9a7c Deprecate JiBX marshaller
Resolves #22249
2019-01-14 11:57:15 +01:00
Arjen Poutsma 89a7e752ef Remove Castor marshaller
Resolves #22250
2019-01-14 11:28:16 +01:00
Arjen Poutsma bfff9ca0ce Fix typo
Resolves #22241
2019-01-14 10:49:11 +01:00
Brian Clozel 33cbe2e77a Remove admonitions surrounding code snippets 2019-01-09 18:38:31 +01:00
Brian Clozel 8c768e48fa Use Spring Doc Resources for reference docs
This commit removes the custom static resources for the reference
documentation and instead uses the new Spring Doc Resources project
https://github.com/spring-io/spring-doc-resources

The asciidoctor theme is now shared between Spring projects and
integrated in the project build.
2019-01-09 18:38:31 +01:00
Sam Brannen df13e4dd5e Document effect of preemptive timeouts on transactional tests
Issue: SPR-17647
2019-01-09 16:37:56 +01:00
Sam Brannen bd9d3334a2 Document effect of @DirtiesContext when used with constructor injection
Issue: SPR-17654
2019-01-09 15:39:56 +01:00
Sam Brannen 9ea618ede9 Improve documentation for DI options in the TestContext framework 2019-01-09 14:54:14 +01:00
Stephane Nicoll 2a76a65708 Switch master to 5.2.0.BUILD-SNAPSHOT 2019-01-09 14:12:05 +01:00
5063 changed files with 264485 additions and 151901 deletions
+16
View File
@@ -0,0 +1,16 @@
# Normalize line endings to LF.
* text eol=lf
# Ensure that line endings for multipart files in spring-web are not modified.
*.multipart -text
# Ensure that line endings for DOS batch files are not modified.
*.bat -text
# Ensure the following are treated as binary.
*.gif binary
*.jar binary
*.jpeg binary
*.jpg binary
*.png binary
*.vsd binary
+17
View File
@@ -0,0 +1,17 @@
<!--
!!! For Security Vulnerabilities, please go to https://pivotal.io/security !!!
-->
**Affects:** \<Spring Framework version>
---
<!--
Thanks for taking the time to create an issue. Please read the following:
- Questions should be asked on Stack Overflow.
- For bugs, specify affected versions and explain what you are trying to do.
- For enhancements, provide context and describe the problem.
Issue or Pull Request? Create only one, not both. GitHub treats them as the same.
If unsure, start with an issue, and if you submit a pull request later, the
issue will be closed as superseded.
-->
@@ -0,0 +1,10 @@
name: "Validate Gradle Wrapper"
on: [push, pull_request]
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
+3
View File
@@ -21,6 +21,9 @@ classes/
/build
buildSrc/build
/spring-*/build
/spring-core/kotlin-coroutines/build
/framework-bom/build
/integration-tests/build
/src/asciidoc/build
target/
+51 -45
View File
@@ -7,8 +7,8 @@ First off, thank you for taking the time to contribute! :+1: :tada:
* [Code of Conduct](#code-of-conduct)
* [How to Contribute](#how-to-contribute)
* [Discuss](#discuss)
* [Create a Ticket](#create-a-ticket)
* [Ticket Lifecycle](#ticket-lifecycle)
* [Create an Issue](#create-an-issue)
* [Issue Lifecycle](#issue-lifecycle)
* [Submit a Pull Request](#submit-a-pull-request)
* [Build from Source](#build-from-source)
* [Source Code Style](#source-code-style)
@@ -24,72 +24,71 @@ Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
#### Discuss
If you have a question, check StackOverflow using
[this list of tags](https://spring.io/questions), organized by Spring project.
Find an existing discussion or start a new one if necessary.
If you have a question, check Stack Overflow using
[this list of tags](https://stackoverflow.com/questions/tagged/spring+or+spring-mvc+or+spring-aop+or+spring-jdbc+or+spring-transactions+or+spring-annotations+or+spring-jms+or+spring-el+or+spring-test+or+spring+or+spring-remoting+or+spring-orm+or+spring-jmx+or+spring-cache+or+spring-webflux?tab=Newest).
Find an existing discussion, or start a new one if necessary.
If you suspect an issue, perform a search in the
[Github issue tracker](https://github.com/spring-projects/spring-framework/issues), using a few different keywords.
When you find related issues and discussions, prior or current, it helps you to learn and
it helps us to make a decision.
If you believe there is an issue, search through
[existing issues](https://github.com/spring-projects/spring-framework/issues) trying a
few different ways to find discussions, past or current, that are related to the issue.
Reading those discussions helps you to learn about the issue, and helps us to make a
decision.
#### Create a Ticket
#### Create an Issue
Reporting an issue or making a feature request is a great way to contribute. Your feedback
and the conversations that result from it provide a continuous flow of ideas.
and the conversations that result from it provide a continuous flow of ideas. However,
before creating a ticket, please take the time to [discuss and research](#discuss) first.
Before you create a ticket, please take the time to [research first](#discuss).
If creating an issue after a discussion on Stack Overflow, please provide a description
in the issue instead of simply referring to Stack Overflow. The issue tracker is an
important place of record for design discussions and should be self-sufficient.
If creating a ticket after a discussion on StackOverflow, please provide a self-sufficient description in the ticket, independent of the details on StackOverview. We understand this is extra work but the issue tracker is an important place of record for design discussions and decisions that can often be referenced long after the fix version, for example to revisit decisions, to understand the origin of a feature, and so on.
Once you're ready, create an issue on
[GitHub](https://github.com/spring-projects/spring-framework/issues).
When ready create a ticket in the [Github issue tracker](https://github.com/spring-projects/spring-framework/issues).
#### Issue Lifecycle
#### Ticket Lifecycle
When an issue is first created, it is flagged `waiting-for-triage` waiting for a team
member to triage it. Once the issue has been reviewed, the team may ask for further
information if needed, and based on the findings, the issue is either assigned a target
milestone or is closed with a specific status.
When an issue is first created, it may not be assigned and will not have a fix version.
Within a day or two, the issue is assigned to a specific committer and the target
version is set to "Waiting for Triage". The committer will then review the issue, ask for
further information if needed, and based on the findings, the issue is either assigned a fix
version or rejected.
When a fix is ready, the issue is marked "Resolved" and may still be re-opened. Once a fix
is released, the issue is permanently "Closed". If necessary, you will need to create a new,
related ticket with a fresh description.
When a fix is ready, the issue is closed and may still be re-opened until the fix is
released. After that the issue will typically no longer be reopened. In rare cases if the
issue was not at all fixed, the issue may be re-opened. In most cases however any
follow-up reports will need to be created as new issues with a fresh description.
#### Submit a Pull Request
You can contribute a source code change by submitting a pull request.
1. If you have not previously done so, please sign the
[Contributor License Agreement](https://cla.pivotal.io/sign/spring). You will also be reminded
automatically when you submit a pull request.
[Contributor License Agreement](https://cla.pivotal.io/sign/spring). You will be reminded
automatically when you submit the PR.
1. For all but the most trivial of contributions, please [create a ticket](#create-a-ticket).
The purpose of the ticket is to understand and discuss the underlying issue or feature.
We use the GitHub issue tracker as the preferred place of record for conversations and
conclusions. In that sense discussions directly under a PR are more implementation detail
oriented and transient in nature.
1. Should you create an issue first? No, just create the pull request and use the
description to provide context and motivation, as you would for an issue. If you want
to start a discussion first or have already created an issue, once a pull request is
created, we will close the issue as superseded by the pull request, and the discussion
about the issue will continue under the pull request.
1. Always check out the `master` branch and submit pull requests against it
(for target version see [settings.gradle](settings.gradle)).
Backports to prior versions will be considered on a case-by-case basis and reflected as
the fix version in the issue tracker.
1. Use short branch names, preferably based on the GitHub issue (e.g. `22276`), or
otherwise using succinct, lower-case, dash (-) delimited names, such as `fix-warnings`.
1. Choose the granularity of your commits consciously and squash commits that represent
multiple edits or corrections of the same logical change. See
[Rewriting History section of Pro Git](https://git-scm.com/book/en/Git-Tools-Rewriting-History)
for an overview of streamlining commit history.
for an overview of streamlining the commit history.
1. Format commit messages using 55 characters for the subject line, 72 lines for the
description, followed by the issue fixed, e.g. `Fixes #22276`.
See the
1. Format commit messages using 55 characters for the subject line, 72 characters per line
for the description, followed by the issue fixed, e.g. `Closes gh-22276`. See the
[Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
for best practices around commit messages and use `git log` to see some examples.
for best practices around commit messages, and use `git log` to see some examples.
1. List the GitHub issue number in the PR description.
1. If there is a prior issue, reference the GitHub issue number in the description of the
pull request.
If accepted, your contribution may be heavily modified as needed prior to merging.
You will likely retain author attribution for your Git commits granted that the bulk of
@@ -99,6 +98,13 @@ If asked to make corrections, simply push the changes against the same branch, a
pull request will be updated. In other words, you do not need to create a new pull request
when asked to make changes.
#### Participate in Reviews
Helping to review pull requests is another great way to contribute. Your feedback
can help to shape the implementation of new features. When reviewing pull requests,
however, please refrain from approving or rejecting a PR unless you are a core
committer for the Spring Framework.
### Build from Source
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source)
@@ -110,15 +116,15 @@ source code into your IDE.
The wiki pages
[Code Style](https://github.com/spring-projects/spring-framework/wiki/Code-Style) and
[IntelliJ IDEA Editor Settings](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings)
defines the source file coding standards we use along with some IDEA editor settings we customize.
define the source file coding standards we use along with some IDEA editor settings we customize.
### Reference Docs
The reference documentation is in the [src/docs/asciidoc](src/docs/asciidoc) directory and, in
The reference documentation is in the [src/docs/asciidoc](src/docs/asciidoc) directory, in
[Asciidoctor](https://asciidoctor.org/) format. For trivial changes, you may be able to browse,
edit source files, and submit directly from GitHub.
When making changes locally, use `./gradlew asciidoctor` and then browse the result under
When making changes locally, execute `./gradlew asciidoctor` and then browse the result under
`build/asciidoc/html5/index.html`.
Asciidoctor also supports live editing. For more details read
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+7 -3
View File
@@ -1,6 +1,6 @@
# <img src="src/docs/asciidoc/images/spring-framework.png" width="80" height="80"> Spring Framework
# <img src="src/docs/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://ci.spring.io/api/v1/teams/spring-framework/pipelines/spring-framework-5.3.x/jobs/build/badge)](https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.3.x?groups=Build")
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects is often referred to simply as "Spring".
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the [Overview](https://docs.spring.io/spring/docs/current/spring-framework-reference/overview.html#spring-introduction) section as reference for a more complete introduction.
@@ -17,9 +17,13 @@ For access to artifacts or a distribution zip, see the [Spring Framework Artifac
The Spring Framework maintains reference documentation ([published](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/) and [source](src/docs/asciidoc)), Github [wiki pages](https://github.com/spring-projects/spring-framework/wiki), and an
[API reference](https://docs.spring.io/spring-framework/docs/current/javadoc-api/). There are also [guides and tutorials](https://spring.io/guides) across Spring projects.
## Micro-Benchmarks
See the [Micro-Benchmarks](https://github.com/spring-projects/spring-framework/wiki/Micro-Benchmarks) Wiki page.
## Build from Source
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source) Wikipedia page and the [CONTRIBUTING.md](CONTRIBUTING.md) file.
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source) Wiki page and the [CONTRIBUTING.md](CONTRIBUTING.md) file.
## Stay in Touch
+11
View File
@@ -0,0 +1,11 @@
# Security Policy
## Supported Versions
Please see the
[Spring Framework Versions](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions)
wiki page.
## Reporting a Vulnerability
Please see https://pivotal.io/security.
+373 -268
View File
@@ -1,321 +1,426 @@
buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
classpath("org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16")
}
}
// 3rd party plugin repositories can be configured in settings.gradle
plugins {
id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
id "org.jetbrains.kotlin.jvm" version "1.2.71" apply false
id "org.jetbrains.dokka" version "0.9.18"
id "org.asciidoctor.convert" version "1.5.8"
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'io.spring.nohttp' version '0.0.5.RELEASE'
id 'org.jetbrains.kotlin.jvm' version '1.4.10' apply false
id 'org.jetbrains.dokka' version '0.10.1' apply false
id 'org.asciidoctor.jvm.convert' version '3.1.0'
id 'org.asciidoctor.jvm.pdf' version '3.1.0'
id 'de.undercouch.download' version '4.1.1'
id "io.freefair.aspectj" version '5.1.1' apply false
id "com.github.ben-manes.versions" version '0.28.0'
id "me.champeau.gradle.jmh" version "0.5.0" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "1.4.10" apply false
}
ext {
linkHomepage = "https://spring.io/projects/spring-framework"
linkCi = "https://build.spring.io/browse/SPR"
linkIssue = "https://github.com/spring-projects/spring-framework/issues"
linkScmUrl = "https://github.com/spring-projects/spring-framework"
linkScmConnection = "scm:git:git://github.com/spring-projects/spring-framework.git"
linkScmDevConnection = "scm:git:ssh://git@github.com:spring-projects/spring-framework.git"
moduleProjects = subprojects.findAll {
!it.name.equals("spring-build-src") && !it.name.equals("spring-framework-bom")
}
aspectjVersion = "1.9.4"
freemarkerVersion = "2.3.28"
groovyVersion = "2.5.8"
hsqldbVersion = "2.4.1"
jackson2Version = "2.9.9"
jettyVersion = "9.4.21.v20190926"
junit5Version = "5.3.2"
kotlinVersion = "1.2.71"
log4jVersion = "2.11.2"
nettyVersion = "4.1.43.Final"
reactorVersion = "Californium-SR13"
rxjavaVersion = "1.3.8"
rxjavaAdapterVersion = "1.2.1"
rxjava2Version = "2.2.12"
slf4jVersion = "1.7.28" // spring-jcl + consistent 3rd party deps
tiles3Version = "3.0.8"
tomcatVersion = "9.0.26"
undertowVersion = "2.0.26.Final"
gradleScriptDir = "${rootProject.projectDir}/gradle"
moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
javaProjects = subprojects - project(":framework-bom")
withoutJclOverSlf4j = {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
exclude group: "org.slf4j", name: "jcl-over-slf4j"
}
}
configure(allprojects) { project ->
group = "org.springframework"
version = qualifyVersionIfNecessary(version)
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "checkstyle"
apply plugin: "propdeps"
apply plugin: "test-source-set-dependencies"
apply plugin: "io.spring.dependency-management"
apply from: "${gradleScriptDir}/ide.gradle"
dependencyManagement {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
imports {
mavenBom "com.fasterxml.jackson:jackson-bom:2.11.3"
mavenBom "io.netty:netty-bom:4.1.53.Final"
mavenBom "io.projectreactor:reactor-bom:2020.0.0"
mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR8"
mavenBom "io.rsocket:rsocket-bom:1.1.0"
mavenBom "org.eclipse.jetty:jetty-bom:9.4.34.v20201102"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.4.10"
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.4.1"
mavenBom "org.junit:junit-bom:5.7.0"
}
dependencies {
dependencySet(group: 'org.apache.logging.log4j', version: '2.13.3') {
entry 'log4j-api'
entry 'log4j-core'
entry 'log4j-jul'
entry 'log4j-slf4j-impl'
}
dependency "org.slf4j:slf4j-api:1.7.30"
dependency("com.google.code.findbugs:findbugs:3.0.1") {
exclude group: "dom4j", name: "dom4j"
}
dependency "com.google.code.findbugs:jsr305:3.0.2"
dependencySet(group: 'org.aspectj', version: '1.9.6') {
entry 'aspectjrt'
entry 'aspectjtools'
entry 'aspectjweaver'
}
dependencySet(group: 'org.codehaus.groovy', version: '3.0.6') {
entry 'groovy'
entry 'groovy-jsr223'
entry 'groovy-templates' // requires findbugs for warning-free compilation
entry 'groovy-test'
entry 'groovy-xml'
}
dependency "io.reactivex:rxjava:1.3.8"
dependency "io.reactivex:rxjava-reactive-streams:1.2.1"
dependency "io.reactivex.rxjava2:rxjava:2.2.19"
dependency "io.reactivex.rxjava3:rxjava:3.0.7"
dependency "io.projectreactor.tools:blockhound:1.0.4.RELEASE"
dependency "com.caucho:hessian:4.0.63"
dependency "com.fasterxml:aalto-xml:1.2.2"
dependency("com.fasterxml.woodstox:woodstox-core:6.2.3") {
exclude group: "stax", name: "stax-api"
}
dependency "com.google.code.gson:gson:2.8.6"
dependency "com.google.protobuf:protobuf-java-util:3.13.0"
dependency "com.googlecode.protobuf-java-format:protobuf-java-format:1.4"
dependency("com.thoughtworks.xstream:xstream:1.4.13") {
exclude group: "xpp3", name: "xpp3_min"
exclude group: "xmlpull", name: "xmlpull"
}
dependency "org.apache.johnzon:johnzon-jsonb:1.2.8"
dependency("org.codehaus.jettison:jettison:1.3.8") {
exclude group: "stax", name: "stax-api"
}
dependencySet(group: 'org.jibx', version: '1.3.3') {
entry 'jibx-bind'
entry 'jibx-run'
}
dependency "org.ogce:xpp3:1.1.6"
dependency "org.yaml:snakeyaml:1.27"
dependencySet(group: 'org.jetbrains.kotlinx', version: '1.0.0') {
entry 'kotlinx-serialization-core'
entry 'kotlinx-serialization-json'
}
dependency "com.h2database:h2:1.4.200"
dependency "com.github.ben-manes.caffeine:caffeine:2.8.6"
dependency "com.github.librepdf:openpdf:1.3.22"
dependency "com.rometools:rome:1.15.0"
dependency "commons-io:commons-io:2.5"
dependency "io.vavr:vavr:0.10.3"
dependency "net.sf.jopt-simple:jopt-simple:5.0.4"
dependencySet(group: 'org.apache.activemq', version: '5.16.0') {
entry 'activemq-broker'
entry('activemq-kahadb-store') {
exclude group: "org.springframework", name: "spring-context"
}
entry 'activemq-stomp'
}
dependency "org.apache.bcel:bcel:6.0"
dependency "org.apache.commons:commons-pool2:2.9.0"
dependencySet(group: 'org.apache.derby', version: '10.14.2.0') {
entry 'derby'
entry 'derbyclient'
}
dependency "org.apache.poi:poi-ooxml:4.1.2"
dependency "org.apache-extras.beanshell:bsh:2.0b6"
dependency "org.freemarker:freemarker:2.3.30"
dependency "org.hsqldb:hsqldb:2.5.1"
dependency "org.quartz-scheduler:quartz:2.3.2"
dependency "org.codehaus.fabric3.api:commonj:1.1.0"
dependency "net.sf.ehcache:ehcache:2.10.6"
dependency "org.ehcache:jcache:1.0.1"
dependency "org.ehcache:ehcache:3.4.0"
dependency "org.hibernate:hibernate-core:5.4.23.Final"
dependency "org.hibernate:hibernate-validator:6.1.6.Final"
dependency "org.webjars:webjars-locator-core:0.46"
dependency "org.webjars:underscorejs:1.8.3"
dependencySet(group: 'org.apache.tomcat', version: '9.0.39') {
entry 'tomcat-util'
entry('tomcat-websocket') {
exclude group: "org.apache.tomcat", name: "tomcat-websocket-api"
exclude group: "org.apache.tomcat", name: "tomcat-servlet-api"
}
}
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.39') {
entry 'tomcat-embed-core'
entry 'tomcat-embed-websocket'
}
dependencySet(group: 'io.undertow', version: '2.2.2.Final') {
entry 'undertow-core'
entry('undertow-websockets-jsr') {
exclude group: "org.jboss.spec.javax.websocket", name: "jboss-websocket-api_1.1_spec"
}
entry('undertow-servlet') {
exclude group: "org.jboss.spec.javax.servlet", name: "jboss-servlet-api_3.1_spec"
exclude group: "org.jboss.spec.javax.annotation", name: "jboss-annotations-api_1.2_spec"
}
}
dependencySet(group: 'com.squareup.okhttp3', version: '3.14.9') {
entry 'okhttp'
entry 'mockwebserver'
}
dependency("org.apache.httpcomponents:httpclient:4.5.12") {
exclude group: "commons-logging", name: "commons-logging"
}
dependency("org.apache.httpcomponents:httpasyncclient:4.1.4") {
exclude group: "commons-logging", name: "commons-logging"
}
dependency 'org.apache.httpcomponents.client5:httpclient5:5.0.3'
dependency 'org.apache.httpcomponents.core5:httpcore5-reactive:5.0.2'
dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.1.4"
dependency "org.jruby:jruby:9.2.13.0"
dependency "org.python:jython-standalone:2.7.1"
dependency "org.mozilla:rhino:1.7.11"
dependency "commons-fileupload:commons-fileupload:1.4"
dependency "org.synchronoss.cloud:nio-multipart-parser:1.1.0"
dependency("org.dom4j:dom4j:2.1.3") {
exclude group: "jaxen", name: "jaxen"
exclude group: "net.java.dev.msv", name: "xsdlib"
exclude group: "pull-parser", name: "pull-parser"
exclude group: "xpp3", name: "xpp3"
}
dependency("jaxen:jaxen:1.2.0") {
exclude group: "dom4j", name: "dom4j"
}
dependency("junit:junit:4.13.1") {
exclude group: "org.hamcrest", name: "hamcrest-core"
}
dependency("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1") {
exclude group: "junit", name: "junit"
}
dependency "org.testng:testng:7.3.0"
dependency "org.hamcrest:hamcrest:2.1"
dependency "org.awaitility:awaitility:3.1.6"
dependency "org.assertj:assertj-core:3.18.0"
dependencySet(group: 'org.xmlunit', version: '2.6.2') {
entry 'xmlunit-assertj'
entry('xmlunit-matchers') {
exclude group: "org.hamcrest", name: "hamcrest-core"
}
}
dependencySet(group: 'org.mockito', version: '3.6.0') {
entry('mockito-core') {
exclude group: "org.hamcrest", name: "hamcrest-core"
}
entry 'mockito-junit-jupiter'
}
dependency "io.mockk:mockk:1.10.0"
dependency("net.sourceforge.htmlunit:htmlunit:2.44.0") {
exclude group: "commons-logging", name: "commons-logging"
}
dependency("org.seleniumhq.selenium:htmlunit-driver:2.44.0") {
exclude group: "commons-logging", name: "commons-logging"
}
dependency("org.seleniumhq.selenium:selenium-java:3.141.59") {
exclude group: "commons-logging", name: "commons-logging"
exclude group: "io.netty", name: "netty"
}
dependency "org.skyscreamer:jsonassert:1.5.0"
dependency "com.jayway.jsonpath:json-path:2.4.0"
dependency "org.bouncycastle:bcpkix-jdk15on:1.66"
dependencySet(group: 'org.apache.tiles', version: '3.0.8') {
entry 'tiles-api'
entry('tiles-core', withoutJclOverSlf4j)
entry('tiles-servlet', withoutJclOverSlf4j)
entry('tiles-jsp', withoutJclOverSlf4j)
entry('tiles-el', withoutJclOverSlf4j)
entry('tiles-extras') {
exclude group: "org.springframework", name: "spring-web"
exclude group: "org.slf4j", name: "jcl-over-slf4j"
}
}
dependency("org.apache.taglibs:taglibs-standard-jstlel:1.2.5") {
exclude group: "org.apache.taglibs", name: "taglibs-standard-spec"
}
dependency "com.ibm.websphere:uow:6.0.2.17"
dependency "com.jamonapi:jamon:2.82"
dependency "joda-time:joda-time:2.10.6"
dependency "org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.7"
dependency "org.javamoney:moneta:1.3"
dependency "com.sun.activation:javax.activation:1.2.0"
dependency "com.sun.mail:javax.mail:1.6.2"
dependencySet(group: 'com.sun.xml.bind', version: '2.3.0.1') {
entry 'jaxb-core'
entry 'jaxb-impl'
entry 'jaxb-xjc'
}
dependency "javax.activation:javax.activation-api:1.2.0"
dependency "javax.annotation:javax.annotation-api:1.3.2"
dependency "javax.cache:cache-api:1.1.0"
dependency "javax.ejb:javax.ejb-api:3.2"
dependency "javax.el:javax.el-api:3.0.1-b04"
dependency "javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0"
dependency "javax.faces:javax.faces-api:2.2"
dependency "javax.inject:javax.inject:1"
dependency "javax.inject:javax.inject-tck:1"
dependency "javax.interceptor:javax.interceptor-api:1.2.2"
dependency "javax.jms:javax.jms-api:2.0.1"
dependency "javax.json:javax.json-api:1.1.4"
dependency "javax.json.bind:javax.json.bind-api:1.0"
dependency "javax.mail:javax.mail-api:1.6.2"
dependency "javax.money:money-api:1.0.3"
dependency "javax.resource:javax.resource-api:1.7.1"
dependency "javax.servlet:javax.servlet-api:4.0.1"
dependency "javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b02"
dependency "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1"
dependency "javax.transaction:javax.transaction-api:1.3"
dependency "javax.validation:validation-api:2.0.1.Final"
dependency "javax.websocket:javax.websocket-api:1.1"
dependency "javax.xml.bind:jaxb-api:2.3.1"
dependency "javax.xml.ws:jaxws-api:2.3.1"
dependency "org.eclipse.persistence:javax.persistence:2.2.0"
// Substitute for "javax.management:jmxremote_optional:1.0.1_04" which
// is not available on Maven Central
dependency "org.glassfish.external:opendmk_jmxremote_optional_jar:1.0-b01-ea"
dependency "org.glassfish:javax.el:3.0.1-b08"
dependency "org.glassfish.main:javax.jws:4.0-b33"
dependency "org.glassfish.tyrus:tyrus-container-servlet:1.13.1"
}
applyMavenExclusions = false
generatedPomCustomization {
enabled = false
}
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/libs-spring-framework-build" }
}
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, "seconds"
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
}
}
}
// Consistent slf4j version (e.g. clashes between slf4j versions)
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == "org.slf4j") {
details.useVersion slf4jVersion
configure([rootProject] + javaProjects) { project ->
group = "org.springframework"
apply plugin: "java"
apply plugin: "java-test-fixtures"
apply plugin: "checkstyle"
apply plugin: 'org.springframework.build.compile'
apply from: "${rootDir}/gradle/custom-java-home.gradle"
apply from: "${rootDir}/gradle/ide.gradle"
pluginManager.withPlugin("kotlin") {
apply plugin: "org.jetbrains.dokka"
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = ["-Xjsr305=strict"]
allWarningsAsErrors = true
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ["-Xjsr305=strict"]
}
}
}
def commonCompilerArgs =
["-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options"]
compileJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes",
"-Xlint:deprecation", "-Xlint:unchecked", "-Werror"]
compileTestJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked"]
compileJava {
sourceCompatibility = 1.8 // can be switched to 11 for testing
targetCompatibility = 1.8
options.encoding = "UTF-8"
}
compileTestJava {
sourceCompatibility = 1.8 // can be switched to 11 for testing
targetCompatibility = 1.8
options.encoding = "UTF-8"
options.compilerArgs += "-parameters"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ["-Xjsr305=strict"]
apiVersion = "1.1"
languageVersion = "1.1"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ["-Xjsr305=strict"]
}
}
test {
useJUnitPlatform()
include(["**/*Tests.class", "**/*Test.class"])
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
systemProperty("io.netty.leakDetection.level", "paranoid")
scanForTestClasses = false
include(["**/*Tests.class", "**/*Test.class"])
// Since we set scanForTestClasses to false, we need to filter out inner
// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
// run MyTests by itself will fail if MyTests contains any inner classes.
exclude(["**/Abstract*.class", '**/*$*'])
}
checkstyle {
toolVersion = "8.24"
configDir = rootProject.file("src/checkstyle")
}
repositories {
maven { url "https://repo.spring.io/libs-release" }
mavenLocal()
toolVersion = "8.36.2"
configDirectory.set(rootProject.file("src/checkstyle"))
}
dependencies {
testCompile("junit:junit:4.12") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
testCompile("org.mockito:mockito-core:2.28.2") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
testCompile("com.nhaarman:mockito-kotlin:1.6.0") {
exclude module: "kotlin-stdlib"
exclude module: "kotlin-reflect"
exclude module: "mockito-core"
}
testCompile("org.hamcrest:hamcrest-all:1.3")
testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}")
testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
testCompile("org.junit.jupiter:junit-jupiter-api")
testCompile("org.junit.jupiter:junit-jupiter-params")
testCompile("org.mockito:mockito-core")
testCompile("org.mockito:mockito-junit-jupiter")
testCompile("io.mockk:mockk")
testCompile("org.assertj:assertj-core")
// Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs.
testRuntime("org.junit.platform:junit-platform-launcher")
testRuntime("org.junit.jupiter:junit-jupiter-engine")
testRuntime("org.apache.logging.log4j:log4j-core")
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl")
testRuntime("org.apache.logging.log4j:log4j-jul")
// JSR-305 only used for non-required meta-annotations
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.7")
compileOnly("com.google.code.findbugs:jsr305")
testCompileOnly("com.google.code.findbugs:jsr305")
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.15")
}
ext.javadocLinks = [
"https://docs.oracle.com/javase/8/docs/api/",
"https://docs.oracle.com/javaee/7/api/",
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
"https://www.ibm.com/support/knowledgecenter/SS7JFU_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/",
"https://glassfish.java.net/nonav/docs/v3/api/",
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
"https://tiles.apache.org/tiles-request/apidocs/",
"https://tiles.apache.org/framework/apidocs/",
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
"https://www.ehcache.org/apidocs/2.10.4",
"https://www.quartz-scheduler.org/api/2.3.0/",
"https://fasterxml.github.io/jackson-core/javadoc/2.9/",
"https://fasterxml.github.io/jackson-databind/javadoc/2.9/",
"https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/",
"https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/",
"https://junit.org/junit4/javadoc/4.12/",
"https://junit.org/junit5/docs/${junit5Version}/api/"
"https://docs.oracle.com/javase/8/docs/api/",
"https://docs.oracle.com/javaee/7/api/",
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
"https://www.ibm.com/support/knowledgecenter/SS7JFU_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/",
"https://glassfish.java.net/nonav/docs/v3/api/",
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
"https://tiles.apache.org/tiles-request/apidocs/",
"https://tiles.apache.org/framework/apidocs/",
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
"https://www.ehcache.org/apidocs/2.10.4/",
"https://www.quartz-scheduler.org/api/2.3.0/",
"https://fasterxml.github.io/jackson-core/javadoc/2.10/",
"https://fasterxml.github.io/jackson-databind/javadoc/2.10/",
"https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.10/",
"https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/",
"https://projectreactor.io/docs/test/release/api/",
"https://junit.org/junit4/javadoc/4.13.1/",
"https://junit.org/junit5/docs/5.7.0/api/"
] as String[]
}
configure(subprojects - project(":spring-build-src")) { subproject ->
apply from: "${gradleScriptDir}/publish-maven.gradle"
jar {
manifest.attributes["Implementation-Title"] = subproject.name
manifest.attributes["Implementation-Version"] = subproject.version
manifest.attributes["Automatic-Module-Name"] = subproject.name.replace('-', '.') // for Jigsaw
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
from("${rootProject.projectDir}/src/docs/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.encoding = "UTF-8"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.use = true
options.links(project.ext.javadocLinks)
options.addStringOption("Xdoclint:none", "-quiet")
// Suppress warnings due to cross-module @see and @link references.
// Note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
}
task sourcesJar(type: Jar, dependsOn: classes) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "sources"
from sourceSets.main.allSource
// Don't include or exclude anything explicitly by default. See SPR-12085.
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
configure(moduleProjects) { project ->
apply from: "${rootDir}/gradle/spring-module.gradle"
}
configure(rootProject) {
description = "Spring Framework"
apply plugin: "groovy"
apply from: "${gradleScriptDir}/jdiff.gradle"
apply from: "${gradleScriptDir}/docs.gradle"
apply plugin: "kotlin"
apply plugin: "io.spring.nohttp"
apply plugin: 'org.springframework.build.api-diff'
apply from: "${rootDir}/gradle/publications.gradle"
apply from: "${rootDir}/gradle/docs.gradle"
dependencyManagement {
imports {
mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
nohttp {
source.exclude "**/test-output/**"
allowlistFile = project.file("src/nohttp/allowlist.lines")
def rootPath = file(rootDir).toPath()
def projectDirs = allprojects.collect { it.projectDir } + "${rootDir}/buildSrc"
projectDirs.forEach { dir ->
[ 'bin', 'build', 'out', '.settings' ]
.collect { rootPath.relativize(new File(dir, it).toPath()) }
.forEach { source.exclude "$it/**" }
[ '.classpath', '.project' ]
.collect { rootPath.relativize(new File(dir, it).toPath()) }
.forEach { source.exclude "$it" }
}
}
// Don't publish the default jar for the root project
configurations.archives.artifacts.clear()
dependencies { // for integration tests
testCompile(project(":spring-aop"))
testCompile(project(":spring-beans"))
testCompile(project(":spring-context"))
testCompile(project(":spring-core"))
testCompile(project(":spring-expression"))
testCompile(project(":spring-jdbc"))
testCompile(project(":spring-orm"))
testCompile(project(":spring-test"))
testCompile(project(":spring-tx"))
testCompile(project(":spring-web"))
testCompile("javax.inject:javax.inject:1")
testCompile("javax.resource:javax.resource-api:1.7.1")
testCompile("javax.servlet:javax.servlet-api:3.1.0")
testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
testCompile("org.hibernate:hibernate-core:5.1.17.Final")
}
artifacts {
archives docsZip
archives schemaZip
archives distZip
}
wrapper {
doLast() {
def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
File wrapperFile = file("gradlew")
wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
File wrapperBatFile = file("gradlew.bat")
wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
publishing {
publications {
mavenJava(MavenPublication) {
artifact docsZip
artifact schemaZip
artifact distZip
}
}
}
}
/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
* If <TOPIC> starts with 'SPR-', change version
* from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
* e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT
*/
def qualifyVersionIfNecessary(version) {
if (rootProject.hasProperty("BRANCH_NAME")) {
def qualifier = rootProject.getProperty("BRANCH_NAME")
if (qualifier.startsWith("SPR-")) {
return version.replace("BUILD", qualifier)
}
}
return version
}
+41
View File
@@ -0,0 +1,41 @@
# Spring Framework Build
This folder contains the custom plugins and conventions for the Spring Framework build.
They are declared in the `build.gradle` file in this folder.
## Build Conventions
### Compiler conventions
The `org.springframework.build.compile` plugin applies the Java compiler conventions to the build.
By default, the build compiles sources with Java `1.8` source and target compatibility.
You can test a different source compatibility version on the CLI with a project property like:
```
./gradlew test -PjavaSourceVersion=11
```
## Build Plugins
## Optional dependencies
The `org.springframework.build.optional-dependencies` plugin creates a new `optional`
Gradle configuration - it adds the dependencies to the project's compile and runtime classpath
but doesn't affect the classpath of dependent projects.
This plugin does not provide a `provided` configuration, as the native `compileOnly` and `testCompileOnly`
configurations are preferred.
## API Diff
This plugin uses the [Gradle JApiCmp](https://github.com/melix/japicmp-gradle-plugin) plugin
to generate API Diff reports for each Spring Framework module. This plugin is applied once on the root
project and creates tasks in each framework module. Unlike previous versions of this part of the build,
there is no need for checking out a specific tag. The plugin will fetch the JARs we want to compare the
current working version with. You can generate the reports for all modules or a single module:
```
./gradlew apiDiff -PbaselineVersion=5.1.0.RELEASE
./gradlew :spring-core:apiDiff -PbaselineVersion=5.1.0.RELEASE
```
The reports are located under `build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/`.
+30
View File
@@ -0,0 +1,30 @@
plugins {
id 'java-gradle-plugin'
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation "me.champeau.gradle:japicmp-gradle-plugin:0.2.8"
implementation "com.google.guava:guava:28.2-jre" // required by japicmp-gradle-plugin
}
gradlePlugin {
plugins {
apiDiffPlugin {
id = "org.springframework.build.api-diff"
implementationClass = "org.springframework.build.api.ApiDiffPlugin"
}
compileConventionsPlugin {
id = "org.springframework.build.compile"
implementationClass = "org.springframework.build.compile.CompilerConventionsPlugin"
}
optionalDependenciesPlugin {
id = "org.springframework.build.optional-dependencies"
implementationClass = "org.springframework.build.optional.OptionalDependenciesPlugin"
}
}
}
+1
View File
@@ -0,0 +1 @@
org.gradle.caching=true
-10
View File
@@ -1,10 +0,0 @@
description = "Exposes gradle buildSrc for IDE support"
apply plugin: "groovy"
dependencies {
compile gradleApi()
compile localGroovy()
}
configurations.archives.artifacts.clear()
@@ -1,55 +0,0 @@
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ProjectDependency;
/**
* Gradle plugin that automatically updates testCompile dependencies to include
* the test source sets of project dependencies.
*
* @author Phillip Webb
*/
class TestSourceSetDependenciesPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
project.afterEvaluate {
Set<ProjectDependency> projectDependencies = new LinkedHashSet<ProjectDependency>()
collectProjectDependencies(projectDependencies, project)
projectDependencies.each {
project.dependencies.add("testCompile", it.dependencyProject.sourceSets.test.output)
}
}
}
private void collectProjectDependencies(Set<ProjectDependency> projectDependencies, Project project) {
for (def configurationName in ["compile", "optional", "provided", "testCompile"]) {
Configuration configuration = project.getConfigurations().findByName(configurationName)
if (configuration) {
configuration.dependencies.findAll { it instanceof ProjectDependency }.each {
projectDependencies.add(it)
collectProjectDependencies(projectDependencies, it.dependencyProject)
}
}
}
}
}
@@ -0,0 +1,115 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.api;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import me.champeau.gradle.japicmp.JapicmpPlugin;
import me.champeau.gradle.japicmp.JapicmpTask;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.jvm.tasks.Jar;
/**
* {@link Plugin} that applies the {@code "japicmp-gradle-plugin"}
* and create tasks for all subprojects, diffing the public API one by one
* and creating the reports in {@code "build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/"}.
* <p>{@code "./gradlew apiDiff -PbaselineVersion=5.1.0.RELEASE"} will output the
* reports for the API diff between the baseline version and the current one for all modules.
* You can limit the report to a single module with
* {@code "./gradlew :spring-core:apiDiff -PbaselineVersion=5.1.0.RELEASE"}.
*
* @author Brian Clozel
*/
public class ApiDiffPlugin implements Plugin<Project> {
public static final String TASK_NAME = "apiDiff";
private static final String BASELINE_VERSION_PROPERTY = "baselineVersion";
private static final List<String> PACKAGE_INCLUDES = Collections.singletonList("org.springframework.*");
@Override
public void apply(Project project) {
if (project.hasProperty(BASELINE_VERSION_PROPERTY) && project.equals(project.getRootProject())) {
project.getPluginManager().apply(JapicmpPlugin.class);
project.getPlugins().withType(JapicmpPlugin.class,
plugin -> applyApiDiffConventions(project));
}
}
private void applyApiDiffConventions(Project project) {
String baselineVersion = project.property(BASELINE_VERSION_PROPERTY).toString();
project.subprojects(subProject -> createApiDiffTask(baselineVersion, subProject));
}
private void createApiDiffTask(String baselineVersion, Project project) {
if (isProjectEligible(project)) {
JapicmpTask apiDiff = project.getTasks().create(TASK_NAME, JapicmpTask.class);
apiDiff.setDescription("Generates an API diff report with japicmp");
apiDiff.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);
apiDiff.setOldClasspath(project.files(createBaselineConfiguration(baselineVersion, project)));
TaskProvider<Jar> jar = project.getTasks().withType(Jar.class).named("jar");
apiDiff.setNewArchives(project.getLayout().files(jar.get().getArchiveFile().get().getAsFile()));
apiDiff.setNewClasspath(getRuntimeClassPath(project));
apiDiff.setPackageIncludes(PACKAGE_INCLUDES);
apiDiff.setOnlyModified(true);
apiDiff.setIgnoreMissingClasses(true);
// Ignore Kotlin metadata annotations since they contain
// illegal HTML characters and fail the report generation
apiDiff.setAnnotationExcludes(Collections.singletonList("@kotlin.Metadata"));
apiDiff.setHtmlOutputFile(getOutputFile(baselineVersion, project));
apiDiff.dependsOn(project.getTasks().getByName("jar"));
}
}
private boolean isProjectEligible(Project project) {
return project.getPlugins().hasPlugin(JavaPlugin.class)
&& project.getPlugins().hasPlugin(MavenPublishPlugin.class);
}
private Configuration createBaselineConfiguration(String baselineVersion, Project project) {
String baseline = String.join(":",
project.getGroup().toString(), project.getName(), baselineVersion);
Dependency baselineDependency = project.getDependencies().create(baseline + "@jar");
return project.getRootProject().getConfigurations().detachedConfiguration(baselineDependency);
}
private Configuration getRuntimeClassPath(Project project) {
return project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
}
private File getOutputFile(String baseLineVersion, Project project) {
Path outDir = Paths.get(project.getRootProject().getBuildDir().getAbsolutePath(),
"reports", "api-diff",
baseLineVersion + "_to_" + project.getRootProject().getVersion());
return project.file(outDir.resolve(project.getName() + ".html").toString());
}
}
@@ -0,0 +1,106 @@
/*
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.compile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.compile.JavaCompile;
/**
* {@link Plugin} that applies conventions for compiling Java sources in Spring Framework.
* <p>One can override the default Java source compatibility version
* with a dedicated property on the CLI: {@code "./gradlew test -PjavaSourceVersion=11"}.
*
* @author Brian Clozel
* @author Sam Brannen
*/
public class CompilerConventionsPlugin implements Plugin<Project> {
/**
* The project property that can be used to switch the Java source
* compatibility version for building source and test classes.
*/
public static final String JAVA_SOURCE_VERSION_PROPERTY = "javaSourceVersion";
public static final JavaVersion DEFAULT_COMPILER_VERSION = JavaVersion.VERSION_1_8;
private static final List<String> COMPILER_ARGS;
private static final List<String> TEST_COMPILER_ARGS;
static {
List<String> commonCompilerArgs = Arrays.asList(
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options"
);
COMPILER_ARGS = new ArrayList<>();
COMPILER_ARGS.addAll(commonCompilerArgs);
COMPILER_ARGS.addAll(Arrays.asList(
"-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
"-Xlint:unchecked", "-Werror"
));
TEST_COMPILER_ARGS = new ArrayList<>();
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
TEST_COMPILER_ARGS.addAll(Arrays.asList("-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked", "-parameters"));
}
@Override
public void apply(Project project) {
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> applyJavaCompileConventions(project));
}
/**
* Applies the common Java compiler options for main sources, test fixture sources, and
* test sources.
* @param project the current project
*/
private void applyJavaCompileConventions(Project project) {
JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class);
if (project.hasProperty(JAVA_SOURCE_VERSION_PROPERTY)) {
JavaVersion javaSourceVersion = JavaVersion.toVersion(project.property(JAVA_SOURCE_VERSION_PROPERTY));
java.setSourceCompatibility(javaSourceVersion);
}
else {
java.setSourceCompatibility(DEFAULT_COMPILER_VERSION);
}
java.setTargetCompatibility(DEFAULT_COMPILER_VERSION);
project.getTasks().withType(JavaCompile.class)
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_JAVA_TASK_NAME))
.forEach(compileTask -> {
compileTask.getOptions().setCompilerArgs(COMPILER_ARGS);
compileTask.getOptions().setEncoding("UTF-8");
});
project.getTasks().withType(JavaCompile.class)
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME)
|| compileTask.getName().equals("compileTestFixturesJava"))
.forEach(compileTask -> {
compileTask.getOptions().setCompilerArgs(TEST_COMPILER_ARGS);
compileTask.getOptions().setEncoding("UTF-8");
});
}
}
@@ -0,0 +1,64 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.optional;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
/**
* A {@code Plugin} that adds support for Maven-style optional dependencies. Creates a new
* {@code optional} configuration. The {@code optional} configuration is part of the
* project's compile and runtime classpath's but does not affect the classpath of
* dependent projects.
*
* @author Andy Wilkinson
*/
public class OptionalDependenciesPlugin implements Plugin<Project> {
/**
* Name of the {@code optional} configuration.
*/
public static final String OPTIONAL_CONFIGURATION_NAME = "optional";
@Override
public void apply(Project project) {
Configuration optional = project.getConfigurations().create("optional");
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> {
SourceSetContainer sourceSets = project.getConvention()
.getPlugin(JavaPluginConvention.class).getSourceSets();
sourceSets.all((sourceSet) -> {
sourceSet.setCompileClasspath(
sourceSet.getCompileClasspath().plus(optional));
sourceSet.setRuntimeClasspath(
sourceSet.getRuntimeClasspath().plus(optional));
});
});
project.getPlugins().withType(EclipsePlugin.class, (eclipePlugin) -> {
project.getExtensions().getByType(EclipseModel.class)
.classpath((classpath) -> {
classpath.getPlusConfigurations().add(optional);
});
});
}
}
@@ -1 +0,0 @@
implementation-class=org.springframework.build.gradle.TestSourceSetDependenciesPlugin
+51
View File
@@ -0,0 +1,51 @@
== Spring Framework Concourse pipeline
The Spring Framework is using https://concourse-ci.org/[Concourse] for its CI build and other automated tasks.
The Spring team has a dedicated Concourse instance available at https://ci.spring.io.
=== Setting up your development environment
If you're part of the Spring Framework project on GitHub, you can get access to CI management features.
First, you need to go to https://ci.spring.io and install the client CLI for your platform (see bottom right of the screen).
You can then login with the instance using:
[source]
----
$ fly -t spring login -n spring-framework -c https://ci.spring.io
----
Once logged in, you should get something like:
[source]
----
$ fly ts
name url team expiry
spring https://ci.spring.io spring-framework Wed, 25 Mar 2020 17:45:26 UTC
----
=== Pipeline configuration and structure
The build pipelines are described in `pipeline.yml` file.
This file is listing Concourse resources, i.e. build inputs and outputs such as container images, artifact repositories, source repositories, notification services, etc.
It also describes jobs (a job is a sequence of inputs, tasks and outputs); jobs are organized by groups.
The `pipeline.yml` definition contains `((parameters))` which are loaded from the `parameters.yml` file or from our https://docs.cloudfoundry.org/credhub/[credhub instance].
You'll find in this folder the following resources:
* `pipeline.yml` the build pipeline
* `parameters.yml` the build parameters used for the pipeline
* `images/` holds the container images definitions used in this pipeline
* `scripts/` holds the build scripts that ship within the CI container images
* `tasks` contains the task definitions used in the main `pipeline.yml`
=== Updating the build pipeline
Updating files on the repository is not enough to update the build pipeline, as changes need to be applied.
The pipeline can be deployed using the following command:
[source]
----
$ fly -t spring set-pipeline -p spring-framework-5.3.x -c ci/pipeline.yml -l ci/parameters.yml
----
NOTE: This assumes that you have credhub integration configured with the appropriate secrets.
+17
View File
@@ -0,0 +1,17 @@
changelog:
repository: spring-projects/spring-framework
sections:
- title: ":star: New Features"
labels:
- "type: enhancement"
- title: ":beetle: Bug Fixes"
labels:
- "type: bug"
- "type: regression"
- title: ":notebook_with_decorative_cover: Documentation"
labels:
- "type: documentation"
- title: ":hammer: Dependency Upgrades"
sort: "title"
labels:
- "type: dependency-upgrade"
+9
View File
@@ -0,0 +1,9 @@
logging:
level:
io.spring.concourse: DEBUG
distribute:
optional-deployments:
- '.*\\.zip'
spring:
main:
banner-mode: off
+21
View File
@@ -0,0 +1,21 @@
== CI Images
These images are used by CI to run the actual builds.
To build the image locally run the following from this directory:
----
$ docker build --no-cache -f <image-folder>/Dockerfile .
----
For example
----
$ docker build --no-cache -f spring-framework-ci-image/Dockerfile .
----
To test run:
----
$ docker run -it --entrypoint /bin/bash <SHA>
----
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
case "$1" in
java8)
echo "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u265b01.tar.gz"
;;
java11)
echo "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10.tar.gz"
;;
java14)
echo "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12/OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.tar.gz"
;;
java15)
echo "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_linux_hotspot_15_36.tar.gz"
;;
*)
echo $"Unknown java version"
exit 1
esac
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -ex
###########################################################
# UTILS
###########################################################
apt-get update
apt-get install --no-install-recommends -y ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq fontconfig
rm -rf /var/lib/apt/lists/*
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.3/concourse-java.sh > /opt/concourse-java.sh
curl --output /opt/concourse-release-scripts.jar https://repo.spring.io/release/io/spring/concourse/releasescripts/concourse-release-scripts/0.2.1/concourse-release-scripts-0.2.1.jar
###########################################################
# JAVA
###########################################################
JDK_URL=$( ./get-jdk-url.sh $1 )
mkdir -p /opt/openjdk
cd /opt/openjdk
curl -L ${JDK_URL} | tar zx --strip-components=1
test -f /opt/openjdk/bin/java
test -f /opt/openjdk/bin/javac
###########################################################
# GRADLE ENTERPRISE
###########################################################
cd /
mkdir ~/.gradle
echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties
@@ -0,0 +1,8 @@
FROM ubuntu:bionic-20200713
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java8
ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH
@@ -0,0 +1,8 @@
FROM ubuntu:bionic-20200713
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java11
ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH
@@ -0,0 +1,8 @@
FROM ubuntu:bionic-20200713
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java14
ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH
@@ -0,0 +1,8 @@
FROM ubuntu:bionic-20200713
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java15
ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH
+14
View File
@@ -0,0 +1,14 @@
email-server: "smtp.svc.pivotal.io"
email-from: "ci@spring.io"
email-to: ["spring-framework-dev@pivotal.io"]
github-repo: "https://github.com/spring-projects/spring-framework.git"
github-repo-name: "spring-projects/spring-framework"
docker-hub-organization: "springci"
artifactory-server: "https://repo.spring.io"
branch: "master"
build-name: "spring-framework"
pipeline-name: "spring-framework"
concourse-url: "https://ci.spring.io"
bintray-subject: "spring"
bintray-repo: "jars"
task-timeout: 1h00m
+487
View File
@@ -0,0 +1,487 @@
anchors:
artifactory-task-params: &artifactory-task-params
ARTIFACTORY_SERVER: ((artifactory-server))
ARTIFACTORY_USERNAME: ((artifactory-username))
ARTIFACTORY_PASSWORD: ((artifactory-password))
bintray-task-params: &bintray-task-params
BINTRAY_SUBJECT: ((bintray-subject))
BINTRAY_REPO: ((bintray-repo))
BINTRAY_USERNAME: ((bintray-username))
BINTRAY_API_KEY: ((bintray-api-key))
docker-resource-source: &docker-resource-source
username: ((docker-hub-username))
password: ((docker-hub-password))
tag: 5.3.x
gradle-enterprise-task-params: &gradle-enterprise-task-params
GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key))
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle_enterprise_cache_user.username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password))
slack-fail-params: &slack-fail-params
text: >
:concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>
[$TEXT_FILE_CONTENT]
text_file: git-repo/build/build-scan-uri.txt
silent: true
icon_emoji: ":concourse:"
username: concourse-ci
sonatype-task-params: &sonatype-task-params
SONATYPE_USER_TOKEN: ((sonatype-user-token))
SONATYPE_PASSWORD_TOKEN: ((sonatype-user-token-password))
changelog-task-params: &changelog-task-params
name: generated-changelog/tag
tag: generated-changelog/tag
body: generated-changelog/changelog.md
github-task-params: &github-task-params
GITHUB_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
resource_types:
- name: artifactory-resource
type: docker-image
source:
repository: springio/artifactory-resource
tag: 0.0.12
- name: github-status-resource
type: docker-image
source:
repository: dpb587/github-status-resource
tag: master
- name: slack-notification
type: docker-image
source:
repository: cfcommunity/slack-notification-resource
tag: latest
resources:
- name: git-repo
type: git
icon: github
source:
uri: ((github-repo))
username: ((github-username))
password: ((github-password))
branch: ((branch))
- name: every-morning
type: time
icon: alarm
source:
start: 8:00 AM
stop: 9:00 AM
location: Europe/Vienna
- name: ci-images-git-repo
type: git
icon: github
source:
uri: ((github-repo))
branch: ((branch))
paths: ["ci/images/*"]
- name: spring-framework-ci-image
type: docker-image
icon: docker
source:
<<: *docker-resource-source
repository: ((docker-hub-organization))/spring-framework-ci-image
- name: spring-framework-jdk11-ci-image
type: docker-image
icon: docker
source:
<<: *docker-resource-source
repository: ((docker-hub-organization))/spring-framework-jdk11-ci-image
- name: spring-framework-jdk14-ci-image
type: docker-image
icon: docker
source:
<<: *docker-resource-source
repository: ((docker-hub-organization))/spring-framework-jdk14-ci-image
- name: spring-framework-jdk15-ci-image
type: docker-image
icon: docker
source:
<<: *docker-resource-source
repository: ((docker-hub-organization))/spring-framework-jdk15-ci-image
- name: artifactory-repo
type: artifactory-resource
icon: package-variant
source:
uri: ((artifactory-server))
username: ((artifactory-username))
password: ((artifactory-password))
build_name: ((build-name))
- name: repo-status-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: build
- name: repo-status-jdk11-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: jdk11-build
- name: repo-status-jdk14-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: jdk14-build
- name: repo-status-jdk15-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: jdk15-build
- name: slack-alert
type: slack-notification
icon: slack
source:
url: ((slack-webhook-url))
- name: github-pre-release
type: github-release
icon: briefcase-download-outline
source:
owner: spring-projects
repository: spring-framework
access_token: ((github-ci-release-token))
pre_release: true
release: false
- name: github-release
type: github-release
icon: briefcase-download
source:
owner: spring-projects
repository: spring-framework
access_token: ((github-ci-release-token))
pre_release: false
jobs:
- name: build-spring-framework-ci-images
plan:
- get: ci-images-git-repo
trigger: true
- in_parallel:
- put: spring-framework-ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-framework-ci-image/Dockerfile
- put: spring-framework-jdk11-ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-framework-jdk11-ci-image/Dockerfile
- put: spring-framework-jdk14-ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-framework-jdk14-ci-image/Dockerfile
- put: spring-framework-jdk15-ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-framework-jdk15-ci-image/Dockerfile
- name: build
serial: true
public: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: true
- put: repo-status-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: build-project
privileged: true
timeout: ((task-timeout))
image: spring-framework-ci-image
file: git-repo/ci/tasks/build-project.yml
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
on_failure:
do:
- put: repo-status-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
<<: *slack-fail-params
- put: repo-status-build
params: { state: "success", commit: "git-repo" }
- put: artifactory-repo
params: &artifactory-params
repo: libs-snapshot-local
folder: distribution-repository
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
disable_checksum_uploads: true
threads: 8
artifact_set:
- include:
- "/**/spring-*.zip"
properties:
"zip.name": "spring-framework"
"zip.displayname": "Spring Framework"
"zip.deployed": "false"
- include:
- "/**/spring-*-docs.zip"
properties:
"zip.type": "docs"
- include:
- "/**/spring-*-dist.zip"
properties:
"zip.type": "dist"
- include:
- "/**/spring-*-schema.zip"
properties:
"zip.type": "schema"
get_params:
threads: 8
- name: jdk11-build
serial: true
public: true
plan:
- get: spring-framework-jdk11-ci-image
- get: git-repo
- get: every-morning
trigger: true
- put: repo-status-jdk11-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: check-project
privileged: true
timeout: ((task-timeout))
image: spring-framework-jdk11-ci-image
file: git-repo/ci/tasks/check-project.yml
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
on_failure:
do:
- put: repo-status-jdk11-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
<<: *slack-fail-params
- put: repo-status-jdk11-build
params: { state: "success", commit: "git-repo" }
- name: jdk14-build
serial: true
public: true
plan:
- get: spring-framework-jdk14-ci-image
- get: git-repo
- get: every-morning
trigger: true
- put: repo-status-jdk14-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: check-project
privileged: true
timeout: ((task-timeout))
image: spring-framework-jdk14-ci-image
file: git-repo/ci/tasks/check-project.yml
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
on_failure:
do:
- put: repo-status-jdk14-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
<<: *slack-fail-params
- put: repo-status-jdk14-build
params: { state: "success", commit: "git-repo" }
- name: jdk15-build
serial: true
public: true
plan:
- get: spring-framework-jdk15-ci-image
- get: git-repo
- get: every-morning
trigger: true
- put: repo-status-jdk15-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: check-project
privileged: true
timeout: ((task-timeout))
image: spring-framework-jdk15-ci-image
file: git-repo/ci/tasks/check-project.yml
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
on_failure:
do:
- put: repo-status-jdk15-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
<<: *slack-fail-params
- put: repo-status-jdk15-build
params: { state: "success", commit: "git-repo" }
- name: stage-milestone
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- task: stage
image: spring-framework-ci-image
file: git-repo/ci/tasks/stage-version.yml
params:
RELEASE_TYPE: M
<<: *gradle-enterprise-task-params
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: promote-milestone
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- get: artifactory-repo
trigger: false
passed: [stage-milestone]
params:
download_artifacts: false
save_build_info: true
- task: promote
image: spring-framework-ci-image
file: git-repo/ci/tasks/promote-version.yml
params:
RELEASE_TYPE: M
<<: *artifactory-task-params
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
params:
RELEASE_TYPE: M
<<: *github-task-params
- put: github-pre-release
params:
<<: *changelog-task-params
- name: stage-rc
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- task: stage
image: spring-framework-ci-image
file: git-repo/ci/tasks/stage-version.yml
params:
RELEASE_TYPE: RC
<<: *gradle-enterprise-task-params
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: promote-rc
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- get: artifactory-repo
trigger: false
passed: [stage-rc]
params:
download_artifacts: false
save_build_info: true
- task: promote
image: spring-framework-ci-image
file: git-repo/ci/tasks/promote-version.yml
params:
RELEASE_TYPE: RC
<<: *artifactory-task-params
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
params:
RELEASE_TYPE: RC
<<: *github-task-params
- put: github-pre-release
params:
<<: *changelog-task-params
- name: stage-release
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- task: stage
image: spring-framework-ci-image
file: git-repo/ci/tasks/stage-version.yml
params:
RELEASE_TYPE: RELEASE
<<: *gradle-enterprise-task-params
- put: artifactory-repo
params:
<<: *artifactory-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- name: promote-release
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
trigger: false
- get: artifactory-repo
trigger: false
passed: [stage-release]
params:
download_artifacts: false
save_build_info: true
- task: promote
image: spring-framework-ci-image
file: git-repo/ci/tasks/promote-version.yml
params:
RELEASE_TYPE: RELEASE
<<: *artifactory-task-params
<<: *bintray-task-params
- name: sync-to-maven-central
serial: true
plan:
- get: spring-framework-ci-image
- get: git-repo
- get: artifactory-repo
trigger: true
passed: [promote-release]
params:
download_artifacts: false
save_build_info: true
- task: sync-to-maven-central
image: spring-framework-ci-image
file: git-repo/ci/tasks/sync-to-maven-central.yml
params:
<<: *bintray-task-params
<<: *sonatype-task-params
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
params:
RELEASE_TYPE: RELEASE
<<: *github-task-params
- put: github-release
params:
<<: *changelog-task-params
groups:
- name: "builds"
jobs: ["build", "jdk11-build", "jdk14-build", "jdk15-build"]
- name: "releases"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone","promote-rc", "promote-release", "sync-to-maven-central"]
- name: "ci-images"
jobs: ["build-spring-framework-ci-images"]
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
popd > /dev/null
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
source $(dirname $0)/common.sh
pushd git-repo > /dev/null
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 check
popd > /dev/null
+2
View File
@@ -0,0 +1,2 @@
source /opt/concourse-java.sh
setup_symlinks
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
CONFIG_DIR=git-repo/ci/config
version=$( cat version/version )
java -jar /github-changelog-generator.jar \
--spring.config.location=${CONFIG_DIR}/changelog-generator.yml \
${version} generated-changelog/changelog.md
echo ${version} > generated-changelog/version
echo v${version} > generated-changelog/tag
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
source $(dirname $0)/common.sh
CONFIG_DIR=git-repo/ci/config
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json
java -jar /opt/concourse-release-scripts.jar promote $RELEASE_TYPE $BUILD_INFO_LOCATION > /dev/null || { exit 1; }
java -jar /opt/concourse-release-scripts.jar \
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \
distribute $RELEASE_TYPE $BUILD_INFO_LOCATION > /dev/null || { exit 1; }
echo "Promotion complete"
echo $version > version/version
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
set -e
source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null
git fetch --tags --all > /dev/null
popd > /dev/null
git clone git-repo stage-git-repo > /dev/null
pushd stage-git-repo > /dev/null
snapshotVersion=$( awk -F '=' '$1 == "version" { print $2 }' gradle.properties )
if [[ $RELEASE_TYPE = "M" ]]; then
stageVersion=$( get_next_milestone_release $snapshotVersion)
nextVersion=$snapshotVersion
elif [[ $RELEASE_TYPE = "RC" ]]; then
stageVersion=$( get_next_rc_release $snapshotVersion)
nextVersion=$snapshotVersion
elif [[ $RELEASE_TYPE = "RELEASE" ]]; then
stageVersion=$( get_next_release $snapshotVersion)
nextVersion=$( bump_version_number $snapshotVersion)
else
echo "Unknown release type $RELEASE_TYPE" >&2; exit 1;
fi
echo "Staging $stageVersion (next version will be $nextVersion)"
sed -i "s/version=$snapshotVersion/version=$stageVersion/" gradle.properties
git config user.name "Spring Buildmaster" > /dev/null
git config user.email "buildmaster@springframework.org" > /dev/null
git add gradle.properties > /dev/null
git commit -m"Release v$stageVersion" > /dev/null
git tag -a "v$stageVersion" -m"Release v$stageVersion" > /dev/null
./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
git reset --hard HEAD^ > /dev/null
if [[ $nextVersion != $snapshotVersion ]]; then
echo "Setting next development version (v$nextVersion)"
sed -i "s/version=$snapshotVersion/version=$nextVersion/" gradle.properties
git add gradle.properties > /dev/null
git commit -m"Next development version (v$nextVersion)" > /dev/null
fi;
echo "Staging Complete"
popd > /dev/null
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
java -jar /opt/concourse-release-scripts.jar syncToCentral "RELEASE" $BUILD_INFO_LOCATION || { exit 1; }
echo "Sync complete"
echo $version > version/version
+22
View File
@@ -0,0 +1,22 @@
---
platform: linux
inputs:
- name: git-repo
outputs:
- name: distribution-repository
- name: git-repo
caches:
- path: gradle
params:
BRANCH:
CI: true
GRADLE_ENTERPRISE_ACCESS_KEY:
GRADLE_ENTERPRISE_CACHE_USERNAME:
GRADLE_ENTERPRISE_CACHE_PASSWORD:
GRADLE_ENTERPRISE_URL: https://ge.spring.io
run:
path: bash
args:
- -ec
- |
${PWD}/git-repo/ci/scripts/build-project.sh
+22
View File
@@ -0,0 +1,22 @@
---
platform: linux
inputs:
- name: git-repo
outputs:
- name: distribution-repository
- name: git-repo
caches:
- path: gradle
params:
BRANCH:
CI: true
GRADLE_ENTERPRISE_ACCESS_KEY:
GRADLE_ENTERPRISE_CACHE_USERNAME:
GRADLE_ENTERPRISE_CACHE_PASSWORD:
GRADLE_ENTERPRISE_URL: https://ge.spring.io
run:
path: bash
args:
- -ec
- |
${PWD}/git-repo/ci/scripts/check-project.sh
+20
View File
@@ -0,0 +1,20 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: springio/github-changelog-generator
tag: '0.0.4'
inputs:
- name: git-repo
- name: version
outputs:
- name: generated-changelog
params:
GITHUB_ORGANIZATION:
GITHUB_REPO:
GITHUB_USERNAME:
GITHUB_TOKEN:
RELEASE_TYPE:
run:
path: git-repo/ci/scripts/generate-changelog.sh
+18
View File
@@ -0,0 +1,18 @@
---
platform: linux
inputs:
- name: git-repo
- name: artifactory-repo
outputs:
- name: version
params:
RELEASE_TYPE:
ARTIFACTORY_SERVER:
ARTIFACTORY_USERNAME:
ARTIFACTORY_PASSWORD:
BINTRAY_SUBJECT:
BINTRAY_REPO:
BINTRAY_USERNAME:
BINTRAY_API_KEY:
run:
path: git-repo/ci/scripts/promote-version.sh
+17
View File
@@ -0,0 +1,17 @@
---
platform: linux
inputs:
- name: git-repo
outputs:
- name: stage-git-repo
- name: distribution-repository
params:
RELEASE_TYPE:
CI: true
GRADLE_ENTERPRISE_CACHE_USERNAME:
GRADLE_ENTERPRISE_CACHE_PASSWORD:
GRADLE_ENTERPRISE_URL: https://ge.spring.io
caches:
- path: gradle
run:
path: git-repo/ci/scripts/stage-version.sh
+16
View File
@@ -0,0 +1,16 @@
---
platform: linux
inputs:
- name: git-repo
- name: artifactory-repo
outputs:
- name: version
params:
BINTRAY_REPO:
BINTRAY_SUBJECT:
BINTRAY_USERNAME:
BINTRAY_API_KEY:
SONATYPE_USER_TOKEN:
SONATYPE_PASSWORD_TOKEN:
run:
path: git-repo/ci/scripts/sync-to-maven-central.sh
+23
View File
@@ -0,0 +1,23 @@
description = "Spring Framework (Bill of Materials)"
apply plugin: 'java-platform'
apply from: "$rootDir/gradle/publications.gradle"
group = "org.springframework"
dependencies {
constraints {
parent.moduleProjects.sort { "$it.name" }.each {
api it
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'spring-framework-bom'
from components.javaPlatform
}
}
}
+5 -1
View File
@@ -1 +1,5 @@
version=5.1.11.BUILD-SNAPSHOT
version=5.3.1
org.gradle.jvmargs=-Xmx1536M
org.gradle.caching=true
org.gradle.parallel=true
kotlin.stdlib.default.dependency=false
+80
View File
@@ -0,0 +1,80 @@
// -----------------------------------------------------------------------------
//
// This script adds support for the following two JVM system properties
// that control the build for alternative JDKs (i.e., a JDK other than
// the one used to launch the Gradle process).
//
// - customJavaHome: absolute path to the alternate JDK installation to
// use to compile Java code and execute tests. This system property
// is also used in spring-oxm.gradle to determine whether JiBX is
// supported.
//
// - customJavaSourceVersion: Java version supplied to the `--release`
// command line flag to control the Java source and target
// compatibility version. Supported versions include 9 or higher.
// Do not set this system property if Java 8 should be used.
//
// Examples:
//
// ./gradlew -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home test
//
// ./gradlew --no-build-cache -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home test
//
// ./gradlew -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home -DcustomJavaSourceVersion=14 test
//
//
// Credits: inspired by work from Marc Philipp and Stephane Nicoll
//
// -----------------------------------------------------------------------------
import org.gradle.internal.os.OperatingSystem
// import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
def customJavaHome = System.getProperty("customJavaHome")
if (customJavaHome) {
def customJavaHomeDir = new File(customJavaHome)
def customJavaSourceVersion = System.getProperty("customJavaSourceVersion")
tasks.withType(JavaCompile) {
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHomeDir)
options.forkOptions.javaHome = customJavaHomeDir
inputs.property("customJavaHome", customJavaHome)
if (customJavaSourceVersion) {
options.compilerArgs += [ "--release", customJavaSourceVersion]
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
}
}
tasks.withType(GroovyCompile) {
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHomeDir)
options.forkOptions.javaHome = customJavaHomeDir
inputs.property("customJavaHome", customJavaHome)
if (customJavaSourceVersion) {
options.compilerArgs += [ "--release", customJavaSourceVersion]
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
}
}
/*
tasks.withType(KotlinJvmCompile) {
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHome)
kotlinOptions.jdkHome = customJavaHomeDir
inputs.property("customJavaHome", customJavaHome)
}
*/
tasks.withType(Test) {
def javaExecutable = customJavaHome + "/bin/java"
if (OperatingSystem.current().isWindows()) {
javaExecutable += ".exe"
}
logger.info("Java executable for " + it.name + " task in " + project.name + ": " + javaExecutable)
executable = javaExecutable
inputs.property("customJavaHome", customJavaHome)
if (customJavaSourceVersion) {
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
}
}
}
+184 -140
View File
@@ -1,162 +1,235 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
configurations {
asciidoctorExt
}
dependencies {
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.4.3.RELEASE")
}
repositories {
maven {
url "https://repo.spring.io/release"
mavenContent {
includeGroup "io.spring.asciidoctor"
}
}
}
/**
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
*/
task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"
dependsOn {
subprojects.collect {
moduleProjects.collect {
it.tasks.getByName("jar")
}
}
options.encoding = "UTF-8"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.use = true
options.overview = "src/docs/api/overview.html"
options.stylesheetFile = file("src/docs/api/stylesheet.css")
options.splitIndex = true
options.links(project.ext.javadocLinks)
options.addStringOption('Xdoclint:none', '-quiet')
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
maxMemory = "1024m"
destinationDir = new File(buildDir, "api")
doFirst {
classpath = files(
// ensure the javadoc process can resolve types compiled from .aj sources
project(":spring-aspects").sourceSets.main.output
)
classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
}
options {
encoding = "UTF-8"
memberLevel = JavadocMemberLevel.PROTECTED
author = true
header = rootProject.description
use = true
overview = "src/docs/api/overview.html"
stylesheetFile = file("src/docs/api/stylesheet.css")
splitIndex = true
links(project.ext.javadocLinks)
addStringOption('Xdoclint:none', '-quiet')
if(JavaVersion.current().isJava9Compatible()) {
addBooleanOption('html5', true)
}
}
source moduleProjects.collect { project ->
project.sourceSets.main.allJava
}
maxMemory = "1024m"
destinationDir = file("$buildDir/docs/javadoc")
}
/**
* Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
*/
dokka {
dependsOn {
tasks.getByName("api")
}
doFirst {
classpath = subprojects.collect { project -> project.jar.outputs.files.getFiles() }.flatten()
classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
doFirst {
configuration {
classpath = moduleProjects.collect { project -> project.jar.outputs.files.getFiles() }.flatten()
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
moduleProjects.findAll {
it.pluginManager.hasPlugin("kotlin")
}.each { project ->
def kotlinDirs = project.sourceSets.main.kotlin.srcDirs.collect()
kotlinDirs -= project.sourceSets.main.java.srcDirs
kotlinDirs.each { dir ->
if (dir.exists()) {
sourceRoot {
path = dir.path
}
}
}
}
}
}
moduleName = "spring-framework"
outputFormat = "html"
outputDirectory = "$buildDir/docs/kdoc"
sourceDirs = files(subprojects.collect { project ->
def kotlinDirs = project.sourceSets.main.kotlin.srcDirs.collect()
kotlinDirs -= project.sourceSets.main.java.srcDirs
})
externalDocumentationLink {
url = new URL("https://docs.spring.io/spring-framework/docs/$version/javadoc-api/")
packageListUrl = new File(buildDir, "api/package-list").toURI().toURL()
}
externalDocumentationLink {
url = new URL("https://projectreactor.io/docs/core/release/api/")
}
externalDocumentationLink {
url = new URL("https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
configuration {
moduleName = "spring-framework"
externalDocumentationLink {
url = new URL("https://docs.spring.io/spring-framework/docs/$version/javadoc-api/")
packageListUrl = new File(buildDir, "docs/javadoc/package-list").toURI().toURL()
}
externalDocumentationLink {
url = new URL("https://projectreactor.io/docs/core/release/api/")
}
externalDocumentationLink {
url = new URL("https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
}
externalDocumentationLink {
url = new URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
}
externalDocumentationLink {
url = new URL("https://r2dbc.io/spec/0.8.3.RELEASE/api/")
}
}
}
asciidoctor {
sources {
include '*.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'stylesheets/*', 'tocbot-3.0.2/*'
}
}
logDocuments = true
backends = ["html5"]
// only ouput PDF documentation for non-SNAPSHOT builds
if(!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
backends += "pdf"
}
task downloadResources(type: Download) {
def version = "0.2.2.RELEASE"
src "https://repo.spring.io/release/io/spring/docresources/" +
"spring-doc-resources/$version/spring-doc-resources-${version}.zip"
dest project.file("$buildDir/docs/spring-doc-resources.zip")
onlyIfModified true
useETag "all"
}
task extractDocResources(type: Copy, dependsOn: downloadResources) {
from project.zipTree(downloadResources.dest);
into "$buildDir/docs/spring-docs-resources/"
}
asciidoctorj {
version = '2.4.1'
fatalWarnings ".*"
options doctype: 'book', eruby: 'erubis'
attributes 'icons': 'font',
'idprefix': '',
'idseparator': '-',
docinfo: '',
attributes([
icons: 'font',
idprefix: '',
idseparator: '-',
docinfo: 'shared',
revnumber: project.version,
sectanchors: '',
sectnums: '',
'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend
stylesdir: 'stylesheets/',
stylesheet: 'main.css',
'source-highlighter': 'highlight.js',
highlightjsdir: 'js/highlight',
'highlightjs-theme': 'googlecode',
stylesdir: 'css/',
stylesheet: 'stylesheet.css',
'spring-version': project.version
])
}
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'dokka']) {
/**
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
* in "build/docs/ref-docs/html5".
*/
asciidoctor {
baseDirFollowsSourceDir()
configurations 'asciidoctorExt'
sources {
include '*.adoc'
}
outputDir "$buildDir/docs/ref-docs/html5"
logDocuments = true
resources {
from(sourceDir) {
include 'images/*.png', 'css/**', 'js/**'
}
from extractDocResources
}
}
/**
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
* in "build/docs/ref-docs/pdf".
*/
asciidoctorPdf {
baseDirFollowsSourceDir()
configurations 'asciidoctorExt'
sources {
include '*.adoc'
}
outputDir "$buildDir/docs/ref-docs/pdf"
logDocuments = true
}
/**
* Zip all docs (API and reference) into a single archive
*/
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', 'dokka']) {
group = "Distribution"
baseName = "spring-framework"
classifier = "docs"
description = "Builds -${classifier} archive containing api and reference " +
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at https://docs.spring.io/spring-framework/docs."
archiveBaseName.set("spring-framework")
archiveClassifier.set("docs")
from("src/dist") {
include "changelog.txt"
}
from (api) {
into "javadoc-api"
}
from ("$asciidoctor.outputDir/html5") {
into "spring-framework-reference"
from ("$asciidoctor.outputDir") {
into "reference/html"
}
from ("$asciidoctor.outputDir/pdf") {
into "spring-framework-reference/pdf"
from ("$asciidoctorPdf.outputDir") {
into "reference/pdf"
}
from (dokka) {
into "kdoc-api"
}
}
/**
* Zip all Spring Framework schemas into a single archive
*/
task schemaZip(type: Zip) {
group = "Distribution"
baseName = "spring-framework"
classifier = "schema"
description = "Builds -${classifier} archive containing all " +
archiveBaseName.set("spring-framework")
archiveClassifier.set("schema")
description = "Builds -${archiveClassifier} archive containing all " +
"XSDs for deployment at https://springframework.org/schema."
duplicatesStrategy 'exclude'
moduleProjects.each { subproject ->
duplicatesStrategy DuplicatesStrategy.EXCLUDE
moduleProjects.each { module ->
def Properties schemas = new Properties();
subproject.sourceSets.main.resources.find {
it.path.endsWith("META-INF/spring.schemas")
module.sourceSets.main.resources.find {
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
assert shortName != key
File xsdFile = subproject.sourceSets.main.resources.find {
it.path.endsWith(schemas.get(key))
File xsdFile = module.sourceSets.main.resources.find {
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
}
assert xsdFile != null
into (shortName) {
@@ -166,15 +239,18 @@ task schemaZip(type: Zip) {
}
}
/**
* Create a distribution zip with everything:
* docs, schemas, jars, source jars, javadoc jars
*/
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = "Distribution"
baseName = "spring-framework"
classifier = "dist"
description = "Builds -${classifier} archive, containing all jars and docs, " +
archiveBaseName.set("spring-framework")
archiveClassifier.set("dist")
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${baseName}-${project.version}";
ext.baseDir = "spring-framework-${project.version}";
from("src/docs/dist") {
include "readme.txt"
@@ -192,49 +268,17 @@ task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
into "${baseDir}/schema"
}
moduleProjects.each { subproject ->
moduleProjects.each { module ->
into ("${baseDir}/libs") {
from subproject.jar
if (subproject.tasks.findByPath("sourcesJar")) {
from subproject.sourcesJar
from module.jar
if (module.tasks.findByPath("sourcesJar")) {
from module.sourcesJar
}
if (subproject.tasks.findByPath("javadocJar")) {
from subproject.javadocJar
if (module.tasks.findByPath("javadocJar")) {
from module.javadocJar
}
}
}
}
distZip.mustRunAfter subprojects.test
// Create a distribution that contains all dependencies (required and optional).
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = "Distribution"
baseName = "spring-framework"
classifier = "dist-with-deps"
description = "Builds -${classifier} archive, containing everything " +
"in the -${distZip.classifier} archive plus all runtime dependencies."
from zipTree(distZip.archivePath)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectNames = rootProject.subprojects*.name
def artifacts = new HashSet()
subprojects.each { subproject ->
(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
distZip.mustRunAfter moduleProjects.check
+1 -3
View File
@@ -1,9 +1,7 @@
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
import org.gradle.plugins.ide.eclipse.model.SourceFolder
apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"
apply plugin: "eclipse"
eclipse.jdt {
sourceCompatibility = 1.8
-76
View File
@@ -1,76 +0,0 @@
/**
* Generate a JDiff report between the current version and an older version.
*
* Usage:
* gradle jdiff -D OLD_VERSION=3.1.3.RELEASE -D OLD_VERSION_ROOT=/path/to/3.1.3.RELEASE
*
* View generated report at:
* build/reports/jdiff/changes.html
*
* @param OLD_VERSION required
* @param OLD_VERSION_ROOT required, typically pointing to a separate git clone dir
*/
task jdiff {
description = "Generates a JDiff report"
group = "Documentation"
def jdiffHome = "${rootProject.rootDir}/gradle/jdiff"
ant.taskdef(
name: "jdiff",
classname: "jdiff.JDiffAntTask",
classpath: "${jdiffHome}/antjdiff.jar")
def currentVersion = rootProject.version
def currentVersionRoot = rootProject.rootDir
def oldVersion = System.getProperty("OLD_VERSION")
def oldVersionRoot = System.getProperty("OLD_VERSION_ROOT")
def outputDir = "${rootProject.buildDir}/reports/jdiff/${oldVersion}_to_${currentVersion}"
doLast {
if (oldVersion == null)
throw new IllegalArgumentException(
"Set OLD_VERSION property to indicate older of the two versions being compared")
if (oldVersionRoot == null)
throw new IllegalArgumentException(
"Set OLD_VERSION_ROOT property to indicate the root directory for ${oldVersion}")
oldVersionRoot = new File(oldVersionRoot)
ant.property(name: "JDIFF_HOME", value: jdiffHome)
ant.mkdir(dir: outputDir)
ant.jdiff(
destdir: outputDir,
source: "1.8",
verbose: "off",
stats: "on",
docchanges: "off") {
old(name: "Spring Framework ${oldVersion}") {
oldVersionRoot.eachDirMatch( {
def candidate = new File(it)
candidate.name.matches("org.springframework.*") ||
candidate.name.matches("spring-.*") }) { match ->
match.eachDirRecurse { subdir ->
if (subdir.path ==~ '.*/src/main/java$') {
dirset(dir: subdir.path, includes: "org/**")
}
}
}
}
"new"(name: "Spring Framework ${currentVersion}") {
currentVersionRoot.eachDirMatch( {
def candidate = new File(it)
candidate.name.matches("org.springframework.*") ||
candidate.name.matches("spring-.*") }) { match ->
match.eachDirRecurse { subdir ->
if (subdir.path ==~ '.*/src/main/java$') {
dirset(dir: subdir.path, includes: "org/**")
}
}
}
}
}
}
}
-506
View File
@@ -1,506 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
-9
View File
@@ -1,9 +0,0 @@
/**
* This class is used only as a "null" argument for Javadoc when comparing
* two API files. Javadoc has to have a package, .java or .class file as an
* argument, even though JDiff doesn't use it.
*/
public class Null {
public Null() {
}
}
-6
View File
@@ -1,6 +0,0 @@
This distribution of JDiff 1.1.1 is included in the Spring Framework build
because JDiff has a hard requirement on a JDIFF_HOME directory containing
jdiff.jar and xerces.jar as well as other presentation resources.
The actual generation of JDiff reports is driven by the `jdiff` task declared
in build.gradle in the project root.
-59
View File
@@ -1,59 +0,0 @@
JDiff Doclet
------------
Matthew Doar
mdoar@pobox.com
The JDiff doclet is used to generate a report describing the
difference between two public Java APIs.
The file jdiff.html contains the reference page for JDiff. The latest
version of JDiff can be downloaded at:
https://sourceforge.net/projects/javadiff
To use the Ant task on your own project, see example.xml. More examples
of using JDiff to compare the public APIs of J2SE1.3 and J2SE1.4 can
be seen at http://www.jdiff.org
For an example with the source distribution, run "ant" and
look at the HTML output in ./build/reports/example/changes.html
The page at ./build/reports/example/changes/com.acme.sp.SPImpl.html
shows what a typical page of changes looks like.
System Requirements
-------------------
JDiff has been tested with all releases of Java since J2SE1.2 but
releases of JDiff after 1.10.0 focus on JDK1.5.
License
-------
JDiff is licensed under the Lesser GNU General Public License (LGPL).
See the file LICENSE.txt.
Acknowledgements
----------------
JDiff uses Stuart D. Gathman's Java translation of Gene Myers' O(ND)
difference algorithm.
JDiff uses Xerces 1.4.2 from https://www.apache.org.
JDiff also includes a script to use the classdoc application from
http://classdoc.sourceforge.net or http://www.jensgulden.de, by Jens
Gulden, (mail@jensgulden.de), to call a doclet such as jdiff on a .jar
file rather than on source.
Many thanks to the reviewers at Sun and Vitria who gave feedback on early
versions of JDiff output, and also to the distillers of Laphroaig, and to
Arturo Fuente for his consistently fine cigars which helped inspire
much of this work.
Footnote:
If you are looking for a generalized diff tool for XML, try diffmk from
https://wwws.sun.com/software/xml/developers/diffmk/
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.
+64
View File
@@ -0,0 +1,64 @@
apply plugin: "maven-publish"
publishing {
publications {
mavenJava(MavenPublication) {
pom {
afterEvaluate {
name = project.description
description = project.description
}
url = "https://github.com/spring-projects/spring-framework"
organization {
name = "Spring IO"
url = "https://spring.io/projects/spring-framework"
}
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0"
distribution = "repo"
}
}
scm {
url = "https://github.com/spring-projects/spring-framework"
connection = "scm:git:git://github.com/spring-projects/spring-framework"
developerConnection = "scm:git:git://github.com/spring-projects/spring-framework"
}
developers {
developer {
id = "jhoeller"
name = "Juergen Hoeller"
email = "jhoeller@pivotal.io"
}
}
issueManagement {
system = "GitHub"
url = "https://github.com/spring-projects/spring-framework/issues"
}
}
versionMapping {
usage('java-api') {
fromResolutionResult()
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
}
configureDeploymentRepository(project)
void configureDeploymentRepository(Project project) {
project.plugins.withType(MavenPublishPlugin.class).all {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
if (project.hasProperty("deploymentRepository")) {
publishing.repositories.maven {
it.url = project.property("deploymentRepository")
it.name = "deployment"
}
}
}
}
-60
View File
@@ -1,60 +0,0 @@
apply plugin: "propdeps-maven"
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == "test"
}
// sort to make pom dependencies order consistent to ease comparison of older poms
generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
"$dep.scope:$dep.groupId:$dep.artifactId"
}
def managedVersions = dependencyManagement.managedVersions
generatedPom.dependencies.findAll{dep -> !dep.version }.each { dep ->
dep.version = managedVersions["${dep.groupId}:${dep.artifactId}"]
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = "https://github.com/spring-projects/spring-framework"
organization {
name = "Spring IO"
url = "https://projects.spring.io/spring-framework"
}
licenses {
license {
name "Apache License, Version 2.0"
url "https://www.apache.org/licenses/LICENSE-2.0"
distribution "repo"
}
}
scm {
url = "https://github.com/spring-projects/spring-framework"
connection = "scm:git:git://github.com/spring-projects/spring-framework"
developerConnection = "scm:git:git://github.com/spring-projects/spring-framework"
}
developers {
developer {
id = "jhoeller"
name = "Juergen Hoeller"
email = "jhoeller@pivotal.io"
}
}
issueManagement {
system = "GitHub"
url = "https://github.com/spring-projects/spring-framework/issues"
}
}
}
}
+77
View File
@@ -0,0 +1,77 @@
apply plugin: 'org.springframework.build.compile'
apply plugin: 'org.springframework.build.optional-dependencies'
apply plugin: 'me.champeau.gradle.jmh'
apply from: "$rootDir/gradle/publications.gradle"
dependencies {
jmh 'org.openjdk.jmh:jmh-core:1.23'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.23'
jmh 'net.sf.jopt-simple:jopt-simple:4.6'
}
jmh {
duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE
}
jar {
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
manifest.attributes["Automatic-Module-Name"] = project.name.replace('-', '.') // for Jigsaw
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
from("${rootDir}/src/docs/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
normalization {
runtimeClasspath {
ignore "META-INF/MANIFEST.MF"
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.encoding = "UTF-8"
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.use = true
options.links(project.ext.javadocLinks)
options.addStringOption("Xdoclint:none", "-quiet")
// Suppress warnings due to cross-module @see and @link references.
// Note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
}
task sourcesJar(type: Jar, dependsOn: classes) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from sourceSets.main.allSource
// Don't include or exclude anything explicitly by default. See SPR-12085.
}
task javadocJar(type: Jar) {
archiveClassifier.set("javadoc")
from javadoc
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
// Disable publication of test fixture artifacts.
components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+33 -21
View File
@@ -1,5 +1,21 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
@@ -28,8 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
GRADLE_OPTS="-XX:MaxMetaspaceSize=1024m -Xmx1024m $GRADLE_OPTS"
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -67,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -110,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@@ -139,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@@ -160,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
Vendored
+24 -20
View File
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -13,16 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set GRADLE_OPTS=-XX:MaxMetaspaceSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -36,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -46,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
+31 -28
View File
@@ -1,46 +1,49 @@
# Spring Framework - Eclipse/STS Project Import Guide
This document will guide you through the process of importing the Spring Framework
projects into Eclipse or the Spring Tool Suite (STS). It is recommended that you have a
recent version of Eclipse or STS. As a bare minimum you will need Eclipse with full Java
8 support, the AspectJ Development Tools (AJDT), and the Groovy Compiler.
projects into Eclipse or the Spring Tool Suite (_STS_). It is recommended that you
have a recent version of Eclipse. As a bare minimum you will need Eclipse with full Java
8 support, Eclipse Buildship, the Kotlin plugin, and the Groovy plugin.
The following instructions have been tested against
[Spring Tool Suite](https://spring.io/tools) (_STS_) 3.9.4 and 4.0.0.M11 with
[Eclipse Buildship](https://projects.eclipse.org/projects/tools.buildship) (Eclipse
Plug-ins for Gradle). The instructions should work with the latest Eclipse distribution
as long as you install
The following instructions have been tested against [STS](https://spring.io/tools) 4.3.2
([download](https://github.com/spring-projects/sts4/wiki/Previous-Versions#spring-tools-432-changelog))
(based on Eclipse 4.12) with [Eclipse Buildship](https://projects.eclipse.org/projects/tools.buildship).
The instructions should work with the latest Eclipse distribution as long as you install
[Buildship](https://marketplace.eclipse.org/content/buildship-gradle-integration). Note
that STS 4 comes with Buildship preinstalled.
## Steps
_Within your locally cloned `spring-framework` working directory:_
_When instructed to execute `./gradlew` from the command line, be sure to execute it within your locally cloned `spring-framework` working directory._
1. Precompile `spring-oxm` with `./gradlew :spring-oxm:compileTestJava`
2. Import into Eclipse (File -> Import -> Gradle -> Existing Gradle Project -> Navigate
to directory -> Select Finish)
3. If prompted, exclude the `spring-aspects` module (or after the import by closing or
deleting the project)
4. In the `spring-oxm` project, add the two folders (`castor` and `jaxb`) in
`build/generated-sources` to the build path (right click on them and select
`Build Path -> Use as Source Folder`)
5. To apply project specific settings run `./gradlew eclipseBuildship`
7. Code away
1. Ensure that Eclipse launches with JDK 8.
- For example, on Mac OS this can be configured in the `Info.plist` file located in the `Contents` folder of the installed Eclipse or STS application (e.g., the `Eclipse.app` file).
1. Install the [Kotlin Plugin for Eclipse](https://marketplace.eclipse.org/content/kotlin-plugin-eclipse) in Eclipse.
1. Install the [Eclipse Groovy Development Tools](https://github.com/groovy/groovy-eclipse/wiki) in Eclipse.
1. Switch to Groovy 2.5 (Preferences -> Groovy -> Compiler -> Switch to 2.5...) in Eclipse.
1. Change the _Forbidden reference (access rule)_ in Eclipse from Error to Warning
(Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rule)).
1. Optionally install the [AspectJ Development Tools](https://marketplace.eclipse.org/content/aspectj-development-tools) (_AJDT_) if you need to work with the `spring-aspects` project. The AspectJ Development Tools available in the Eclipse Marketplace have been tested with these instructions using STS 4.5 (Eclipse 4.14).
1. Optionally install the [TestNG plugin](https://testng.org/doc/eclipse.html) in Eclipse if you need to execute TestNG tests in the `spring-test` module.
1. Build `spring-oxm` from the command line with `./gradlew :spring-oxm:check`.
1. To apply project specific settings, run `./gradlew eclipseBuildship` from the command line.
1. Import into Eclipse (File -> Import -> Gradle -> Existing Gradle Project -> Navigate to the locally cloned `spring-framework` directory -> Select Finish).
- If you have not installed AJDT, exclude the `spring-aspects` project from the import, if prompted, or close it after the import.
- If you run into errors during the import, you may need to set the _Java home_ for Gradle Buildship to the location of your JDK 8 installation in Eclipse (Preferences -> Gradle -> Java home).
1. If you need to execute JAXB-related tests in the `spring-oxm` project and wish to have the generated sources available, add the `build/generated-sources/jaxb` folder to the build path (right click on the `jaxb` folder and select `Build Path -> Use as Source Folder`).
- If you do not see the `build` folder in the `spring-oxm` project, ensure that the "Gradle build folder" is not filtered out from the view. This setting is available under "Filters" in the configuration of the Package Explorer (available by clicking on the small downward facing arrow in the upper right corner of the Package Explorer).
1. Code away!
## Known Issues
1. `spring-core` and `spring-oxm` should be pre-compiled due to repackaged dependencies.
- See `*RepackJar` tasks in the build.
2. `spring-aspects` does not compile due to references to aspect types unknown to Eclipse.
- If you install [AJDT](https://www.eclipse.org/ajdt/downloads/) into Eclipse it should
work.
3. While JUnit tests pass from the command line with Gradle, some may fail when run from
- See `*RepackJar` tasks in the build.
1. `spring-aspects` does not compile due to references to aspect types unknown to Eclipse.
- If you installed _AJDT_ into Eclipse it should work.
1. While JUnit tests pass from the command line with Gradle, some may fail when run from
the IDE.
- Resolving this is a work in progress.
- If attempting to run all JUnit tests from within the IDE, you will likely need to set
the following VM options to avoid out of memory errors:
`-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m`
- Resolving this is a work in progress.
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m`
## Tips
@@ -0,0 +1,30 @@
description = "Spring Integration Tests"
dependencies {
testCompile(project(":spring-aop"))
testCompile(project(":spring-beans"))
testCompile(project(":spring-context"))
testCompile(project(":spring-core"))
testCompile(testFixtures(project(":spring-aop")))
testCompile(testFixtures(project(":spring-beans")))
testCompile(testFixtures(project(":spring-core")))
testCompile(testFixtures(project(":spring-tx")))
testCompile(project(":spring-expression"))
testCompile(project(":spring-jdbc"))
testCompile(project(":spring-orm"))
testCompile(project(":spring-test"))
testCompile(project(":spring-tx"))
testCompile(project(":spring-web"))
testCompile("javax.inject:javax.inject")
testCompile("javax.resource:javax.resource-api")
testCompile("javax.servlet:javax.servlet-api")
testCompile("org.aspectj:aspectjweaver")
testCompile("org.hsqldb:hsqldb")
testCompile("org.hibernate:hibernate-core")
}
normalization {
runtimeClasspath {
ignore "META-INF/MANIFEST.MF"
}
}
@@ -0,0 +1,119 @@
/*
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.config;
import java.util.ArrayList;
import java.util.List;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Integration tests for advice invocation order for advice configured via the
* AOP namespace.
*
* @author Sam Brannen
* @since 5.2.7
* @see org.springframework.aop.framework.autoproxy.AspectJAutoProxyAdviceOrderIntegrationTests
*/
class AopNamespaceHandlerAdviceOrderIntegrationTests {
@Nested
@SpringJUnitConfig(locations = "AopNamespaceHandlerAdviceOrderIntegrationTests-afterFirst.xml")
@DirtiesContext
class AfterAdviceFirstTests {
@Test
void afterAdviceIsInvokedFirst(@Autowired Echo echo, @Autowired InvocationTrackingAspect aspect) throws Exception {
assertThat(aspect.invocations).isEmpty();
assertThat(echo.echo(42)).isEqualTo(42);
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after", "after returning");
aspect.invocations.clear();
assertThatExceptionOfType(Exception.class).isThrownBy(() -> echo.echo(new Exception()));
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after", "after throwing");
}
}
@Nested
@SpringJUnitConfig(locations = "AopNamespaceHandlerAdviceOrderIntegrationTests-afterLast.xml")
@DirtiesContext
class AfterAdviceLastTests {
@Test
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired InvocationTrackingAspect aspect) throws Exception {
assertThat(aspect.invocations).isEmpty();
assertThat(echo.echo(42)).isEqualTo(42);
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after returning", "after");
aspect.invocations.clear();
assertThatExceptionOfType(Exception.class).isThrownBy(() -> echo.echo(new Exception()));
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after throwing", "after");
}
}
static class Echo {
Object echo(Object obj) throws Exception {
if (obj instanceof Exception) {
throw (Exception) obj;
}
return obj;
}
}
static class InvocationTrackingAspect {
List<String> invocations = new ArrayList<>();
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
invocations.add("around - start");
try {
return joinPoint.proceed();
}
finally {
invocations.add("around - end");
}
}
void before() {
invocations.add("before");
}
void afterReturning() {
invocations.add("after returning");
}
void afterThrowing() {
invocations.add("after throwing");
}
void after() {
invocations.add("after");
}
}
}
@@ -0,0 +1,137 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.config;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.testfixture.beans.ITestBean;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.core.testfixture.io.SerializationTestUtils;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for scoped proxy use in conjunction with aop: namespace.
* Deemed an integration test because .web mocks and application contexts are required.
*
* @author Rob Harrop
* @author Juergen Hoeller
* @author Chris Beams
* @see org.springframework.aop.config.AopNamespaceHandlerTests
*/
@SpringJUnitWebConfig
class AopNamespaceHandlerScopeIntegrationTests {
@Autowired
ITestBean singletonScoped;
@Autowired
ITestBean requestScoped;
@Autowired
ITestBean sessionScoped;
@Autowired
ITestBean sessionScopedAlias;
@Autowired
ITestBean testBean;
@Test
void testSingletonScoping() throws Exception {
assertThat(AopUtils.isAopProxy(singletonScoped)).as("Should be AOP proxy").isTrue();
boolean condition = singletonScoped instanceof TestBean;
assertThat(condition).as("Should be target class proxy").isTrue();
String rob = "Rob Harrop";
String bram = "Bram Smeets";
assertThat(singletonScoped.getName()).isEqualTo(rob);
singletonScoped.setName(bram);
assertThat(singletonScoped.getName()).isEqualTo(bram);
ITestBean deserialized = SerializationTestUtils.serializeAndDeserialize(singletonScoped);
assertThat(deserialized.getName()).isEqualTo(bram);
}
@Test
void testRequestScoping() throws Exception {
MockHttpServletRequest oldRequest = new MockHttpServletRequest();
MockHttpServletRequest newRequest = new MockHttpServletRequest();
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(oldRequest));
assertThat(AopUtils.isAopProxy(requestScoped)).as("Should be AOP proxy").isTrue();
boolean condition = requestScoped instanceof TestBean;
assertThat(condition).as("Should be target class proxy").isTrue();
assertThat(AopUtils.isAopProxy(testBean)).as("Should be AOP proxy").isTrue();
boolean condition1 = testBean instanceof TestBean;
assertThat(condition1).as("Regular bean should be JDK proxy").isFalse();
String rob = "Rob Harrop";
String bram = "Bram Smeets";
assertThat(requestScoped.getName()).isEqualTo(rob);
requestScoped.setName(bram);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(newRequest));
assertThat(requestScoped.getName()).isEqualTo(rob);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(oldRequest));
assertThat(requestScoped.getName()).isEqualTo(bram);
assertThat(((Advised) requestScoped).getAdvisors().length > 0).as("Should have advisors").isTrue();
}
@Test
void testSessionScoping() throws Exception {
MockHttpSession oldSession = new MockHttpSession();
MockHttpSession newSession = new MockHttpSession();
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(oldSession);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
assertThat(AopUtils.isAopProxy(sessionScoped)).as("Should be AOP proxy").isTrue();
boolean condition1 = sessionScoped instanceof TestBean;
assertThat(condition1).as("Should not be target class proxy").isFalse();
assertThat(sessionScopedAlias).isSameAs(sessionScoped);
assertThat(AopUtils.isAopProxy(testBean)).as("Should be AOP proxy").isTrue();
boolean condition = testBean instanceof TestBean;
assertThat(condition).as("Regular bean should be JDK proxy").isFalse();
String rob = "Rob Harrop";
String bram = "Bram Smeets";
assertThat(sessionScoped.getName()).isEqualTo(rob);
sessionScoped.setName(bram);
request.setSession(newSession);
assertThat(sessionScoped.getName()).isEqualTo(rob);
request.setSession(oldSession);
assertThat(sessionScoped.getName()).isEqualTo(bram);
assertThat(((Advised) sessionScoped).getAdvisors().length > 0).as("Should have advisors").isTrue();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,23 +22,23 @@ import java.util.List;
import javax.servlet.ServletException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.aop.testfixture.advice.CountingBeforeAdvice;
import org.springframework.aop.testfixture.advice.MethodCounter;
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.testfixture.beans.ITestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.lang.Nullable;
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
import org.springframework.tests.aop.advice.MethodCounter;
import org.springframework.tests.aop.interceptor.NopInterceptor;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.transaction.CallCountingTransactionManager;
import org.springframework.transaction.NoTransactionException;
import org.springframework.transaction.interceptor.TransactionInterceptor;
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for auto proxy creation by advisor recognition working in
@@ -49,7 +49,7 @@ import static org.junit.Assert.*;
* @author Rod Johnson
* @author Chris Beams
*/
public class AdvisorAutoProxyCreatorIntegrationTests {
class AdvisorAutoProxyCreatorIntegrationTests {
private static final Class<?> CLASS = AdvisorAutoProxyCreatorIntegrationTests.class;
private static final String CLASSNAME = CLASS.getSimpleName();
@@ -67,95 +67,95 @@ public class AdvisorAutoProxyCreatorIntegrationTests {
}
@Test
public void testDefaultExclusionPrefix() throws Exception {
void testDefaultExclusionPrefix() throws Exception {
DefaultAdvisorAutoProxyCreator aapc = (DefaultAdvisorAutoProxyCreator) getBeanFactory().getBean(ADVISOR_APC_BEAN_NAME);
assertEquals(ADVISOR_APC_BEAN_NAME + DefaultAdvisorAutoProxyCreator.SEPARATOR, aapc.getAdvisorBeanNamePrefix());
assertFalse(aapc.isUsePrefix());
assertThat(aapc.getAdvisorBeanNamePrefix()).isEqualTo((ADVISOR_APC_BEAN_NAME + DefaultAdvisorAutoProxyCreator.SEPARATOR));
assertThat(aapc.isUsePrefix()).isFalse();
}
/**
* If no pointcuts match (no attrs) there should be proxying.
*/
@Test
public void testNoProxy() throws Exception {
void testNoProxy() throws Exception {
BeanFactory bf = getBeanFactory();
Object o = bf.getBean("noSetters");
assertFalse(AopUtils.isAopProxy(o));
assertThat(AopUtils.isAopProxy(o)).isFalse();
}
@Test
public void testTxIsProxied() throws Exception {
void testTxIsProxied() throws Exception {
BeanFactory bf = getBeanFactory();
ITestBean test = (ITestBean) bf.getBean("test");
assertTrue(AopUtils.isAopProxy(test));
assertThat(AopUtils.isAopProxy(test)).isTrue();
}
@Test
public void testRegexpApplied() throws Exception {
void testRegexpApplied() throws Exception {
BeanFactory bf = getBeanFactory();
ITestBean test = (ITestBean) bf.getBean("test");
MethodCounter counter = (MethodCounter) bf.getBean("countingAdvice");
assertEquals(0, counter.getCalls());
assertThat(counter.getCalls()).isEqualTo(0);
test.getName();
assertEquals(1, counter.getCalls());
assertThat(counter.getCalls()).isEqualTo(1);
}
@Test
public void testTransactionAttributeOnMethod() throws Exception {
void testTransactionAttributeOnMethod() throws Exception {
BeanFactory bf = getBeanFactory();
ITestBean test = (ITestBean) bf.getBean("test");
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
OrderedTxCheckAdvisor txc = (OrderedTxCheckAdvisor) bf.getBean("orderedBeforeTransaction");
assertEquals(0, txc.getCountingBeforeAdvice().getCalls());
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
assertEquals(0, txMan.commits);
assertEquals("Initial value was correct", 4, test.getAge());
assertThat(txMan.commits).isEqualTo(0);
assertThat(test.getAge()).as("Initial value was correct").isEqualTo(4);
int newAge = 5;
test.setAge(newAge);
assertEquals(1, txc.getCountingBeforeAdvice().getCalls());
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(1);
assertEquals("New value set correctly", newAge, test.getAge());
assertEquals("Transaction counts match", 1, txMan.commits);
assertThat(test.getAge()).as("New value set correctly").isEqualTo(newAge);
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
}
/**
* Should not roll back on servlet exception.
*/
@Test
public void testRollbackRulesOnMethodCauseRollback() throws Exception {
void testRollbackRulesOnMethodCauseRollback() throws Exception {
BeanFactory bf = getBeanFactory();
Rollback rb = (Rollback) bf.getBean("rollback");
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
OrderedTxCheckAdvisor txc = (OrderedTxCheckAdvisor) bf.getBean("orderedBeforeTransaction");
assertEquals(0, txc.getCountingBeforeAdvice().getCalls());
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
assertEquals(0, txMan.commits);
assertThat(txMan.commits).isEqualTo(0);
rb.echoException(null);
// Fires only on setters
assertEquals(0, txc.getCountingBeforeAdvice().getCalls());
assertEquals("Transaction counts match", 1, txMan.commits);
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
assertEquals(0, txMan.rollbacks);
assertThat(txMan.rollbacks).isEqualTo(0);
Exception ex = new Exception();
try {
rb.echoException(ex);
}
catch (Exception actual) {
assertEquals(ex, actual);
assertThat(actual).isEqualTo(ex);
}
assertEquals("Transaction counts match", 1, txMan.rollbacks);
assertThat(txMan.rollbacks).as("Transaction counts match").isEqualTo(1);
}
@Test
public void testRollbackRulesOnMethodPreventRollback() throws Exception {
void testRollbackRulesOnMethodPreventRollback() throws Exception {
BeanFactory bf = getBeanFactory();
Rollback rb = (Rollback) bf.getBean("rollback");
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
assertEquals(0, txMan.commits);
assertThat(txMan.commits).isEqualTo(0);
// Should NOT roll back on ServletException
try {
rb.echoException(new ServletException());
@@ -163,25 +163,26 @@ public class AdvisorAutoProxyCreatorIntegrationTests {
catch (ServletException ex) {
}
assertEquals("Transaction counts match", 1, txMan.commits);
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
}
@Test
public void testProgrammaticRollback() throws Exception {
void testProgrammaticRollback() throws Exception {
BeanFactory bf = getBeanFactory();
Object bean = bf.getBean(TXMANAGER_BEAN_NAME);
assertTrue(bean instanceof CallCountingTransactionManager);
boolean condition = bean instanceof CallCountingTransactionManager;
assertThat(condition).isTrue();
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
Rollback rb = (Rollback) bf.getBean("rollback");
assertEquals(0, txMan.commits);
assertThat(txMan.commits).isEqualTo(0);
rb.rollbackOnly(false);
assertEquals("Transaction counts match", 1, txMan.commits);
assertEquals(0, txMan.rollbacks);
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
assertThat(txMan.rollbacks).isEqualTo(0);
// Will cause rollback only
rb.rollbackOnly(true);
assertEquals(1, txMan.rollbacks);
assertThat(txMan.rollbacks).isEqualTo(1);
}
}
@@ -289,7 +290,6 @@ class Rollback {
/**
* Inherits transaction attribute.
* Illustrates programmatic rollback.
* @param rollbackOnly
*/
public void rollbackOnly(boolean rollbackOnly) {
if (rollbackOnly) {
@@ -310,8 +310,9 @@ class Rollback {
* @org.springframework.transaction.interceptor.NoRollbackRule ( "ServletException" )
*/
public void echoException(Exception ex) throws Exception {
if (ex != null)
if (ex != null) {
throw ex;
}
}
}
@@ -0,0 +1,233 @@
/*
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.framework.autoproxy;
import java.util.ArrayList;
import java.util.List;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Integration tests for advice invocation order for advice configured via
* AspectJ auto-proxy support.
*
* @author Sam Brannen
* @since 5.2.7
* @see org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests
*/
class AspectJAutoProxyAdviceOrderIntegrationTests {
/**
* {@link After @After} advice declared as first <em>after</em> method in source code.
*/
@Nested
@SpringJUnitConfig(AfterAdviceFirstConfig.class)
@DirtiesContext
class AfterAdviceFirstTests {
@Test
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired AfterAdviceFirstAspect aspect) throws Exception {
assertThat(aspect.invocations).isEmpty();
assertThat(echo.echo(42)).isEqualTo(42);
assertThat(aspect.invocations).containsExactly("around - start", "before", "after returning", "after", "around - end");
aspect.invocations.clear();
assertThatExceptionOfType(Exception.class).isThrownBy(
() -> echo.echo(new Exception()));
assertThat(aspect.invocations).containsExactly("around - start", "before", "after throwing", "after", "around - end");
}
}
/**
* This test class uses {@link AfterAdviceLastAspect} which declares its
* {@link After @After} advice as the last <em>after advice type</em> method
* in its source code.
*
* <p>On Java versions prior to JDK 7, we would have expected the {@code @After}
* advice method to be invoked before {@code @AfterThrowing} and
* {@code @AfterReturning} advice methods due to the AspectJ precedence
* rules implemented in
* {@link org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator}.
*/
@Nested
@SpringJUnitConfig(AfterAdviceLastConfig.class)
@DirtiesContext
class AfterAdviceLastTests {
@Test
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired AfterAdviceLastAspect aspect) throws Exception {
assertThat(aspect.invocations).isEmpty();
assertThat(echo.echo(42)).isEqualTo(42);
assertThat(aspect.invocations).containsExactly("around - start", "before", "after returning", "after", "around - end");
aspect.invocations.clear();
assertThatExceptionOfType(Exception.class).isThrownBy(
() -> echo.echo(new Exception()));
assertThat(aspect.invocations).containsExactly("around - start", "before", "after throwing", "after", "around - end");
}
}
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class AfterAdviceFirstConfig {
@Bean
AfterAdviceFirstAspect echoAspect() {
return new AfterAdviceFirstAspect();
}
@Bean
Echo echo() {
return new Echo();
}
}
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class AfterAdviceLastConfig {
@Bean
AfterAdviceLastAspect echoAspect() {
return new AfterAdviceLastAspect();
}
@Bean
Echo echo() {
return new Echo();
}
}
static class Echo {
Object echo(Object obj) throws Exception {
if (obj instanceof Exception) {
throw (Exception) obj;
}
return obj;
}
}
/**
* {@link After @After} advice declared as first <em>after</em> method in source code.
*/
@Aspect
static class AfterAdviceFirstAspect {
List<String> invocations = new ArrayList<>();
@Pointcut("execution(* echo(*))")
void echo() {
}
@After("echo()")
void after() {
invocations.add("after");
}
@AfterReturning("echo()")
void afterReturning() {
invocations.add("after returning");
}
@AfterThrowing("echo()")
void afterThrowing() {
invocations.add("after throwing");
}
@Before("echo()")
void before() {
invocations.add("before");
}
@Around("echo()")
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
invocations.add("around - start");
try {
return joinPoint.proceed();
}
finally {
invocations.add("around - end");
}
}
}
/**
* {@link After @After} advice declared as last <em>after</em> method in source code.
*/
@Aspect
static class AfterAdviceLastAspect {
List<String> invocations = new ArrayList<>();
@Pointcut("execution(* echo(*))")
void echo() {
}
@Around("echo()")
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
invocations.add("around - start");
try {
return joinPoint.proceed();
}
finally {
invocations.add("around - end");
}
}
@Before("echo()")
void before() {
invocations.add("before");
}
@AfterReturning("echo()")
void afterReturning() {
invocations.add("after returning");
}
@AfterThrowing("echo()")
void afterThrowing() {
invocations.add("after throwing");
}
@After("echo()")
void after() {
invocations.add("after");
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,12 +14,13 @@
* limitations under the License.
*/
package com.foo;
package org.springframework.beans.factory.xml;
import java.util.ArrayList;
import java.util.List;
public class Component {
private String name;
private List<Component> components = new ArrayList<>();
@@ -39,4 +40,5 @@ public class Component {
public void setName(String name) {
this.name = name;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.foo;
package org.springframework.beans.factory.xml;
import java.util.List;
@@ -24,8 +24,6 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.CollectionUtils;
import org.springframework.util.xml.DomUtils;
@@ -0,0 +1,81 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.xml;
import java.util.List;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Costin Leau
*/
@TestInstance(Lifecycle.PER_CLASS)
class ComponentBeanDefinitionParserTests {
private final DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
@BeforeAll
void setUp() throws Exception {
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
new ClassPathResource("component-config.xml", ComponentBeanDefinitionParserTests.class));
}
@AfterAll
void tearDown() {
bf.destroySingletons();
}
@Test
void testBionicBasic() {
Component cp = getBionicFamily();
assertThat("Bionic-1").isEqualTo(cp.getName());
}
@Test
void testBionicFirstLevelChildren() {
Component cp = getBionicFamily();
List<Component> components = cp.getComponents();
assertThat(2).isEqualTo(components.size());
assertThat("Mother-1").isEqualTo(components.get(0).getName());
assertThat("Rock-1").isEqualTo(components.get(1).getName());
}
@Test
void testBionicSecondLevelChildren() {
Component cp = getBionicFamily();
List<Component> components = cp.getComponents().get(0).getComponents();
assertThat(2).isEqualTo(components.size());
assertThat("Karate-1").isEqualTo(components.get(0).getName());
assertThat("Sport-1").isEqualTo(components.get(1).getName());
}
private Component getBionicFamily() {
return bf.getBean("bionic-family", Component.class);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,13 +14,14 @@
* limitations under the License.
*/
package com.foo;
package org.springframework.beans.factory.xml;
import java.util.List;
import org.springframework.beans.factory.FactoryBean;
public class ComponentFactoryBean implements FactoryBean<Component> {
private Component parent;
private List<Component> children;
@@ -51,4 +52,5 @@ public class ComponentFactoryBean implements FactoryBean<Component> {
public boolean isSingleton() {
return true;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
* limitations under the License.
*/
package com.foo;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
package org.springframework.beans.factory.xml;
public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
@Override
public void init() {
registerBeanDefinitionParser("component",
new ComponentBeanDefinitionParser());
registerBeanDefinitionParser("component", new ComponentBeanDefinitionParser());
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ package org.springframework.cache.annotation;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.Advisor;
import org.springframework.aop.framework.Advised;
@@ -33,8 +33,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Repository;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Integration tests for the @EnableCaching annotation.
@@ -43,47 +43,45 @@ import static org.junit.Assert.*;
* @since 3.1
*/
@SuppressWarnings("resource")
public class EnableCachingIntegrationTests {
class EnableCachingIntegrationTests {
@Test
public void repositoryIsClassBasedCacheProxy() {
void repositoryIsClassBasedCacheProxy() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, ProxyTargetClassCachingConfig.class);
ctx.refresh();
assertCacheProxying(ctx);
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class)), is(true));
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class))).isTrue();
}
@Test
public void repositoryUsesAspectJAdviceMode() {
void repositoryUsesAspectJAdviceMode() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, AspectJCacheConfig.class);
try {
ctx.refresh();
}
catch (Exception ex) {
// this test is a bit fragile, but gets the job done, proving that an
// attempt was made to look up the AJ aspect. It's due to classpath issues
// in .integration-tests that it's not found.
assertTrue(ex.getMessage().contains("AspectJCachingConfiguration"));
}
// this test is a bit fragile, but gets the job done, proving that an
// attempt was made to look up the AJ aspect. It's due to classpath issues
// in .integration-tests that it's not found.
assertThatExceptionOfType(Exception.class).isThrownBy(
ctx::refresh)
.withMessageContaining("AspectJCachingConfiguration");
}
private void assertCacheProxying(AnnotationConfigApplicationContext ctx) {
FooRepository repo = ctx.getBean(FooRepository.class);
assertThat(isCacheProxy(repo)).isTrue();
}
boolean isCacheProxy = false;
private boolean isCacheProxy(FooRepository repo) {
if (AopUtils.isAopProxy(repo)) {
for (Advisor advisor : ((Advised)repo).getAdvisors()) {
if (advisor instanceof BeanFactoryCacheOperationSourceAdvisor) {
isCacheProxy = true;
break;
return true;
}
}
}
assertTrue("FooRepository is not a cache proxy", isCacheProxy);
return false;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,10 +24,9 @@ import java.lang.annotation.Target;
import javax.inject.Named;
import javax.inject.Singleton;
import org.junit.After;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
@@ -43,12 +42,14 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.support.GenericWebApplicationContext;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Mark Fisher
* @author Juergen Hoeller
* @author Chris Beams
*/
public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
private static final String DEFAULT_NAME = "default";
@@ -63,8 +64,8 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
private ServletRequestAttributes newRequestAttributesWithSession;
@Before
public void setUp() {
@BeforeEach
void setup() {
this.oldRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
this.newRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
@@ -77,223 +78,228 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
this.newRequestAttributesWithSession = new ServletRequestAttributes(newRequestWithSession);
}
@After
public void tearDown() throws Exception {
@AfterEach
void reset() {
RequestContextHolder.setRequestAttributes(null);
}
@Test
public void testPrototype() {
void testPrototype() {
ApplicationContext context = createContext(ScopedProxyMode.NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("prototype");
assertNotNull(bean);
assertTrue(context.isPrototype("prototype"));
assertFalse(context.isSingleton("prototype"));
assertThat(bean).isNotNull();
assertThat(context.isPrototype("prototype")).isTrue();
assertThat(context.isSingleton("prototype")).isFalse();
}
@Test
public void testSingletonScopeWithNoProxy() {
void testSingletonScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
assertTrue(context.isSingleton("singleton"));
assertFalse(context.isPrototype("singleton"));
assertThat(context.isSingleton("singleton")).isTrue();
assertThat(context.isPrototype("singleton")).isFalse();
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testSingletonScopeIgnoresProxyInterfaces() {
void testSingletonScopeIgnoresProxyInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testSingletonScopeIgnoresProxyTargetClass() {
void testSingletonScopeIgnoresProxyTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testRequestScopeWithNoProxy() {
void testRequestScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("request");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// but a newly retrieved bean should have the default name
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("request");
assertEquals(DEFAULT_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
}
@Test
public void testRequestScopeWithProxiedInterfaces() {
void testRequestScopeWithProxiedInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
// should be dynamic proxy, implementing both interfaces
assertTrue(AopUtils.isJdkDynamicProxy(bean));
assertTrue(bean instanceof AnotherScopeTestInterface);
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
boolean condition = bean instanceof AnotherScopeTestInterface;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testRequestScopeWithProxiedTargetClass() {
void testRequestScopeWithProxiedTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
// should be a class-based proxy
assertTrue(AopUtils.isCglibProxy(bean));
assertTrue(bean instanceof RequestScopedTestBean);
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
boolean condition = bean instanceof RequestScopedTestBean;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testSessionScopeWithNoProxy() {
void testSessionScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(ScopedProxyMode.NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("session");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// but a newly retrieved bean should have the default name
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("session");
assertEquals(DEFAULT_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
}
@Test
public void testSessionScopeWithProxiedInterfaces() {
void testSessionScopeWithProxiedInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
// should be dynamic proxy, implementing both interfaces
assertTrue(AopUtils.isJdkDynamicProxy(bean));
assertTrue(bean instanceof AnotherScopeTestInterface);
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
boolean condition = bean instanceof AnotherScopeTestInterface;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
bean2.setName(DEFAULT_NAME);
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void testSessionScopeWithProxiedTargetClass() {
void testSessionScopeWithProxiedTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
// should be a class-based proxy
assertTrue(AopUtils.isCglibProxy(bean));
assertTrue(bean instanceof ScopedTestBean);
assertTrue(bean instanceof SessionScopedTestBean);
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
boolean condition1 = bean instanceof ScopedTestBean;
assertThat(condition1).isTrue();
boolean condition = bean instanceof SessionScopedTestBean;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
bean2.setName(DEFAULT_NAME);
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@@ -336,7 +342,7 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
}
public static interface IScopedTestBean {
public interface IScopedTestBean {
String getName();
@@ -367,7 +373,7 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
}
public static interface AnotherScopeTestInterface {
public interface AnotherScopeTestInterface {
}
@@ -386,14 +392,14 @@ public class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@javax.inject.Scope
public static @interface RequestScoped {
public @interface RequestScoped {
}
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@javax.inject.Scope
public static @interface SessionScoped {
public @interface SessionScoped {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@
package org.springframework.context.annotation.scope;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.ApplicationContext;
@@ -33,9 +33,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.support.GenericWebApplicationContext;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.context.annotation.ScopedProxyMode.DEFAULT;
import static org.springframework.context.annotation.ScopedProxyMode.INTERFACES;
import static org.springframework.context.annotation.ScopedProxyMode.NO;
@@ -47,7 +45,7 @@ import static org.springframework.context.annotation.ScopedProxyMode.TARGET_CLAS
* @author Chris Beams
* @author Sam Brannen
*/
public class ClassPathBeanDefinitionScannerScopeIntegrationTests {
class ClassPathBeanDefinitionScannerScopeIntegrationTests {
private static final String DEFAULT_NAME = "default";
private static final String MODIFIED_NAME = "modified";
@@ -59,8 +57,8 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests {
private ServletRequestAttributes newRequestAttributesWithSession;
@Before
public void setUp() {
@BeforeEach
void setup() {
MockHttpServletRequest oldRequestWithSession = new MockHttpServletRequest();
oldRequestWithSession.setSession(new MockHttpSession());
this.oldRequestAttributesWithSession = new ServletRequestAttributes(oldRequestWithSession);
@@ -70,212 +68,217 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests {
this.newRequestAttributesWithSession = new ServletRequestAttributes(newRequestWithSession);
}
@After
public void tearDown() throws Exception {
@AfterEach
void reset() {
RequestContextHolder.resetRequestAttributes();
}
@Test
public void singletonScopeWithNoProxy() {
void singletonScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void singletonScopeIgnoresProxyInterfaces() {
void singletonScopeIgnoresProxyInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(INTERFACES);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void singletonScopeIgnoresProxyTargetClass() {
void singletonScopeIgnoresProxyTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(TARGET_CLASS);
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// singleton bean, so name should be modified even after lookup
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void requestScopeWithNoProxy() {
void requestScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("request");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// but a newly retrieved bean should have the default name
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("request");
assertEquals(DEFAULT_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
}
@Test
public void requestScopeWithProxiedInterfaces() {
void requestScopeWithProxiedInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(INTERFACES);
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
// should be dynamic proxy, implementing both interfaces
assertTrue(AopUtils.isJdkDynamicProxy(bean));
assertTrue(bean instanceof AnotherScopeTestInterface);
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
boolean condition = bean instanceof AnotherScopeTestInterface;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void requestScopeWithProxiedTargetClass() {
void requestScopeWithProxiedTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
ApplicationContext context = createContext(TARGET_CLASS);
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
// should be a class-based proxy
assertTrue(AopUtils.isCglibProxy(bean));
assertTrue(bean instanceof RequestScopedTestBean);
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
boolean condition = bean instanceof RequestScopedTestBean;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributes);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void sessionScopeWithNoProxy() {
void sessionScopeWithNoProxy() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("session");
// should not be a proxy
assertFalse(AopUtils.isAopProxy(bean));
assertThat(AopUtils.isAopProxy(bean)).isFalse();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// not a proxy so this should not have changed
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
// but a newly retrieved bean should have the default name
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("session");
assertEquals(DEFAULT_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
}
@Test
public void sessionScopeWithProxiedInterfaces() {
void sessionScopeWithProxiedInterfaces() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(INTERFACES);
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
// should be dynamic proxy, implementing both interfaces
assertTrue(AopUtils.isJdkDynamicProxy(bean));
assertTrue(bean instanceof AnotherScopeTestInterface);
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
boolean condition = bean instanceof AnotherScopeTestInterface;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
bean2.setName(DEFAULT_NAME);
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@Test
public void sessionScopeWithProxiedTargetClass() {
void sessionScopeWithProxiedTargetClass() {
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
ApplicationContext context = createContext(TARGET_CLASS);
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
// should be a class-based proxy
assertTrue(AopUtils.isCglibProxy(bean));
assertTrue(bean instanceof ScopedTestBean);
assertTrue(bean instanceof SessionScopedTestBean);
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
boolean condition1 = bean instanceof ScopedTestBean;
assertThat(condition1).isTrue();
boolean condition = bean instanceof SessionScopedTestBean;
assertThat(condition).isTrue();
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
// this is a proxy so it should be reset to default
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
bean.setName(MODIFIED_NAME);
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
assertEquals(MODIFIED_NAME, bean2.getName());
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
bean2.setName(DEFAULT_NAME);
assertEquals(DEFAULT_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
assertEquals(MODIFIED_NAME, bean.getName());
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
}
@@ -295,7 +298,7 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests {
}
static interface IScopedTestBean {
interface IScopedTestBean {
String getName();
@@ -320,7 +323,7 @@ public class ClassPathBeanDefinitionScannerScopeIntegrationTests {
}
static interface AnotherScopeTestInterface {
interface AnotherScopeTestInterface {
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ package org.springframework.core.env;
import java.io.File;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -57,11 +57,19 @@ import org.springframework.web.context.support.StandardServletEnvironment;
import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
import static org.springframework.context.ConfigurableApplicationContext.*;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
import static org.springframework.context.ConfigurableApplicationContext.ENVIRONMENT_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.ENVIRONMENT_AWARE_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.TRANSITIVE_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.XML_PATH;
/**
* System integration tests for container support of the {@link Environment} API.
@@ -91,15 +99,15 @@ public class EnvironmentSystemIntegrationTests {
private final ConfigurableEnvironment prodWebEnv = new StandardServletEnvironment();
@Before
public void setUp() {
@BeforeEach
void setUp() {
prodEnv.setActiveProfiles(PROD_ENV_NAME);
devEnv.setActiveProfiles(DEV_ENV_NAME);
prodWebEnv.setActiveProfiles(PROD_ENV_NAME);
}
@Test
public void genericApplicationContext_standardEnv() {
void genericApplicationContext_standardEnv() {
ConfigurableApplicationContext ctx = new GenericApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
ctx.refresh();
@@ -109,7 +117,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void genericApplicationContext_customEnv() {
void genericApplicationContext_customEnv() {
GenericApplicationContext ctx = new GenericApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
ctx.setEnvironment(prodEnv);
ctx.refresh();
@@ -120,51 +128,51 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void xmlBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
void xmlBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.setEnvironment(prodEnv);
new XmlBeanDefinitionReader(ctx).loadBeanDefinitions(XML_PATH);
ctx.refresh();
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void annotatedBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
void annotatedBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.setEnvironment(prodEnv);
new AnnotatedBeanDefinitionReader(ctx).register(Config.class);
ctx.refresh();
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedConfigClasses() {
void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedConfigClasses() {
// it's actually ConfigurationClassPostProcessor's Environment that gets the job done here.
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.setEnvironment(prodEnv);
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
scanner.scan("org.springframework.core.env.scan1");
ctx.refresh();
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedComponents() {
void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedComponents() {
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.setEnvironment(prodEnv);
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
scanner.scan("org.springframework.core.env.scan2");
ctx.refresh();
assertThat(scanner.getEnvironment(), is((Environment)ctx.getEnvironment()));
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(scanner.getEnvironment()).isEqualTo(ctx.getEnvironment());
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void genericXmlApplicationContext() {
void genericXmlApplicationContext() {
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
assertHasStandardEnvironment(ctx);
ctx.setEnvironment(prodEnv);
@@ -174,12 +182,12 @@ public class EnvironmentSystemIntegrationTests {
assertHasEnvironment(ctx, prodEnv);
assertEnvironmentBeanRegistered(ctx);
assertEnvironmentAwareInvoked(ctx, prodEnv);
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void classPathXmlApplicationContext() {
void classPathXmlApplicationContext() {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(XML_PATH);
ctx.setEnvironment(prodEnv);
ctx.refresh();
@@ -187,12 +195,12 @@ public class EnvironmentSystemIntegrationTests {
assertEnvironmentBeanRegistered(ctx);
assertHasEnvironment(ctx, prodEnv);
assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void fileSystemXmlApplicationContext() throws IOException {
void fileSystemXmlApplicationContext() throws IOException {
ClassPathResource xml = new ClassPathResource(XML_PATH);
File tmpFile = File.createTempFile("test", "xml");
FileCopyUtils.copy(xml.getFile(), tmpFile);
@@ -205,12 +213,12 @@ public class EnvironmentSystemIntegrationTests {
assertEnvironmentBeanRegistered(ctx);
assertHasEnvironment(ctx, prodEnv);
assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void annotationConfigApplicationContext_withPojos() {
void annotationConfigApplicationContext_withPojos() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -223,7 +231,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void annotationConfigApplicationContext_withProdEnvAndProdConfigClass() {
void annotationConfigApplicationContext_withProdEnvAndProdConfigClass() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -232,11 +240,11 @@ public class EnvironmentSystemIntegrationTests {
ctx.register(ProdConfig.class);
ctx.refresh();
assertThat("should have prod bean", ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void annotationConfigApplicationContext_withProdEnvAndDevConfigClass() {
void annotationConfigApplicationContext_withProdEnvAndDevConfigClass() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -245,12 +253,12 @@ public class EnvironmentSystemIntegrationTests {
ctx.register(DevConfig.class);
ctx.refresh();
assertThat("should not have dev bean", ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat("should not have transitive bean", ctx.containsBean(TRANSITIVE_BEAN_NAME), is(false));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
}
@Test
public void annotationConfigApplicationContext_withDevEnvAndDevConfigClass() {
void annotationConfigApplicationContext_withDevEnvAndDevConfigClass() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -259,12 +267,12 @@ public class EnvironmentSystemIntegrationTests {
ctx.register(DevConfig.class);
ctx.refresh();
assertThat("should have dev bean", ctx.containsBean(DEV_BEAN_NAME), is(true));
assertThat("should have transitive bean", ctx.containsBean(TRANSITIVE_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isTrue();
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isTrue();
}
@Test
public void annotationConfigApplicationContext_withImportedConfigClasses() {
void annotationConfigApplicationContext_withImportedConfigClasses() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -274,13 +282,13 @@ public class EnvironmentSystemIntegrationTests {
ctx.refresh();
assertEnvironmentAwareInvoked(ctx, prodEnv);
assertThat("should have prod bean", ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat("should not have dev bean", ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat("should not have transitive bean", ctx.containsBean(TRANSITIVE_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
}
@Test
public void mostSpecificDerivedClassDrivesEnvironment_withDerivedDevEnvAndDerivedDevConfigClass() {
void mostSpecificDerivedClassDrivesEnvironment_withDerivedDevEnvAndDerivedDevConfigClass() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
StandardEnvironment derivedDevEnv = new StandardEnvironment();
derivedDevEnv.setActiveProfiles(DERIVED_DEV_ENV_NAME);
@@ -288,40 +296,40 @@ public class EnvironmentSystemIntegrationTests {
ctx.register(DerivedDevConfig.class);
ctx.refresh();
assertThat("should have dev bean", ctx.containsBean(DEV_BEAN_NAME), is(true));
assertThat("should have derived dev bean", ctx.containsBean(DERIVED_DEV_BEAN_NAME), is(true));
assertThat("should have transitive bean", ctx.containsBean(TRANSITIVE_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isTrue();
assertThat(ctx.containsBean(DERIVED_DEV_BEAN_NAME)).isTrue();
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isTrue();
}
@Test
public void mostSpecificDerivedClassDrivesEnvironment_withDevEnvAndDerivedDevConfigClass() {
void mostSpecificDerivedClassDrivesEnvironment_withDevEnvAndDerivedDevConfigClass() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.setEnvironment(devEnv);
ctx.register(DerivedDevConfig.class);
ctx.refresh();
assertThat("should not have dev bean", ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat("should not have derived dev bean", ctx.containsBean(DERIVED_DEV_BEAN_NAME), is(false));
assertThat("should not have transitive bean", ctx.containsBean(TRANSITIVE_BEAN_NAME), is(false));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(DERIVED_DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
}
@Test
public void annotationConfigApplicationContext_withProfileExpressionMatchOr() {
void annotationConfigApplicationContext_withProfileExpressionMatchOr() {
testProfileExpression(true, "p3");
}
@Test
public void annotationConfigApplicationContext_withProfileExpressionMatchAnd() {
void annotationConfigApplicationContext_withProfileExpressionMatchAnd() {
testProfileExpression(true, "p1", "p2");
}
@Test
public void annotationConfigApplicationContext_withProfileExpressionNoMatchAnd() {
void annotationConfigApplicationContext_withProfileExpressionNoMatchAnd() {
testProfileExpression(false, "p1");
}
@Test
public void annotationConfigApplicationContext_withProfileExpressionNoMatchNone() {
void annotationConfigApplicationContext_withProfileExpressionNoMatchNone() {
testProfileExpression(false, "p4");
}
@@ -332,12 +340,11 @@ public class EnvironmentSystemIntegrationTests {
ctx.setEnvironment(environment);
ctx.register(ProfileExpressionConfig.class);
ctx.refresh();
assertThat("wrong presence of expression bean",
ctx.containsBean("expressionBean"), is(expected));
assertThat(ctx.containsBean("expressionBean")).isEqualTo(expected);
}
@Test
public void webApplicationContext() {
void webApplicationContext() {
GenericWebApplicationContext ctx = new GenericWebApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
assertHasStandardServletEnvironment(ctx);
ctx.setEnvironment(prodWebEnv);
@@ -349,7 +356,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void xmlWebApplicationContext() {
void xmlWebApplicationContext() {
AbstractRefreshableWebApplicationContext ctx = new XmlWebApplicationContext();
ctx.setConfigLocation("classpath:" + XML_PATH);
ctx.setEnvironment(prodWebEnv);
@@ -358,12 +365,12 @@ public class EnvironmentSystemIntegrationTests {
assertHasEnvironment(ctx, prodWebEnv);
assertEnvironmentBeanRegistered(ctx);
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
}
@Test
public void staticApplicationContext() {
void staticApplicationContext() {
StaticApplicationContext ctx = new StaticApplicationContext();
assertHasStandardEnvironment(ctx);
@@ -379,7 +386,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void staticWebApplicationContext() {
void staticWebApplicationContext() {
StaticWebApplicationContext ctx = new StaticWebApplicationContext();
assertHasStandardServletEnvironment(ctx);
@@ -395,7 +402,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void annotationConfigWebApplicationContext() {
void annotationConfigWebApplicationContext() {
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
ctx.setEnvironment(prodWebEnv);
ctx.setConfigLocation(EnvironmentAwareBean.class.getName());
@@ -407,7 +414,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void registerServletParamPropertySources_AbstractRefreshableWebApplicationContext() {
void registerServletParamPropertySources_AbstractRefreshableWebApplicationContext() {
MockServletContext servletContext = new MockServletContext();
servletContext.addInitParameter("pCommon", "pCommonContextValue");
servletContext.addInitParameter("pContext1", "pContext1Value");
@@ -422,23 +429,23 @@ public class EnvironmentSystemIntegrationTests {
ctx.refresh();
ConfigurableEnvironment environment = ctx.getEnvironment();
assertThat(environment, instanceOf(StandardServletEnvironment.class));
assertThat(environment).isInstanceOf(StandardServletEnvironment.class);
MutablePropertySources propertySources = environment.getPropertySources();
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME), is(true));
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME), is(true));
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)).isTrue();
// ServletConfig gets precedence
assertThat(environment.getProperty("pCommon"), is("pCommonConfigValue"));
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)),
lessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME))));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)));
// but all params are available
assertThat(environment.getProperty("pContext1"), is("pContext1Value"));
assertThat(environment.getProperty("pConfig1"), is("pConfig1Value"));
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
assertThat(environment.getProperty("pConfig1")).isEqualTo("pConfig1Value");
// Servlet* PropertySources have precedence over System* PropertySources
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)),
lessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME))));
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
// Replace system properties with a mock property source for convenience
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
@@ -447,12 +454,12 @@ public class EnvironmentSystemIntegrationTests {
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
// assert that servletconfig params resolve with higher precedence than sysprops
assertThat(environment.getProperty("pCommon"), is("pCommonConfigValue"));
assertThat(environment.getProperty("pSysProps1"), is("pSysProps1Value"));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
}
@Test
public void registerServletParamPropertySources_GenericWebApplicationContext() {
void registerServletParamPropertySources_GenericWebApplicationContext() {
MockServletContext servletContext = new MockServletContext();
servletContext.addInitParameter("pCommon", "pCommonContextValue");
servletContext.addInitParameter("pContext1", "pContext1Value");
@@ -462,17 +469,17 @@ public class EnvironmentSystemIntegrationTests {
ctx.refresh();
ConfigurableEnvironment environment = ctx.getEnvironment();
assertThat(environment, instanceOf(StandardServletEnvironment.class));
assertThat(environment).isInstanceOf(StandardServletEnvironment.class);
MutablePropertySources propertySources = environment.getPropertySources();
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME), is(true));
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
// ServletContext params are available
assertThat(environment.getProperty("pCommon"), is("pCommonContextValue"));
assertThat(environment.getProperty("pContext1"), is("pContext1Value"));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonContextValue");
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
// Servlet* PropertySources have precedence over System* PropertySources
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)),
lessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME))));
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)))
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
// Replace system properties with a mock property source for convenience
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
@@ -481,12 +488,12 @@ public class EnvironmentSystemIntegrationTests {
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
// assert that servletcontext init params resolve with higher precedence than sysprops
assertThat(environment.getProperty("pCommon"), is("pCommonContextValue"));
assertThat(environment.getProperty("pSysProps1"), is("pSysProps1Value"));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonContextValue");
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
}
@Test
public void registerServletParamPropertySources_StaticWebApplicationContext() {
void registerServletParamPropertySources_StaticWebApplicationContext() {
MockServletContext servletContext = new MockServletContext();
servletContext.addInitParameter("pCommon", "pCommonContextValue");
servletContext.addInitParameter("pContext1", "pContext1Value");
@@ -501,21 +508,21 @@ public class EnvironmentSystemIntegrationTests {
ConfigurableEnvironment environment = ctx.getEnvironment();
MutablePropertySources propertySources = environment.getPropertySources();
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME), is(true));
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME), is(true));
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)).isTrue();
// ServletConfig gets precedence
assertThat(environment.getProperty("pCommon"), is("pCommonConfigValue"));
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)),
lessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME))));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)));
// but all params are available
assertThat(environment.getProperty("pContext1"), is("pContext1Value"));
assertThat(environment.getProperty("pConfig1"), is("pConfig1Value"));
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
assertThat(environment.getProperty("pConfig1")).isEqualTo("pConfig1Value");
// Servlet* PropertySources have precedence over System* PropertySources
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)),
lessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME))));
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
// Replace system properties with a mock property source for convenience
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
@@ -524,12 +531,12 @@ public class EnvironmentSystemIntegrationTests {
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
// assert that servletconfig params resolve with higher precedence than sysprops
assertThat(environment.getProperty("pCommon"), is("pCommonConfigValue"));
assertThat(environment.getProperty("pSysProps1"), is("pSysProps1Value"));
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
}
@Test
public void resourceAdapterApplicationContext() {
void resourceAdapterApplicationContext() {
ResourceAdapterApplicationContext ctx = new ResourceAdapterApplicationContext(new SimpleBootstrapContext(new SimpleTaskWorkManager()));
assertHasStandardEnvironment(ctx);
@@ -545,7 +552,7 @@ public class EnvironmentSystemIntegrationTests {
}
@Test
public void abstractApplicationContextValidatesRequiredPropertiesOnRefresh() {
void abstractApplicationContextValidatesRequiredPropertiesOnRefresh() {
{
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.refresh();
@@ -554,12 +561,8 @@ public class EnvironmentSystemIntegrationTests {
{
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.getEnvironment().setRequiredProperties("foo", "bar");
try {
ctx.refresh();
fail("expected missing property exception");
}
catch (MissingRequiredPropertiesException ex) {
}
assertThatExceptionOfType(MissingRequiredPropertiesException.class).isThrownBy(
ctx::refresh);
}
{
@@ -585,33 +588,33 @@ public class EnvironmentSystemIntegrationTests {
private void assertEnvironmentBeanRegistered(
ConfigurableApplicationContext ctx) {
// ensure environment is registered as a bean
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME), is(true));
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME)).isTrue();
}
private void assertHasStandardEnvironment(ApplicationContext ctx) {
Environment defaultEnv = ctx.getEnvironment();
assertThat(defaultEnv, notNullValue());
assertThat(defaultEnv, instanceOf(StandardEnvironment.class));
assertThat(defaultEnv).isNotNull();
assertThat(defaultEnv).isInstanceOf(StandardEnvironment.class);
}
private void assertHasStandardServletEnvironment(WebApplicationContext ctx) {
// ensure a default servlet environment exists
Environment defaultEnv = ctx.getEnvironment();
assertThat(defaultEnv, notNullValue());
assertThat(defaultEnv, instanceOf(StandardServletEnvironment.class));
assertThat(defaultEnv).isNotNull();
assertThat(defaultEnv).isInstanceOf(StandardServletEnvironment.class);
}
private void assertHasEnvironment(ApplicationContext ctx, Environment expectedEnv) {
// ensure the custom environment took
Environment actualEnv = ctx.getEnvironment();
assertThat(actualEnv, notNullValue());
assertThat(actualEnv, is(expectedEnv));
assertThat(actualEnv).isNotNull();
assertThat(actualEnv).isEqualTo(expectedEnv);
// ensure environment is registered as a bean
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME), is(true));
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME)).isTrue();
}
private void assertEnvironmentAwareInvoked(ConfigurableApplicationContext ctx, Environment expectedEnv) {
assertThat(ctx.getBean(EnvironmentAwareBean.class).environment, is(expectedEnv));
assertThat(ctx.getBean(EnvironmentAwareBean.class).environment).isEqualTo(expectedEnv);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,22 +16,25 @@
package org.springframework.core.env;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.support.GenericApplicationContext;
@SuppressWarnings("resource")
public class PropertyPlaceholderConfigurerEnvironmentIntegrationTests {
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
class PropertyPlaceholderConfigurerEnvironmentIntegrationTests {
@Test
public void test() {
@SuppressWarnings("deprecation")
void test() {
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.registerBeanDefinition("ppc",
rootBeanDefinition(PropertyPlaceholderConfigurer.class)
rootBeanDefinition(org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.class)
.addPropertyValue("searchSystemEnvironment", false)
.getBeanDefinition());
ctx.refresh();
ctx.getBean("ppc");
ctx.close();
}
}
@@ -0,0 +1,26 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env.scan1;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@Configuration
@Import({ DevConfig.class, ProdConfig.class })
class Config {
}
@@ -0,0 +1,32 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env.scan1;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
@Configuration
class DevConfig {
@Bean
public Object devBean() {
return new Object();
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,39 +14,19 @@
* limitations under the License.
*/
/**
* Mirrors the structure of beans and environment-specific config files
* in EnvironmentIntegrationTests-context.xml
*/
package org.springframework.core.env.scan1;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
@Configuration
@Import({DevConfig.class, ProdConfig.class})
class Config {
}
@Profile(DEV_ENV_NAME)
@Configuration
class DevConfig {
@Bean
public Object devBean() {
return new Object();
}
}
@Profile(PROD_ENV_NAME)
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
@Configuration
class ProdConfig {
@Bean
public Object prodBean() {
return new Object();
}
}
@@ -0,0 +1,25 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env.scan2;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME)
class DevBean {
}
@@ -0,0 +1,26 @@
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env.scan2;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME)
class ProdBean {
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,28 +18,26 @@ package org.springframework.expression.spel.support;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.MethodParameter;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.expression.MethodExecutor;
public class Spr7538Tests {
class Spr7538Tests {
@Ignore @Test
public void repro() throws Exception {
@Test
void repro() throws Exception {
AlwaysTrueReleaseStrategy target = new AlwaysTrueReleaseStrategy();
BeanFactoryTypeConverter converter = new BeanFactoryTypeConverter();
StandardEvaluationContext context = new StandardEvaluationContext();
context.setTypeConverter(converter);
List<Foo> arguments = new ArrayList<>();
// !!!! With the below line commented you'll get NPE. Uncomment and everything is OK!
//arguments.add(new Foo());
List<Foo> arguments = Collections.emptyList();
List<TypeDescriptor> paramDescriptors = new ArrayList<>();
Method method = AlwaysTrueReleaseStrategy.class.getMethod("checkCompleteness", List.class);
@@ -55,11 +53,11 @@ public class Spr7538Tests {
System.out.println("Result: " + result);
}
public static class AlwaysTrueReleaseStrategy {
static class AlwaysTrueReleaseStrategy {
public boolean checkCompleteness(List<Foo> messages) {
return true;
}
}
public static class Foo{}
static class Foo{}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,7 @@ package org.springframework.scheduling.annotation;
import java.util.concurrent.atomic.AtomicInteger;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
import org.springframework.aop.support.AopUtils;
@@ -29,19 +28,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.testfixture.EnabledForTestGroups;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.dao.support.PersistenceExceptionTranslator;
import org.springframework.stereotype.Repository;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.tests.transaction.CallCountingTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.Mockito.mock;
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
/**
* Integration tests cornering bug SPR-8651, which revealed that @Scheduled methods may
@@ -53,29 +52,20 @@ import static org.mockito.BDDMockito.*;
* @since 3.1
*/
@SuppressWarnings("resource")
public class ScheduledAndTransactionalAnnotationIntegrationTests {
@Before
public void assumePerformanceTests() {
Assume.group(TestGroup.PERFORMANCE);
}
@EnabledForTestGroups(LONG_RUNNING)
class ScheduledAndTransactionalAnnotationIntegrationTests {
@Test
public void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() {
void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigA.class);
try {
ctx.refresh();
fail("Should have thrown BeanCreationException");
}
catch (BeanCreationException ex) {
assertTrue(ex.getRootCause() instanceof IllegalStateException);
}
assertThatExceptionOfType(BeanCreationException.class)
.isThrownBy(ctx::refresh)
.withCauseInstanceOf(IllegalStateException.class);
}
@Test
public void succeedsWhenSubclassProxyAndScheduledMethodNotPresentOnInterface() throws InterruptedException {
void succeedsWhenSubclassProxyAndScheduledMethodNotPresentOnInterface() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, SubclassProxyTxConfig.class, RepoConfigA.class);
ctx.refresh();
@@ -84,13 +74,13 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
MyRepository repository = ctx.getBean(MyRepository.class);
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
assertThat("repository is not a proxy", AopUtils.isCglibProxy(repository), equalTo(true));
assertThat("@Scheduled method never called", repository.getInvocationCount(), greaterThan(0));
assertThat("no transactions were committed", txManager.commits, greaterThan(0));
assertThat(AopUtils.isCglibProxy(repository)).isEqualTo(true);
assertThat(repository.getInvocationCount()).isGreaterThan(0);
assertThat(txManager.commits).isGreaterThan(0);
}
@Test
public void succeedsWhenJdkProxyAndScheduledMethodIsPresentOnInterface() throws InterruptedException {
void succeedsWhenJdkProxyAndScheduledMethodIsPresentOnInterface() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigB.class);
ctx.refresh();
@@ -99,13 +89,13 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
MyRepositoryWithScheduledMethod repository = ctx.getBean(MyRepositoryWithScheduledMethod.class);
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
assertThat("repository is not a proxy", AopUtils.isJdkDynamicProxy(repository), is(true));
assertThat("@Scheduled method never called", repository.getInvocationCount(), greaterThan(0));
assertThat("no transactions were committed", txManager.commits, greaterThan(0));
assertThat(AopUtils.isJdkDynamicProxy(repository)).isTrue();
assertThat(repository.getInvocationCount()).isGreaterThan(0);
assertThat(txManager.commits).isGreaterThan(0);
}
@Test
public void withAspectConfig() throws InterruptedException {
void withAspectConfig() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(AspectConfig.class, MyRepositoryWithScheduledMethodImpl.class);
ctx.refresh();
@@ -113,8 +103,8 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
Thread.sleep(100); // allow @Scheduled method to be called several times
MyRepositoryWithScheduledMethod repository = ctx.getBean(MyRepositoryWithScheduledMethod.class);
assertThat("repository is not a proxy", AopUtils.isCglibProxy(repository), is(true));
assertThat("@Scheduled method never called", repository.getInvocationCount(), greaterThan(0));
assertThat(AopUtils.isCglibProxy(repository)).isTrue();
assertThat(repository.getInvocationCount()).isGreaterThan(0);
}
@@ -134,7 +124,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
static class RepoConfigA {
@Bean
public MyRepository repository() {
MyRepository repository() {
return new MyRepositoryImpl();
}
}
@@ -144,7 +134,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
static class RepoConfigB {
@Bean
public MyRepositoryWithScheduledMethod repository() {
MyRepositoryWithScheduledMethod repository() {
return new MyRepositoryWithScheduledMethodImpl();
}
}
@@ -155,17 +145,17 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
static class Config {
@Bean
public PlatformTransactionManager txManager() {
PlatformTransactionManager txManager() {
return new CallCountingTransactionManager();
}
@Bean
public PersistenceExceptionTranslator peTranslator() {
PersistenceExceptionTranslator peTranslator() {
return mock(PersistenceExceptionTranslator.class);
}
@Bean
public static PersistenceExceptionTranslationPostProcessor peTranslationPostProcessor() {
static PersistenceExceptionTranslationPostProcessor peTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
}
@@ -176,14 +166,14 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
static class AspectConfig {
@Bean
public static AnnotationAwareAspectJAutoProxyCreator autoProxyCreator() {
static AnnotationAwareAspectJAutoProxyCreator autoProxyCreator() {
AnnotationAwareAspectJAutoProxyCreator apc = new AnnotationAwareAspectJAutoProxyCreator();
apc.setProxyTargetClass(true);
return apc;
}
@Bean
public static MyAspect myAspect() {
static MyAspect myAspect() {
return new MyAspect();
}
}
@@ -192,7 +182,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
@Aspect
public static class MyAspect {
private final AtomicInteger count = new AtomicInteger(0);
private final AtomicInteger count = new AtomicInteger();
@org.aspectj.lang.annotation.Before("execution(* scheduled())")
public void checkTransaction() {
@@ -210,7 +200,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
@Repository
static class MyRepositoryImpl implements MyRepository {
private final AtomicInteger count = new AtomicInteger(0);
private final AtomicInteger count = new AtomicInteger();
@Transactional
@Scheduled(fixedDelay = 5)
@@ -236,7 +226,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
@Repository
static class MyRepositoryWithScheduledMethodImpl implements MyRepositoryWithScheduledMethod {
private final AtomicInteger count = new AtomicInteger(0);
private final AtomicInteger count = new AtomicInteger();
@Autowired(required = false)
private MyAspect myAspect;
@@ -251,7 +241,7 @@ public class ScheduledAndTransactionalAnnotationIntegrationTests {
@Override
public int getInvocationCount() {
if (this.myAspect != null) {
assertEquals(this.count.get(), this.myAspect.count.get());
assertThat(this.myAspect.count.get()).isEqualTo(this.count.get());
}
return this.count.get();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,15 +17,14 @@
package org.springframework.transaction.annotation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.sql.DataSource;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.Advisor;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.cache.Cache;
@@ -41,150 +40,121 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.stereotype.Repository;
import org.springframework.tests.transaction.CallCountingTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor;
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* Integration tests for the @EnableTransactionManagement annotation.
*
* @author Chris Beams
* @author Sam Brannen
* @since 3.1
*/
@SuppressWarnings("resource")
public class EnableTransactionManagementIntegrationTests {
class EnableTransactionManagementIntegrationTests {
@Test
public void repositoryIsNotTxProxy() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class);
ctx.refresh();
void repositoryIsNotTxProxy() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);
try {
assertTxProxying(ctx);
fail("expected exception");
}
catch (AssertionError ex) {
assertThat(ex.getMessage(), equalTo("FooRepository is not a TX proxy"));
}
assertThat(isTxProxy(ctx.getBean(FooRepository.class))).isFalse();
}
@Test
public void repositoryIsTxProxy_withDefaultTxManagerName() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, DefaultTxManagerNameConfig.class);
ctx.refresh();
void repositoryIsTxProxy_withDefaultTxManagerName() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, DefaultTxManagerNameConfig.class);
assertTxProxying(ctx);
}
@Test
public void repositoryIsTxProxy_withCustomTxManagerName() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, CustomTxManagerNameConfig.class);
ctx.refresh();
assertTxProxying(ctx);
}
@Ignore @Test // TODO SPR-8207
public void repositoryIsTxProxy_withNonConventionalTxManagerName_fallsBackToByTypeLookup() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, NonConventionalTxManagerNameConfig.class);
ctx.refresh();
void repositoryIsTxProxy_withCustomTxManagerName() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, CustomTxManagerNameConfig.class);
assertTxProxying(ctx);
}
@Test
public void repositoryIsClassBasedTxProxy() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, ProxyTargetClassTxConfig.class);
ctx.refresh();
assertTxProxying(ctx);
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class)), is(true));
void repositoryIsTxProxy_withNonConventionalTxManagerName_fallsBackToByTypeLookup() {
assertTxProxying(new AnnotationConfigApplicationContext(Config.class, NonConventionalTxManagerNameConfig.class));
}
@Test
public void repositoryUsesAspectJAdviceMode() {
void repositoryIsClassBasedTxProxy() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, ProxyTargetClassTxConfig.class);
assertTxProxying(ctx);
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class))).isTrue();
}
@Test
void repositoryUsesAspectJAdviceMode() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(Config.class, AspectJTxConfig.class);
try {
ctx.refresh();
}
catch (Exception ex) {
// this test is a bit fragile, but gets the job done, proving that an
// attempt was made to look up the AJ aspect. It's due to classpath issues
// in .integration-tests that it's not found.
assertTrue(ex.getMessage().contains("AspectJJtaTransactionManagementConfiguration"));
}
// this test is a bit fragile, but gets the job done, proving that an
// attempt was made to look up the AJ aspect. It's due to classpath issues
// in .integration-tests that it's not found.
assertThatExceptionOfType(Exception.class)
.isThrownBy(ctx::refresh)
.withMessageContaining("AspectJJtaTransactionManagementConfiguration");
}
@Test
public void implicitTxManager() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(ImplicitTxManagerConfig.class);
ctx.refresh();
void implicitTxManager() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImplicitTxManagerConfig.class);
FooRepository fooRepository = ctx.getBean(FooRepository.class);
fooRepository.findAll();
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
assertThat(txManager.begun, equalTo(1));
assertThat(txManager.commits, equalTo(1));
assertThat(txManager.rollbacks, equalTo(0));
assertThat(txManager.begun).isEqualTo(1);
assertThat(txManager.commits).isEqualTo(1);
assertThat(txManager.rollbacks).isEqualTo(0);
}
@Test
public void explicitTxManager() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(ExplicitTxManagerConfig.class);
ctx.refresh();
void explicitTxManager() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ExplicitTxManagerConfig.class);
FooRepository fooRepository = ctx.getBean(FooRepository.class);
fooRepository.findAll();
CallCountingTransactionManager txManager1 = ctx.getBean("txManager1", CallCountingTransactionManager.class);
assertThat(txManager1.begun, equalTo(1));
assertThat(txManager1.commits, equalTo(1));
assertThat(txManager1.rollbacks, equalTo(0));
assertThat(txManager1.begun).isEqualTo(1);
assertThat(txManager1.commits).isEqualTo(1);
assertThat(txManager1.rollbacks).isEqualTo(0);
CallCountingTransactionManager txManager2 = ctx.getBean("txManager2", CallCountingTransactionManager.class);
assertThat(txManager2.begun, equalTo(0));
assertThat(txManager2.commits, equalTo(0));
assertThat(txManager2.rollbacks, equalTo(0));
assertThat(txManager2.begun).isEqualTo(0);
assertThat(txManager2.commits).isEqualTo(0);
assertThat(txManager2.rollbacks).isEqualTo(0);
}
@Test
public void apcEscalation() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(EnableTxAndCachingConfig.class);
ctx.refresh();
void apcEscalation() {
new AnnotationConfigApplicationContext(EnableTxAndCachingConfig.class);
}
private void assertTxProxying(AnnotationConfigApplicationContext ctx) {
FooRepository repo = ctx.getBean(FooRepository.class);
boolean isTxProxy = false;
if (AopUtils.isAopProxy(repo)) {
for (Advisor advisor : ((Advised)repo).getAdvisors()) {
if (advisor instanceof BeanFactoryTransactionAttributeSourceAdvisor) {
isTxProxy = true;
break;
}
}
}
assertTrue("FooRepository is not a TX proxy", isTxProxy);
assertThat(isTxProxy(repo)).isTrue();
// trigger a transaction
repo.findAll();
}
private boolean isTxProxy(FooRepository repo) {
if (!AopUtils.isAopProxy(repo)) {
return false;
}
return Arrays.stream(((Advised) repo).getAdvisors())
.anyMatch(BeanFactoryTransactionAttributeSourceAdvisor.class::isInstance);
}
@Configuration
@EnableTransactionManagement
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,16 +16,14 @@
package org.springframework.transaction.annotation;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests proving that regardless the proxy strategy used (JDK interface-based vs. CGLIB
* subclass-based), discovery of advice-oriented annotations is consistent.
@@ -37,66 +35,66 @@ import org.springframework.context.annotation.Configuration;
* @author Chris Beams
*/
@SuppressWarnings("resource")
public class ProxyAnnotationDiscoveryTests {
class ProxyAnnotationDiscoveryTests {
@Test
public void annotatedServiceWithoutInterface_PTC_true() {
void annotatedServiceWithoutInterface_PTC_true() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCTrue.class, AnnotatedServiceWithoutInterface.class);
ctx.refresh();
AnnotatedServiceWithoutInterface s = ctx.getBean(AnnotatedServiceWithoutInterface.class);
assertTrue("expected a subclass proxy", AopUtils.isCglibProxy(s));
assertThat(s, instanceOf(AnnotatedServiceWithoutInterface.class));
assertThat(AopUtils.isCglibProxy(s)).isTrue();
assertThat(s).isInstanceOf(AnnotatedServiceWithoutInterface.class);
}
@Test
public void annotatedServiceWithoutInterface_PTC_false() {
void annotatedServiceWithoutInterface_PTC_false() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCFalse.class, AnnotatedServiceWithoutInterface.class);
ctx.refresh();
AnnotatedServiceWithoutInterface s = ctx.getBean(AnnotatedServiceWithoutInterface.class);
assertTrue("expected a subclass proxy", AopUtils.isCglibProxy(s));
assertThat(s, instanceOf(AnnotatedServiceWithoutInterface.class));
assertThat(AopUtils.isCglibProxy(s)).isTrue();
assertThat(s).isInstanceOf(AnnotatedServiceWithoutInterface.class);
}
@Test
public void nonAnnotatedService_PTC_true() {
void nonAnnotatedService_PTC_true() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCTrue.class, AnnotatedServiceImpl.class);
ctx.refresh();
NonAnnotatedService s = ctx.getBean(NonAnnotatedService.class);
assertTrue("expected a subclass proxy", AopUtils.isCglibProxy(s));
assertThat(s, instanceOf(AnnotatedServiceImpl.class));
assertThat(AopUtils.isCglibProxy(s)).isTrue();
assertThat(s).isInstanceOf(AnnotatedServiceImpl.class);
}
@Test
public void nonAnnotatedService_PTC_false() {
void nonAnnotatedService_PTC_false() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCFalse.class, AnnotatedServiceImpl.class);
ctx.refresh();
NonAnnotatedService s = ctx.getBean(NonAnnotatedService.class);
assertTrue("expected a jdk proxy", AopUtils.isJdkDynamicProxy(s));
assertThat(s, not(instanceOf(AnnotatedServiceImpl.class)));
assertThat(AopUtils.isJdkDynamicProxy(s)).isTrue();
assertThat(s).isNotInstanceOf(AnnotatedServiceImpl.class);
}
@Test
public void annotatedService_PTC_true() {
void annotatedService_PTC_true() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCTrue.class, NonAnnotatedServiceImpl.class);
ctx.refresh();
AnnotatedService s = ctx.getBean(AnnotatedService.class);
assertTrue("expected a subclass proxy", AopUtils.isCglibProxy(s));
assertThat(s, instanceOf(NonAnnotatedServiceImpl.class));
assertThat(AopUtils.isCglibProxy(s)).isTrue();
assertThat(s).isInstanceOf(NonAnnotatedServiceImpl.class);
}
@Test
public void annotatedService_PTC_false() {
void annotatedService_PTC_false() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(PTCFalse.class, NonAnnotatedServiceImpl.class);
ctx.refresh();
AnnotatedService s = ctx.getBean(AnnotatedService.class);
assertTrue("expected a jdk proxy", AopUtils.isJdkDynamicProxy(s));
assertThat(s, not(instanceOf(NonAnnotatedServiceImpl.class)));
assertThat(AopUtils.isJdkDynamicProxy(s)).isTrue();
assertThat(s).isNotInstanceOf(NonAnnotatedServiceImpl.class);
}
}
@@ -0,0 +1 @@
http\://www.foo.example/schema/component=org.springframework.beans.factory.xml.ComponentNamespaceHandler
@@ -0,0 +1 @@
http\://www.foo.example/schema/component/component.xsd=org/springframework/beans/factory/xml/component.xsd
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="echo" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$Echo"/>
<bean id="invocationTrackingAspect" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$InvocationTrackingAspect" />
<aop:config>
<aop:aspect id="echoAdvice" ref="invocationTrackingAspect">
<aop:pointcut id="echoMethod" expression="execution(* echo(*))" />
<aop:around method="around" pointcut-ref="echoMethod" />
<aop:before method="before" pointcut-ref="echoMethod" />
<aop:after method="after" pointcut-ref="echoMethod" />
<aop:after-throwing method="afterThrowing" pointcut-ref="echoMethod" />
<aop:after-returning method="afterReturning" pointcut-ref="echoMethod" />
</aop:aspect>
</aop:config>
</beans>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="echo" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$Echo"/>
<bean id="invocationTrackingAspect" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$InvocationTrackingAspect" />
<aop:config>
<aop:aspect id="echoAdvice" ref="invocationTrackingAspect">
<aop:pointcut id="echoMethod" expression="execution(* echo(*))" />
<aop:around method="around" pointcut-ref="echoMethod" />
<aop:before method="before" pointcut-ref="echoMethod" />
<aop:after-throwing method="afterThrowing" pointcut-ref="echoMethod" />
<aop:after-returning method="afterReturning" pointcut-ref="echoMethod" />
<aop:after method="after" pointcut-ref="echoMethod" />
</aop:aspect>
</aop:config>
</beans>

Some files were not shown because too many files have changed in this diff Show More