Commit Graph

22277 Commits

Author SHA1 Message Date
Sam Brannen
7efb4eade6 Delete unnecessary @SuppressWarnings declaration 2021-03-02 14:10:40 +01:00
Sam Brannen
e89cc9934f Delete unused method 2021-03-02 14:00:36 +01:00
Sam Brannen
010b7375fc Fix typo in Javadoc 2021-03-02 14:00:21 +01:00
Sam Brannen
01c2e12fef Polish contribution
See gh-26619
2021-03-02 13:54:01 +01:00
GungnirLaevatain
90de1ab6d1 Ensure local @CrossOrigin maxAge overrides global value
Prior to this commit, a method-level @CrossOrigin maxAge value did not
override a class-level @CrossOrigin maxAge value. This contradicts the
Javadoc for @CrossOrgin which states the following.

    For those attributes where only a single value can be accepted such
    as allowCredentials and maxAge, the local overrides the global
    value.

This commit ensures that a method-level @CrossOrigin maxAge value
overrides a class-level @CrossOrigin maxAge value.

Closes gh-26619
2021-03-02 13:21:35 +01:00
Brian Clozel
5a11569790 Allow ServerHttpRequest content-type mutation
Prior to this commit, `ServerHttpRequest.mutate()` would not reflect
changes made on the "Accept" and "Content-Type" HTTP headers.
This was due to the fact that the instantiation of a new request based
on the mutated values would not use the writable HTTP headers used
during the mutation, but rather a read-only view of the headers backed
by `ReadOnlyHttpHeaders`.

`ReadOnlyHttpHeaders` caches those values for performance reasons, so
getting those from the new request would not reflect the changes made
during the mutation phase.

This commit ensures that the new request uses the mutated headers.

Fixes gh-26615
2021-03-01 20:55:03 +01:00
Oleksandr Kravchuk
0087578469 Fix @EventListener example in reference manual
Closes gh-26622
2021-03-01 20:22:58 +01:00
Arjen Poutsma
1a79c54b01 Support quoted boundary in DefaultPartHttpMessageReader
This commit makes sure that quoted boundary parameters are supported in
the DefaultPartHttpMessageReader.

Closes gh-26616
2021-03-01 14:07:20 +01:00
Juergen Hoeller
4af7a6863b Polishing 2021-02-26 17:49:10 +01:00
Juergen Hoeller
c084936870 Upgrade to Jetty 9.4.37, Caffeine 2.9, Mockito 3.8, Checkstyle 8.40 2021-02-26 17:31:30 +01:00
Juergen Hoeller
48bd81341f Add javadoc for body parameter
See gh-26613
2021-02-26 17:31:14 +01:00
k3v1n
118d8133d3 Add missing nullable annotation to ResponseEntity ok convenience method 2021-02-26 17:00:32 +01:00
Rossen Stoyanchev
c2137a0d2f Cancel handling onError/Timeout in ServletHttpHandlerAdapter
This commit ensures handling is cancelled in case of onError/Timeout
callback from the Servlet container.

Separately we detect the same in ServletServerHttpRequest and
ServletServerHttpResponse, which signal onError to the read publisher
and cancel writing, but if the onError/Timeout arrives after reading
is done and before writing has started (e.g. longer handling), then
neither will reach handling.

See gh-26434, gh-26407
2021-02-26 14:29:01 +00:00
Rossen Stoyanchev
8c9c59eba0 Fix typo
See gh-24539
2021-02-25 18:33:35 +00:00
Rossen Stoyanchev
8ed7f4703b Improve Javadoc for responseType on RestTemplate#exchange
Closes gh-26599
2021-02-25 18:29:05 +00:00
Rossen Stoyanchev
e04269cadd Consistently check DispatcherType to avoid NPE in tests
Closes gh-26602
2021-02-25 18:20:34 +00:00
Rossen Stoyanchev
aa73f6733e Lenient treatment of malformed Accept header for @ExceptionHandler
Closes gh-24539
2021-02-25 17:58:32 +00:00
Juergen Hoeller
b5147a034c Polishing
See gh-26574
See gh-26575
2021-02-25 18:08:04 +01:00
Craig Andrews
ebf6fff312 Fix handling of file: paths to non-existent files
For setAsText, if the text argument is a file: URL for a path that does not exist, Paths.get(text) is called where text is a file: URL, which doesn't work - the result is an InvalidPathException.

To fix this issue, also check that the resource isn't a file before calling Paths.get(). That way, resources that are files skip to the other branch.
2021-02-25 17:55:55 +01:00
Craig Andrews
dee12db50a getResource can throw IllegalArgumentException
Class.getResource, ClassLoader.getResource, and ClassLoader.getSystemResource will throw IllegalArgumentException if a malformed URL is provided to them.

According to its javadoc, resolveURL should return null if not resolvable, so catch the IllegalArgumentException and return null.
2021-02-25 17:55:24 +01:00
Juergen Hoeller
e53cce0778 Allow AOP proxies to be created using the original ClassLoader
Closes gh-26601
2021-02-25 17:48:01 +01:00
Sam Brannen
8baf404893 Polish contribution
See gh-26600
2021-02-25 11:41:11 +01:00
nullzl
a33eac3ec0 Correctly set auto-growing array's element
Prior to this commit, the implementation of processKeyedProperty() in
AbstractNestablePropertyAccessor resulted in a
`java.lang.IllegalArgumentException: array element type mismatch` when
the property expression had more than one property key and the last key
should cause the array to grow automatically.

For example, given a property `int[][] multiArray` and property
expression `multiArray[1][3]`, the `processKeyedProperty()` method
created a new array object and assigned it to `multiArray`; whereas,
the new array object should have be assigned to `multiArray[1]`.

This commit fixes this issue.

Closes gh-26600
2021-02-25 11:25:54 +01:00
Arjen Poutsma
eb68e6a62a Support SUN as minimum of range in CronExpression
This commit makes sure that SUN can be used at the beginning of a range,
 like SUN-FRI.

Closes gh-26598
2021-02-25 10:50:34 +01:00
Sam Brannen
a9240e0bac Document all supported SpringProperties keys in the reference manual
Closes gh-26554
2021-02-24 17:18:04 +01:00
Sam Brannen
262b7d7c27 Polishing 2021-02-24 17:14:10 +01:00
Sam Brannen
31d9f31806 Polish Javadoc for @DateTimeFormat 2021-02-24 11:38:07 +01:00
Rossen Stoyanchev
0fd774e69f Add allowedOriginPatterns to WebSocketHandlerRegistration
Closes gh-26593
2021-02-24 09:37:20 +00:00
Rossen Stoyanchev
ec5774e748 Polishing
Closes gh-26577
2021-02-24 09:37:20 +00:00
fengyuanwei
962ec38a61 Improve Javadoc of ExchangeFunction
See gh-26577
2021-02-24 09:37:20 +00:00
Rossen Stoyanchev
3ec0452fed Dedicated, "_"-prefixed log category for request mappings
Closes gh-26539
2021-02-24 09:36:43 +00:00
ShaoqiangLu
cb3af52df2 Add vscode folder to .gitignore
Closes gh-26595
2021-02-23 17:43:39 +01:00
Sam Brannen
5b114b7208 Cross reference DataClassRowMapper from BeanPropertyRowMapper 2021-02-23 17:30:11 +01:00
Sam Brannen
f7cef2ab20 Remove section on RequiredAnnotationBeanPostProcessor in ref docs
In order to reduce the focus on the deprecated @Required support, this
commit removes the RequiredAnnotationBeanPostProcessor section and
replaces it with a TIP and an updated NOTE.

See gh-26578
2021-02-23 16:21:07 +01:00
Brian Clozel
77a658f51b Fix registration of ApplicationStartupAware
Closes gh-26576
2021-02-23 11:45:53 +01:00
Johnny Lim
cf4e77907f Fix MockHttpServletRequest reference in Javadoc
Closes gh-26592
2021-02-23 10:43:38 +01:00
Sam Brannen
42a223b9cd Upgrade to Gradle 6.8.3 2021-02-22 23:00:49 +01:00
Sam Brannen
6d2fec383b Reduce focus on RequiredAnnotationBeanPostProcessor in ref docs
See gh-26578
2021-02-22 18:41:50 +01:00
Oleksandr Kravchuk
90ee22f2af Update reference manual regarding deprecated @Required annotation
Closes gh-26578
2021-02-22 17:54:53 +01:00
Sam Brannen
db5be44ff4 Polishing 2021-02-22 17:02:17 +01:00
Sam Brannen
a78c12b8d3 Fix Javadoc for PlaceholderConfigurerSupport 2021-02-22 17:02:01 +01:00
Johnny Lim
dfc8406917 Polish contribution
See gh-26462
Closes gh-26586
2021-02-22 11:05:25 +01:00
Sam Brannen
313e754a84 Support load-time weaving for @Component classes again
Since Spring Framework 5.2, the LoadTimeWeaver no longer weaves bean
classes annotated with @Component. This is a regression caused by the
changes in 40c62139ae, stemming from the fact that any class annotated
or meta-annotated with @Component is considered to be a candidate
configuration class in 'configuration lite' mode (i.e., a class without
the @Configuration annotation and without any @Bean methods) and
therefore now has its class eagerly loaded. This results in the class
being loaded before the LoadTimeWeaver has a chance to weave it.

This commit fixes this regression by explicitly avoiding eager class
loading for any 'lite' @Configuration or @Component class without @Bean
methods.

Closes gh-26199
2021-02-22 09:59:22 +01:00
Sam Brannen
207ee9e307 Polishing 2021-02-21 19:14:05 +01:00
Sam Brannen
3215880d08 Remove Javadoc link to private method 2021-02-21 19:13:02 +01:00
Rossen Stoyanchev
274db2f7a9 Undo HttpServletMapping support in MockHttpServletRequest
Closes gh-26555
2021-02-19 12:07:05 +00:00
Rossen Stoyanchev
1dd7d53de0 More precise mapping for WebSocket handshake requests
Closes gh-26565
2021-02-19 11:49:44 +00:00
Sam Brannen
8535193df3 Update copyright date for DynamicIntroductionAdvice
See gh-26568
2021-02-18 13:02:10 +01:00
heqiang
a78701cc4b Fix Javadoc link in DynamicIntroductionAdvice
Closes gh-26568
2021-02-18 12:54:15 +01:00
Brian Clozel
947387b4cd Fix ResourceUrlProvider handler auto-detection
Prior to this commit, `ResourceUrlProvider` would listen and consider
all `ContextRefreshedEvent` and use the given context to detect
`SimpleUrlHandlerMapping`.

This could lead to situations where a `ResourceUrlProvider` uses another
application context than its own (in a parent/child context setup) and
detect the wrong set of handlers.

Because `ResourceUrlProvider` locks itself once the auto-detection is
done, we need to ensure that it considers only events sent by its
application context.

Fixes gh-26561
2021-02-17 22:04:39 +01:00