Commit Graph

3266 Commits

Author SHA1 Message Date
Juergen Hoeller 3a08d643ed Upgrade to ASM master (including early support for Java 21 bytecode)
Closes gh-29910
2023-01-31 16:06:33 +01:00
Juergen Hoeller 7c9dca3d2e Declare no-op close() method in order to avoid container-triggered shutdown call
Closes gh-29892
2023-01-31 16:03:26 +01:00
Chen Jianbin 9e735d4f0f Normalize and optimize internals of CGLIB ParallelSorter
Closes gh-29516
2023-01-31 12:20:45 +01:00
Sam Brannen 64b89429cb Update copyright headers 2023-01-31 11:52:25 +01:00
xavier-b b7d53ac9a4 Use DataBuffer::toString instead of CharBuffer
This commit ensures that converting DataBuffers to a String does not
use an expensive ByteBuffer allocation.

Closes gh-29889
2023-01-30 14:58:48 +01:00
Sam Brannen 75046bbea0 Update copyright headers 2023-01-28 20:42:21 +01:00
Sam Brannen 556863d401 Polishing 2023-01-27 17:54:03 +01:00
Sébastien Deleuze e6397c8a38 Infer reflection hints for Jackson annotation class attributes
Closes gh-29646
Closes gh-29386
2023-01-23 13:21:34 +01:00
Sam Brannen fa1ef1dc85 Deprecate obsolete ConcurrentExecutorAdapter for removal in 6.1
Closes gh-29865
2023-01-20 14:20:18 +01:00
Sam Brannen 58872c79ee Update copyright headers 2023-01-20 14:17:53 +01:00
Sam Brannen 24f18275dd Stop referring to "Spring 3.x" features in documentation and code 2023-01-20 14:13:18 +01:00
Sam Brannen 0502d18e3d Update copyright headers 2023-01-19 16:20:03 +01:00
Sam Brannen c4c786596f Migrate to Mockito.mock(T...) where feasible 2023-01-19 16:20:02 +01:00
Sam Brannen 64de6de725 Update copyright headers 2023-01-17 15:49:26 +01:00
Brian Clozel 5448e81021 Deprecate Base64Utils in favor of Java's Base64
Originally, `Base64Utils` was providing base64 encoding and decoding
utilities, bridging to commons-codecs or Java 8, if available. Since
then, only the Java 8 variant remains and Spring Framework 6 requires
now Java 17. This utility class doesn't provide additional checks or
syntactic sugar over what's in Java already.

As a result, this commit deprecates this class in favor of `Base64` and
schedules the removal of this class completely.

Closes gh-28434
2023-01-17 15:30:45 +01:00
j3graham f7e07322ab Simplify Base64Utils by using java.util.Base64
This commit simplifies the `Base64Utils` implementation by relying more
on the `Base64` methods that perform similar work.

See gh-28434
2023-01-17 15:29:58 +01:00
정준영 37217a63e1 Remove unnecessary calls to Reference::clear
Prior to this commit, `ConcurrentReferenceHashMap` subclasses extending
`Reference` would call `Reference::clear` right next to
`Reference::enqueue`; this is not needed as the latter calls it already.

Closes gh-28863
2023-01-17 14:44:39 +01:00
Sam Brannen a4956dfe26 Update copyright headers 2023-01-11 13:52:20 +01:00
Sam Brannen 0415975dd1 Polish contribution and related code 2023-01-11 13:52:20 +01:00
Krzysztof Krason afb8a0d1b1 Use new Java features (switch expressions, text blocks, new JDK methods)
Closes gh-29747
2023-01-11 13:51:28 +01:00
Sam Brannen d5fb5d029b Polish contribution 2023-01-10 16:07:48 +01:00
Vasiliy Kudriavtsev 3738a45658 Avoid wasted memory on empty maps and sets
This commit avoids wasted memory on empty hash maps in
MergedAnnotationReadingVisitor and empty sets in InjectionMetadata.

Closes gh-29742
2023-01-10 15:52:17 +01:00
Sam Brannen d4623a393b Update copyright headers 2022-12-18 12:16:19 +01:00
Sam Brannen 5c28b56823 Remove duplicated words in Javadoc 2022-12-18 12:05:18 +01:00
Sam Brannen b5b80d0a07 Polishing 2022-12-16 14:50:02 +01:00
Carlos Belizón 5d2ca11315
Fix manipulating property sources example in Javadoc for ConfigurableEnvironment
The "manipulating property sources" example in the Javadoc for
`ConfigurableEnvironment` states that `MutablePropertySources`
expect a `Map<String,String>`; whereas it expects a
`Map<String,Object>`.

Closes gh-29693
2022-12-16 13:47:40 +01:00
Sam Brannen 6e08c56076 Improve Javadoc for RepeatableContainers 2022-12-14 13:40:43 +01:00
Sam Brannen fb6d3f5b5c Remove duplicated test code 2022-12-14 13:26:51 +01:00
Sam Brannen e7bcb48e57 Remove obsolete AttributeMethods.hasOnlyValueAttribute() method
See gh-29685
2022-12-13 16:01:05 +01:00
Sam Brannen 433b1c480c Support repeatable annotation containers with multiple attributes
Prior to this commit, there was a bug in the implementation of
StandardRepeatableContainers.computeRepeatedAnnotationsMethod() which
has existed since Spring Framework 5.2 (when
StandardRepeatableContainers was introduced). Specifically,
StandardRepeatableContainers ignored any repeatable container
annotation if it declared attributes other than `value()`. However,
Java permits any number of attributes in a repeatable container
annotation.

In addition, the changes made in conjunction with gh-20279 made the bug
in StandardRepeatableContainers apparent when using the
getMergedRepeatableAnnotations() or findMergedRepeatableAnnotations()
method in AnnotatedElementUtils, resulting in regressions for the
behavior of those two methods.

This commit fixes the regressions and bug by altering the logic in
StandardRepeatableContainers.computeRepeatedAnnotationsMethod() so that
it explicitly looks for the `value()` method and ignores any other
methods declared in a repeatable container annotation candidate.

Closes gh-29685
2022-12-13 16:00:55 +01:00
Sam Brannen 0b08246760 Revise RepeatableContainersTests 2022-12-13 15:54:43 +01:00
Sébastien Deleuze b27735d4a6 Refine BindingReflectionHintsRegistrar Kotlin support
Closes gh-29593
2022-12-11 12:02:55 +01:00
Sébastien Deleuze dc5a773b2b Support properties on records in BindingReflectionHintsRegistrar
Closes gh-29571
2022-12-10 16:12:23 +01:00
Sam Brannen b0b2bbc857 Polish CGLIB fork
- primarily automated "clean up" using Eclipse IDE
2022-12-09 00:56:38 -05:00
Sam Brannen 69f47e7700 Polishing
- primarily automated "clean up" using Eclipse IDE
2022-12-09 00:56:00 -05:00
Sam Brannen 098c924e32 Introduce @Suite classes for individual modules 2022-12-07 12:12:41 -05:00
Brian Clozel d601f3196a Fix BindingReflectionHintsRegistrar anonymous classes support
This commit ensures that giving an anonymous class for reflection hints
registration does not result in a NullPointerException, since the
canonical name of anonymous classes is null.

Fixes gh-29657
2022-12-07 16:37:01 +01:00
Arjen Poutsma 92a6e7ddcd Fix InputStream violation in DataBufferInputStream
This commit fixes an issue in DataBufferInputStream::mark, which before
did not follow the contract defined by InputStream.

Closes gh-29642
2022-12-07 15:23:19 +01:00
Brian Clozel 4a555aaef1 Reduce heap memory usage in ConcurrentLruCache
Prior to this commit, the `ConcurrentLruCache` implementation would use
arrays of `AtomicReference` as operation buffers, and the buffer count
would be calculated with the nearest power of two for the CPU count.

This can result in significant heap memory usage as each
`AtomicReference` buffer entry adds to the memory pressure. As seen in
FasterXML/jackson-databind#3665, this can add a significant overhead for
no real added benefit for the current use case.

This commit changes the current implementation to use
`AtomicReferenceArray` as buffers and reduce the number of buffers.
JMH benchmarks results are within the error margin so we can assume that
this does not change the performance characteristics for the typical use
case in Spring Framework.

Fixes gh-29520
2022-12-05 13:02:11 +01:00
Sam Brannen ad60164911 Update copyright headers for source code changed since August 2022
The changes in this commit were performed using the newly introduced
update_copyright_headers.sh script.
2022-11-29 19:38:42 +01:00
Sam Brannen fdec9f0adc Apply "instanceof pattern matching" 2022-11-29 18:09:42 +01:00
Sam Brannen a88dbbec98 Apply project formatting rules for ternary operator
Discovered via RegEx: ^\s+\?
2022-11-29 17:51:13 +01:00
Juergen Hoeller 8e5eb84da1 Consistently register CGLIB hints for lazy resolution proxy classes
Core JDK/CGLIB proxy registration code extracted to ClassHintUtils.

Closes gh-29584
2022-11-26 13:38:34 +01:00
Juergen Hoeller b7e99fbe30 Additional documentation notes on Java/Kotlin parameter name retention
See gh-29563
2022-11-24 14:08:53 +01:00
Juergen Hoeller cbf25b704d Reduce deprecation warn logging to one entry per introspected class
Closes gh-29563
2022-11-24 12:01:03 +01:00
Juergen Hoeller fe5bd6751f Retain default LocalVariableTableParameterNameDiscoverer with warn log entries
For a transition period, LocalVariableTableParameterNameDiscoverer logs a warning for each successful resolution attempt now, suggesting that -parameters was missed.

See gh-29531
See gh-29559
2022-11-23 10:31:43 +01:00
Juergen Hoeller beb9fa2b8b Add since attribute to Deprecated annotation
Also retaining standard Java parameter names for Spring's AspectJ sources now.

See gh-29531
2022-11-22 21:18:34 +01:00
Juergen Hoeller 459e8a1ea5 Deprecate LocalVariableTableParameterNameDiscoverer completely
LocalVariableTableParameterNameDiscoverer is not registered by default anymore now.
Java sources should be compiled with `-parameters` instead (available since Java 8).
Also retaining standard Java parameter names for all of Spring's Kotlin sources now.

Closes gh-29531
2022-11-22 19:26:15 +01:00
Sam Brannen 7fcd1de8e3 Use AssertJ's isEmpty() instead of hasSize(0)
Achieved via global search-and-replace.
2022-11-22 17:11:50 +01:00
Sam Brannen d5b0b2b1a1 User AssertJ's hasSize() for arrays
Achieved via global search-and-replace.
2022-11-22 17:03:45 +01:00