Commit Graph

3758 Commits

Author SHA1 Message Date
Juergen Hoeller bb1cdb6b48 Consistently expose parameter annotations from base classes as well
Closes gh-25788
2024-01-08 21:03:32 +01:00
Stéphane Nicoll 1f2d29ee08 Polish 2024-01-08 17:12:33 +01:00
Juergen Hoeller 419e34e571 Introduce getMostSpecificMethod variant on BridgeMethodResolver
This is able to resolve the original method even if no bridge method has been generated at the same class hierarchy level (a known difference between the Eclipse compiler and regular javac).

Closes gh-21843
2024-01-07 16:33:06 +01:00
Juergen Hoeller d6c84c43ec Polishing 2024-01-06 23:24:48 +01:00
Juergen Hoeller 70247c4a94 Refine exception handling for type not present versus access exception
Includes TypeVariable bypass for reflection-free annotation retrieval.
Includes info log message for annotation attribute retrieval failure.

Closes gh-27182
2024-01-06 23:02:59 +01:00
Juergen Hoeller 07097976ef Polishing 2024-01-05 10:08:57 +01:00
Stéphane Nicoll af2e13e211 Polish 2024-01-05 06:34:09 +01:00
Juergen Hoeller 174eae377f Upgrade to ASM master (including early support for Java 23 bytecode)
Closes gh-31929
2023-12-31 13:29:50 +01:00
Stéphane Nicoll adcf236a3d Polish "Use Object.equals() where feasible"
See gh-31916
2023-12-28 13:21:46 +01:00
Yanming Zhou 72a9864788 Use Object.equals() where feasible
See gh-31916
2023-12-28 13:19:03 +01:00
Yanming Zhou 094479b55f Use diamond operator where feasible
See gh-31916
2023-12-28 13:08:08 +01:00
Yanming Zhou 4a450c6fab Use enhanced for loop where feasible
See gh-31916
2023-12-28 13:01:44 +01:00
Yanming Zhou 45080e3724 Remove unnecessary final modifier
final is useless for private and static methods

See gh-31916
2023-12-28 13:01:43 +01:00
Juergen Hoeller a338a16b29 Polishing 2023-12-27 23:23:38 +01:00
Juergen Hoeller 55d9d151fb Recommend ResourcePropertySource for distinct PropertySource names
Closes gh-28886
2023-12-27 23:19:27 +01:00
Stéphane Nicoll 12f6330fae Improve code coverage of PropertyPlaceholderHelper
See gh-26268
2023-12-22 11:07:16 +01:00
Sam Brannen 3476402a75 Polish switch statements 2023-12-21 17:30:56 +01:00
Juergen Hoeller b04803de99 Polishing 2023-12-21 17:20:29 +01:00
Sébastien Deleuze 85cb6cc5fb Support Kotlin extensions in web handlers
This commit restores support for Kotlin extensions in
web handlers, and adds support for invoking reflectively
suspending extension functions, as well as the other
features supported as of Spring Framework 6.1 like
value classes and default value for parameters.

Closes gh-31876
2023-12-21 12:16:33 +01:00
Stéphane Nicoll 1bd523f6b6 Polish 2023-12-20 09:52:55 +01:00
Stéphane Nicoll eaf7a28250 Write runtime hints with deterministic order
This commit updates the JSON writers to use a deterministic order for
arrays. Previously, the order could change with the same content,
breaking caching.

Closes gh-31852
2023-12-18 14:57:13 +01:00
Arjen Poutsma 1ff683b259 Correctly set capacity of remainder in DefaultDataBuffer::split
This commit ensures that the capacity of the remainder buffer after a
split operation is set directly on the field. Calling capacity(int)
caused a new buffer to be allocated.

Closes gh-31848
2023-12-18 11:45:02 +01:00
Stéphane Nicoll 22bf4df290 Polish 2023-12-16 19:19:33 +01:00
Sébastien Deleuze d2aa6a98f2 Polishing
Closes gh-31846
2023-12-15 10:12:15 +01:00
T45K bf0819390f Support Kotlin value classes as suspending function arguments
Similar to gh-31698 but for Coroutines.

See gh-31846
2023-12-15 10:11:59 +01:00
dogglezz 503ccb577c Remove unused imports
Closes gh-31851
2023-12-15 09:35:17 +01:00
Stéphane Nicoll 3c2c9ca186 Extract value code generation to make it reusable
This commit introduces ValueCodeGenerator and its Delegate interface
as a way to generate the code for a particular value. Implementations
in spring-core provides support for common value types such a String,
primitives, Collections, etc.

Additional implementations are provided for code generation of bean
definition property values.

Closes gh-28999
2023-12-13 07:05:58 +01:00
Sam Brannen 75da9c3c47 Scan annotations on method in interface hierarchy only once
Prior to this commit, the AnnotationsScanner used in the
MergedAnnotations infrastructure found duplicate annotations on methods
within multi-level interface hierarchies.

This commit addresses this issue by scanning methods at a given level
in the interface hierarchy using ReflectionUtils#getDeclaredMethods
instead of Class#getMethods, since the latter includes public methods
declared in super-interfaces which will anyway be scanned when
processing super-interfaces recursively.

Closes gh-31803
2023-12-12 18:28:53 +01:00
Sam Brannen 952223dcf9 Polish MergedAnnotation tests 2023-12-12 17:42:58 +01:00
Sam Brannen c0683cd30b Update copyright headers 2023-12-12 14:51:03 +01:00
Sam Brannen 1c58511cb2 Polishing 2023-12-12 14:51:03 +01:00
Brian Clozel 07d2571e0b Avoid race conditions while restructuring ConcurrentReferenceHashMap
Prior to this commit, the `ConcurrentReferenceHashMap#restructure`
operation would null out the entire references array before starting the
restructuring operation (in case resizing is not necessary).

This could cause at runtime race conditions where a lookup operation
would return null, when the value is actually cached but not accesible
during the restructuring phase.

This commit ensures that, when resizing is not required, a new reference
list is built (purged of null entries) and then assigned to the
reference array. This way, concurrent reads will not return null for
existing entries and there are less chances of re-calculating cache
entries during the restructuring phase.

Closes gh-31008
2023-12-12 10:18:58 +01:00
Sam Brannen 7432a96b48 Polish contribution
See gh-31808
2023-12-11 13:42:03 +01:00
Mathieu AMBLARD (u118971) a01384068a Fix Comparators.nullsLow and Comporators.nullsHigh behavior
Commit 33454a4007 introduced a regression in Comparators.nullsLow() and
Comporators.nullsHigh().

This commit updates the code so that nullsLow() sorts null values lower
than non-null values and nullsHigh sorts null values higher than
non-null values.

See gh-25478
Closes gh-31808
2023-12-11 13:18:24 +01:00
Juergen Hoeller c57b7e8418 Introduce ClassFormatException and spring.classformat.ignore property
Closes gh-27691
2023-12-09 20:03:57 +01:00
Stéphane Nicoll 2eba3510f7 Annotate generated classes with @Generated
This commit annotates every generated class with `@Generated` so that
build tools can recognize and ignore those types if necessary.

Closes gh-30824
2023-12-08 14:24:53 +01:00
Stéphane Nicoll 0717ea5ca5 Polish 2023-12-08 12:17:44 +01:00
Stéphane Nicoll e36d035f58 Remove leftovers
See gh-31690
2023-12-07 10:59:01 +01:00
Sam Brannen 438c3818cc Replace System.getProperties().remove(x) with System.clearProperty(x)
This commit migrates to the not-so-new System.clearProperty() method
introduced in Java 1.5.
2023-12-06 17:11:46 +01:00
Stéphane Nicoll 25537938d6 Polish contribution
See gh-31700
2023-12-06 15:00:14 +01:00
Yanming Zhou 9704b809b1 Add support for location patterns in ResourceArrayPropertyEditor
This commit adds support for comma delimited location patterns in
ResourceArrayPropertyEditor.

See gh-31700
2023-12-06 15:00:14 +01:00
Sam Brannen 1afea0b144 Fix and polish Javadoc for MimeTypeUtils 2023-12-06 14:30:16 +01:00
Johnny Lim 7b95bd72f7 Fix condition for "Too many elements" in MimeTypeUtils.sortBySpecificity()
See gh-31254
Closes gh-31769
2023-12-06 14:09:53 +01:00
Sam Brannen 448e753184 Honor classValuesAsString in getMergedRepeatableAnnotationAttributes()
Closes gh-31768
2023-12-06 12:09:39 +01:00
Sam Brannen 6b53f37030 Favor local @⁠ComponentScan annotations over meta-annotations
Work performed in conjunction with gh-30941 resulted in a regression.
Specifically, prior to Spring Framework 6.1 a locally declared
@⁠ComponentScan annotation took precedence over @⁠ComponentScan
meta-annotations, which allowed "local" configuration to override
"meta-present" configuration.

This commit modifies the @⁠ComponentScan search algorithm so that
locally declared @⁠ComponentScan annotations are once again favored
over @⁠ComponentScan meta-annotations (and, indirectly, composed
annotations).

See gh-30941 Closes gh-31704
2023-12-06 11:40:25 +01:00
Yanming Zhou afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou 7b16ef90f1 Replace assertThat(x.equals(y)) with assertThat(x).isEqualTo(y)
Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isTrue\(\)
Replace with : assertThat($1).isEqualTo($2)

Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isFalse\(\)
Replace with : assertThat($1).isNotEqualTo($2)

Closes gh-31763
2023-12-06 09:50:15 +01:00
Yanming Zhou e2852e7355 Replace assertThat(x.contains(y)).isTrue() with assertThat(x).contains(y)
Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isTrue\(\)
Replace with : assertThat($1).contains($2)

Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isFalse\(\)
Replace with : assertThat($1).doesNotContain($2)

Closes gh-31762
2023-12-06 09:48:49 +01:00
Yanming Zhou 59815cefce Replace assertThat(x.get(i)). with assertThat(x).element(i).
Search for   : assertThat\((.+)\.get\((\d+)\)\)\.
Replace with : assertThat($1).element($2).

Closes gh-31759
2023-12-06 09:43:59 +01:00
Sébastien Deleuze 3f9a809c32 Improve `@RegisterReflectionForBinding` for enums
Closes gh-31570
2023-12-05 16:53:51 +01:00