Returning a private class from a package-private method causes the
AOT-generated source files to fail to compile as the private class is
not visible.
Closes gh-33106
Update `@Autowired` detection logic to consider all constructors and to
search user classes.
Fixes gh-33061
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Update `MeterRegistryPostProcessor` to configure `MeterRegistry` beans
in two distinct sweeps. The first sweep applies customizers and filters
as the `MeterRegistry` bean is initialized, the second sweep applies
`MeterBinder` beans once all singletons have been instantiated.
Prior to this commit, it was not possible for a `MeterBinder` bean to
directly or indirectly use a `MeterRegistry`. It was also possible for
bound meters to cause a deadlock during refresh processing if those
meters could be updated on a thread other than main, such as GC
notifications.
Fixes gh-30636
Fixes gh-33070
Update types returned from endpoints to implement the
`OperationResponseBody` interface. This ensures that they will be
serialized using the isolated actuator `ObjectMapper`.
See gh-20291
Add `OperationResponseBody` tagging interface that can be used
to trigger the use of an isolated ObjectMapper specifically for
actuator responses.
The isolated mapper is provided by an `EndpointObjectMapper`
bean which is auto-configured unless specifically disabled
by the user.
WebMVC, WebFlux and Jersey integrations have been updated
to provide a link between the `OperationResponseBody` type
and the endpoint `ObjectMapper`.
See gh-20291
When a test context fails to load, a `ContextLoadException` should
be thrown so that Framework can catch it and call any registered
`ApplicationContextFailureProcessor`s.
Closes gh-31793
In Tomcat 10.0, reflection hints on Http11AprProtocol were
registering hints on AbstractProtocol as a side effect.
Tomcat 10.1 removed this protocol and related hints, breaking
Http11NioProtocol usage in Spring Boot.
This commit contributes reflection hints for protocol properties
accessed reflectively from org.apache.catalina.connector.Connector.
See gh-33064
Reorder `SpringBootJoranConfigurator.addModelHandlerAssociations` so
that handlers are added before calling the super method. Prior to this
commit, handlers were added behind filters which prevented them from
being used in `<if>` blocks.
Fixes gh-33028
Update `ModifiedClassPathExtension` and related classes so that
annotations can be used directly on test methods, or on classes
passed into parameterized tests.
Closes gh-33014
Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework
automatically registers hints for enclosing directories. This fixes the
tests to use a contains instead of exact match.
Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework
automatically registers hints for enclosing directories. This fixes the
tests to expect hints for those directories as well.
Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework
automatically registers hints for enclosing directories. This fixes the
tests to expect hints for those directories as well.
Rename `/actuator/httptrace` to `/actuator/httpexchanges` to better
describe its purpose and to remove confusion with distribute tracing.
This change also takes the opportunity to improve the code by making
the `HttpExchange` class (previously `HttpTrace`) fully immutable.
Closes gh-32885
Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>
Without this change we're missing the BaggageTextMapPropagator for
OTel. This means that we're not propagating remote-fields
(only baggage via the 'baggage' field).
With this change we're adding the missing propagator as
THE LAST entry in the composite TextMapPropagator. It has to be
last cause with the latest Snapshots of Micrometer Tracing it
will append the remote field baggage to existing baggage in the
context extracted via the W3CBaggagePropagator.
See gh-32898
Without those changes, if @AutoConfigureTestDatabase is used, the
native image build process fails with:
EmbeddedDatabaseConnection was unintentionally initialized at build
time.
Closes gh-32865
Update `EventPublishingRunListener` to ensure that application event
listeners are always refreshed before multicasting initial events.
Prior to this commit, refreshing occurred after multicasting which
meant that listeners added by a different `SpringApplicationRunListener`
would not be picked up. This caused properties from tests that have
`UseMainMethod` set to `ALWAYS` or `WHEN_AVAILABLE` to be missing.
Fixes gh-32860
Refactor the way `ClientHttpRequestFactory` instances are created in
order to support setting read timeouts.
Prior to this commit, the reflection based approach would call
`setReadTimeout`. As of Spring Framework 6.0, the
`HttpComponentsClientHttpRequestFactory` class no longer supports this
approach. The timeout must be set on the `HttpClientConnectionManager`
used in the `HttpClient` which can be passed in to the constructor.
In order to support this approach, the `ClientHttpRequestFactory` can
now be created using a `Function` rather than a `Supplier`. The
function accepts a `ClientHttpRequestFactorySettings` which provides
the timeout settings to apply.
The `ClientHttpRequestFactories` utility class provides methods to
create `ClientHttpRequestFactory` instances that respect the settings.
Whenever possible, these are created without using reflection.
Fixes gh-32857
Co-authored-by: Phillip Webb <pwebb@vmware.com>
This commit adds a `Build-Jdk-Spec` attribute to the manifest in a
jar or war file built with the Spring Boot Gradle plugin. This
aligns the Gradle plugin's behavior with the default Maven plugin
behavior.
This removes the need to set a `BP_JVM_VERSION` environment variable
when invoking Cloud Native Buildpacks, as the Paketo buildpacks will
honor `Build-Jdk-Spec` in a jar or war manifest to determine the
default JVM version.
Fixes gh-32829
After AOT processing, a HttpGraphQlTester bean will be defined directly
so the context customizer that initiates its registration is not
needed.
Closes gh-32872
After AOT processing, a WebTestClient bean will be defined directly
so the context customizer that initiates its registration is not
needed.
Closes gh-32859
After AOT processing, a TestRestTemplate bean will be defined
directly so the context customizer that initiates its registration is
not needed. We'd already disabled the registrar but this is
insufficient in Graal 22.3 which fails fast when the customizer tries
to reference the registrar.
Fixes gh-32848
Logback can infer the Java class to which an XML tag should be mapped
by looking for a setter method on the class to which the parent tag
was mapped. This commits ensures that reflection hints are added for
such classes.
Fixes gh-32839
Provide a workaround for spring-projects/spring-framework#29361 so
that multiple `@ImportRuntimeHints` can be used in a type hierarchy.
The commit should cover Actuator web endpoint use cases with the
exception of Cloud Foundry endpoints which are not possible due to
package access issues.
See gh-29361
Relocate `ConfigurationPropertiesReflectionHintsProcessor` and refactor
it to be a general purpose `BindableRuntimeHintsRegistrar`.
Prior to this commit, `ConfigurationPropertiesReflectionHintsProcessor`
was used to declare binding hints for classes that were bound, but
might be `@ConfigurationProperties`. By moving and renaming the class,
it's now better aligned to the way it's used.
Support for `@NestedConfigurationProperties` has been implemented by
adding a `@Nestable` meta-annotation. This allow us to create the
appropriate hints, without the `Binder` needing to be directly aware of
the `@NestedConfigurationProperties` annotation.
Closes gh-32815
Update `ConfigurationMetadataAnnotationProcessor` to use the correct
location for the `@ConstructorBinding` annotation and to deal with
finding it as a meta-annotation.
Closes gh-32660
Rename the SomeProperties class so that it is consistent with other
examples given within the Type-safe Configuration Properties. This
ensures that readers can intuitively draw the conclusion that the
MyProperties class is annotated with ConfigurationProperties.
See gh-32644
Prior to this commit, Spring Boot would offer a specific Metrics
instrumentation for WebFlux applications through a `WebFilter` and
custom Tag providers.
As of Spring Framework 6.0, the Observation instrumentation is done
directly in WebFlux, also with a `WebFilter`. While this allows both
metrics and traces, some features cannot be supported in the same way
with this new infrastructure.
The former `WebFilter` has been removed and the Tagging infrastructure
deprecated in favor of custom Observation conventions. This commit
provides an adapter layer so that developers can refactor their custom
tagging solution to the convention way, during the deprecation phase,
without losing any feature.
Closes gh-32539