Commit Graph

24828 Commits

Author SHA1 Message Date
Marc Wrobel 3b68e97710 Fix and improve Javadoc in spring-tx
Closes gh-28794
2022-07-12 12:36:49 +02:00
Sam Brannen 3f993f8639 Merge branch '5.3.x'
# Conflicts:
#	spring-web/src/main/java/org/springframework/web/accept/AbstractMappingContentNegotiationStrategy.java
2022-07-12 12:14:52 +02:00
Marc Wrobel 6f494ef438 Fix and improve Javadoc in spring-web
Closes gh-28791
2022-07-12 12:08:12 +02:00
Sam Brannen 983c6e233f Merge branch '5.3.x'
# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java
2022-07-12 12:01:27 +02:00
Sam Brannen 19704805fd Polish contribution
See gh-28790
2022-07-12 11:56:01 +02:00
Marc Wrobel 31c6965c7f Fix and improve Javadoc in spring-webflux
Closes gh-28790
2022-07-12 11:48:58 +02:00
Sam Brannen 285b1b483e Update Javadoc in DefaultHandlerExceptionResolver to reflect changes
See gh-27052
2022-07-12 11:00:39 +02:00
rstoyanchev 7f0abb718b Add repo for transitive dependency on context-propagation
Reactor Netty M4 brings in a dependency on context-propagation, so we
need the milestone repository. The dependency will become optional for
M5, so we only need this temporarily.

See gh-28766
2022-07-12 09:55:15 +01:00
rstoyanchev b64835d2c8 Improve ResponseEntityExceptionHandler
- update handler methods for lower level exceptions to create a mapping
to a ProblemDetail.
- add protected method for creating the ResponseEntity that a subclass
can override to re-create ProblemDetail without overriding the rest
of what handleExceptionInternal does.
- update Javadoc and polishing

See gh-28439
2022-07-12 09:55:15 +01:00
Sam Brannen 87a2652604 Merge branch '5.3.x'
# Conflicts:
#	spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java
2022-07-12 10:48:51 +02:00
Sam Brannen 5b1a84e395 Polish contribution
See gh-28789
2022-07-12 10:39:11 +02:00
Marc Wrobel 6985fa8057 Fix and improve Javadoc in spring-webmvc
Closes gh-28789
2022-07-12 10:39:03 +02:00
Stephane Nicoll ee6a4e7c1e Add predicates for Serialization hints
Closes gh-28772
2022-07-11 16:37:12 -04:00
Sam Brannen 7751c44487 Merge branch '5.3.x'
# Conflicts:
#	spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java
#	spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java
#	spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java
2022-07-11 21:37:13 +02:00
Marc Wrobel 03f0c57704 Fix and improve Javadoc in spring-websocket
Closes gh-28788
2022-07-11 21:30:32 +02:00
Sébastien Deleuze bcb6f13fc4 Add native image support for STOMP messaging
This commit adds reflection hints for messaging
annotations as well as for classes and methods
annotated with @MessageMapping.

Closes gh-28754
2022-07-11 19:40:23 +02:00
Sam Brannen 255a52bc7a Fix attribute aliasing in @Reflective
See gh-28469
2022-07-11 19:14:39 +02:00
Sam Brannen 65f9106d49 Polishing 2022-07-11 18:53:29 +02:00
Sam Brannen dad67423d6 Suppress warnings 2022-07-11 18:53:11 +02:00
Sam Brannen c991aa9a78 Add missing package-info 2022-07-11 18:18:29 +02:00
Sam Brannen c86d193a78 Polish AotDetector 2022-07-11 18:18:08 +02:00
Sam Brannen 656dc549b1 Reject JDK proxy hint registration for sealed interfaces
Closes gh-28786
2022-07-11 17:48:40 +02:00
Sam Brannen 5c2ee249b5 Polish ProxyHintsTests 2022-07-11 17:48:39 +02:00
Sam Brannen d8003e326d Revert "Introduce ProxyHints.registerJdkProxy(String...)"
This reverses commit b560c10d4c.

See gh-28781
2022-07-11 17:48:39 +02:00
Sam Brannen 49dfcad447 Remove AopProxyUtils.completeJdkProxyInterfaces(String...)
Since gh-28781 is still open for team discussion, this commit removes
the `String...` variant for AopProxyUtils.completeJdkProxyInterfaces.

Depending on the outcome of gh-28781, this method may be reintroduced
in 6.0 M6.

Closes gh-28745
2022-07-11 17:48:38 +02:00
Sam Brannen 7bfcb4c753 Reject sealed interfaces in AopProxyUtils.completeJdkProxyInterfaces()
See gh-28745
2022-07-11 17:47:41 +02:00
Sébastien Deleuze 9d42779826 Add reflection hints for data binding in Web controllers
Closes gh-28623
2022-07-11 11:41:33 +02:00
Sébastien Deleuze 4104ea7c1c Upgrade to Kotlin 1.7.10
Closes gh-28784
2022-07-11 10:12:49 +02:00
Sam Brannen 5178e9c28e Simplify hint registration for Spring AOP proxies
Prior to this commit, when users wished to register proxy hints for a
Spring AOP JDK dynamic proxy, they were required to explicitly specify
SpringProxy, Advised, and DecoratingProxy along with user interfaces.

This commit simplifies hint registration for Spring AOP proxies by
introducing two completeJdkProxyInterfaces() methods in AopProxyUtils,
one that accepts strings and one that accepts classes that represent
the user-specified interfaces implemented the user component to be
proxied. The SpringProxy, Advised, and DecoratingProxy interfaces are
appended to the user-specified interfaces and returned as the complete
set of interfaces that the proxy will implement.

Closes gh-28745
2022-07-10 20:10:12 +02:00
Sam Brannen 2a0b3c1af9 Polish AopProxyUtilsTests 2022-07-10 20:10:12 +02:00
Sam Brannen b560c10d4c Introduce ProxyHints.registerJdkProxy(String...)
Since users might not have a concrete need to work with TypeReference,
this commit introduces ProxyHints.registerJdkProxy(String...) to
simplify use of the API for registering a dynamic proxy based on fully
qualified class names of the required interfaces.

Closes gh-28781
2022-07-10 18:54:16 +02:00
Sam Brannen 9db43037fe Polishing 2022-07-10 18:31:58 +02:00
Sam Brannen d7b45b7c8e Improve diagnostics for convention-based annotation attribute overrides
The warning message logged for an annotation that still uses
convention-based overrides now includes a concrete suggestion for how
the problem may potentially be fixed.

  WARN - Support for convention-based annotation attribute overrides is
  deprecated and will be removed in Spring Framework 6.1. Please
  annotate the 'locations' attribute in
  @org.springframework.core.annotation.MergedAnnotationsTests$ConventionBasedComposedContextConfiguration
  with an appropriate @AliasFor declaration -- for example,
  @AliasFor(annotation = org.springframework.core.annotation.MergedAnnotationsTests$ContextConfiguration.class).

See gh-28760
2022-07-09 17:15:17 +02:00
Sam Brannen 597873746c Update test annotations due to removal of AnnotationAttributesReadingVisitor
Annotations are no longer required to be public when looked up via
ASM since 6.0 M1.
2022-07-09 16:50:24 +02:00
Sam Brannen 2af08cf163 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java
#	spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java
#	spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java
#	spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java
2022-07-09 16:24:04 +02:00
Sam Brannen d274e893a6 Remove superfluous static declaration for enum, annotation, & interface 2022-07-09 16:16:13 +02:00
Sam Brannen 73d92d66b9 Stop using convention-based annotation attribute overrides in tests
This commit replaces convention-based annotation attribute overrides in
tests with explicit use of @AliasFor -- except for tests in spring-core,
since we still want to test our support for convention-based annotation
attribute overrides.

See gh-28760
2022-07-08 19:28:14 +02:00
Sam Brannen 6812de7b82 Polishing 2022-07-08 19:24:15 +02:00
Sébastien Deleuze 49fd7c99ae Fix TransactionBeanRegistrationAotProcessorTests
See gh-28717
2022-07-08 17:30:11 +02:00
Sébastien Deleuze 1458d5f39f Add support for @Transactional in native images
This commit introduces a TransactionBeanRegistrationAotProcessor
in charge of creating the required proxy and reflection hints
when @Transactional is detected on beans.

It also refines DefaultAopProxyFactory to throw an exception
when a subclass-based proxy is created in native images
since that's unsupported for now (see gh-28115 related issue).

Closes gh-28717
2022-07-08 16:47:35 +02:00
Arjen Poutsma a64d3716e0 Merge branch '5.3.x' 2022-07-08 16:43:28 +02:00
Arjen Poutsma aa8b06b622 Delete file on multipart cancel
This commit makes sure that the temporary file used for multipart
storage is deleted when the source stream is malformed or cancelled.

Closes gh-28740
2022-07-08 16:36:01 +02:00
Arjen Poutsma 9b739a2310 Update scheduling package to use java.time
This commit deprecates all methods in org.springframework.scheduling
that use

- Date, in favor of variants that take an Instant.
- long & TimeUnit, in favor of variants that take a Duration.

Closes: gh-28714
2022-07-08 16:25:27 +02:00
Sébastien Deleuze 8ccf05adee Remove SpringProxyRuntimeHintsRegistrar
A dynamic mechanism to register proxy and reflection
hints for classes annotated by @Transactional is needed
instead.

See gh-28717
2022-07-07 18:10:53 +02:00
Sam Brannen 9f7cbe1234 Polishing 2022-07-07 17:50:45 +02:00
Sam Brannen a68f5b1674 Deprecate convention-based annotation attribute overrides
Implicit convention-based annotation attribute overrides have been
supported for a long time; however, Spring Framework 4.2 introduced
support for explicit annotation attribute overrides via @AliasFor.

Since explicit overrides are favorable to implicit overrides, and since
the support for convention-based overrides increases the complexity of
Spring's annotation search algorithms, this commit deprecates
convention-based overrides and logs a WARNING whey the are encountered.

For example, the following message is logged for a test that still
uses convention-based overrides. A log message is generated for each
such attribute in a given annotation but only once per application run.

  WARN Support for convention-based annotation attribute overrides is
  deprecated and will be removed in Spring Framework 6.1. Please
  annotate the 'basePackages' attribute in
  @org.springframework.context.annotation.ConfigurationClassPostProcessorTests$ComposedConfigurationWithAttributeOverrides
  with an appropriate @AliasFor declaration.

Closes gh-28760
2022-07-07 17:36:16 +02:00
Sam Brannen 81acbe7e2f Ensure AnnotationTypeMapping properly tracks convention-based mappings
AnnotationTypeMapping.addConventionMappings() sometimes adds
convention-based mappings that it should not.

For example, in certain circumstances an explicit annotation attribute
override configured via @AliasFor can be incorrectly mapped as
convention-based.

Although this does not appear to cause negative side effects (other
than unnecessary processing), this is technically a bug, and this
commit address this issue.

Closes gh-28773
2022-07-07 17:33:27 +02:00
Sébastien Deleuze 5397d4721b Recognize PRESENT fields in native classpath checks at build time
This pattern is used in Spring Boot.

See gh-28624
2022-07-07 11:48:43 +02:00
Sébastien Deleuze 0387d54607 Add support for Transactional in native-image
This commit annotates @Transactional with @Reflective
and registers proxy hints for SpringProxy.

Injection of proxied beans via their interfaces still fails
in native images with a
"No qualifying bean of type MyInterface" error.

See gh-28717
2022-07-07 10:30:34 +02:00
Sébastien Deleuze cdf01ede8d Perform Reactor native classpath checks at build time
See gh-28624
2022-07-06 16:39:00 +02:00