Commit Graph

31309 Commits

Author SHA1 Message Date
Sébastien Deleuze effe606b28 Refine record canonical constructor support in BeanUtils
This commit refines the contribution with the following changes:
 - Move the support to findPrimaryConstructor
 - Use a for loop instead of a Stream for more efficiency
 - Support other visibilities than public
 - Polishing

Closes gh-33707
2024-10-16 17:38:47 +02:00
evgenijnikiforov 514d6000d1 Support record canonical constructor in BeanUtils
See gh-33707
2024-10-16 17:38:47 +02:00
Sam Brannen 161d3995bf Introduce BeanOverrideHandler.createOverrideInstance() template method 2024-10-16 17:31:19 +02:00
Sam Brannen da856de100 Revise BeanOverrideRegistrar and rename it to BeanOverrideRegistry 2024-10-16 17:31:19 +02:00
Juergen Hoeller fa955934e7 Merge branch '6.1.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java
2024-10-16 17:19:30 +02:00
Juergen Hoeller fde7116ae4 Consistently skip processing of plain Java annotations
Closes gh-33580
2024-10-16 17:17:22 +02:00
rstoyanchev 92c9b0dc97 Reduce logging for unsent SUBSCRIBE messages
Closes gh-28252
2024-10-16 16:14:10 +01:00
Sam Brannen c0c78bd67e Rename OverrideMetadata for Bean Overrides
Prior to this commit, OverrideMetadata was the only public type in the
org.springframework.test.context.bean.override package whose name did
not start with BeanOverride. In addition, an OverrideMetadata component
plays multiple roles in addition to serving as a holder for metadata.

This commit therefore renames OverrideMetadata to BeanOverrideHandler.

In addition, this commit updates the affected documentation and renames
the following related methods in the Bean Override support.

- BeanOverrideHandler: createOverride() -> createOverrideInstance()
- BeanOverrideHandler: track() -> trackOverrideInstance()
- BeanOverrideProcessor: createMetadata() -> createHandler()
- BeanOverrideContextCustomizer: getMetadata() -> getBeanOverrideHandlers()
- BeanOverrideRegistrar: registerNameForMetadata() -> registerBeanOverrideHandler()
- BeanOverrideRegistrar: markWrapEarly() -> registerWrappingBeanOverrideHandler()

Closes gh-33702
2024-10-16 16:32:38 +02:00
Brian Clozel ab4fe5a29c Merge branch '6.1.x' 2024-10-16 16:26:12 +02:00
Brian Clozel 0a645916cd Add checkstyle rule for toLowerCase/toUpperCase
This commit adds a checkstyle rule that prevents the re-introduction of
such calls.

See gh-33708
2024-10-16 16:25:03 +02:00
Sébastien Deleuze beac903423 Merge branch '6.1.x' 2024-10-16 14:21:11 +02:00
Habin Song 5302e7aa25 Update fallback.adoc
Fix a typo.

Closes gh-33721
2024-10-16 14:20:56 +02:00
Sébastien Deleuze 0e70117d77 Merge branch '6.1.x' 2024-10-16 14:17:17 +02:00
github-actions[bot] cad02c1743 Update Antora Spring UI to v0.4.17 2024-10-16 14:15:55 +02:00
rstoyanchev ca820c914f Polishing contribution
Closes gh-33715
2024-10-16 13:06:22 +01:00
Yanming Zhou f35ed8d044 Improve check whether to lowercase scheme
See gh-33715

```
Map has no value for 'thescheme'
java.lang.IllegalArgumentException: Map has no value for 'thescheme'
	at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
	at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:436)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
	at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
	at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:364)
```
2024-10-16 12:54:33 +01:00
Juergen Hoeller e89218b39a Merge branch '6.1.x' 2024-10-16 13:46:22 +02:00
Juergen Hoeller c765d03a59 Use Locale.ROOT consistently for toLower/toUpperCase
Closes gh-33708
2024-10-16 13:44:59 +02:00
Juergen Hoeller 11d4272ff4 Use Locale.ROOT consistently for toLower/toUpperCase
Closes gh-33708
2024-10-16 13:36:23 +02:00
rstoyanchev bdcfbee7df Merge branch '6.1.x' 2024-10-16 12:11:23 +01:00
rstoyanchev 23656aebc6 Use Locale.ROOT consistently for toLower/toUpperCase
See gh-33708
2024-10-16 12:05:54 +01:00
Juergen Hoeller fb6a6892ef Merge branch '6.1.x' 2024-10-16 11:36:30 +02:00
Juergen Hoeller feb6a5f52d Polishing 2024-10-16 11:35:23 +02:00
Simon Baslé dbbc578676 Polishing
Inline `AbstractMockitoTestExecutionListener` since there's now only one
Mockito `TestExecutionListener`.
2024-10-16 10:22:38 +02:00
Simon Baslé 6f79c7e70f Remove support for Mockito annotations and `MockitoSession`
This change remove the support for Mockito annotations, `MockitoSession`
and opening/closing of mocks that was inherited from Boot's `@MockBean`
support, as well as the switch to `MockitoSession` made in 1c893e6.

Attempting to take responsability for things Mockito's own JUnit
Jupiter extension does better is not ideal, and we found it leads to
several corner cases which make `SpringExtension` and `MockitoExtension`
incompatible in the current approach.

Instead, this change refocuses our Mockito bean overriding support
exclusively on aspects specific to the Framework. `MockitoExtension`
will thus be usable in conjunction with `SpringExtension` if one needs
to use `@Captor`/`@InitMocks`/`@Mock`/`@Spy` or other Mockito utilities.

See gh-33318
Closes gh-33692
2024-10-16 09:40:57 +02:00
rstoyanchev c261ca3102 Ensure scheme not lowercased if URI variable
Closes gh-33699
2024-10-15 20:50:01 +01:00
rstoyanchev a63cf06496 Update Javadoc snippets for static resource locations
Switch to FileUrlResource, the same as what is used get with
the "file:" prefix in webmvc and webflux config.

See gh-33712
2024-10-15 19:23:07 +01:00
rstoyanchev 789d7effa9 Assert static resource location
Closes gh-33712
2024-10-15 19:23:07 +01:00
Brian Clozel f204f4962d Document XML parser usage against security false positives
Prior to this commit, our XML parser usage would be already haredened
against XXE (XML External Entities) attacks. Still, we recently received
several invalid security reports claiming that our setup should be
hardened.

This commit documents a few usages of XML parsers to add some more
context and hopefully prevent future invalid reports.

Closes gh-33713
2024-10-15 18:59:02 +02:00
Habin Song 166714c8f5 Update scheduling.adoc
Change quotation marks to backticks.

Closes gh-33709
2024-10-15 18:21:42 +02:00
Sam Brannen 67cb3c77ec Rename BeanOverrideStrategy enum constants
Closes gh-33701
2024-10-15 18:19:59 +02:00
Rossen Stoyanchev 7ea43bb252
Update SECURITY.md 2024-10-15 17:13:29 +01:00
Brian Clozel 88b684c981 Update security policy and issue template
Because Spring Framework already has a security policy, this shows up in
the issue template automatically. This commit removes the extra external
link and updates the original security policy.

See gh-33711
2024-10-15 17:57:04 +02:00
Brian Clozel 3bc2c91eff Revisit GitHub issue template
Prior to this commit, this repository had a single issue template
markdown file that listed all the information for creating a new issue
in this project. Because there was a lot, people missed warnings against
creating security reports publicly or asking questions in the issue
tracker.

This commit introduces an issue template configuration that provides
developers with a choice before creating the actual issue.

Closes gh-33711
2024-10-15 17:36:48 +02:00
Stéphane Nicoll 7f7de55b67 Merge branch '6.1.x' 2024-10-15 14:59:10 +02:00
Stéphane Nicoll 453849ab20 Upgrade to Reactor 2024.0.0-RC1
Closes gh-33636
2024-10-15 14:57:44 +02:00
Stéphane Nicoll a228eb8bd6 Upgrade to Reactor 2023.0.11
Closes gh-33637
2024-10-15 14:56:57 +02:00
Stéphane Nicoll f03f074581 Merge branch '6.1.x' 2024-10-15 09:13:35 +02:00
Stéphane Nicoll c79b575417 Upgrade to Micrometer 1.14.0-RC1
Closes gh-33648
2024-10-15 09:07:45 +02:00
Stéphane Nicoll c015814140 Upgrade to Micrometer 1.12.11
Closes gh-33647
2024-10-15 09:06:27 +02:00
rstoyanchev 5099657244 Merge branch '6.1.x' 2024-10-14 18:18:39 +01:00
rstoyanchev 7d3a3d35ce Update valid path checks for double encoding
See gh-33687
2024-10-14 18:14:01 +01:00
rstoyanchev fb7890d739 Update processPath for double encoding
See gh-33689
2024-10-14 18:13:55 +01:00
Sébastien Deleuze 20cdd192d9 Merge branch '6.1.x' 2024-10-14 19:01:43 +02:00
Habin Song 7c2c4d7c9a Update scheduling.adoc
Change 'OutOfMemoryErrors' to 'OutOfMemoryError'.

Closes gh-33703
2024-10-14 19:01:33 +02:00
Sébastien Deleuze 60978ff4c7 Polish WebRequest Javadoc
See gh-33698
2024-10-14 17:07:07 +02:00
rstoyanchev cff6db02b4 Merge branch '6.1.x' 2024-10-14 16:00:48 +01:00
rstoyanchev 1a0b577bfc Do not support relative static resource paths
Closes gh-33687
2024-10-14 15:54:59 +01:00
rstoyanchev 3bfbe30a78 Normalize static resource path early
Rather than leaving it to the Resource implementation, and
potentially normalizing twice, we apply it once as part of the
initial processPath checks.

Closes gh-33689
2024-10-14 15:52:15 +01:00
Tran Ngoc Nhan e191c34078 Polishing
Closes gh-33681
2024-10-14 16:44:42 +02:00