Commit Graph

2505 Commits

Author SHA1 Message Date
Brian Clozel
0c739016d4 Merge branch '6.2.x' 2025-02-06 18:33:42 +01:00
Brian Clozel
174d0e4576 Fix "Nth day of week" Quartz-style cron expressions
Prior to this commit, `CronExpression` would support Quartz-style
expressions with "Nth occurence of a  dayOfWeek" semantics by using the
`TemporalAdjusters.dayOfWeekInMonth` JDK support. This method will
return the Nth occurence starting with the month of the given temporal,
but in some cases will overflow to the next or previous month.
This behavior is not expected for our cron expression support.

This commit ensures that when an overflow happens (meaning, the
resulting date is not in the same month as the input temporal), we
should instead have another attempt at finding a valid month for this
expression.

Fixes gh-34360
2025-02-06 18:27:07 +01:00
rstoyanchev
03984bacf4 Merge branch '6.2.x' 2025-02-05 14:34:11 +00:00
rstoyanchev
462c2bd538 Enhance constructor binding for List/Map/Array
Support List/Map/Array of simple values, or values supported
by type conversion.

Closes gh-34305
2025-02-05 14:26:12 +00:00
rstoyanchev
7f29f0e663 Revert commit 3505c4bcad
The fix did not address the issue. It only made the constructor not
fail with tests succeeding due to setter binding instead.

See gh-34043
2025-02-05 14:26:12 +00:00
Sam Brannen
e997e16cd1 Merge branch '6.2.x' 2025-02-05 13:43:46 +01:00
Sam Brannen
819a7c86c1 Clarify component scanning of abstract classes with @⁠Lookup methods
Due to changes in gh-19118, classes that contain @⁠Lookup methods are
no longer required to be concrete classes for use with component
scanning; however, the reference documentation still states that such
classes must not be abstract.

This commit therefore removes the outdated reference documentation and
updates the corresponding Javadoc.

See gh-19118
Closes gh-34367
2025-02-05 13:39:29 +01:00
Juergen Hoeller
088d53adb4 Merge branch '6.2.x' 2025-02-03 15:24:59 +01:00
Juergen Hoeller
1b18928bf0 Explicitly set custom ClassLoader on CGLIB Enhancer
Closes gh-34274
2025-02-03 15:23:51 +01:00
Sébastien Deleuze
4620d864dd Refine GenericApplicationContext#registerBean nullness
Closes gh-34343
2025-01-30 12:26:31 +01:00
rstoyanchev
52c187bf64 Merge branch '6.2.x' 2025-01-28 15:37:38 +00:00
rstoyanchev
1cc767e90b Polishing in ExtendedServletRequestDataBinder 2025-01-28 15:36:19 +00:00
Sébastien Deleuze
7f21443a1b Refine null-safety based on IDEA warnings
See gh-28797
2025-01-22 13:20:11 +01:00
Brian Clozel
f85752a956 Fix hints and predicates for Field reflective access
This commit revisits the arrangement for Field hints after changes made
in gh-34239.

Closes gh-34294
2025-01-21 20:05:12 +01:00
Sébastien Deleuze
1763334180 Refine KotlinDetector usages and implementation
This commit refines KotlinDetector usages and implementation in order
to remove preliminary KotlinDetector#isKotlinReflectPresent invocations
and to ensure that KotlinDetector methods are implemented safely and
efficiently for such use case.

Closes gh-34275
2025-01-20 12:34:28 +01:00
rstoyanchev
9f77d5ff1f Remove deprecated ThemeResolver support
See gh-33809
2025-01-15 16:26:16 +00:00
Sébastien Deleuze
435cb0c7d6 Specify generic type nullness in spring-context
Also in spring-context-support.

See gh-34140
2025-01-14 12:35:02 +01:00
Sébastien Deleuze
96f7d50abf Remove unneeded NullAway warning suppressions
This commit removes warning suppressions related to uber/NullAway#1113
which is now fixed.

See gh-28797
2025-01-07 09:57:56 +01:00
rstoyanchev
48308aee26 Merge branch '6.2.x' 2024-12-30 14:48:04 +00:00
rstoyanchev
4350fc21b3 List constructor arg initialized correctly
DataBinder now uses the calculated List size rather than
the number of indexes to initialize the list.

Closes gh-34145
2024-12-30 14:47:26 +00:00
rstoyanchev
59ed4686c5 Create ParameterErrors for type level constraint
Closes gh-34105
2024-12-30 14:47:26 +00:00
Simon Baslé
f025d60b92 Merge branch '6.2.x' 2024-12-27 11:00:10 +01:00
Simon Baslé
3505c4bcad Ensure DataBinder can bind constructor with a Map with simple values
This change ensures that DataBinder can bind constructor with a Map
parameter that has no nested properties, but just simple values like
a String: `someMap[0]=exampleString`.

Integration tests have been added to cover similar cases that use the
ServletRequestDataBinder.

Closes gh-34043
2024-12-27 10:57:30 +01:00
Sébastien Deleuze
1c37e7092e Use @SuppressWarnings("NullAway.Init")`
This commit uses `@SuppressWarnings("NullAway.Init")` when
relevant.

See gh-34147
See gh-34151
2024-12-26 10:47:10 +01:00
Sébastien Deleuze
f368147f9d Refine null-safety in the spring-context module
Closes gh-34151
2024-12-24 18:27:13 +01:00
Sébastien Deleuze
1e0ef99b0c Leverage @NullMarked instead of package configuration
This commit replaces NullAway package configuration by package-level
`@NullMarked` detection by configuring `NullAway:AnnotatedPackages` to
an empty string.

NullAway configuration should be refined to use a proper flag instead
once uber/NullAway#574 is fixed.

See gh-28797
2024-12-23 17:14:29 +01:00
Sébastien Deleuze
0e85d950b3 Remove unneeded @NonNull annotations
See gh-28797
2024-12-19 11:07:33 +01:00
Sébastien Deleuze
bc5d771a06 Switch to JSpecify annotations
This commit updates the whole Spring Framework codebase to use JSpecify
annotations instead of Spring null-safety annotations with JSR 305
semantics.

JSpecify provides signficant enhancements such as properly defined
specifications, a canonical dependency with no split-package issue,
better tooling, better Kotlin integration and the capability to specify
generic type, array and varargs element null-safety. Generic type
null-safety is not defined by this commit yet and will be specified
later.

A key difference is that Spring null-safety annotations, following
JSR 305 semantics, apply to fields, parameters and return values,
while JSpecify annotations apply to type usages. That's why this
commit moves nullability annotations closer to the type for fields
and return values.

See gh-28797
2024-12-19 11:07:23 +01:00
Sam Brannen
bf80485cc3 Clean up after deprecation of AsyncResult
See gh-33809
2024-12-15 15:53:33 +01:00
Juergen Hoeller
43ff6d9711 Deprecate use of several bean factory methods for the same bean
See gh-31073
2024-12-12 22:16:24 +01:00
Brian Clozel
11db31a8ee Merge branch '6.2.x' 2024-12-10 22:36:01 +01:00
Brian Clozel
0c688742e1 Fix custom scheduler support for @Scheduled methods
This commit fixes a regression introduced by gh-24560, when adding
execution metadata support for scheduled tasks. The
`OutcomeTrackingRunnable` would delegate to the actual runnable but
could also hide whether it implements the `SchedulingAwareRunnable`
contract.

This commit ensures that `OutcomeTrackingRunnable` always implements
that contract and delegates to the runnable if possible, or return
default values otherwise.

Fixes gh-34058
2024-12-10 22:33:20 +01:00
Juergen Hoeller
3d19d78461 Merge branch '6.2.x' 2024-12-10 16:26:56 +01:00
Juergen Hoeller
3e3ca74020 Log provider setup failure at info level without stacktrace
Closes gh-33979
2024-12-10 16:25:57 +01:00
Juergen Hoeller
66da5d7ab9 Restore original override behavior when override allowed
Closes gh-33920
2024-12-10 16:25:49 +01:00
Juergen Hoeller
2b9010c2a2 Remove APIs marked as deprecated for removal
Closes gh-33809
2024-12-04 13:19:39 +01:00
Brian Clozel
5de03f6bb1 Merge branch '6.2.x' 2024-12-03 15:39:16 +01:00
Brian Clozel
d990449b0d Improve toString for reactive ScheduledTask
Prior to this commit, the reactive Scheduled tasks would be wrapped as a
`SubscribingRunnable` which does not implement a custom `toString`. This
would result in task metadata using the default Java `toString`
representation for those.

This commit ensures that the bean class name and method name are used
for this `toString`.

Closes gh-34010
2024-12-03 15:06:27 +01:00
Juergen Hoeller
949432ce8b General upgrade to Jakarta EE 11 APIs
Includes removal of ManagedBean and javax.annotation legacy support.
Includes AbstractJson(Http)MessageConverter revision for Yasson 3.0.
Includes initial Hibernate ORM 7.0 upgrade.

Closes gh-34011
Closes gh-33750
2024-12-03 13:30:25 +01:00
Brian Clozel
ba312f6c7c Update AOT support after RuntimeHints changes
This commit adapts AOT support in various modules after the RuntimeHints
and related deprecation changes.

`MemberCategory.INTROSPECT_*` hints are now removed and
`MemberCategory.*_FIELDS` are  replaced with
`MemberCategory.INVOKE*_FIELDS` when invocation is needed.

Usage of `RuntimeHintsAgent` are also deprecated.

Closes gh-33847
2024-11-29 14:44:05 +01:00
Sam Brannen
ea3bd7ae0c Polish BeanValidationBeanRegistrationAotProcessor[Tests]
The log message for a NoClassDefFoundError is now a DEBUG level message
handled like a TypeNotPresentException and similar to the following.

DEBUG: Skipping validation constraint hint inference for class
org.example.CustomConstraint due to a NoClassDefFoundError for
com.example.MissingType

See gh-33949
2024-11-27 12:53:51 +01:00
Stefano Cordio
9b0253e117 Skip runtime hint registration for constraint with missing dependencies
Prior to this commit, AOT processing for bean validation failed with a
NoClassDefFoundError for constraints with missing dependencies.

With this commit, the processing no longer fails, and a warning is
logged instead.

See gh-33940
Closes gh-33949

Co-authored-by: Sam Brannen <sam.brannen@broadcom.com>
2024-11-27 12:42:12 +01:00
Sam Brannen
051f1dac24 Polish contribution
See gh-33950
2024-11-24 14:13:03 +01:00
Stefano Cordio
5e7b3a3bed Avoid infinite recursion in BeanValidationBeanRegistrationAotProcessor
Prior to this commit, AOT processing for bean validation failed with a
StackOverflowError for constraints with fields having recursive generic
types.

With this commit, the algorithm tracks visited classes and aborts
preemptively when a cycle is detected.

Closes gh-33950

Co-authored-by: Sam Brannen <sam.brannen@broadcom.com>
2024-11-24 14:09:48 +01:00
Sam Brannen
d421f61a4a Polish @⁠DurationFormat Javadoc and tests 2024-11-18 14:12:13 +01:00
Tran Ngoc Nhan
883254e1d0 Polish
- Update copyright header.
- Consistent use of "SIMPLE" link text for Style#SIMPLE in javadoc.

Closes gh-33883
2024-11-18 13:40:23 +01:00
Juergen Hoeller
18a3b52d5e Restore enum-style exception message expected by test 2024-11-13 18:56:19 +01:00
Sam Brannen
b523f3caff Polish documentation and exception message for @⁠DurationFormat 2024-11-13 17:19:53 +01:00
Sam Brannen
7f9901d35d Merge branch '6.1.x' 2024-11-13 16:46:11 +01:00
Sam Brannen
bfde33a514 Document options for Date/Time parsing & formatting issues with JDK 20+
This commit updates Javadoc and the reference guide to document options
for handling date/time parsing and formatting issues on JDK 20 and higher.

A new "Date and Time Formatting with JDK 20 and higher" page has also been
introduced in the wiki.

https://github.com/spring-projects/spring-framework/wiki/Date-and-Time-Formatting-with-JDK-20-and-higher

Closes gh-33151
2024-11-13 16:39:40 +01:00