Commit Graph

2046 Commits

Author SHA1 Message Date
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
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
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
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
Brian Clozel be801fc5fc Polish
See gh-24878
2020-07-28 14:48:25 +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
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
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 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
XenoAmess c547809e89 Use instanceof instead of Class#isInstance where feasible
Closes gh-25446
2020-07-22 14:06:29 +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
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
Juergen Hoeller e4e54b3c4a Merge branch '5.2.x' 2020-07-19 20:01:21 +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 198d64d539 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-07-17 17:52:08 +02:00
Juergen Hoeller e9898f7d52 Polishing 2020-07-17 17:48:33 +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
Sébastien Deleuze 9d37794ebc Avoid using LiveBeansView in GraalVM native images
Closes gh-25344
2020-06-30 15:52:50 +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
Juergen Hoeller 56c661829b Avoid package cycle through dedicated ResourcePropertiesPersister
See gh-25151
2020-06-23 16:54:55 +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
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 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
Сергей Цыпанов 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
Juergen Hoeller 1279b3b822 Merge branch '5.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context-support/src/main/java/org/springframework/cache/jcache/config/AbstractJCacheConfiguration.java
2020-06-11 23:53:27 +02:00
Juergen Hoeller e46ccd74b1 Consistent abstract declaration of "Abstract" base classes
Closes gh-25240
2020-06-11 23:43:41 +02:00
Juergen Hoeller 663f2e8afd Merge branch '5.2.x' 2020-06-10 22:53:06 +02:00
Juergen Hoeller ae1ed9d458 Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:52:01 +02:00
Sam Brannen 905483be30 Polish Javadoc for @PropertySource 2020-06-09 16:39:58 +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 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
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
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
Juergen Hoeller 42ff01b5aa Merge branch '5.2.x' 2020-05-29 15:57:32 +02:00
Juergen Hoeller 2ff22510d9 Avoid earlyApplicationEvents iteration in case of empty Set
Closes gh-25161
2020-05-29 15:50:10 +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
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
Juergen Hoeller 807ded24c4 Avoid ClassCastException on IllegalArgumentException from sync invocation
Closes gh-25110
2020-05-22 16:12:49 +02:00
Juergen Hoeller 9999414b3b Merge branch '5.2.x' 2020-05-18 14:24:33 +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 28177ad91b Explicit notes on access to standard context beans in SpEL expressions
Closes gh-25037
2020-05-18 14:19:05 +02:00
Сергей Цыпанов 703d54677e Avoid unnecessary boxing/unboxing of primitives
Closes gh-25080
2020-05-15 18:01:59 +02:00
Rossen Stoyanchev 6403a9f10e Defer decision on BindingResult type until access
Closes gh-24347
2020-05-14 15:42:43 +01: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 3c1ee64b7f Explicit nullability declarations for all AOP Alliance methods
Includes consistent declarations in AOP Alliance related Spring AOP code.

Closes gh-24117
2020-05-13 23:33:47 +02:00
Juergen Hoeller 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
Juergen Hoeller f09093132e Use proxyBeanMethods=false on remaining internal configuration classes
Closes gh-24511
2020-05-12 22:19:44 +02:00
Sam Brannen 273d952ddf Merge branch '5.2.x' 2020-05-12 18:49:48 +02:00
Andy Wilkinson 1015f79b42 Include timeout unit in shutdown failure logging
Closes gh-25058
2020-05-12 18:42:40 +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 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
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 12e05280ad Upgrade to AssertJ 3.16 2020-05-06 15:22:23 +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
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 9628038c58 Upgrade to BeanShell 2.0b6 2020-04-07 18:06:43 +02:00
Juergen Hoeller 8595f01e44 Polishing 2020-04-03 21:08:45 +02:00
陈其苗 13970ae528 Use autoboxing instead of explicit wrapping in tests
Closes gh-24801
2020-04-01 14:34:20 +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 e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Сергей Цыпанов e63d1cf12d Improve usage of ByteArrayOutputStream/ByteArrayInputStream
Closes gh-24805
2020-03-30 13:22:21 +02:00
Qimiao Chen 7c831d2ef4
Replace anonymous inner classes with lambdas in tests
Closes gh-24808
2020-03-30 12:02:23 +02:00
Sam Brannen 06fa8692cd Attempt to make MBeanClientInterceptorTests more robust 2020-03-27 11:18:45 +01:00
Sam Brannen ac11acb532 Optimize sorting in PostProcessorRegistrationDelegate
Closes gh-24776
2020-03-26 17:32:38 +01: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