Commit Graph

2307 Commits

Author SHA1 Message Date
rstoyanchev fdfa7cbae6 Add docs for RSocket interface client
Closes gh-24456
2022-09-07 15:01:40 +01:00
Stephane Nicoll 3b36171926 Merge branch '5.3.x' 2022-09-05 07:24:07 +02:00
heqiang 111a9902ac Fix typo in data-access section
See gh-29048
2022-09-05 07:21:31 +02:00
Sam Brannen dc7c7ac22a Register runtime hint for @WebAppConfiguration's resource path
This commit introduces automatic registration of a runtime hint for
classpath resources configured via the `value` attribute in
@WebAppConfiguration.

Closes gh-29026
2022-09-04 16:45:06 +02:00
Sébastien Deleuze cc555d2ff4 Avoid shipping AWT classes in native images
This commit provides an alternative
java.beans.Introspector#findCustomizerClass implementation
via a GraalVM substitution that avoids to include thousands
of unused AWT classes in the native image.

Closes gh-29060
2022-09-02 15:06:50 +02:00
Arjen Poutsma 9c33d2707a Introduce support for Netty 5 Buffer
This commit introduces support for Netty 5's Buffer, in the form of
Netty5DataBuffer. Because of the new API offered by Buffer, several
changes have been made to the DataBuffer API:

- CloseableDataBuffer is a simpler alternative to PooledDataBuffer, and
  implemented by Netty5DataBuffer. DataBufferUtils::release can now
  handle CloseableDataBuffer as well as PooledDataBuffer.
- PooledDataBuffer::touch has been moved into a separate interface:
  TouchableDataBuffer, which is implemented by Netty5DataBuffer.
- The capacity of DataBuffers can no longer be reduced, they can only
  grow larger. As a consequence, DataBuffer::capacity(int) has been
  deprecated, but ensureWritable (formally ensureCapacity) still exists.
- DataBuffer::slice and retainedSlice have been deprecated in favor of
  split, a new method that ensures that memory regions do not overlap.
- DataBuffer::asByteBuffer has been deprecated in favor of toByteBuffer,
  a new method that returns a copy, instead of shared data.
- DataBufferFactory::allocateBuffer has been deprecated in favor of
  allocateBuffer(int).

Closes gh-28874
2022-08-25 11:00:22 +02:00
Stephane Nicoll 496b1879ab Merge branch '5.3.x' 2022-08-09 15:32:27 +02:00
Andy Wilkinson d6b60046ce Correct description of @RequestParam with WebFlux
See gh-28944
2022-08-09 15:30:08 +02:00
Vedran Pavic 7e719fe3f8 Use Jakarta EE XML namespaces instead of Java EE
Closes gh-28903
2022-08-04 13:24:30 +02:00
Brian Clozel 9e71889ed9 Merge branch '5.3.x' 2022-08-04 11:02:52 +02:00
Chanhyeong Cho 8685b2f5bf Fix broken kdoc-api links in kotlin.adoc
Fixes gh-28908
2022-08-04 11:02:02 +02:00
Stephane Nicoll 1bdb67cda9 Merge branch '5.3.x' 2022-07-29 17:13:52 +02:00
Stephane Nicoll 982d8ea84a Polish "Clarify docs on JNDI properties in Servlet environment"
See gh-28488
2022-07-29 17:09:55 +02:00
Arend v. Reinersdorff 67eb2bbf19 Clarify docs on JNDI properties in Servlet environment
See gh-28488
2022-07-29 17:05:58 +02:00
Arjen Poutsma e0190c12d4 Merge branch '5.3.x' 2022-07-29 11:10:09 +02:00
Arjen Poutsma 3d4a778b73 Fix KDoc API link 2022-07-29 11:08:57 +02:00
Stephane Nicoll 75c63f877b Merge branch '5.3.x' 2022-07-25 13:33:06 +02:00
arvyy 4383a673bb Add missing closing parenthesis
See gh-28867
2022-07-25 13:30:45 +02:00
Sébastien Deleuze c0bea373a2 Merge branch '5.3.x' 2022-07-19 10:19:00 +02:00
Jupiter 7fa9f1c9cf Fix broken link to rsocket protocol page
Closes gh-28817
2022-07-19 10:14:46 +02:00
Sam Brannen 9962aa00a0 Introduce TestClassScanner to locate Spring test classes for AOT processing
This commit introduces the TestClassScanner which scans provided
classpath roots for Spring integration test classes using the JUnit
Platform Launcher API which allows all registered TestEngines to
discover tests according to their own rules.

The scanner currently detects the following categories of Spring
integration test classes.

- JUnit Jupiter: classes that register the SpringExtension via
  @ExtendWith.
- JUnit 4: classes that register the SpringJUnit4ClassRunner or
  SpringRunner via @RunWith.
- Generic: classes that are annotated with @ContextConfiguration or
  @BootstrapWith.

The scanner has been tested with the following TestEngine
implementations for the JUnit Platform.

- JUnit Jupiter
- JUnit Vintage
- JUnit Platform Suite Engine
- TestNG Engine for the JUnit Platform

Closes gh-28824
2022-07-15 13:21:22 +02:00
rstoyanchev f814fb420b Merge branch '5.3.x' 2022-07-13 19:21:33 +01:00
rstoyanchev cdd4e8cd7f Improve regex support for URL path matching
Closes gh-28815
2022-07-13 18:43:51 +01:00
Sam Brannen 0b5c5dbc31 Merge branch '5.3.x' 2022-07-13 15:13:41 +02:00
Marc Wrobel 165fba868c Fix typos in reference docs
Closes gh-28805
2022-07-13 15:12:31 +02:00
rstoyanchev ff9a4ab35c Update documentation for RFC 7807 support
Closes gh-28438
2022-07-13 13:12:16 +01:00
rstoyanchev eea793be98 Move sections on REST API exceptions 2 levels up
See gh-28438
2022-07-13 13:12:16 +01:00
rstoyanchev 263811ecfa Add WebFlux equivalent of ResponseEntityExceptionHandler
Closes gh-28665
2022-07-13 10:58:48 +01:00
Sébastien Deleuze b135cbe7c8 Merge branch '5.3.x' 2022-07-13 10:10:42 +02:00
Sébastien Deleuze c942c8d2cf Fix expectations in MockMvc Kotlin documentation
Closes gh-28301
2022-07-13 10:06:41 +02:00
Sébastien Deleuze 1201af20e4 Improve consistency of Kotlin injection code samples
Closes gh-28596
2022-07-13 09:42:47 +02:00
Sébastien Deleuze d1df4d3739 Fix Kotlin code snippets language
Closes gh-28810
2022-07-13 09:21:02 +02:00
Sébastien Deleuze 1ef8800c6c Fix Kotlin example for custom @Production
Closes gh-28680
2022-07-13 09:13:47 +02:00
Sébastien Deleuze 4d7e4e0c58 Fix a typo
See gh-28630
2022-07-12 18:54: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
Lucas Mantovani 05df491154
Fix WebClientAdapter.createHttpServiceProxyFactory() example in ref docs
* Remove build() call
* Add call to afterPropertiesSet()

Closes gh-28753
2022-07-04 19:47:23 +02:00
Sam Brannen ce5076ffe8 Merge branch '5.3.x' 2022-07-03 18:05:36 +02:00
Sam Brannen fda3f8201a Switch warning level for forbidden reference to INFO in Eclipse IDE 2022-07-03 17:23:55 +02:00
Brian Clozel 444a9bd011 Add testing infrastructure for RuntimeHintsAgent
This commit adds the supporting testing infrastructure using the
`RuntimeHintsAgent`. Given that the agent is loaded by the JVM running
the test suite, we can then use it to record method invocations at
runtime and check whether the prepared `RuntimeHints` match the expected
behavior.

This commit contributes the `RuntimeHintsRecorder`. With this, we can
record relevant method invocations for a given lambda, focusing on a
specific part of the code behavior. This returns a
`RuntimeHintsInvocations` instance, which is an AssertJ assert provider.
From there, we can perform assertions on the recorded invocations and
check that a given collection of hints cover the reflection, resources
and proxies needs at runtime.

This also ships the `@EnabledIfRuntimeHintsAgent` opinionated
annotation: this applies the `RuntimeHintsAgentCondition` JUnit
extension that detects whether the `RuntimeHintsAgent` is loaded by the
current JVM. Tests annotated with this will be skipped if the agent is
not present. This annotation is also tagged with a JUnit `@Tag` to
gather such tests in a specific `"RuntimeHintsTests"` test suite.

In the Spring Framework build, we have chosen to isolate such tests and
not load the agent for the main test suite ("RuntimeHintsTests" tests
are excluded from the main suite). While the agent's intent is to be as
transparent as possible, there are security and access considerations
that could interefere with other tests.
With this approach, we can then create a separate test suite and run
agent tests in a dedicated JVM.

Note that projects using this infrastructure can choose to use the
condition by itself in a custom annotation.

Here is an example of this testing infrastructure:

```
@EnabledIfRuntimeHintsAgent
class MyTestCases {

  @Test
  void hintsForMethodsReflectionShouldMatch() {
      RuntimeHints hints = new RuntimeHints();
      hints.reflection().registerType(String.class,
          hint -> hint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));

      RuntimeHintsInvocations invocations = RuntimeHintsRecorder.record(() -> {
          Method[] methods = String.class.getMethods();
      });
      assertThat(invocations).match(hints);
  }

}
```

See gh-27981
2022-06-30 18:20:22 +02:00
rstoyanchev b312eca391 Deprecate and set trailingSlash option to false
Closes gh-28552
2022-06-29 16:09:10 +01:00
rstoyanchev 92cf1e13e8 Enable use of parsed patterns by default in Spring MVC
Closes gh-28607
2022-06-29 10:17:27 +01:00
Sam Brannen f8cdb7a747 Fix switch statement formatting in Eclipse
See https://github.com/spring-io/spring-javaformat/issues/336
2022-06-25 14:26:59 +02:00
rstoyanchev 24c46142c6 Add docs on exceptions for HTTP interface client
Closes gh-28533
2022-06-24 15:55:18 +01:00
rstoyanchev b72ee5f034 Add static factory methods to WebClientAdapter
Ideally one would pass WebClient directly to HttpServiceProxyFactory,
but two need to remain decoupled. This commit adds static, shortcut
methods to WebClientAdapter to create an HttpServiceProxyFactory, thus
eliminating the step to wrap the WebClient.
2022-06-24 09:55:21 +01:00
Sébastien Deleuze 36012ffea9 Merge branch '5.3.x' 2022-06-17 12:58:27 +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 a1f14e8eeb Merge branch '5.3.x' 2022-06-16 16:14:05 +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
Sam Brannen 67b1420b32 Merge branch '5.3.x' 2022-06-15 11:28:04 +02:00
Sam Brannen 8b4750e705 Fix Kotlin example for @ComponentScan basePackages attribute
Closes gh-28628
2022-06-15 11:27:39 +02:00
Juergen Hoeller aa48dec697 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
2022-06-14 15:14:10 +02:00
Juergen Hoeller e72b0a04cd Document limitations for MessageProducer/Consumer caching with WebLogic JMS
Closes gh-28500
2022-06-14 15:09:10 +02:00
Arjen Poutsma 405e5921a6 Merge branch '5.3.x' 2022-06-10 13:38:27 +02:00
Arjen Poutsma 27738cc20f Fix code samples for nested router functions
Closes gh-28603
2022-06-10 13:36:33 +02:00
Sam Brannen 74d1be9bd8 Remove obsolete references to @Required
Since the @Required annotation was removed in a previous 6.0 milestone,
this commit removes all remaining references to it.

Closes gh-28600
2022-06-09 14:54:09 +02:00
Sam Brannen 40ab20e14a Merge branch '5.3.x' 2022-06-09 13:56:15 +02:00
Sam Brannen babff8e635 Fix Kotlin example for dependency injection with static factory method
Closes gh-28589
2022-06-09 13:16:19 +02:00
Sam Brannen 290cc73d3d Fix Kotlin example for @Required
Since @Required can only be declared on a method, this commit moves the
@Required declaration from the field to the "set" method.

Closes gh-28590
2022-06-09 13:13:43 +02:00
Stephane Nicoll 62d98685ce Merge branch '5.3.x' 2022-06-07 08:30:59 +02:00
Stephane Nicoll e18a118f8b Polish contribution
See gh-28572
2022-06-07 08:29:28 +02:00
Lee, Kyutae 77aac7768d Update reference docs to use PropertySourcesPlaceholderConfigurer
See gh-28572
2022-06-07 08:22:53 +02:00
Stephane Nicoll a46b71a4b9 Merge branch '5.3.x' 2022-05-31 10:01:50 +02:00
Ikko Ashimine 6e3b3c5419 Fix typo in webflux.adoc
See gh-28542
2022-05-31 10:01:13 +02:00
Sam Brannen a3ee27bb4d Polishing 2022-05-30 20:00:07 +02:00
Eddú Meléndez Gonzales 506b78f469
Use getHost instead of getContainerIpAddress in Redis examples
getContainerIpAddress is deprecated.

Closes gh-28461
2022-05-15 15:12:03 +02:00
Sam Brannen 4b0531b4aa Merge branch '5.3.x' 2022-05-11 17:33:52 +02:00
Sam Brannen 48c797e429 Fix Kotlin example for static factory method
Closes gh-28399
2022-05-11 17:33:31 +02:00
Sam Brannen 5ddbdb6ba7 Merge branch '5.3.x' 2022-05-11 17:17:20 +02:00
Sam Brannen be782a2197 Polish ref docs regarding the BeanFactory API
See gh-28403
2022-05-11 17:16:40 +02:00
rstoyanchev 922636e85e Content decoding in client exceptions
Closes gh-28190
2022-05-10 11:48:46 +01:00
Maciej Walkowiak 2713f28c28
Fix typo in declarative HTTP interfaces docs
Closes gh-28431
2022-05-09 14:12:51 +02:00
rstoyanchev d2b674391a Add documentation for interface proxy client
Closes gh-28386
2022-05-09 09:52:15 +01:00
rstoyanchev 54d90aa6f5 Remove Remoting and EJB sections in reference docs 2022-05-09 09:52:15 +01:00
Phillip Webb 4b82546b97 Improve TestCompiler and allow lookup based class defines
Update the `TestCompiler` so that classes can be defined using
a `Lookup`. This update allows package-private classes to be
accessed without needing a quite so unusual classloader setup.

The `@CompileWithTargetClassAccess` should be added to any
test that needs to use `Lookup` based defines. The test will
run with a completed forked classloader so not to pollute the
main classloader.

This commit also adds some useful additional APIs.

See gh-28120
2022-05-05 12:35:21 -07:00
Phillip Webb 44bdcef0b9 Tweak Eclipse settings 2022-05-05 12:35:21 -07:00
Juergen Hoeller f963fc5f98 Check that nullable annotations are from org.springframework.lang
Closes gh-28410
2022-05-05 18:02:27 +02:00
Juergen Hoeller 17c778e3a0 Preserve javax nullability annotations for AOP Alliance fork
See gh-28410
2022-05-05 17:26:17 +02:00
Sam Brannen 0d561caf6d Merge branch '5.3.x' 2022-05-05 16:32:27 +02:00
Lee, Kyutae 7a75b94556 Fix typo in reference docs regarding RequestMappingHandlerAdapter
Closes gh-28370
2022-05-05 16:31:40 +02:00
Phillip Webb 63b129a3f7 Check that nullable annotations are from org.springframework.lang
Fix a few incorrect nullable annotation imports and add a checkstyle
rule to ensure they don't return.

Closes gh-28410
2022-05-03 11:14:53 -07:00
Sam Brannen 437b35b336 Merge branch '5.3.x' 2022-05-03 12:15:45 +02:00
Sam Brannen ed06a6de26 Convert SimpleFormController example to @Controller in reference manual
This change is necessary since the SimpleFormController class no longer
exists.
2022-05-03 12:03:04 +02:00
Johannes Wengert 08bc9edcbc
Use "instanceof pattern matching" in sample in reference docs
Closes gh-28332
2022-04-13 12:16:10 +02:00
Sam Brannen 1574fed90b Merge branch '5.3.x' 2022-04-13 10:08:31 +02:00
Sam Brannen a7cf19cec5 Improve documentation and matching algorithm in data binders 2022-04-13 09:55:40 +02:00
Sam Brannen 50973f73c7 Change link from 5.3.x to main
See gh-28228
2022-03-27 17:47:41 +02:00
Sam Brannen e88a88cb7d Merge branch '5.3.x' 2022-03-27 17:46:39 +02:00
Sam Brannen d927e37364 Add "Testing ORM entity lifecycle callbacks" note to Testing chapter
Closes gh-28228
2022-03-27 17:46:06 +02:00
Stephane Nicoll defcaae6e4 Merge branch '5.3.x' 2022-03-27 10:05:47 +02:00
Stephane Nicoll 4b150fd451 Update copyright date in reference manual
Closes gh-28237
2022-03-27 09:59:12 +02:00
Brian Clozel 7161940b53 Merge branch '5.3.x' 2022-03-24 13:44:38 +01:00
Yanming Zhou acf2955b96 Ban jetbrains annotations imports
Closes gh-28226
2022-03-24 13:31:36 +01:00
Sam Brannen b570f60560 Merge branch '5.3.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedNotification.java
#	spring-context/src/main/java/org/springframework/jmx/export/annotation/ManagedOperationParameter.java
#	spring-core/src/main/java/org/springframework/javapoet/support/package-info.java
#	spring-core/src/main/java/org/springframework/util/TypeUtils.java
#	spring-web/src/main/java/org/springframework/http/HttpMethod.java
2022-03-18 16:47:12 +01:00
Sam Brannen 64b64d9ba0 Stop referring to features as "Java 5" features
With a Java 8 baseline in place for quite some time now, it no longer
makes sense to refer to features such as annotations as "Java 5
annotations".

This commit also removes old `Tiger*Tests` classes, thereby avoiding
duplicate execution of various tests.
2022-03-18 16:32:30 +01:00
Sam Brannen 9764f0e59b Merge branch '5.3.x'
# Conflicts:
#	spring-test/src/test/java/org/springframework/mock/http/server/reactive/MockServerHttpRequestTests.java
#	spring-web/src/test/java/org/springframework/http/server/reactive/HeadersAdaptersTests.java
#	spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/handler/MappedInterceptorTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java
#	spring-websocket/src/test/java/org/springframework/web/socket/AbstractWebSocketIntegrationTests.java
2022-03-16 15:07:53 +01:00
Sam Brannen c462fe30ed Use Named arguments in parameterized tests 2022-03-16 14:45:47 +01:00
Sam Brannen c249b578b5 Merge branch '5.3.x' 2022-03-12 16:05:39 +01:00
Sam Brannen d9c22e657f Document the effect of @DirtiesContext on test execution events
See gh-27757
2022-03-12 16:05:14 +01:00