In some cases, the default response status of a `ServerWebExchange` can
be `null`, especially when the response is not available or the server
implementation does not set a default response status.
This commit ensures that the status code is available when deriving
`KeyValue` information from it, or uses a fallback value for the key
value.
Fixes gh-29359
The observation context relies on request and response for propagation,
but the exchange itself holds attributes and locale context so this is
needed for keyvalues extraction in general.
This commit adds a getter to expose the exchange from the context.
Update `ServerHttpObservationFilter` to check if the `Observation`
is a no-op before adding the `ServerRequestObservationContext`.
Prior to this commit, if the `Observation` is a no-op then the
context type added with the `CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE`
would not be a `ServerRequestObservationContext`. This would mean
that `findObservationContext` would throw a `ClassCastException`.
Fixes gh-29356
This new GraalVM feature replaces ConstantFieldFeature and
introduces various enhancements:
- Leverage the new FieldValueTransformer API
- Use GraalVM 22.3 graal-sdk dependency instead of svm one
- Avoid using internal GraalVM APIs
- No need to configure JPMS exports
- Directly integrated in spring-core module
- Simplified build configuration
Closes gh-29081
Closes gh-29080
Closes gh-29089
This commit makes sure that a `ScopedProxyFactoryBean` is exposed in the
container, rather than its underlying proxy. Previously, any lifecycle
method that the proxy target exposed were invoked in the container.
This is a complementary fix to gh-29335
At present, creating LoggingCacheErrorHandler with custom logger requires use of Commons Logging API, as the appropriate constructor expects org.apache.commons.logging.Log instance. As Commons Logging is rarely the logging framework of choice in applications these days, interaction with its API might not be desirable.
This commit adds LoggingCacheErrorHandler constructor that accepts logger name and thus avoids leaking out any details about the underlying logging framework.
Prior to this commit, the `ServerHttpObservationFilter` would set the
response status (and possibly overwrite it) in case an exception is
found as an attribute.
While the exception itself should be used in the observation, the filter
should have no side effect on the response.
Fixes gh-29353
This commit upgrades Jackson to 2.14.0-rc2, and uses the new
ByteBufferFeeder in Jackson2Tokenizer.
Unfortunately, because of https://github.com/FasterXML/jackson-core/issues/478,
we had to change the CompilerConventions to suppress class file warnings.
Closes gh-29343
Provide a better Javadoc to clarify that @RegisterReflectionForBinding
should annotate a bean and that the types where reflection is needed
should be specified in the annotation attributes.
Closes gh-29345
This commit exposes a "spring.aot.processing" system property when the
AOT engine is running. This can be used by code that need to react
differently when the application is being refreshed for AOT processing.
Closes gh-29340
This commit restores the support of multiple bean definitions being
specified in a `List` as a property value or constructor argument.
Rather than handling inner bean definitions externally, there are now
supported by BeanDefinitionPropertiesCodeGenerator, and list of such
type is handled transparently.
Closes gh-29075
This commit introduces an ApplicationContextFailureProcessor SPI in the
Spring TestContext Framework that allows third parties to process
failures that occur while a SmartContextLoader attempts to load an
ApplicationContext.
SmartContextLoader implementations must introduce a try-catch block
around the loading code and throw a ContextLoadException that wraps
the failed ApplicationContext and the cause of the failure.
Extensions of AbstractTestContextBootstrapper can configure an
ApplicationContextFailureProcessor by overriding the new protected
getApplicationContextFailureProcessor() method.
DefaultCacheAwareContextLoaderDelegate unwraps any ContextLoadException
and delegates to the configured ApplicationContextFailureProcessor for
processing.
Closes gh-28826
Tested successfully using the following locally built GraalVM dev build.
OpenJDK Runtime Environment GraalVM 22.3.0-dev (build 17.0.5+5-jvmci-22.3-b07)
Closes gh-29214