This commit also ensures that Jersey-based actuator endpoints are
available before the user has configured a `ResourceConfig` bean
Fixes gh-15625
Fixes gh-15877
Previously, if profiles were included via a property source with higher
precedence than config files, profiles activated via config files would
not be taken into account. This commit makes spring.profiles.include
behave consistently where it adds to active profiles rather than replacing
them, regardless of property source.
Fixes gh-15344
Prior to this commit, the `HttpTraceWebFilter` would collect the
response information (status and headers) for tracing purposes, after
the handling chain is done with the exchange - inside a
`doAfterSuccessOrError`.
Once the handler has processed the exchange, there is no strong
guarantee about the HTTP resources being still present. Depending on the
web server implementation, HTTP resources (including HTTP header maps)
might be recycled, because pooled in the first place.
This commit moves the collection and processing of the HTTP trace right
before the response is committed. This removes the need to handle
special cases with exceptions, since by that time all exception handlers
have processed the response and the information that we extract is the
information that's about to be written to the network.
Fixes gh-15819
Prior to this commit, errors unhandled by custom `WebExceptionHandler`
and resulting in an HTTP 500 status would not be logged at ERROR level,
giving no information to developers about the actual exception.
This commit ensures that such exceptions are logged at the ERROR level
with their exception. By the time the exception hits the
`DefaultErrorWebExceptionHandler`, if the response is already committed
or if the exception is due to a client disconnecting, the error is
delegated to Framework support as Spring Boot won't be able to render an
error page as expected.
Fixes gh-15769
This commit changes the iteration order when checking for element
equality. This is based on the educated guess that child elements
will likely differ while parents will probably be the same.
E.g. comparing "spring.banner.charset" with "spring.banner.location"
will now first check "charset" against "location" and thus saves some
cycles for elements that will be the same.
See gh-15782
Previously, when ConfigurationPropertyName was building the String
returned from toString() it would use a StringBuilder with the
default initial capacity of 16. For properties with several
elements this was likely to be too small resulting in the builder's
buffer being resized.
This commit sizes the StringBuilder as a multiple of the number of
elements in the name, attempting to strike a balance between
allocating a StringBuilder with an initial capacity that's too
large and wastes memory and an initial capacity that's too small
and requires resizing.
See gh-15760
Previously, the ElementsParser would be created using its default
capacity of 6 even when parsing a String that is expected to
produce a single element.
This commit updates ConfigurationPropertyName to create an
ElementsParser with a capacity of 1 when parsing a String that should
contain only a single element.
See gh-15760
Previously, ElementsParser would expand its internal storage when the
size of the storage was <= the end index of the element being parsed,
irrespective of how many elements had been stored. This led to
expansion of the storage, even for a source that contains a single
element, if the end of the element was at an index greater than the
size of the storage.
This commit updates ElementsParser to resize its storage when the size
(the number of elements that have been stored) is equal to the size of
the storage.
See gh-15760