mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
97b98c3378
Prior to this commit, if the TypeReference supplied to ResourceHintsPredicates.forResource(TypeReference,String) was for a class declared in the default package (i.e., without a package), the resolveAbsoluteResourceName() method incorrectly prepended two leading slashes (//) to the absolute resource name, causing correct matches to fail. This commit fixes this by adding special handling for a TypeReference without a package name. In addition, this commit introduces lenient handling of resource names by consistently removing a leading slash in ResourceHintsPredicates.forResource(*) methods. The latter aligns with absolute resource path handling in other places in the framework, such as ClassPathResource. Closes gh-29086