Return absolute path without leading slash from ClassPathResource#getPath #29099
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
Uh oh!
There was an error while loading. Please reload this page.
After putting further thought into the semantics for
getPath()
inClassPathResource
, I realized the following.getPath()
, and I rectified that in commit 1688bec.getPath()
make it clear that the semantics are very inconsistent. See current Javadoc.getPath()
to returnthis.absolutePath
, the entire test suite passes exceptClassPathResourceTests.preserveLeadingSlashForClassRelativeAccess()
. Yet, I would argue that's not a valid use case.In light of the above, I'm wondering if we should:
getPath()
to return the absolute path consistently without a leading slash.getPath()
to its previous state (prior to Introduce getAbsolutePath() in ClassPathResource #29094).getAbsolutePath()
method (i.e., revert Introduce getAbsolutePath() in ClassPathResource #29094).The text was updated successfully, but these errors were encountered: