TestClassScanner was made public with the assumption that Spring Boot's
AOT testing support might need to work directly with that class; however,
it turns out that Spring Boot does not currently have such a need.
In light of that, this commit restores TestClassScanner's visibility to
package private.
Prior to this commit, the TestRuntimeHintsRegistrar API combined
processing of MergedContextConfiguration and test classes. However, it
appears that only spring-test internals have a need for registering
hints based on the MergedContextConfiguration. For example, Spring
Boot's AOT testing support has not had such a need, and it is assumed
that third parties likely will not have such a need.
In light of that, this commit simplifies the TestRuntimeHintsRegistrar
API so that it focuses on processing of a single test class.
In addition, this commit moves the hint registration code specific to
MergedContextConfiguration to an internal mechanism.
Closes gh-29264
Prior to this commit, if two ClassPathResource instances were
constructed differently (one from an absolute path and one from a path
relative to a Class) but had the same absolute path and the same
ClassLoader, they were effectively equal, but ClassPathResource#equals
returned false.
This commit addresses this by revising the logic in
ClassPathResource#equals accordingly.
Closes gh-29263
Prior to this commit, UrlResource#getFilename() returned the filename
of the resource URL-encoded which is in contrast to what
FileSystemResource#getFilename() returns for an equivalent resource.
In addition, users most likely expect that a filename returned from a
method defined in the Resource interface is unencoded.
This commit therefore revises UrlResource#getFilename() so that it
always returns the filename URL-decoded.
Closes gh-29261
This commit adds a reflection hint on
EmbeddedDatabaseFactory$EmbeddedDataSourceProxy#shutdown when
EmbeddedDatabaseFactory is reachable in order to allow its usage
as bean destroy method.
Closes gh-29259
Prior to this commit, the Observation filter for Servlet applications
would only use the request pathInfo as an "http.url" high cardinality
keyvalue. This commit ensures that we're using the full request URL as a
value there.
This also polishes gh-29254.
Fixes gh-29257
See gh-29254
This commit changes the new high cardinality key value from
"uri.expanded" to "http.url" in order to align with the OTel
specification, since there is no need for backwards compatibility on
this new metadata.
Closes gh-29254
This commit updates code generation to customize the instantiation of
a configuration class that requires a proxy. Rather than instantiating
the raw class, the proxy is used.
Closes gh-29107
Previously, InstanceSupplierCodeGenerator used reflection if the target
visibility is either protected or private, and use direct access if the
target visibility is public or package private.
The previous arrangement already assumed that the code is generateed in
the same package as the target type. This means that protected can be
used as well so this commit only use reflection if the target visibility
is private.
Closes gh-29253
This commit introduces assertions that verify that the sub-path is
properly URL-decoded when a path contains `#`. The additional assertions
are necessary since the existing assertions use Resource#getFilename
which already implicitly decodes the path.
See gh-29243
This commit introduces tests which serve as "regression tests" for the
behavior of PathMatchingResourcePatternResolver in Spring Framework
5.3.x with regard to URL-encoding and Unicode normalization of resource
paths.
Specifically, the new tests demonstrate that resource paths do NOT need
to be decoded or normalized in 5.3.x.
See gh-29243
Prior to this commit, the parsing algorithm in
`StringUtils#parseLocaleString` would skip empty tokens, turning
`en__VARIANT` into `en_VARIANT` when parsed.
This commit ensures that such cases are now supported and that more
invalid formats are rejected by the parser.
Fixes gh-29248
This commit adapts AccessVisibility so that it can determine if the
member or type signature is accessible from a given package. This lets
implementers figure out if reflection is necessary without assuming that
package private visibility is OK.
Closes gh-29245