Commit Graph

23450 Commits

Author SHA1 Message Date
Sam Brannen
2bf5f7a6b3 Introduce lenient parsing in DataSize regarding whitespace
Prior to this commit, a DataSize input string could not be parsed if it
contained any whitespace.

With this commit, a DataSize input string can contain leading, trailing,
or 'in between' whitespace. For example, the following will be parsed
to the same DataSize value.

- "1024B"
- "1024 B"
- " 1024B "
- " 1024 B "

Closes gh-28643
2022-07-04 19:24:58 +02:00
Sam Brannen
bf39492c34 Introduce StringUtils.trimAllWhitespace(CharSequence)
Closes gh-28757
2022-07-04 19:24:45 +02:00
rstoyanchev
007bdede46 Add missing check to avoid re-initialization
Noticed during review of #28736 that a check protecting against
re-initialization was accidentally removed in commit
3d6e38bb43.
2022-07-04 16:17:57 +01:00
rstoyanchev
22cc6c5918 Polishing contribution
Closes gh-28736
2022-07-04 16:12:57 +01:00
CodeInDreams
461ba53b39 Qualify channelExecutor and taskScheduler in WebSocket config
See gh-28736
2022-07-04 15:51:40 +01:00
Sam Brannen
d1d6eb095e Fix GenericApplicationContextTests on Microsoft Windows (round 2)
The previous change to the tests resulted in a failure on Windows when
using the DefaultResourceLoader by expecting an exception when no
exception is thrown.

This commit narrows the scope of the if-clause to expect an exception
only when using the FileSystemResourceLoader on Windows.

See gh-28703, gh-28746
2022-07-03 17:59:37 +02:00
Sam Brannen
f732fab820 Delete unused imports and dead code in CGLIB fork 2022-07-03 17:30:30 +02:00
Sam Brannen
fda3f8201a Switch warning level for forbidden reference to INFO in Eclipse IDE 2022-07-03 17:23:55 +02:00
Sam Brannen
e608b36713 Improve GenericApplicationContextTests.getResource*() tests
This commit updates the tests so that they test something meaningful on
MS Windows as well as on Linux/Mac.

See gh-28703, gh-28746
2022-07-03 14:36:41 +02:00
jason
59180e76a7 Fix GenericApplicationContextTests on Microsoft Windows
The tests introduced in commit 9868c28c73 pass on Mac OS and Linux but
fail on Microsoft Windows.

This commit updates the tests so that they pass on MS Windows as well.

See gh-28703
Closes gh-28746
2022-07-03 14:35:07 +02:00
Sam Brannen
c5987d7c37 Fix typo in test 2022-07-02 17:09:07 +02:00
Sam Brannen
5650e20edd Polishing 2022-07-01 10:42:23 +02:00
Johnny Lim
2885177f5b Add @since tag for new CannotGetJdbcConnectionException constructor
See gh-28669
Closes gh-28738
2022-07-01 10:39:35 +02:00
rstoyanchev
058ce36402 Improve ExtendedWebExchangeDataBinder implementation
Close gh-28646
2022-07-01 03:23:32 +01:00
Vikey Chen
2afe560e41 Replace forEach with putAll
See gh-28646
2022-07-01 03:01:12 +01:00
rstoyanchev
b95362a3fd Avoid request params access for form data in logRequest
Close gh-28587
2022-07-01 02:55:16 +01:00
Sam Brannen
9ea45697ac Support cookie comments in MockHttpServletResponse and MockCookie
Prior to this commit, if a cookie was added to MockHttpServletResponse,
the comment attribute was not included in the generated Set-Cookie
header. In addition, MockCookie.parse(String) did not support the
Comment attribute.

This commit addresses both of these issues.

Closes gh-28730
2022-06-30 16:51:43 +02:00
Johnny Lim
fe2b8580a0 Upgrade to Gradle Enterprise Conventions 0.0.10 2022-06-30 14:59:55 +02:00
Sam Brannen
622fc3edf7 Fix merged annotation attributes regression
Commit d6768ccc18 introduced a regression in the support for merging
annotation attributes in a multi-level annotation hierarchy.

This commit addresses that issue by ensuring that a merged annotation
is once again synthesized if a meta-annotation in the annotation
hierarchy declares attributes that override attributes in the target
annotation.

Closes gh-28716
2022-06-28 14:22:53 +02:00
Sam Brannen
9868c28c73 Honor ProtocolResolvers in GenericApplicationContext
When the ProtocolResolver SPI was introduced in Spring Framework 4.3,
support for protocol resolvers was added in DefaultResourceLoader's
getResource() implementation; however, GenericApplicationContext's
overridden getResource() implementation was not updated accordingly.

Prior to this commit, if a GenericApplicationContext was configured
with a custom ResourceLoader, registered protocol resolvers were
ignored.

This commit ensures that protocol resolvers are honored in
GenericApplicationContext even if a custom ResourceLoader is used.

Closes gh-28703
2022-06-27 18:00:29 +02:00
Sam Brannen
a970516080 Polish GenericApplicationContextTests 2022-06-27 17:05:02 +02:00
Sam Brannen
0c9def89de Ignore build artifacts from the main branch for nohttp 2022-06-27 15:05:05 +02:00
Sam Brannen
8892a05868 Ignore /spring-core/graalvm/build artifacts from the main branch
This commit eases switching between the `main` and `5.3.x` branches.
2022-06-27 14:43:06 +02:00
Sam Brannen
d6768ccc18 Ensure meta-annotations are not unnecessarily synthesized
Prior to this commit, meta-annotations were unnecessarily synthesized
when attempting to synthesize a MergedAnnotation retrieved via the
MergedAnnotations.from(AnnotatedElement, ...).get(<annotationType>) API.

This is a regression in our merged annotation support that was
introduced when the MergedAnnotations API replaced our previous support.

This commit fixes this by revising the logic in TypeMappedAnnotation's
createSynthesizedAnnotation() method so that a meta-annotation is
returned unmodified if it is not synthesizable.

This commit also updates BootstrapUtilsTests, since @BootstrapWith
should never have been synthesized, and Class#getCanonicalName() is
only used in the toString() implementation of an annotation synthesized
by Spring or normal annotations on Java 19+ (see
https://bugs.openjdk.org/browse/JDK-8281462).

Closes gh-28704
2022-06-25 20:02:04 +02:00
Sam Brannen
faf20b7a5a Polish MergedAnnotations Javadoc and internals 2022-06-25 19:50:03 +02:00
Sam Brannen
661996471e Polishing 2022-06-25 19:24:51 +02:00
Stephane Nicoll
5639ff0939 Merge pull request #28669 from kevin0x90
* pr/28669:
  Polish "Fix DataSourceUtils inconsistent exception handling"
  Fix DataSourceUtils inconsistent exception handling

Closes gh-28669
2022-06-23 09:04:40 +02:00
Stephane Nicoll
e98b602d4f Polish "Fix DataSourceUtils inconsistent exception handling"
See gh-28669
2022-06-23 09:01:39 +02:00
Kevin Schönfeld
edfe5d2f18 Fix DataSourceUtils inconsistent exception handling
Align IllegalStateException with SQLException handling and propagate
the original exception.

See gh-28669

Co-authored-by: Christoph Mies <chr.mi@web.de>
2022-06-23 09:01:39 +02:00
Sam Brannen
26df4580b3 Revise internals of LoggingCacheErrorHandler
Since LoggingCacheErrorHandler was only recently introduced in 5.3.16,
we have decided to completely revise its internals (protected API) in
5.3.x while retaining the current public API.

Specifically, this commit:

- introduces protected getLogger() and isLogStackTraces() methods to
  improve extensibility

- revises logCacheError() to accept a Supplier<String> for lazy
  resolution of error messages

Closes gh-28672
See gh-28670, gh-28648
2022-06-21 16:13:55 +02:00
Vedran Pavic
57208bf47a Simplify LoggingCacheErrorHandlerTests
See gh-28648
2022-06-21 14:40:09 +02:00
Sam Brannen
8b34558284 Polish LoggingCacheErrorHandler 2022-06-21 14:07:39 +02:00
Vedran Pavic
dbe8f200a9 Simplify creation of LoggingCacheErrorHandler with logged stacktrace
At present, creating a LoggingCacheErrorHandler that logs stack traces
also requires supplying the logger to be used. This might be
inconvenient for some users, as it requires usage of the Commons
Logging API.

This commit simplifies creation of such as LoggingCacheErrorHandler
instance by adding a constructor that only accepts a boolean flag
indicating whether to log stack traces.

Closes gh-28670
2022-06-21 13:50:10 +02:00
Sam Brannen
ea4d9a20ac Upgrade to Hamcrest 2.2 2022-06-21 13:48:02 +02:00
Sam Brannen
e19e9757d4 Polishing 2022-06-20 15:19:02 +02:00
Jerome Prinet
2473e956ff Update Gradle Enterprise plugin
Closes gh-28661
2022-06-20 11:40:43 +02:00
Sébastien Deleuze
854307d8d8 Document that Kotlin inline classes are not supported
Closes gh-28642
2022-06-17 12:34:58 +02:00
Sébastien Deleuze
3401359bdf Refine @Required Kotlin documentation
Refine @Required Kotlin documentation to use
annotation use site targets.

Closes gh-28630
2022-06-17 12:25:52 +02:00
Sébastien Deleuze
f1c00dd8a6 Fix a typo in ResponseEntity documentation
Closes gh-28647
2022-06-17 12:15:22 +02:00
Sam Brannen
bdf91ac435 Set default encoding for Eclipse projects to UTF-8
This change aligns with Java 18 support in recent versions of Eclipse.
2022-06-16 16:13:35 +02:00
Lars Grefer
181023c0c3 Update to Bouncycastle 1.71
Closes gh-28636
2022-06-16 16:03:11 +02:00
Sam Brannen
fb1fa073a6 Polishing 2022-06-15 15:07:58 +02:00
Sam Brannen
e9806a96dc Polish contribution and introduce test
See gh-28631
2022-06-15 15:07:58 +02:00
Johnny Lim
9b93508374 Add MockMvcRequestBuilders.multipart(HttpMethod, String, Object...)
See gh-28545
Closes gh-28631
2022-06-15 14:09:59 +02:00
Sam Brannen
8b4750e705 Fix Kotlin example for @ComponentScan basePackages attribute
Closes gh-28628
2022-06-15 11:27:39 +02:00
Spring Builds
2e033339d1 Next development version (v5.3.22-SNAPSHOT) 2022-06-15 08:17:52 +00:00
Stephane Nicoll
c75da7ba10 Upgrade to Reactor 2020.0.20
Closes gh-28612
2022-06-14 19:27:03 +02:00
Sam Brannen
eeac150030 Polish contribution
See gh-28616
2022-06-14 16:42:51 +02:00
Fabian Gonzalez
0ce9516aef Avoid eager instantiation of non-singleton FactoryBean in getBeanNamesForType
Closes gh-28616
2022-06-14 16:42:31 +02:00
Sam Brannen
e47cc44947 Polish DefaultListableBeanFactoryTests 2022-06-14 16:38:11 +02:00