Commit Graph

2275 Commits

Author SHA1 Message Date
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
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 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
Rossen Stoyanchev 3aaff40e2e Replace explicit use of PooledDataBuffer.release() 2020-07-01 08:07:50 +01:00
Rossen Stoyanchev b16f6fa456 Shared static instance of DefaultDataBufferFactory 2020-06-24 16:12:56 +01:00
Juergen Hoeller 56c661829b Avoid package cycle through dedicated ResourcePropertiesPersister
See gh-25151
2020-06-23 16:54:55 +02:00
Rossen Stoyanchev f0b8e638ad Avoid dependency on netty-common in DataBufferUtils
See: gh-22594
2020-06-23 14:20:24 +01:00
Juergen Hoeller 9e12a20324 Polishing 2020-06-23 11:35:22 +02:00
izeye a678db3888 Polish
Closes gh-880
2020-06-23 09:51:45 +02:00
Sam Brannen ab0e651547 Polish SerializationTestUtils, clean up warnings, etc. 2020-06-20 18:17:03 +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 f35903f23d Catch IllegalReferenceCountException
Closes gh-22594
2020-06-19 21:58:03 +01: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
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 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 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
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
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 65b09be669 Polishing 2020-06-06 16:10:20 +02:00
Sam Brannen da7ead8914 Polishing 2020-06-03 15:05:58 +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 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 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
Juergen Hoeller 27d5fdc5aa Polishing 2020-05-26 23:35:38 +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
Juergen Hoeller 399453d9f1 Merge branch '5.2.x'
# Conflicts:
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
#	spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
2020-05-22 17:16:09 +02:00
Juergen Hoeller d7161f5e5e Polishing 2020-05-22 16:23:46 +02:00
Juergen Hoeller e5c079edfc Introduce serializeToByteArray/deserializeFromByteArray on (De)Serializer
Closes gh-25117
2020-05-22 16:22:59 +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
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
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 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